From nobody Fri May 17 09:38:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1661366328; cv=none; d=zohomail.com; s=zohoarc; b=bRvpyHL5YdP1Xd66jbqivBAxPZYdYj/rOvC/1+WAcao9+ieVxF5bvbtseg83T33XwGZzt5g3uGYQhdD5ZvDhX7qLe7km8KbsYGjNHUx2urzOmrEpod3K4CRdbOD5IPqhg9ej40yrncz0bOnaR1tQHPBvP/lDhLsU4XmE+aY6aq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661366328; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=MFiLWeiVsGEscClQ/MvCKfr/QZjXWkuihIbsMAiGk+o=; b=dEvSt0Wl8ogzVeeQrKYPmEH4LEBeVxBm7pv4BFjNZHCuR61o2d7iINH0C2jq3dNT3rjkEZqd9/jqDixqOCklXWDEcnMXLidlhllWgfdjdF6WoJNxVcVYpCRHK7pfn1/1hsN8J8PZsFnF045Xf2Bh15ifAghF6Ucs1aASxq/7Kbk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661366328156632.4988071377385; Wed, 24 Aug 2022 11:38:48 -0700 (PDT) Received: from localhost ([::1]:41516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQvH4-0001SA-B6 for importer@patchew.org; Wed, 24 Aug 2022 14:38:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQvEj-0007aj-EG for qemu-devel@nongnu.org; Wed, 24 Aug 2022 14:36:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQvEV-0005Ri-C4 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 14:36:12 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-652-Y_Scn3pLM82iW5zgEw-6Ng-1; Wed, 24 Aug 2022 14:36:00 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CF8793C0CD5D; Wed, 24 Aug 2022 18:35:59 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.193.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50BC72166B26; Wed, 24 Aug 2022 18:35:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661366164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MFiLWeiVsGEscClQ/MvCKfr/QZjXWkuihIbsMAiGk+o=; b=aV4cxl6wB3b+Iqqj2fdBy8vjwj3nX6vPudViqUjGDKWjndGlawJ6ZObt8vc0AdjZ6wvEFM Z+1/EOU55LCl6ic70aDyEPJLP+5iHTMCpTKQfebW9yp064i4UNFIMBePeYs2OY8gay9Mi0 aExRbpamydhjyL0be1mI6bCSauOGQVs= X-MC-Unique: Y_Scn3pLM82iW5zgEw-6Ng-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Cindy Lu , Stefano Garzarella , "Michael S. Tsirkin" , Liuxiangdong , Stefan Hajnoczi , Laurent Vivier , Cornelia Huck , Gautam Dawar , Jason Wang , Harpreet Singh Anand , "Gonglei (Arei)" , Parav Pandit , Paolo Bonzini , Zhu Lingshan , Eli Cohen Subject: [PATCH v2 1/6] vdpa: Make VhostVDPAState cvq_cmd_out_buffer control ack type Date: Wed, 24 Aug 2022 20:35:46 +0200 Message-Id: <20220824183551.197052-2-eperezma@redhat.com> In-Reply-To: <20220824183551.197052-1-eperezma@redhat.com> References: <20220824183551.197052-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661366331631100002 This allows to simplify the code. Signed-off-by: Eugenio P=C3=A9rez --- net/vhost-vdpa.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 6ce68fcd3f..468e460ac2 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -35,7 +35,9 @@ typedef struct VhostVDPAState { VHostNetState *vhost_net; =20 /* Control commands shadow buffers */ - void *cvq_cmd_out_buffer, *cvq_cmd_in_buffer; + void *cvq_cmd_out_buffer; + virtio_net_ctrl_ack *cvq_cmd_in_buffer; + bool started; } VhostVDPAState; =20 @@ -396,7 +398,7 @@ static int vhost_vdpa_net_load(NetClientState *nc) return dev_written; } =20 - return *((virtio_net_ctrl_ack *)s->cvq_cmd_in_buffer) !=3D VIRTIO_= NET_OK; + return *s->cvq_cmd_in_buffer !=3D VIRTIO_NET_OK; } =20 return 0; @@ -491,8 +493,7 @@ static int vhost_vdpa_net_handle_ctrl_avail(VhostShadow= Virtqueue *svq, goto out; } =20 - memcpy(&status, s->cvq_cmd_in_buffer, sizeof(status)); - if (status !=3D VIRTIO_NET_OK) { + if (*s->cvq_cmd_in_buffer !=3D VIRTIO_NET_OK) { return VIRTIO_NET_ERR; } =20 --=20 2.31.1 From nobody Fri May 17 09:38:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1661366345; cv=none; d=zohomail.com; s=zohoarc; b=B1iX6dkIt0R57dA3MFnTR5TAwn5CWy08zOhJZ7M4rHKImbybhEQTkuwmV93ViBFpDapo64kAbKDgMMODSqDakECV1BqTXqm9J4Ty2lXBMoGPMBDsgoyCOYC4rb6eHw8pJ8GVoQLn4f65TmL2NhNPQhMxf8hcqADOV1gsROle3Hk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661366345; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=naaRwhcnqZscdMw6fcVC2/f7vDSLifPy1NzGabm4hQk=; b=cc2aP8ClQqSv4CPrsmPJ+8glvfIbVRYjD5PdHcF0rYjKhjKsyTTZVo/VemUVez16yGH7OyEXucyqYpV+uJV7LpMqa8pgLNbkvJRUfFmgQ4xI15ZBvXtEd7ct1Tpam22fwpHFsqSCRz87ccM3B4meby644aDz1OHVOO6sZdC7ig4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661366345776875.173634813112; Wed, 24 Aug 2022 11:39:05 -0700 (PDT) Received: from localhost ([::1]:47126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQvHM-0002EZ-MI for importer@patchew.org; Wed, 24 Aug 2022 14:39:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQvEZ-0007a2-Jk for qemu-devel@nongnu.org; Wed, 24 Aug 2022 14:36:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:36169) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQvEV-0005Ru-C3 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 14:36:10 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-156-Q3NFcxfXPWqQEUubYJy4Yg-1; Wed, 24 Aug 2022 14:36:03 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A0BAE293248E; Wed, 24 Aug 2022 18:36:02 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.193.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C95B2166B29; Wed, 24 Aug 2022 18:35:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661366166; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=naaRwhcnqZscdMw6fcVC2/f7vDSLifPy1NzGabm4hQk=; b=gOggw3BS2KzUx00diqim7H/gjXB8GRGzCzbsGfW28A3Po/TwHfX+/bGeWz6tDZ1S/q45/P qb1QmhVVjd1H6PZ3A1cdSo659FANZMKe9HPppeXkZrojKYomCXrTvHoiRGhObokNhJDl66 iG60/wn21pTl4dQcc06S3/FklgJ+Fn8= X-MC-Unique: Q3NFcxfXPWqQEUubYJy4Yg-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Cindy Lu , Stefano Garzarella , "Michael S. Tsirkin" , Liuxiangdong , Stefan Hajnoczi , Laurent Vivier , Cornelia Huck , Gautam Dawar , Jason Wang , Harpreet Singh Anand , "Gonglei (Arei)" , Parav Pandit , Paolo Bonzini , Zhu Lingshan , Eli Cohen Subject: [PATCH v2 2/6] vdpa: extract vhost_vdpa_net_load_mac from vhost_vdpa_net_load Date: Wed, 24 Aug 2022 20:35:47 +0200 Message-Id: <20220824183551.197052-3-eperezma@redhat.com> In-Reply-To: <20220824183551.197052-1-eperezma@redhat.com> References: <20220824183551.197052-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661366347437100001 Since there may be many commands we need to issue to load the NIC state, let's split them in individual functions Signed-off-by: Eugenio P=C3=A9rez -- v2: Add vhost_vdpa_net_load_cmd helper --- net/vhost-vdpa.c | 54 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 468e460ac2..c89e2262d9 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -365,35 +365,31 @@ static ssize_t vhost_vdpa_net_cvq_add(VhostVDPAState = *s, size_t out_len, return vhost_svq_poll(svq); } =20 -static int vhost_vdpa_net_load(NetClientState *nc) +static ssize_t vhost_vdpa_net_load_cmd(VhostVDPAState *s, + const struct virtio_net_ctrl_hdr *c= trl, + const void *data, size_t data_size) { - VhostVDPAState *s =3D DO_UPCAST(VhostVDPAState, nc, nc); - const struct vhost_vdpa *v =3D &s->vhost_vdpa; - const VirtIONet *n; - uint64_t features; + assert(data_size < vhost_vdpa_net_cvq_cmd_page_len() - sizeof(*ctrl)); =20 - assert(nc->info->type =3D=3D NET_CLIENT_DRIVER_VHOST_VDPA); + memcpy(s->cvq_cmd_out_buffer, ctrl, sizeof(*ctrl)); + memcpy(s->cvq_cmd_out_buffer + sizeof(ctrl), data, data_size); =20 - if (!v->shadow_vqs_enabled) { - return 0; - } + return vhost_vdpa_net_cvq_add(s, sizeof(ctrl) + data_size, + sizeof(virtio_net_ctrl_ack)); +} =20 - n =3D VIRTIO_NET(v->dev->vdev); - features =3D n->parent_obj.guest_features; +static int vhost_vdpa_net_load_mac(VhostVDPAState *s, const VirtIONet *n) +{ + uint64_t features =3D n->parent_obj.guest_features; if (features & BIT_ULL(VIRTIO_NET_F_CTRL_MAC_ADDR)) { const struct virtio_net_ctrl_hdr ctrl =3D { .class =3D VIRTIO_NET_CTRL_MAC, .cmd =3D VIRTIO_NET_CTRL_MAC_ADDR_SET, }; - char *cursor =3D s->cvq_cmd_out_buffer; ssize_t dev_written; =20 - memcpy(cursor, &ctrl, sizeof(ctrl)); - cursor +=3D sizeof(ctrl); - memcpy(cursor, n->mac, sizeof(n->mac)); - - dev_written =3D vhost_vdpa_net_cvq_add(s, sizeof(ctrl) + sizeof(n-= >mac), - sizeof(virtio_net_ctrl_ack)); + dev_written =3D vhost_vdpa_net_load_cmd(s, &ctrl, n->mac, + sizeof(n->mac)); if (unlikely(dev_written < 0)) { return dev_written; } @@ -404,6 +400,28 @@ static int vhost_vdpa_net_load(NetClientState *nc) return 0; } =20 +static int vhost_vdpa_net_load(NetClientState *nc) +{ + VhostVDPAState *s =3D DO_UPCAST(VhostVDPAState, nc, nc); + struct vhost_vdpa *v =3D &s->vhost_vdpa; + const VirtIONet *n; + int r; + + assert(nc->info->type =3D=3D NET_CLIENT_DRIVER_VHOST_VDPA); + + if (!v->shadow_vqs_enabled) { + return 0; + } + + n =3D VIRTIO_NET(v->dev->vdev); + r =3D vhost_vdpa_net_load_mac(s, n); + if (unlikely(r < 0)) { + return r; + } + + return 0; +} + static NetClientInfo net_vhost_vdpa_cvq_info =3D { .type =3D NET_CLIENT_DRIVER_VHOST_VDPA, .size =3D sizeof(VhostVDPAState), --=20 2.31.1 From nobody Fri May 17 09:38:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1661366636; cv=none; d=zohomail.com; s=zohoarc; b=KUV6MC1SZA28dnSa1Q7vADK5r5ybLvd4HKd2LR50j9kG0WSG/99/WrjUfTorke4fUrID49PN+SrI1jqXpQYw4KepT6qwpKZlJYEnE+J0ECiajXXric05CWLUGErr2AdvNykgqVAP1ByIQokf/IIbY41r1XqTleFtLEWiCi/PUjc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661366636; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FWGv15i6933p5S0UQDcSLRpXSTNPnB/6M20ffMC4s6Q=; b=giQIRIvbDgZgYhxRPHDUCMBpxLE4sTeQ8BwIZjaHtJy7tuRlQ0bIfhCycDLA955smqdH+Ra0LDOm9KhjVvdnUAlzoq1hCk0jfndWpoJezY3MbFsCAsQIebJHf84MT5fNW89/rEg7aNqCsZ5E1B6nyg2dXmUssZ+dRylf8cPm+2Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661366636051863.0323283363332; Wed, 24 Aug 2022 11:43:56 -0700 (PDT) Received: from localhost ([::1]:51100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQvM2-0006Ab-IW for importer@patchew.org; Wed, 24 Aug 2022 14:43:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQvEj-0007al-Ul for qemu-devel@nongnu.org; Wed, 24 Aug 2022 14:36:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44496) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQvEa-0005Sq-BH for qemu-devel@nongnu.org; Wed, 24 Aug 2022 14:36:18 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-120-xzGiJooUMUm47J-QCDSJxQ-1; Wed, 24 Aug 2022 14:36:05 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 66134101AA6A; Wed, 24 Aug 2022 18:36:05 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.193.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id E13672166B26; Wed, 24 Aug 2022 18:36:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661366171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FWGv15i6933p5S0UQDcSLRpXSTNPnB/6M20ffMC4s6Q=; b=eAXJIpXnUp4JZHkr7H9ZgEDGhueXws9BlVRK3YcSNaydc+eBk9fF2O8/ZpcKPC2siWXo0M rd5J2FFIVRscguz6XixP6ykvaphdbLmm+eEdIzWUqhC2X8R+JEij+xO9JGhlaFiH9nsJ9w 20Y4TMb2g1ZvgfZAQj34zK3jr0PZ7+w= X-MC-Unique: xzGiJooUMUm47J-QCDSJxQ-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Cindy Lu , Stefano Garzarella , "Michael S. Tsirkin" , Liuxiangdong , Stefan Hajnoczi , Laurent Vivier , Cornelia Huck , Gautam Dawar , Jason Wang , Harpreet Singh Anand , "Gonglei (Arei)" , Parav Pandit , Paolo Bonzini , Zhu Lingshan , Eli Cohen Subject: [PATCH v2 3/6] vdpa: Add vhost_vdpa_net_load_mq Date: Wed, 24 Aug 2022 20:35:48 +0200 Message-Id: <20220824183551.197052-4-eperezma@redhat.com> In-Reply-To: <20220824183551.197052-1-eperezma@redhat.com> References: <20220824183551.197052-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661366637828100001 Same way as with the MAC, restore the expected number of queues at device's start. Signed-off-by: Eugenio P=C3=A9rez --- net/vhost-vdpa.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index c89e2262d9..77c85f4ddd 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -400,6 +400,30 @@ static int vhost_vdpa_net_load_mac(VhostVDPAState *s, = const VirtIONet *n) return 0; } =20 +static int vhost_vdpa_net_load_mq(VhostVDPAState *s, + const VirtIONet *n) +{ + const struct virtio_net_ctrl_hdr ctrl =3D { + .class =3D VIRTIO_NET_CTRL_MQ, + .cmd =3D VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET, + }; + struct virtio_net_ctrl_mq mq; + uint64_t features =3D n->parent_obj.guest_features; + ssize_t dev_written; + + if (!(features & BIT_ULL(VIRTIO_NET_F_MQ))) { + return 0; + } + + mq.virtqueue_pairs =3D cpu_to_le16(n->curr_queue_pairs); + dev_written =3D vhost_vdpa_net_load_cmd(s, &ctrl, &mq, sizeof(mq)); + if (unlikely(dev_written < 0)) { + return dev_written; + } + + return *s->cvq_cmd_in_buffer !=3D VIRTIO_NET_OK; +} + static int vhost_vdpa_net_load(NetClientState *nc) { VhostVDPAState *s =3D DO_UPCAST(VhostVDPAState, nc, nc); @@ -418,6 +442,10 @@ static int vhost_vdpa_net_load(NetClientState *nc) if (unlikely(r < 0)) { return r; } + r =3D vhost_vdpa_net_load_mq(s, n); + if (unlikely(r)) { + return r; + } =20 return 0; } --=20 2.31.1 From nobody Fri May 17 09:38:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1661366644; cv=none; d=zohomail.com; s=zohoarc; b=DGBMgtRX0QDOrtF5dQViUUO7rrCTN1+W0mqwyRR+jHUibblP15ibbyFiXvYWZdHIrtcDldB+nduREJFJK4sOPCutpqiLzUfzWB75OgOw0b/xuVkbuIpOIMD9g+E5c83OGiZLNablGl0L5n7nQO42zYVrJeQiTuYZFHSSO2O05Fs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661366644; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3skSELz/ftK6DYd0+fbYwIww+EVUIoVg4WOCXikX4qs=; b=PyypsNGQhVEmhjGfYhHiE6BayhZff2IAH+0nAHazR5XFXqMGPlKeCtRmXwpPyKfIhfrtRM96oYvBJZYbpT6qbSblfeYDrEx74AwR7bnlbszJW1So6mvzosV7VGayWOknOQs/MnLkshYWxl2BRNBv6Cp09zF/Cxm+miwnVDFyN1Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661366644904659.3070921620283; Wed, 24 Aug 2022 11:44:04 -0700 (PDT) Received: from localhost ([::1]:41060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQvMB-0006eh-Ut for importer@patchew.org; Wed, 24 Aug 2022 14:44:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQvEm-0007b1-PU for qemu-devel@nongnu.org; Wed, 24 Aug 2022 14:36:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:29775) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQvEe-0005Sv-MW for qemu-devel@nongnu.org; Wed, 24 Aug 2022 14:36:20 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-342-kiY6ccF5M5OlDOGr88jOUA-1; Wed, 24 Aug 2022 14:36:08 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 30B9C101E9B2; Wed, 24 Aug 2022 18:36:08 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.193.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id A85D92166B26; Wed, 24 Aug 2022 18:36:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661366171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3skSELz/ftK6DYd0+fbYwIww+EVUIoVg4WOCXikX4qs=; b=JtCDAMogTUghtVws/2f39//rh2PZugyDbqYb8208NmM2hKRuUYsucLeIZG4OGTyzeEKo13 c+kWoGbGWzCuqxTqRwgLgnWP9hNa3NdNE3xWRg1OxBpALLrEtuen17o3/gMPVTLabmH4pv RDki09Y7+2jsN2JPo9WmQtL9VDJH2h8= X-MC-Unique: kiY6ccF5M5OlDOGr88jOUA-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Cindy Lu , Stefano Garzarella , "Michael S. Tsirkin" , Liuxiangdong , Stefan Hajnoczi , Laurent Vivier , Cornelia Huck , Gautam Dawar , Jason Wang , Harpreet Singh Anand , "Gonglei (Arei)" , Parav Pandit , Paolo Bonzini , Zhu Lingshan , Eli Cohen Subject: [PATCH v2 4/6] vdpa: validate MQ CVQ commands Date: Wed, 24 Aug 2022 20:35:49 +0200 Message-Id: <20220824183551.197052-5-eperezma@redhat.com> In-Reply-To: <20220824183551.197052-1-eperezma@redhat.com> References: <20220824183551.197052-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661366645824100001 So we are sure we can update the device model properly before sending to the device. Signed-off-by: Eugenio P=C3=A9rez --- net/vhost-vdpa.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 77c85f4ddd..b070c029e7 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -488,6 +488,15 @@ static bool vhost_vdpa_net_cvq_validate_cmd(const void= *out_buf, size_t len) __func__, ctrl.cmd); }; break; + case VIRTIO_NET_CTRL_MQ: + switch (ctrl.cmd) { + case VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET: + return true; + default: + qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid mq cmd %u\n", + __func__, ctrl.cmd); + }; + break; default: qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid control class %u\n", __func__, ctrl.class); --=20 2.31.1 From nobody Fri May 17 09:38:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1661366757; cv=none; d=zohomail.com; s=zohoarc; b=jcf5kWIzFL0crE0r6ow20Gh1vlK6RSvrKj0yEqtWJFqRa2Vo7AMLWNsbPbs7umbGS7PDaG6/q045zeNIyrxFpJl/o010bI/dgfnqJRI3G6liclthIY4jzEOkkbkyPjJVQ61oy4YgMFt/wzXT4CoolAQCVTYQwwa+NsyD20JjGyw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661366757; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xoutYqkapS/nIMsepScl0jd/aod9k3GRqbKF46hCZW0=; b=BULSLToEiG5sQlx/osAXVEL81FyYHCvqJJJhG4b3ifvQ9AfLMAc8c818VDWk0HCpfwn1ctsJA4YkqYXkAHAMK2jpIZdwL8aQZb9ymmUY06MSzLEXsvdBu59tSjMdrekQLzRSQPdn5G4ikrYXHZYutYQS26I4LDzLUGcmykR2Eao= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661366757228308.1926461437663; Wed, 24 Aug 2022 11:45:57 -0700 (PDT) Received: from localhost ([::1]:51330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQvNz-0001P0-2L for importer@patchew.org; Wed, 24 Aug 2022 14:45:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQvEu-0007gf-3e for qemu-devel@nongnu.org; Wed, 24 Aug 2022 14:36:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:25239) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQvEq-0005V9-S8 for qemu-devel@nongnu.org; Wed, 24 Aug 2022 14:36:30 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-260-tP36kRF9MYqdDDUpy_rabQ-1; Wed, 24 Aug 2022 14:36:11 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EDE17101A56C; Wed, 24 Aug 2022 18:36:10 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.193.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70F032166B26; Wed, 24 Aug 2022 18:36:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661366187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xoutYqkapS/nIMsepScl0jd/aod9k3GRqbKF46hCZW0=; b=adxO8Z6nZLm+2jLz4sEe4Z6olIlTNnTXJdgqT85m3zWyPd50h2km/8OS626ZBzyzp3t3zj AjBpJF+74uV+L67ckE967GREIvO926MX6qaVpK2o2aBlgb3PQMeMCgxAxCoJiRYJF97iN1 QXS8vNlUyzpSD1wyK/PYlBHD5eZnOd4= X-MC-Unique: tP36kRF9MYqdDDUpy_rabQ-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Cindy Lu , Stefano Garzarella , "Michael S. Tsirkin" , Liuxiangdong , Stefan Hajnoczi , Laurent Vivier , Cornelia Huck , Gautam Dawar , Jason Wang , Harpreet Singh Anand , "Gonglei (Arei)" , Parav Pandit , Paolo Bonzini , Zhu Lingshan , Eli Cohen Subject: [PATCH v2 5/6] virtio-net: Update virtio-net curr_queue_pairs in vdpa backends Date: Wed, 24 Aug 2022 20:35:50 +0200 Message-Id: <20220824183551.197052-6-eperezma@redhat.com> In-Reply-To: <20220824183551.197052-1-eperezma@redhat.com> References: <20220824183551.197052-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661366758818100001 It was returned as error before. Instead of it, simply update the corresponding field so qemu can send it in the migration data. Signed-off-by: Eugenio P=C3=A9rez --- hw/net/virtio-net.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index dd0d056fde..63a8332cd0 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -1412,19 +1412,14 @@ static int virtio_net_handle_mq(VirtIONet *n, uint8= _t cmd, return VIRTIO_NET_ERR; } =20 - /* Avoid changing the number of queue_pairs for vdpa device in - * userspace handler. A future fix is needed to handle the mq - * change in userspace handler with vhost-vdpa. Let's disable - * the mq handling from userspace for now and only allow get - * done through the kernel. Ripples may be seen when falling - * back to userspace, but without doing it qemu process would - * crash on a recursive entry to virtio_net_set_status(). - */ + n->curr_queue_pairs =3D queue_pairs; if (nc->peer && nc->peer->info->type =3D=3D NET_CLIENT_DRIVER_VHOST_VD= PA) { - return VIRTIO_NET_ERR; + /* + * Avoid updating the backend for a vdpa device: We're only intere= sted + * in updating the device model queues. + */ + return VIRTIO_NET_OK; } - - n->curr_queue_pairs =3D queue_pairs; /* stop the backend before changing the number of queue_pairs to avoid= handling a * disabled queue */ virtio_net_set_status(vdev, vdev->status); --=20 2.31.1 From nobody Fri May 17 09:38:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1661366632; cv=none; d=zohomail.com; s=zohoarc; b=foEuaI4MPYU/NyeCo5KuU14akVZ50+81yXGskN5egoUlYYuDLq2X1SDBS0CkMihpbruPy+buycLvTebmJRRv9kZSq11AvVvu8O6AOonZHHIV9Lz6zPVZ0XhD7ebAWZUxj6IE7jHaPsK3cmu+5OqIqISP6zO9DQn7esrkFp87GMQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661366632; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vldHrZkwaODePCqH6svGbEAIaESOGjjCriCn35ZnDlQ=; b=OGEP+n3Xohx4UMJUhtPgC2sj2rDIxuZYBismbqtHM0lFBufBDhpS71hmwYDHceSjmin8nvuKWOEXu5gCl9QDykSlczYxBX8AQT7ZEH8/ByIRodkHo0p/IpvXSowjVB5XoyT37ZQyQzC6+h31Njab5diNa0r7HuDELaUm/Q9hJks= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1661366632001295.6035755954989; Wed, 24 Aug 2022 11:43:52 -0700 (PDT) Received: from localhost ([::1]:48164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQvLy-00060m-Ro for importer@patchew.org; Wed, 24 Aug 2022 14:43:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQvEr-0007br-3g for qemu-devel@nongnu.org; Wed, 24 Aug 2022 14:36:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQvEh-0005T6-EW for qemu-devel@nongnu.org; Wed, 24 Aug 2022 14:36:22 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-512-4P1C38u1NsqK4b0hjo-KHA-1; Wed, 24 Aug 2022 14:36:14 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE7CD3C0E227; Wed, 24 Aug 2022 18:36:13 +0000 (UTC) Received: from eperezma.remote.csb (unknown [10.39.193.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CA322166B26; Wed, 24 Aug 2022 18:36:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661366177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vldHrZkwaODePCqH6svGbEAIaESOGjjCriCn35ZnDlQ=; b=QdT4Gz+dYLuExbrAxnay4m3kOhiqzVy0yQuECb/gcY8SbvyINWxwyLCY06V/lZKKb2tO9v sUgtIvLN9oqBeErv7yijlYm8WplmyF0k+Aj6nCmywfFmgbqK4jg53Cgn3yGe+ODhI/oiWj R6iCkgU7FA/5u+W7k+KqgGL8Pi+WvoY= X-MC-Unique: 4P1C38u1NsqK4b0hjo-KHA-1 From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: qemu-devel@nongnu.org Cc: Cindy Lu , Stefano Garzarella , "Michael S. Tsirkin" , Liuxiangdong , Stefan Hajnoczi , Laurent Vivier , Cornelia Huck , Gautam Dawar , Jason Wang , Harpreet Singh Anand , "Gonglei (Arei)" , Parav Pandit , Paolo Bonzini , Zhu Lingshan , Eli Cohen Subject: [PATCH v2 6/6] vdpa: Allow MQ feture in SVQ Date: Wed, 24 Aug 2022 20:35:51 +0200 Message-Id: <20220824183551.197052-7-eperezma@redhat.com> In-Reply-To: <20220824183551.197052-1-eperezma@redhat.com> References: <20220824183551.197052-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=eperezma@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661366634097100001 Finally enable SVQ with MQ feature. Signed-off-by: Eugenio P=C3=A9rez --- net/vhost-vdpa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index b070c029e7..0376151b60 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -94,6 +94,7 @@ static const uint64_t vdpa_svq_device_features =3D BIT_ULL(VIRTIO_NET_F_MRG_RXBUF) | BIT_ULL(VIRTIO_NET_F_STATUS) | BIT_ULL(VIRTIO_NET_F_CTRL_VQ) | + BIT_ULL(VIRTIO_NET_F_MQ) | BIT_ULL(VIRTIO_F_ANY_LAYOUT) | BIT_ULL(VIRTIO_NET_F_CTRL_MAC_ADDR) | BIT_ULL(VIRTIO_NET_F_RSC_EXT) | --=20 2.31.1