From 13b3137f3b7c8f866947a9b34e06a8aec0d084f7 Mon Sep 17 00:00:00 2001 From: Dilshod Urazov Date: Wed, 9 Oct 2019 13:32:07 +0100 Subject: [PATCH] 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 Signed-off-by: Andrew Rybchenko Reviewed-by: Maxime Coquelin --- drivers/net/virtio/virtio_ethdev.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 0a2ed2e500..76bd40a3e4 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) -- 2.20.1