[dpdk-dev,2/2] net/mlx5: fix RSS key len query

Message ID 20180326101219.91229-2-shahafs@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Shahaf Shuler
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Shahaf Shuler March 26, 2018, 10:12 a.m. UTC
  The RSS key length returned by rte_eth_dev_info_get command was taken
from the
PMD private structure. This structure initialization was done only after
the port configuration.

Considering Mellanox device supports only 40B long RSS key, reporting
the fixed number instead.

Fixes: 29c1d8bb3e79 ("net/mlx5: handle a single RSS hash key for all protocols")
Cc: stable@dpdk.org
Cc: nelio.laranjeiro@6wind.com

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 drivers/net/mlx5/mlx5_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Nélio Laranjeiro March 26, 2018, 11:33 a.m. UTC | #1
On Mon, Mar 26, 2018 at 01:12:19PM +0300, Shahaf Shuler wrote:
> The RSS key length returned by rte_eth_dev_info_get command was taken
> from the
> PMD private structure. This structure initialization was done only after
> the port configuration.
> 
> Considering Mellanox device supports only 40B long RSS key, reporting
> the fixed number instead.
> 
> Fixes: 29c1d8bb3e79 ("net/mlx5: handle a single RSS hash key for all protocols")
> Cc: stable@dpdk.org
> Cc: nelio.laranjeiro@6wind.com
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>  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 365101af9..b6f5101cf 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -428,7 +428,7 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
>  		info->if_index = if_nametoindex(ifname);
>  	info->reta_size = priv->reta_idx_n ?
>  		priv->reta_idx_n : config->ind_table_max_size;
> -	info->hash_key_size = priv->rss_conf.rss_key_len;
> +	info->hash_key_size = rss_hash_default_key_len;
>  	info->speed_capa = priv->link_speed_capa;
>  	info->flow_type_rss_offloads = ~MLX5_RSS_HF_MASK;
>  }
> -- 
> 2.12.0

Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

Regards,
  

Patch

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index 365101af9..b6f5101cf 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -428,7 +428,7 @@  mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
 		info->if_index = if_nametoindex(ifname);
 	info->reta_size = priv->reta_idx_n ?
 		priv->reta_idx_n : config->ind_table_max_size;
-	info->hash_key_size = priv->rss_conf.rss_key_len;
+	info->hash_key_size = rss_hash_default_key_len;
 	info->speed_capa = priv->link_speed_capa;
 	info->flow_type_rss_offloads = ~MLX5_RSS_HF_MASK;
 }