Open LanceLiu89 opened 4 years ago
it is commited in 2019.10.9
commit 13b3137f3b7c8f866947a9b34e06a8aec0d084f7
Author: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Date: Wed Oct 9 13:32:07 2019 +0100
net/virtio: reject unsupported Rx multi-queue modes
This driver supports none of DCB, RSS or VMDQ modes, therefore must
check and return error if configured incorrectly.
Virtio can distribute Rx packets across multi-queue, but there is
no controls (algorithm, redirection table, hash function) except
number of Rx queues and ETH_MQ_RX_NONE is the best fit meaning
no method is enforced on how to route packets to MQs.
Fixes: c1f86306a026 ("virtio: add new driver")
Cc: stable@dpdk.org
Signed-off-by: Dilshod Urazov <dilshod.urazov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 0a2ed2e50..76bd40a3e 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -2066,6 +2066,13 @@ virtio_dev_configure(struct rte_eth_dev *dev)
PMD_INIT_LOG(DEBUG, "configure");
req_features = VIRTIO_PMD_DEFAULT_GUEST_FEATURES;
+ if (rxmode->mq_mode != ETH_MQ_RX_NONE) {
+ PMD_DRV_LOG(ERR,
+ "Unsupported Rx multi queue mode %d",
+ rxmode->mq_mode);
+ return -EINVAL;
+ }
+
if (dev->data->dev_conf.intr_conf.rxq) {
ret = virtio_init_device(dev, hw->req_guest_features);
if (ret < 0)
Good catch. As long as auto-scaling is disabled (that currently relies on the RSS reta) ETH_MQ_RX_NONE
should be acceptable. So I think my fix would be to add an if that checks if RSS is supported, and if not, proceed with mq_rx_none assuming auto-scaling is disabled on the command line. I'll try to implement a fix hopefully in the next few days. Feel free to submit a pull request if you get to it earlier. As a workaround just hardcoding mq_rx_none should probably work. (just disable auto scaling too on the command line as it won't work)
I tried this before, it actually works with autoscaling disabled via command line + mq_rx_none
when start tas with multi queue virtio_net, it start failed [root@localhost tas]# ./tas --ip-addr=192.168.122.123/24 --fp-no-xsumoffload Warning: NIC does not support all requested RSS hash functions. virtio_dev_configure(): Unsupported Rx multi queue mode 1 Port0 dev_configure = -22 rte_eth_dev_configure failed network init failed
looks like the default port_conf->rxmode not change to ETH_MQ_RX_NONE when using virtio_net
but virtio_dev_configure() check failed if it's not ETH_MQ_RX_NONE
BTW, my dpdk is 19.11