[v7,01/15] vhost: add virtio packed virtqueue defines
diff mbox series

Message ID 20180704215438.5579-2-maxime.coquelin@redhat.com
State Superseded, archived
Delegated to: Maxime Coquelin
Headers show
Series
  • Vhost: add support to packed ring layout
Related show

Checks

Context Check Description
ci/Intel-compilation fail Compilation issues

Commit Message

Maxime Coquelin July 4, 2018, 9:54 p.m. UTC
From: Jens Freimann <jfreimann@redhat.com>

Signed-off-by: Jens Freimann <jfreimann@redhat.com>
---
 lib/librte_vhost/vhost.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Patch
diff mbox series

diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
index 79e3117d2..d1f3a4d22 100644
--- a/lib/librte_vhost/vhost.h
+++ b/lib/librte_vhost/vhost.h
@@ -192,6 +192,26 @@  struct vhost_msg {
  #define VIRTIO_F_VERSION_1 32
 #endif
 
+/* Declare packed ring related bits for older kernels */
+#ifndef VIRTIO_F_RING_PACKED
+
+#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_desc_packed {
+	uint64_t addr;
+	uint32_t len;
+	uint16_t index;
+	uint16_t flags;
+};
+#endif
+
 /*
  * Available and used descs are in same order
  */