From: Yuanhan Liu <hidden> Date: 2017-02-23 08:45:50
Some macros (say VIRTIO_NET_F_MQ) are needed for enabling multiple queue,
however they are introduced since kernel v3.8, meaning build error happens
if we build DPDK vhost on those platforms.
71dfdbe66a66 ("vhost: fix build with kernel < 3.8") meant to fix it, but
in a wrong way: it completely disables the MQ features for those kernels.
However, the MQ feature doesn't depend on the kernel at all (except the
macros dependency stated above), that we could still enable the MQ feature
even the host kernel has no such support.
The right fix is to define the macro if it's not defined.
Fixes: 71dfdbe66a66 ("vhost: fix build with kernel < 3.8")
Cc: stable@dpdk.org
Signed-off-by: Yuanhan Liu <redacted>
---
lib/librte_vhost/vhost.c | 2 +-
lib/librte_vhost/vhost.h | 11 ++++-------
lib/librte_vhost/vhost_user.c | 2 +-
3 files changed, 6 insertions(+), 9 deletions(-)
From: Maxime Coquelin <hidden> Date: 2017-03-01 08:16:04
On 02/23/2017 09:45 AM, Yuanhan Liu wrote:
Some macros (say VIRTIO_NET_F_MQ) are needed for enabling multiple queue,
however they are introduced since kernel v3.8, meaning build error happens
if we build DPDK vhost on those platforms.
71dfdbe66a66 ("vhost: fix build with kernel < 3.8") meant to fix it, but
in a wrong way: it completely disables the MQ features for those kernels.
However, the MQ feature doesn't depend on the kernel at all (except the
macros dependency stated above), that we could still enable the MQ feature
even the host kernel has no such support.
The right fix is to define the macro if it's not defined.
Fixes: 71dfdbe66a66 ("vhost: fix build with kernel < 3.8")
Cc: stable@dpdk.org
Signed-off-by: Yuanhan Liu <redacted>
---
lib/librte_vhost/vhost.c | 2 +-
lib/librte_vhost/vhost.h | 11 ++++-------
lib/librte_vhost/vhost_user.c | 2 +-
3 files changed, 6 insertions(+), 9 deletions(-)
Agree this is the right fix:
Reviewed-by: Maxime Coquelin <redacted>
Thanks!
Maxime
From: Yuanhan Liu <hidden> Date: 2017-03-01 10:41:58
Some macros (say VIRTIO_NET_F_MQ) are needed for enabling multiple queue,
however they are introduced since kernel v3.8, meaning build error happens
if we build DPDK vhost on those platforms.
71dfdbe66a66 ("vhost: fix build with kernel < 3.8") meant to fix it, but
in a wrong way: it completely disables the MQ features for those kernels.
However, the MQ feature doesn't depend on the kernel at all (except the
macros dependency stated above), that we could still enable the MQ feature
even the host kernel has no such support.
The right fix is to define the macro if it's not defined.
Fixes: 71dfdbe66a66 ("vhost: fix build with kernel < 3.8")
Cc: stable@dpdk.org
Signed-off-by: Yuanhan Liu <redacted>
Reviewed-by: Maxime Coquelin <redacted>
---
- v2: do not remove the VHOST_MAX_QUEUE_PAIRS macro. The value which
in turn will be fixed in next patch.
---
lib/librte_vhost/vhost.c | 2 +-
lib/librte_vhost/vhost.h | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
From: Yuanhan Liu <hidden> Date: 2017-03-01 10:41:59
0x8000 is the max virito-net queue pairs the virtio 1.0 spec claims to
support. While for vhost-user, it's a different story: the max vring
index could be passed by the vhost-user spec is 0xff, masked by the
VHOST_USER_VRING_IDX_MASK.
That said, the max queue pairs could vhost-user could supported is 0x80.
If user are asking more, I think the vhost-user need be extended.
Fixes: b09b198bfb5c ("vhost-user: announce queue number in message")
Cc: stable@dpdk.org
Signed-off-by: Yuanhan Liu <redacted>
---
lib/librte_vhost/vhost.h | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
@@ -110,24 +110,15 @@ struct vhost_virtqueue {uint16_tshadow_used_idx;}__rte_cache_aligned;-/* Old kernels have no such macro defined */+/* Old kernels have no such macros defined */#ifndef VIRTIO_NET_F_GUEST_ANNOUNCE#define VIRTIO_NET_F_GUEST_ANNOUNCE 21#endif--/*-*MakeanextrawrapperforVIRTIO_NET_F_MQand-*VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAXastheyare-*introducedsincekernelv3.8.Thismakesour-*codebuildableforolderkernel.-*/-#ifdef VIRTIO_NET_F_MQ-#define VHOST_MAX_QUEUE_PAIRS VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX-#else+#ifndef VIRTIO_NET_F_MQ#define VIRTIO_NET_F_MQ 22-#define VHOST_MAX_QUEUE_PAIRS 0x8000#endif+#define VHOST_MAX_QUEUE_PAIRS 0x80/**Definevirtio1.0forolderkernels
From: Yuanhan Liu <hidden> Date: 2017-03-22 08:36:36
On Wed, Mar 01, 2017 at 06:41:59PM +0800, Yuanhan Liu wrote:
0x8000 is the max virito-net queue pairs the virtio 1.0 spec claims to
support. While for vhost-user, it's a different story: the max vring
index could be passed by the vhost-user spec is 0xff, masked by the
VHOST_USER_VRING_IDX_MASK.
That said, the max queue pairs could vhost-user could supported is 0x80.
If user are asking more, I think the vhost-user need be extended.
Fixes: b09b198bfb5c ("vhost-user: announce queue number in message")
Cc: stable@dpdk.org
Signed-off-by: Yuanhan Liu <redacted>