aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/vhost_user_inline.h
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-08-31 17:17:16 +0200
committerDamjan Marion <dmarion@me.com>2020-09-04 13:34:20 +0000
commita7a2281732b926df139b0fd946a084299d813654 (patch)
tree9e6eb7d5a2774c62e1d84041fe0b01182b0ab087 /src/vnet/devices/virtio/vhost_user_inline.h
parentf1cd3da20f1a5a7ed94a18b6d7ea4bf9d491a7d3 (diff)
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>
Diffstat (limited to 'src/vnet/devices/virtio/vhost_user_inline.h')
-rw-r--r--src/vnet/devices/virtio/vhost_user_inline.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/vnet/devices/virtio/vhost_user_inline.h b/src/vnet/devices/virtio/vhost_user_inline.h
index ceaf78cf799..17b6a90618f 100644
--- a/src/vnet/devices/virtio/vhost_user_inline.h
+++ b/src/vnet/devices/virtio/vhost_user_inline.h
@@ -176,7 +176,7 @@ vhost_user_log_dirty_pages_2 (vhost_user_intf_t * vui,
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 @@ vhost_user_update_gso_interface_count (vhost_user_intf_t * vui, u8 add)
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 @@ vhost_user_advance_last_avail_idx (vhost_user_vring_t * vring)
{
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 @@ vhost_user_advance_last_avail_table_idx (vhost_user_intf_t * vui,
/* 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 @@ static_always_inline void
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 @@ vhost_user_advance_last_used_idx (vhost_user_vring_t * vring)
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