Skip to contentSkip to conversation

vhost: fix build error for old kernels

PATCH Applied Yuanhan Liu 2 participants 2 messages Mar 8, 2016 – Mar 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost: fix build error for old kernels

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")
---
 lib/librte_vhost/rte_virtio_net.h | 5 +++++
 1 file changed, 5 insertions(+)
lib/librte_vhost/rte_virtio_net.h +5 -0
index 7d1fde2..443245d 100644
@@ -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
Signature · 1 line
1.9.0
#1 lore raw

2016-03-08 16:51, Yuanhan Liu:

Quoted 7 lines

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")

Applied, thanks