From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 366C6C5F6 for ; Fri, 19 Jun 2015 03:19:28 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP; 18 Jun 2015 18:19:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,641,1427785200"; d="scan'208";a="713645046" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by orsmga001.jf.intel.com with ESMTP; 18 Jun 2015 18:19:24 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by KMSMSX151.gar.corp.intel.com (172.21.73.86) with Microsoft SMTP Server (TLS) id 14.3.224.2; Fri, 19 Jun 2015 09:17:37 +0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.165]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.129]) with mapi id 14.03.0224.002; Fri, 19 Jun 2015 09:17:36 +0800 From: "Ouyang, Changchun" To: Flavio Leitner Thread-Topic: [dpdk-dev] [PATCH v3 2/9] lib_vhost: Support multiple queues in virtio dev Thread-Index: AQHQp0DeP7MJcfzIlUahP6K+INfs0J2xwlAAgAFKKXA= Date: Fri, 19 Jun 2015 01:17:35 +0000 Message-ID: References: <1433915549-18571-1-git-send-email-changchun.ouyang@intel.com> <1434355006-30583-1-git-send-email-changchun.ouyang@intel.com> <1434355006-30583-3-git-send-email-changchun.ouyang@intel.com> <20150618133414.GD2574@x240.home> In-Reply-To: <20150618133414.GD2574@x240.home> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v3 2/9] lib_vhost: Support multiple queues in virtio dev X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jun 2015 01:19:29 -0000 > -----Original Message----- > From: Flavio Leitner [mailto:fbl@sysclose.org] > Sent: Thursday, June 18, 2015 9:34 PM > To: Ouyang, Changchun > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v3 2/9] lib_vhost: Support multiple queues= in > virtio dev >=20 > On Mon, Jun 15, 2015 at 03:56:39PM +0800, Ouyang Changchun wrote: > > Each virtio device could have multiple queues, say 2 or 4, at most 8. > > Enabling this feature allows virtio device/port on guest has the > > ability to use different vCPU to receive/transmit packets from/to each > queue. > > > > In multiple queues mode, virtio device readiness means all queues of > > this virtio device are ready, cleanup/destroy a virtio device also > > requires clearing all queues belong to it. > > > > Changes in v3: > > - fix coding style > > - check virtqueue idx validity > > > > Changes in v2: > > - remove the q_num_set api > > - add the qp_num_get api > > - determine the queue pair num from qemu message > > - rework for reset owner message handler > > - dynamically alloc mem for dev virtqueue > > - queue pair num could be 0x8000 > > - fix checkpatch errors > > > > Signed-off-by: Changchun Ouyang > > --- > > lib/librte_vhost/rte_virtio_net.h | 10 +- > > lib/librte_vhost/vhost-net.h | 1 + > > lib/librte_vhost/vhost_rxtx.c | 49 +++++--- > > lib/librte_vhost/vhost_user/vhost-net-user.c | 4 +- > > lib/librte_vhost/vhost_user/virtio-net-user.c | 76 +++++++++--- > > lib/librte_vhost/vhost_user/virtio-net-user.h | 2 + > > lib/librte_vhost/virtio-net.c | 161 +++++++++++++++++-= -------- > > 7 files changed, 216 insertions(+), 87 deletions(-) > > > > diff --git a/lib/librte_vhost/rte_virtio_net.h > > b/lib/librte_vhost/rte_virtio_net.h > > index 5d38185..873be3e 100644 > > --- a/lib/librte_vhost/rte_virtio_net.h > > +++ b/lib/librte_vhost/rte_virtio_net.h > > @@ -59,7 +59,6 @@ struct rte_mbuf; > > /* Backend value set by guest. */ > > #define VIRTIO_DEV_STOPPED -1 > > > > - > > /* Enum for virtqueue management. */ > > enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM}; > > > > @@ -96,13 +95,14 @@ struct vhost_virtqueue { > > * Device structure contains all configuration information relating to= the > device. > > */ > > struct virtio_net { > > - struct vhost_virtqueue *virtqueue[VIRTIO_QNUM]; /**< Contains > all virtqueue information. */ > > struct virtio_memory *mem; /**< QEMU memory and > memory region information. */ > > + struct vhost_virtqueue **virtqueue; /**< Contains all virtqueue > information. */ > > uint64_t features; /**< Negotiated feature set. > */ > > uint64_t device_fh; /**< device identifier. */ > > uint32_t flags; /**< Device flags. Only used > to check if device is running on data core. */ > > #define IF_NAME_SZ (PATH_MAX > IFNAMSIZ ? PATH_MAX : IFNAMSIZ) > > char ifname[IF_NAME_SZ]; /**< Name of the tap > device or socket path. */ > > + uint32_t num_virt_queues; > > void *priv; /**< private context */ > > } __rte_cache_aligned; >=20 >=20 > As already pointed out, this breaks ABI. > Do you have a plan for that or are you pushing this for dpdk 2.2? Yes, I think it will be enabled in 2.2. I have already sent out the abi announce a few days ago. >=20 >=20 > > @@ -220,4 +220,10 @@ uint16_t rte_vhost_enqueue_burst(struct > > virtio_net *dev, uint16_t queue_id, uint16_t > rte_vhost_dequeue_burst(struct virtio_net *dev, uint16_t queue_id, > > struct rte_mempool *mbuf_pool, struct rte_mbuf **pkts, uint16_t > > count); > > > > +/** > > + * This function get the queue pair number of one vhost device. > > + * @return > > + * num of queue pair of specified virtio device. > > + */ > > +uint16_t rte_vhost_qp_num_get(struct virtio_net *dev); >=20 > This needs to go to rte_vhost_version.map too. Will update it. Thanks Changchun