Skip to contentSkip to conversation

vhost: fix compilation issue caused by virtio 1.0 support

PATCH Applied Marcel Apfelbaum 3 participants 3 messages Nov 3, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost: fix compilation issue caused by virtio 1.0 support

Commit 15e9ee6982a4822ce395fd597dd500a61ceafa7c (vhost: enable virtio 1.0) uses the VIRTIO_F_VERSION_1 macro existing only in newer kernels.

Fixed it by manually defining it for older kernels.

---

Hi,

I reproduced the issue with 3.9.5 kernel and solved using Xie, Huawei's idea.

By the way, what is the earlier kernel that DPDK supports? I tried 3.19 with no luck.

Please let me know if you prefer another way to do it.

Thanks,
Marcel

 lib/librte_vhost/rte_virtio_net.h | 7 +++++++
 1 file changed, 7 insertions(+)
lib/librte_vhost/rte_virtio_net.h +7 -0
index b6386f9..5687452 100644
@@ -108,6 +108,13 @@ struct vhost_virtqueue {
  #define VHOST_SUPPORTS_MQ	0
 #endif
 
+/*
+ * Define virtio 1.0 for older kernels
+ */
+#ifndef VIRTIO_F_VERSION_1
+ #define VIRTIO_F_VERSION_1 32
+#endif
+
 /**
  * Device structure contains all configuration information relating to the device.
  */
Signature · 1 line
2.1.0
#1 lore raw
Quoted 4 lines · Marcel Apfelbaum

Commit 15e9ee6982a4822ce395fd597dd500a61ceafa7c (vhost: enable virtio 1.0) uses the VIRTIO_F_VERSION_1 macro existing only in newer kernels.

Fixed it by manually defining it for older kernels.

I added to CC the involved developers, the git-send-email blocked it. Also sorry for the [Qemu-devel] prefix.

Thanks,
Marcel

Quoted 40 lines

---

Hi,

I reproduced the issue with 3.9.5 kernel and solved using Xie, Huawei's idea.

By the way, what is the earlier kernel that DPDK supports? I tried 3.19 with no luck.

Please let me know if you prefer another way to do it.

Thanks,
Marcel

  lib/librte_vhost/rte_virtio_net.h | 7 +++++++
  1 file changed, 7 insertions(+)
lib/librte_vhost/rte_virtio_net.h +7 -0
index b6386f9..5687452 100644
@@ -108,6 +108,13 @@ struct vhost_virtqueue {
   #define VHOST_SUPPORTS_MQ	0
  #endif
 
+/*
+ * Define virtio 1.0 for older kernels
+ */
+#ifndef VIRTIO_F_VERSION_1
+ #define VIRTIO_F_VERSION_1 32
+#endif
+
  /**
   * Device structure contains all configuration information relating to the device.
   */
#2 lore raw
In reply to Marcel Apfelbaum

2015-11-03 13:28, Marcel Apfelbaum:

Quoted 7 lines

Commit 15e9ee6982a4822ce395fd597dd500a61ceafa7c (vhost: enable virtio 1.0) uses the VIRTIO_F_VERSION_1 macro existing only in newer kernels.

Fixed it by manually defining it for older kernels.

Applied, thanks

Quoted 2 lines

By the way, what is the earlier kernel that DPDK supports? I tried 3.19 with no luck.

We always try to support the latest one.
If there is a bug with 3.19, please report.