]> git.droids-corp.org - dpdk.git/commitdiff
vhost: fix build with kernel < 3.5
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 8 Mar 2016 08:51:21 +0000 (16:51 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 11 Mar 2016 15:46:18 +0000 (16:46 +0100)
VIRTIO_NET_F_GUEST_ANNOUNCE is a new feature introduced since kernel
v3.5. For older kernels (or more precisely, old distributions), we
could simply define it manually, to fix the "macro not defined" error.

Fixes: d293dac8f30e ("vhost: claim support of guest announce")
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/rte_virtio_net.h

index 7d1fde202572736c71ca58ef160adf68eec02b2a..443245dc6864e457977eb04a5ee43e076c74066a 100644 (file)
@@ -97,6 +97,11 @@ struct vhost_virtqueue {
        struct buf_vector       buf_vec[BUF_VECTOR_MAX];        /**< for scatter RX. */
 } __rte_cache_aligned;
 
+/* Old kernels have no such macro defined */
+#ifndef VIRTIO_NET_F_GUEST_ANNOUNCE
+ #define VIRTIO_NET_F_GUEST_ANNOUNCE 21
+#endif
+
 
 /*
  * Make an extra wrapper for VIRTIO_NET_F_MQ and