vhost: fix build with kernel < 3.8
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Thu, 29 Oct 2015 03:37:45 +0000 (11:37 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 30 Oct 2015 14:55:05 +0000 (15:55 +0100)
commit71dfdbe66a66986c80a551268562ff6c54831f04
tree3219298b58fd7c4f0d0ee50cb2dae1ca9cbd9b41
parent07d37fbf5e91e72f961900d851611afe47702548
vhost: fix build with kernel < 3.8

Fix build error:
  virtio-net.c:80:89: error: ‘VIRTIO_NET_F_MQ’ undeclared here
  rte_virtio_net.h:109: error: ‘VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX’ undeclared here

Above two virtio-net MQ macros are introduced since kernel v3.8.
For older kernel, we should not reference them directly, hence,
this patch introduced two wrapper macros, with proper values
being set depending on we support MQ or not.

Fixes: b09b198bfb5c ("vhost-user: announce queue number in message")

Reported-by: Yongjie Gu <yongjiex.gu@intel.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: David Marchand <david.marchand@6wind.com>
lib/librte_vhost/rte_virtio_net.h
lib/librte_vhost/vhost_user/vhost-net-user.c
lib/librte_vhost/virtio-net.c