From 297b1e7350f6933114e0945ca00a1814a258acae Mon Sep 17 00:00:00 2001 From: Jens Freimann Date: Fri, 6 Jul 2018 09:07:08 +0200 Subject: [PATCH] vhost: add virtio packed virtqueue defines Signed-off-by: Jens Freimann Acked-by: Tiwei Bie --- lib/librte_vhost/vhost.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index 79e3117d2c..83c028a1b5 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_packed_desc { + uint64_t addr; + uint32_t len; + uint16_t id; + uint16_t flags; +}; +#endif + /* * Available and used descs are in same order */ -- 2.20.1