[dpdk-stable] [PATCH] vhost: fix packed ring defines declaration

Maxime Coquelin maxime.coquelin at redhat.com
Thu Nov 22 18:09:22 CET 2018


The packed ring defines were declared only if kernel
header does not declare them.
The problem is that they are not applied in upstream kernel,
and some changes in the names have been required.

This patch declares the defines unconditionally, which
fixes potential build issues.

Fixes: 297b1e7350f6 ("vhost: add virtio packed virtqueue defines")
Cc: stable at dpdk.org

Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 lib/librte_vhost/vhost.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index 760f42192..5218f1b12 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -219,13 +219,6 @@ struct vhost_msg {
 
 #define VIRTIO_F_RING_PACKED 34
 
-#define VRING_DESC_F_NEXT	1
-#define VRING_DESC_F_WRITE	2
-#define VRING_DESC_F_INDIRECT	4
-
-#define VRING_DESC_F_AVAIL	(1ULL << 7)
-#define VRING_DESC_F_USED	(1ULL << 15)
-
 struct vring_packed_desc {
 	uint64_t addr;
 	uint32_t len;
@@ -233,16 +226,23 @@ struct vring_packed_desc {
 	uint16_t flags;
 };
 
-#define VRING_EVENT_F_ENABLE 0x0
-#define VRING_EVENT_F_DISABLE 0x1
-#define VRING_EVENT_F_DESC 0x2
-
 struct vring_packed_desc_event {
 	uint16_t off_wrap;
 	uint16_t flags;
 };
 #endif
 
+/*
+ * Declare below packed ring defines unconditionally
+ * as Kernel header might use different names.
+ */
+#define VRING_DESC_F_AVAIL	(1ULL << 7)
+#define VRING_DESC_F_USED	(1ULL << 15)
+
+#define VRING_EVENT_F_ENABLE 0x0
+#define VRING_EVENT_F_DISABLE 0x1
+#define VRING_EVENT_F_DESC 0x2
+
 /*
  * Available and used descs are in same order
  */
-- 
2.17.2



More information about the stable mailing list