[dpdk-dev] [PATCH 1/2] vhost: enable any layout feature

Yuanhan Liu yuanhan.liu at linux.intel.com
Mon Sep 26 08:40:55 CEST 2016


The VIRTIO_F_ANY_LAYOUT feature allows virtio-net header and packet
data in single vring desc if possible. Before that, it is assumed
they will always take two descs.

DPDK vhost removes this assumption since commit bc7f87a2c19f ("vhost:
refactor dequeueing"), meaning we actually support this feature. But
it is not enabled.

Thus, this patch enables it.

Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
---
 lib/librte_vhost/vhost.c | 1 +
 lib/librte_vhost/vhost.h | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c
index 46095c3..1d8d941 100644
--- a/lib/librte_vhost/vhost.c
+++ b/lib/librte_vhost/vhost.c
@@ -57,6 +57,7 @@
 				(1ULL << VIRTIO_NET_F_CTRL_RX) | \
 				(1ULL << VIRTIO_NET_F_GUEST_ANNOUNCE) | \
 				(VHOST_SUPPORTS_MQ)            | \
+				(1ULL << VIRTIO_F_ANY_LAYOUT)  | \
 				(1ULL << VIRTIO_F_VERSION_1)   | \
 				(1ULL << VHOST_F_LOG_ALL)      | \
 				(1ULL << VHOST_USER_F_PROTOCOL_FEATURES) | \
diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index c2dfc3c..5ee6c6c 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -92,6 +92,9 @@ struct vhost_virtqueue {
  #define VIRTIO_NET_F_GUEST_ANNOUNCE 21
 #endif
 
+#ifndef VIRTIO_F_ANY_LAYOUT
+ #define VIRTIO_F_ANY_LAYOUT 27
+#endif
 
 /*
  * Make an extra wrapper for VIRTIO_NET_F_MQ and
-- 
1.9.0



More information about the dev mailing list