From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 042F15A83 for ; Thu, 11 Jun 2015 11:54:51 +0200 (CEST) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 45524B8BD2; Thu, 11 Jun 2015 09:54:50 +0000 (UTC) Received: from localhost.localdomain (vpn1-7-35.ams2.redhat.com [10.36.7.35]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5B9smCT006499; Thu, 11 Jun 2015 05:54:49 -0400 Message-ID: <55795AE8.8020804@redhat.com> Date: Thu, 11 Jun 2015 12:54:48 +0300 From: Panu Matilainen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Ouyang Changchun , dev@dpdk.org References: <1432194581-15301-1-git-send-email-changchun.ouyang@intel.com> <1433915549-18571-1-git-send-email-changchun.ouyang@intel.com> <1433915549-18571-3-git-send-email-changchun.ouyang@intel.com> In-Reply-To: <1433915549-18571-3-git-send-email-changchun.ouyang@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Subject: Re: [dpdk-dev] [PATCH v2 2/7] 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: Thu, 11 Jun 2015 09:54:51 -0000 On 06/10/2015 08:52 AM, 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 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 | 32 ++--- > 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, 197 insertions(+), 89 deletions(-) > > diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h > index 5d38185..92b4bfa 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; > > @@ -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); > Unfortunately this is an ABI break, NAK. Ditto for other changes to struct virtio_net in patch 3/7 in this series. See http://dpdk.org/browse/dpdk/tree/doc/guides/rel_notes/abi.rst for the ABI policy. There's plenty of discussion around the ABI going on at the moment, including this thread: http://dpdk.org/ml/archives/dev/2015-June/018456.html - Panu -