virtio: remove kernel virtio header dependencies
Type: refactor
tap, virtio and vhost use virtio/vhost header files from linux
kernel. Different features are supported on different kernel
versions, making it difficult to use those in VPP. This patch
removes virtio/vhost based header dependencies to local header
files.
Change-Id: I064a8adb5cd9753c986b6f224bb075200b3856af
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
diff --git a/src/vnet/devices/virtio/vhost_user_inline.h b/src/vnet/devices/virtio/vhost_user_inline.h
index ceaf78c..17b6a90 100644
--- a/src/vnet/devices/virtio/vhost_user_inline.h
+++ b/src/vnet/devices/virtio/vhost_user_inline.h
@@ -176,7 +176,7 @@
u64 addr, u64 len, u8 is_host_address)
{
if (PREDICT_TRUE (vui->log_base_addr == 0
- || !(vui->features & (1 << FEAT_VHOST_F_LOG_ALL))))
+ || !(vui->features & VIRTIO_FEATURE (VHOST_F_LOG_ALL))))
{
return;
}
@@ -296,7 +296,7 @@
static_always_inline u8
vhost_user_packed_desc_available (vhost_user_vring_t * vring, u16 idx)
{
- return (((vring->packed_desc[idx].flags & VIRTQ_DESC_F_AVAIL) ==
+ return (((vring->packed_desc[idx].flags & VRING_DESC_F_AVAIL) ==
vring->avail_wrap_counter));
}
@@ -305,7 +305,7 @@
{
vring->last_avail_idx++;
if (PREDICT_FALSE ((vring->last_avail_idx & vring->qsz_mask) == 0))
- vring->avail_wrap_counter ^= VIRTQ_DESC_F_AVAIL;
+ vring->avail_wrap_counter ^= VRING_DESC_F_AVAIL;
}
static_always_inline void
@@ -319,7 +319,7 @@
/* pick up the slot of the next avail idx */
while (desc_table[vring->last_avail_idx & vring->qsz_mask].flags &
- VIRTQ_DESC_F_NEXT)
+ VRING_DESC_F_NEXT)
vhost_user_advance_last_avail_idx (vring);
}
@@ -330,7 +330,7 @@
vhost_user_undo_advanced_last_avail_idx (vhost_user_vring_t * vring)
{
if (PREDICT_FALSE ((vring->last_avail_idx & vring->qsz_mask) == 0))
- vring->avail_wrap_counter ^= VIRTQ_DESC_F_AVAIL;
+ vring->avail_wrap_counter ^= VRING_DESC_F_AVAIL;
vring->last_avail_idx--;
}
@@ -368,7 +368,7 @@
static_always_inline u64
vhost_user_is_packed_ring_supported (vhost_user_intf_t * vui)
{
- return (vui->features & (1ULL << FEAT_VIRTIO_F_RING_PACKED));
+ return (vui->features & VIRTIO_FEATURE (VIRTIO_F_RING_PACKED));
}
#endif