On Mon, Sep 10, 2018 at 06:32:09AM +0000, Gavin Hu (Arm Technology China) wrote:


-----Original Message-----
From: dev <dev-boun...@dpdk.org> On Behalf Of Jens Freimann
Sent: Friday, September 7, 2018 2:20 AM
To: dev@dpdk.org
Cc: tiwei....@intel.com; maxime.coque...@redhat.com
Subject: [dpdk-dev] [PATCH v5 06/11] net/virtio-user: add option to use
packed queues

From: Yuanhan Liu <yuanhan....@linux.intel.com>

Add option to enable packed queue support for virtio-user devices.

Signed-off-by: Yuanhan Liu <yuanhan....@linux.intel.com>
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 10 ++++++++--
drivers/net/virtio/virtio_user/virtio_user_dev.h |  2 +-
 drivers/net/virtio/virtio_user_ethdev.c          | 14 +++++++++++++-
 3 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c
b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 7df600b02..9979bea0d 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -372,12 +372,13 @@ virtio_user_dev_setup(struct virtio_user_dev *dev)
  1ULL << VIRTIO_NET_F_GUEST_TSO4|\
  1ULL << VIRTIO_NET_F_GUEST_TSO6|\
  1ULL << VIRTIO_F_IN_ORDER|\
- 1ULL << VIRTIO_F_VERSION_1)
+ 1ULL << VIRTIO_F_VERSION_1|\
+ 1ULL << VIRTIO_F_RING_PACKED)

 int
 virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
      int cq, int queue_size, const char *mac, char **ifname,
-     int mrg_rxbuf, int in_order)
+     int mrg_rxbuf, int in_order, int packed_vq)
 {
 pthread_mutex_init(&dev->mutex, NULL);
 snprintf(dev->path, PATH_MAX, "%s", path); @@ -432,6 +433,11
@@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int
queues,
 dev->unsupported_features |= (1ull <<
VIRTIO_F_IN_ORDER);
 }

+if (packed_vq)
+dev->device_features |= (1ull << VIRTIO_F_RING_PACKED);
+else
+dev->device_features &= ~(1ull <<
VIRTIO_F_RING_PACKED);
+

unsupported_features should be initialized also like following F_MAC.

Fixed it. Thanks!

regards,
Jens

Reply via email to