From nobody Sat Apr 20 06:03:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151576969561232.71196088401473; Fri, 12 Jan 2018 07:08:15 -0800 (PST) Received: from localhost ([::1]:46700 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0wG-0001Ow-T1 for importer@patchew.org; Fri, 12 Jan 2018 10:08:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43823) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0mw-0000JK-Oi for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:58:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0ms-0001iA-Se for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:58:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56616) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0ms-0001hK-NW for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:58:30 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 93538C047B82; Fri, 12 Jan 2018 14:58:24 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-28.ams2.redhat.com [10.36.112.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id A12474C8; Fri, 12 Jan 2018 14:57:50 +0000 (UTC) From: Maxime Coquelin To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:56:55 +0100 Message-Id: <20180112145658.17121-2-maxime.coquelin@redhat.com> In-Reply-To: <20180112145658.17121-1-maxime.coquelin@redhat.com> References: <20180112145658.17121-1-maxime.coquelin@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 12 Jan 2018 14:58:29 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/4] vhost-user: fix multiple queue specification X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com, Maxime Coquelin , zhengxiang9@huawei.com, mlureau@redhat.com, pbonzini@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The number of queues supported by the slave is queried with message VHOST_USER_GET_QUEUE_NUM, not with message VHOST_USER_GET_PROTOCOL_FEATURES. Also, looking at master and slave implemntations, the payload returned by the slave is the number of queue pairs supported by the slave, not the number of queues. Signed-off-by: Maxime Coquelin --- docs/interop/vhost-user.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/interop/vhost-user.txt b/docs/interop/vhost-user.txt index d49444e037..8a14191a1e 100644 --- a/docs/interop/vhost-user.txt +++ b/docs/interop/vhost-user.txt @@ -214,8 +214,8 @@ Multiple queue is treated as a protocol extension, henc= e the slave has to implement protocol features first. The multiple queues feature is supported only when the protocol feature VHOST_USER_PROTOCOL_F_MQ (bit 0) is set. =20 -The max number of queues the slave supports can be queried with message -VHOST_USER_GET_PROTOCOL_FEATURES. Master should stop when the number of +The max number of queue pairs the slave supports can be queried with messa= ge +VHOST_USER_GET_QUEUE_NUM. Master should stop when the number of requested queues is bigger than that. =20 As all queues share one connection, the master uses a unique index for each @@ -537,7 +537,7 @@ Master message types Master payload: N/A Slave payload: u64 =20 - Query how many queues the backend supports. This request should be + Query how many queue pairs the backend supports. This request should= be sent only when VHOST_USER_PROTOCOL_F_MQ is set in queried protocol features by VHOST_USER_GET_PROTOCOL_FEATURES. =20 --=20 2.14.3 From nobody Sat Apr 20 06:03:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515769792191886.3918731093607; Fri, 12 Jan 2018 07:09:52 -0800 (PST) Received: from localhost ([::1]:46916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0xr-0002go-FS for importer@patchew.org; Fri, 12 Jan 2018 10:09:51 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0nN-0000l7-4i for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:59:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0nK-0002AQ-1Z for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:59:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56914) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0nJ-00029X-PL for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:58:57 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D1CFCC0272F6; Fri, 12 Jan 2018 14:58:56 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-28.ams2.redhat.com [10.36.112.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E160173EA; Fri, 12 Jan 2018 14:58:24 +0000 (UTC) From: Maxime Coquelin To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:56:56 +0100 Message-Id: <20180112145658.17121-3-maxime.coquelin@redhat.com> In-Reply-To: <20180112145658.17121-1-maxime.coquelin@redhat.com> References: <20180112145658.17121-1-maxime.coquelin@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 12 Jan 2018 14:58:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/4] vhost-user: specify and implement VHOST_USER_SET_QUEUE_NUM request X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com, Maxime Coquelin , zhengxiang9@huawei.com, mlureau@redhat.com, pbonzini@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When the slave cannot add queues dynamically, it needs to know for how many queues to wait to be initialized. This patch introduce new vhost-user protocol feature & request for the master to send the number of queue pairs allocated by the driver. Signed-off-by: Maxime Coquelin --- docs/interop/vhost-user.txt | 16 ++++++++++++++++ hw/virtio/vhost-user.c | 24 ++++++++++++++++++++++++ include/hw/virtio/vhost-backend.h | 3 +++ 3 files changed, 43 insertions(+) diff --git a/docs/interop/vhost-user.txt b/docs/interop/vhost-user.txt index 8a14191a1e..85c0e03a95 100644 --- a/docs/interop/vhost-user.txt +++ b/docs/interop/vhost-user.txt @@ -218,6 +218,9 @@ The max number of queue pairs the slave supports can be= queried with message VHOST_USER_GET_QUEUE_NUM. Master should stop when the number of requested queues is bigger than that. =20 +When VHOST_USER_PROTOCOL_F_SET_QUEUE_NUM is negotiated, the master must se= nd +the number of queue pairs initialized with message VHOST_USER_SET_QUEUE_NU= M. + As all queues share one connection, the master uses a unique index for each queue in the sent message to identify a specified queue. One queue pair is enabled initially. More queues are enabled dynamically, by sending @@ -354,6 +357,7 @@ Protocol features #define VHOST_USER_PROTOCOL_F_MTU 4 #define VHOST_USER_PROTOCOL_F_SLAVE_REQ 5 #define VHOST_USER_PROTOCOL_F_CROSS_ENDIAN 6 +#define VHOST_USER_PROTOCOL_F_SET_QUEUE_NUM 7 =20 Master message types -------------------- @@ -623,6 +627,18 @@ Master message types and expect this message once (per VQ) during device configuration (ie. before the master starts the VQ). =20 + * VHOST_USER_SET_QUEUE_NUM + + Id: 24 + Equivalent ioctl: N/A + Master payload: u64 + + Set the number of queue pairs initialized. + Master sends such request to notify the slave the number of queue pa= irs + that have been initialized. + This request should only be sent if VHOST_USER_PROTOCOL_F_SET_QUEUE_= NUM + feature has been successfully negotiated. + Slave message types ------------------- =20 diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 093675ed98..9e7728d2da 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -34,6 +34,7 @@ enum VhostUserProtocolFeature { VHOST_USER_PROTOCOL_F_NET_MTU =3D 4, VHOST_USER_PROTOCOL_F_SLAVE_REQ =3D 5, VHOST_USER_PROTOCOL_F_CROSS_ENDIAN =3D 6, + VHOST_USER_PROTOCOL_F_SET_QUEUE_NUM =3D 7, =20 VHOST_USER_PROTOCOL_F_MAX }; @@ -65,6 +66,7 @@ typedef enum VhostUserRequest { VHOST_USER_SET_SLAVE_REQ_FD =3D 21, VHOST_USER_IOTLB_MSG =3D 22, VHOST_USER_SET_VRING_ENDIAN =3D 23, + VHOST_USER_SET_QUEUE_NUM =3D 24, VHOST_USER_MAX } VhostUserRequest; =20 @@ -922,6 +924,27 @@ static void vhost_user_set_iotlb_callback(struct vhost= _dev *dev, int enabled) /* No-op as the receive channel is not dedicated to IOTLB messages. */ } =20 +static int vhost_user_set_queue_num(struct vhost_dev *dev, uint64_t queues) +{ + VhostUserMsg msg =3D { + .request =3D VHOST_USER_SET_QUEUE_NUM, + .size =3D sizeof(msg.payload.u64), + .flags =3D VHOST_USER_VERSION, + .payload.u64 =3D queues, + }; + + if (!(dev->protocol_features & + (1ULL << VHOST_USER_PROTOCOL_F_SET_QUEUE_NUM))) { + return 0; + } + + if (vhost_user_write(dev, &msg, NULL, 0) < 0) { + return -1; + } + + return 0; +} + const VhostOps user_ops =3D { .backend_type =3D VHOST_BACKEND_TYPE_USER, .vhost_backend_init =3D vhost_user_init, @@ -948,4 +971,5 @@ const VhostOps user_ops =3D { .vhost_net_set_mtu =3D vhost_user_net_set_mtu, .vhost_set_iotlb_callback =3D vhost_user_set_iotlb_callback, .vhost_send_device_iotlb_msg =3D vhost_user_send_device_iotlb_msg, + .vhost_set_queue_num =3D vhost_user_set_queue_num, }; diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-ba= ckend.h index a7a5f22bc6..1dd3e4bbf3 100644 --- a/include/hw/virtio/vhost-backend.h +++ b/include/hw/virtio/vhost-backend.h @@ -84,6 +84,8 @@ typedef void (*vhost_set_iotlb_callback_op)(struct vhost_= dev *dev, int enabled); typedef int (*vhost_send_device_iotlb_msg_op)(struct vhost_dev *dev, struct vhost_iotlb_msg *imsg= ); +typedef int (*vhost_set_queue_num_op)(struct vhost_dev *dev, + uint64_t queues); =20 typedef struct VhostOps { VhostBackendType backend_type; @@ -118,6 +120,7 @@ typedef struct VhostOps { vhost_vsock_set_running_op vhost_vsock_set_running; vhost_set_iotlb_callback_op vhost_set_iotlb_callback; vhost_send_device_iotlb_msg_op vhost_send_device_iotlb_msg; + vhost_set_queue_num_op vhost_set_queue_num; } VhostOps; =20 extern const VhostOps user_ops; --=20 2.14.3 From nobody Sat Apr 20 06:03:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515769407584333.6362107983956; Fri, 12 Jan 2018 07:03:27 -0800 (PST) Received: from localhost ([::1]:46376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0re-0004U2-OO for importer@patchew.org; Fri, 12 Jan 2018 10:03:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0o3-0001Mg-CU for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:59:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0nz-0002ls-Hm for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:59:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38608) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0nz-0002l0-BX for qemu-devel@nongnu.org; Fri, 12 Jan 2018 09:59:39 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 51AE1C0517A6; Fri, 12 Jan 2018 14:59:38 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-28.ams2.redhat.com [10.36.112.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2C6F54C8; Fri, 12 Jan 2018 14:58:56 +0000 (UTC) From: Maxime Coquelin To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:56:57 +0100 Message-Id: <20180112145658.17121-4-maxime.coquelin@redhat.com> In-Reply-To: <20180112145658.17121-1-maxime.coquelin@redhat.com> References: <20180112145658.17121-1-maxime.coquelin@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 12 Jan 2018 14:59:38 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/4] vhost-net: add vhost_net_set_queue_num helper X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com, Maxime Coquelin , zhengxiang9@huawei.com, mlureau@redhat.com, pbonzini@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This patch adds a new help to notify the backend with the number of queue pairs setup by the guest driver. Signed-off-by: Maxime Coquelin --- hw/net/vhost_net.c | 17 +++++++++++++++++ include/net/vhost_net.h | 1 + 2 files changed, 18 insertions(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index e037db63a3..d60e237a34 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -124,6 +124,18 @@ uint64_t vhost_net_get_max_queues(VHostNetState *net) return net->dev.max_queues; } =20 +int vhost_net_set_queue_num(NetClientState *nc, uint64_t queues) +{ + VHostNetState *net =3D get_vhost_net(nc); + const VhostOps *vhost_ops =3D net->dev.vhost_ops; + + if (vhost_ops->vhost_set_queue_num) { + return vhost_ops->vhost_set_queue_num(&net->dev, queues); + } + + return 0; +} + uint64_t vhost_net_get_acked_features(VHostNetState *net) { return net->dev.acked_features; @@ -456,6 +468,11 @@ uint64_t vhost_net_get_max_queues(VHostNetState *net) return 1; } =20 +int vhost_net_set_queue_num(NetClientState *nc, uint64_t queues) +{ + return 0; +} + struct vhost_net *vhost_net_init(VhostNetOptions *options) { error_report("vhost-net support is not compiled in"); diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h index afc1499eb9..39e639d014 100644 --- a/include/net/vhost_net.h +++ b/include/net/vhost_net.h @@ -15,6 +15,7 @@ typedef struct VhostNetOptions { } VhostNetOptions; =20 uint64_t vhost_net_get_max_queues(VHostNetState *net); +int vhost_net_set_queue_num(NetClientState *nc, uint64_t queues); struct vhost_net *vhost_net_init(VhostNetOptions *options); =20 int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, int total_queu= es); --=20 2.14.3 From nobody Sat Apr 20 06:03:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515769463714814.0410131647307; Fri, 12 Jan 2018 07:04:23 -0800 (PST) Received: from localhost ([::1]:46377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0sY-0005PH-UF for importer@patchew.org; Fri, 12 Jan 2018 10:04:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea0oY-0001w2-BO for qemu-devel@nongnu.org; Fri, 12 Jan 2018 10:00:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea0oS-0003NE-3y for qemu-devel@nongnu.org; Fri, 12 Jan 2018 10:00:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39718) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ea0oR-0003Ks-Uy for qemu-devel@nongnu.org; Fri, 12 Jan 2018 10:00:08 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F359319CF8A; Fri, 12 Jan 2018 15:00:01 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-28.ams2.redhat.com [10.36.112.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id 982004C8; Fri, 12 Jan 2018 14:59:38 +0000 (UTC) From: Maxime Coquelin To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 15:56:58 +0100 Message-Id: <20180112145658.17121-5-maxime.coquelin@redhat.com> In-Reply-To: <20180112145658.17121-1-maxime.coquelin@redhat.com> References: <20180112145658.17121-1-maxime.coquelin@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 12 Jan 2018 15:00:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 4/4] virtio-net: notify backend with number of queue pairs setup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mst@redhat.com, Maxime Coquelin , zhengxiang9@huawei.com, mlureau@redhat.com, pbonzini@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Maxime Coquelin --- hw/net/virtio-net.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 38674b08aa..b8908c98ed 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -561,6 +561,7 @@ static int peer_detach(VirtIONet *n, int index) =20 static void virtio_net_set_queues(VirtIONet *n) { + NetClientState *nc =3D qemu_get_queue(n->nic); int i; int r; =20 @@ -568,6 +569,10 @@ static void virtio_net_set_queues(VirtIONet *n) return; } =20 + if (get_vhost_net(nc->peer)) { + vhost_net_set_queue_num(nc->peer, n->curr_queues); + } + for (i =3D 0; i < n->max_queues; i++) { if (i < n->curr_queues) { r =3D peer_attach(n, i); --=20 2.14.3