From: Yuanhan Liu Date: Tue, 8 Mar 2016 08:51:21 +0000 (+0800) Subject: vhost: fix build with kernel < 3.5 X-Git-Tag: spdx-start~7475 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6fe390eed0f0aae9479f9cdbe4f4bb46c27aef63;p=dpdk.git vhost: fix build with kernel < 3.5 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 --- diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h index 7d1fde2025..443245dc68 100644 --- a/lib/librte_vhost/rte_virtio_net.h +++ b/lib/librte_vhost/rte_virtio_net.h @@ -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