From 4ee137baf87fb1261122d4bee4bc15e1432bd0bd Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Tue, 23 Feb 2016 19:23:44 +0100 Subject: Fix warnings in vhost-user code with older version of DPDK Change-Id: If76ef977e3914b51da0d6bb5e4089acb0bd67baa Signed-off-by: Damjan Marion --- vnet/vnet/devices/dpdk/vhost_user.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'vnet') 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 -- cgit 1.2.3-korg