[v2] net/mlx5: Allow configuring mlx5 port for TX only

Message ID 1586789242-9984-1-git-send-email-mohsinshaikh@niometrics.com (mailing list archive)
State Not Applicable, archived
Delegated to: Raslan Darawsheh
Headers
Series [v2] net/mlx5: Allow configuring mlx5 port for TX only |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Mohsin Shaikh April 13, 2020, 2:47 p.m. UTC
  Configuring mlx5 port with 0 rx rings and 1 or more tx rings causes
following error in dev_start:
    net_mlx5: port 1 cannot allocate RSS queue list (0)
    net_mlx5: port 1 reta config failed: Cannot allocate memory
Skip mlx5_dev_configure_rss_reta() when there are no rx rings.

Cc: stable@dpdk.org
Signed-off-by: Mohsin Shaikh <mohsinshaikh@niometrics.com>
---

v2: Fix coding style issue COMMIT_LOG_LONG_LINE

---
 drivers/net/mlx5/mlx5_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Alexander Kozyrev April 13, 2020, 6:50 p.m. UTC | #1
Hi Mohsin, the problem you described has been already fixed by 606d690 ("net/mlx5: fix running without Rx queue").
I guess you see the issue on 19.11 branch, right? Could you please apply this patch and verify that it fixes the issue for you?

Regards,
Alex


> -----Original Message-----
> From: Mohsin Shaikh <mohsinshaikh@niometrics.com>
> Sent: Monday, April 13, 2020 10:47
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Alexander Kozyrev <akozyrev@mellanox.com>; Mohsin
> Shaikh <mohsinshaikh@niometrics.com>
> Subject: [PATCH v2] net/mlx5: Allow configuring mlx5 port for TX only
> 
> Configuring mlx5 port with 0 rx rings and 1 or more tx rings causes following
> error in dev_start:
>     net_mlx5: port 1 cannot allocate RSS queue list (0)
>     net_mlx5: port 1 reta config failed: Cannot allocate memory Skip
> mlx5_dev_configure_rss_reta() when there are no rx rings.
> 
> Cc: stable@dpdk.org
> Signed-off-by: Mohsin Shaikh <mohsinshaikh@niometrics.com>
> ---
> 
> v2: Fix coding style issue COMMIT_LOG_LONG_LINE
> 
> ---
>  drivers/net/mlx5/mlx5_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
> index d7d3bc7..1d443c1 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -463,7 +463,7 @@ struct ethtool_link_settings {
>  	unsigned int *rss_queue_arr = NULL;
>  	unsigned int rss_queue_n = 0;
> 
> -	if (priv->skip_default_rss_reta)
> +	if (priv->skip_default_rss_reta || !rxqs_n)
>  		return ret;
>  	rss_queue_arr = rte_malloc("", rxqs_n * sizeof(unsigned int), 0);
>  	if (!rss_queue_arr) {
> --
> 1.8.3.1
  

Patch

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index d7d3bc7..1d443c1 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -463,7 +463,7 @@  struct ethtool_link_settings {
 	unsigned int *rss_queue_arr = NULL;
 	unsigned int rss_queue_n = 0;
 
-	if (priv->skip_default_rss_reta)
+	if (priv->skip_default_rss_reta || !rxqs_n)
 		return ret;
 	rss_queue_arr = rte_malloc("", rxqs_n * sizeof(unsigned int), 0);
 	if (!rss_queue_arr) {