summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Marchand <david.marchand@redhat.com>2021-08-30 12:13:04 +0200
committerIlya Maximets <i.maximets@ovn.org>2021-09-16 01:03:28 +0200
commit5e86db383ff8e74bc0483c5db50dd66a806f0857 (patch)
tree78ae24812b0bd2326a7f99ce1c414ae1b118b311 /lib
parentd0020c5e8769582ff949cdfff2e7c393fe7b6688 (diff)
downloadopenvswitch-5e86db383ff8e74bc0483c5db50dd66a806f0857.tar.gz
netdev-dpdk: Fix RSS configuration for virtio.
In the future, virtio may support RSS. In any case, it is safer to rely on exposed capabilities rather than matching on driver names. Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Michael Santana <msantana@redhat.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/netdev-dpdk.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 45a96b9be..ca92c947a 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -961,14 +961,6 @@ dpdk_eth_dev_port_config(struct netdev_dpdk *dev, int n_rxq, int n_txq)
rte_eth_dev_info_get(dev->port_id, &info);
- /* As of DPDK 19.11, it is not allowed to set a mq_mode for
- * virtio PMD driver. */
- if (!strcmp(info.driver_name, "net_virtio")) {
- conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
- } else {
- conf.rxmode.mq_mode = ETH_MQ_RX_RSS;
- }
-
/* As of DPDK 17.11.1 a few PMDs require to explicitly enable
* scatter to support jumbo RX.
* Setting scatter for the device is done after checking for
@@ -1000,6 +992,11 @@ dpdk_eth_dev_port_config(struct netdev_dpdk *dev, int n_rxq, int n_txq)
/* Limit configured rss hash functions to only those supported
* by the eth device. */
conf.rx_adv_conf.rss_conf.rss_hf &= info.flow_type_rss_offloads;
+ if (conf.rx_adv_conf.rss_conf.rss_hf == 0) {
+ conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
+ } else {
+ conf.rxmode.mq_mode = ETH_MQ_RX_RSS;
+ }
/* A device may report more queues than it makes available (this has
* been observed for Intel xl710, which reserves some of them for