diff mbox series

[ovs-dev] netdev-dpdk: don't set rx mq mode for net_virtio

Message ID 20200514133844.14806-1-jcaamano@suse.com
State Superseded
Headers show
Series [ovs-dev] netdev-dpdk: don't set rx mq mode for net_virtio | expand

Commit Message

Jaime Caamaño Ruiz May 14, 2020, 1:38 p.m. UTC
Since DPDK 19.11 [1], it is not allowed to set any RX mq mode for virtio
driver.

[1] https://github.com/DPDK/dpdk/commit/13b3137f3b7c8f866947a9b34e06a8aec0d084f7

Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
---
 lib/netdev-dpdk.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Flavio Leitner May 18, 2020, 5:26 p.m. UTC | #1
On Thu, May 14, 2020 at 03:38:44PM +0200, Jaime Caamaño Ruiz wrote:
> Since DPDK 19.11 [1], it is not allowed to set any RX mq mode for virtio
> driver.
> 
> [1] https://github.com/DPDK/dpdk/commit/13b3137f3b7c8f866947a9b34e06a8aec0d084f7
> 
> Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
> ---
>  lib/netdev-dpdk.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 44ebf96da..022e3af92 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -965,6 +965,12 @@ 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;
> +    }
> +

After this we would have the variable initialized in two different
places. I suggest the following for best readability:

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 44ebf96da..1a3471ce9 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -163,7 +163,6 @@ typedef uint16_t dpdk_port_t;
 
 static const struct rte_eth_conf port_conf = {
     .rxmode = {
-        .mq_mode = ETH_MQ_RX_RSS,
         .split_hdr_size = 0,
         .offloads = 0,
     },
@@ -965,6 +964,14 @@ 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

What do you think?
Thanks
fbl



>      /* 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
> -- 
> 2.16.4
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Jaime Caamaño Ruiz May 19, 2020, 11:26 a.m. UTC | #2
Can't disagree, will change to your suggestion.

-----Original Message-----
From: Flavio Leitner <fbl@sysclose.org>
To: Jaime Caamaño Ruiz <jcaamano@suse.com>
Cc: dev@openvswitch.org
Subject: Re: [ovs-dev] [PATCH] netdev-dpdk: don't set rx mq mode for
net_virtio
Date: Mon, 18 May 2020 14:26:17 -0300

On Thu, May 14, 2020 at 03:38:44PM +0200, Jaime Caamaño Ruiz wrote:
> Since DPDK 19.11 [1], it is not allowed to set any RX mq mode for
> virtio
> driver.
> 
> [1] https://github.com/DPDK/dpdk/commit/13b3137f3b7c8f866947a9b34e06a
> 8aec0d084f7
> 
> Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
> ---
>  lib/netdev-dpdk.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 44ebf96da..022e3af92 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -965,6 +965,12 @@ 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;
> +    }
> +

After this we would have the variable initialized in two different
places. I suggest the following for best readability:

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 44ebf96da..1a3471ce9 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -163,7 +163,6 @@ typedef uint16_t dpdk_port_t;
 
 static const struct rte_eth_conf port_conf = {
     .rxmode = {
-        .mq_mode = ETH_MQ_RX_RSS,
         .split_hdr_size = 0,
         .offloads = 0,
     },
@@ -965,6 +964,14 @@ 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

What do you think?
Thanks
fbl



>      /* 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
> -- 
> 2.16.4
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
Jaime Caamaño Ruiz May 19, 2020, 11:28 a.m. UTC | #3
Sorry, ignore this one...

-----Original Message-----
From: Jaime Caamaño Ruiz <jcaamano@suse.com>
To: dev@openvswitch.org
Cc: Jaime Caamaño Ruiz <jcaamano@suse.com>
Subject: [PATCH] netdev-dpdk: don't set rx mq mode for net_virtio
Date: Thu, 14 May 2020 15:38:44 +0200

Since DPDK 19.11 [1], it is not allowed to set any RX mq mode for
virtio
driver.

[1] https://github.com/DPDK/dpdk/commit/13b3137f3b7c8f866947a9b34e06a8a
ec0d084f7

Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
---
 lib/netdev-dpdk.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 44ebf96da..022e3af92 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -965,6 +965,12 @@ 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;
+    }
+
     /* 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
diff mbox series

Patch

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 44ebf96da..022e3af92 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -965,6 +965,12 @@  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;
+    }
+
     /* 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