summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-02-23 19:23:44 +0100
committerDamjan Marion <damarion@cisco.com>2016-02-23 19:23:44 +0100
commit4ee137baf87fb1261122d4bee4bc15e1432bd0bd (patch)
treef75076f2a4f20bb2bf82593fe335b3b8e9262e7c
parentca0f3b3a4353d1eccc48013b18adeebba3579603 (diff)
Fix warnings in vhost-user code with older version of DPDK
Change-Id: If76ef977e3914b51da0d6bb5e4089acb0bd67baa Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r--vnet/vnet/devices/dpdk/vhost_user.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vnet/vnet/devices/dpdk/vhost_user.c b/vnet/vnet/devices/dpdk/vhost_user.c
index a9b2082b4d4..0efbbef3259 100644
--- a/vnet/vnet/devices/dpdk/vhost_user.c
+++ b/vnet/vnet/devices/dpdk/vhost_user.c
@@ -568,7 +568,9 @@ dpdk_vhost_user_get_vring_base(u32 hw_if_index, u8 idx, u32 * num)
* on the descriptor specified by VHOST_USER_SET_VRING_KICK,
* and stop ring upon receiving VHOST_USER_GET_VRING_BASE.
*/
+#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
dpdk_vu_intf_t *vui = xd->vu_intf;
+#endif
DBG_SOCK("Stopping vring Q %u of device %d", idx, hw_if_index);
#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
vui->vrings[idx].enabled = 0; /* Reset local copy */
@@ -627,7 +629,9 @@ dpdk_vhost_user_set_vring_kick(u32 hw_if_index, u8 idx, int fd)
{
dpdk_main_t * dm = &dpdk_main;
dpdk_device_t * xd;
+#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
dpdk_vu_vring *vring;
+#endif
struct vhost_virtqueue *vq0, *vq1, *vq;
int index, vu_is_running = 0;
@@ -636,11 +640,11 @@ dpdk_vhost_user_set_vring_kick(u32 hw_if_index, u8 idx, int fd)
return 0;
}
- vring = &xd->vu_intf->vrings[idx];
vq = xd->vu_vhost_dev.virtqueue[idx];
vq->kickfd = fd;
#if RTE_VERSION >= RTE_VERSION_NUM(2, 2, 0, 0)
+ vring = &xd->vu_intf->vrings[idx];
vq->enabled = (vq->desc && vq->avail && vq->used && vring->enabled) ? 1 : 0;
#endif