diff mbox series

[ovs-dev] netdev-dpdk: Fix RSS configuration for virtio.

Message ID 20210830101304.13689-1-david.marchand@redhat.com
State Accepted
Headers show
Series [ovs-dev] netdev-dpdk: Fix RSS configuration for virtio. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

David Marchand Aug. 30, 2021, 10:13 a.m. UTC
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>
---
 lib/netdev-dpdk.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

Comments

Michael Santana Sept. 2, 2021, 3:27 p.m. UTC | #1
On 8/30/21 6:13 AM, David Marchand wrote:
> In the future, virtio may support RSS.
> In any case, it is safer to rely on exposed capabilities rather than
> matching on driver names.
I agree. It's better to directly check if rss is supported and not 
assume every non virtio driver is supported

Acked-by: Michael Santana <msantana@redhat.com>
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>   lib/netdev-dpdk.c | 13 +++++--------
>   1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 45a96b9be2..ca92c947a2 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
>
Maxime Coquelin Sept. 7, 2021, 8:57 a.m. UTC | #2
On 8/30/21 12:13 PM, David Marchand wrote:
> 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>
> ---
>  lib/netdev-dpdk.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
Ilya Maximets Sept. 16, 2021, 12:53 a.m. UTC | #3
On 8/30/21 12:13, David Marchand wrote:
> In the future, virtio may support RSS.
> In any case, it is safer to rely on exposed capabilities rather than
> matching on driver names.

Thanks!  Applied.  I also backported this down to 2.15 since these
branches are using the same DPDK version, and this change seems to
fix issues with virtio-user.

Best regards, Ilya Maximets.
David Marchand Sept. 16, 2021, 6:54 a.m. UTC | #4
On Thu, Sep 16, 2021 at 2:53 AM Ilya Maximets <i.maximets@ovn.org> wrote:
>
> On 8/30/21 12:13, David Marchand wrote:
> > In the future, virtio may support RSS.
> > In any case, it is safer to rely on exposed capabilities rather than
> > matching on driver names.
>
> Thanks!  Applied.  I also backported this down to 2.15 since these
> branches are using the same DPDK version, and this change seems to
> fix issues with virtio-user.

Thanks Ilya.
diff mbox series

Patch

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 45a96b9be2..ca92c947a2 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