DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] net/mlx5: enforce RSS key length limitation
@ 2018-03-26 10:12 Shahaf Shuler
  2018-03-26 10:12 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix RSS key len query Shahaf Shuler
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Shahaf Shuler @ 2018-03-26 10:12 UTC (permalink / raw)
  To: nelio.laranjeiro, adrien.mazarguil, yskoh; +Cc: dev, stable

RSS hash key must be 40 Bytes long.

Cc: stable@dpdk.org

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 drivers/net/mlx5/mlx5_ethdev.c | 3 ++-
 drivers/net/mlx5/mlx5_rss.c    | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index f5511ce70..365101af9 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -329,7 +329,8 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
 	if (use_app_rss_key &&
 	    (dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len !=
 	     rss_hash_default_key_len)) {
-		/* MLX5 RSS only support 40bytes key. */
+		DRV_LOG(ERR, "port %u RSS key len must be %zu Bytes long",
+			dev->data->port_id, rss_hash_default_key_len);
 		rte_errno = EINVAL;
 		return -rte_errno;
 	}
diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index 5ac650163..ceaa570ef 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -48,6 +48,13 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev,
 		return -rte_errno;
 	}
 	if (rss_conf->rss_key && rss_conf->rss_key_len) {
+		if (rss_conf->rss_key_len != rss_hash_default_key_len) {
+			DRV_LOG(ERR,
+				"port %u RSS key len must be %zu Bytes long",
+				dev->data->port_id, rss_hash_default_key_len);
+			rte_errno = ENOTSUP;
+			return -rte_errno;
+		}
 		priv->rss_conf.rss_key = rte_realloc(priv->rss_conf.rss_key,
 						     rss_conf->rss_key_len, 0);
 		if (!priv->rss_conf.rss_key) {
-- 
2.12.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH 2/2] net/mlx5: fix RSS key len query
  2018-03-26 10:12 [dpdk-dev] [PATCH 1/2] net/mlx5: enforce RSS key length limitation Shahaf Shuler
@ 2018-03-26 10:12 ` Shahaf Shuler
  2018-03-26 11:33   ` Nélio Laranjeiro
  2018-03-26 11:17 ` [dpdk-dev] [PATCH 1/2] net/mlx5: enforce RSS key length limitation Nélio Laranjeiro
  2018-03-28  6:08 ` Shahaf Shuler
  2 siblings, 1 reply; 7+ messages in thread
From: Shahaf Shuler @ 2018-03-26 10:12 UTC (permalink / raw)
  To: nelio.laranjeiro, adrien.mazarguil, yskoh; +Cc: dev, stable

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/mlx5: enforce RSS key length limitation
  2018-03-26 10:12 [dpdk-dev] [PATCH 1/2] net/mlx5: enforce RSS key length limitation Shahaf Shuler
  2018-03-26 10:12 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix RSS key len query Shahaf Shuler
@ 2018-03-26 11:17 ` Nélio Laranjeiro
  2018-03-27  5:55   ` Shahaf Shuler
  2018-03-28  6:08 ` Shahaf Shuler
  2 siblings, 1 reply; 7+ messages in thread
From: Nélio Laranjeiro @ 2018-03-26 11:17 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: adrien.mazarguil, yskoh, dev, stable

On Mon, Mar 26, 2018 at 01:12:18PM +0300, Shahaf Shuler wrote:
> RSS hash key must be 40 Bytes long.
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>  drivers/net/mlx5/mlx5_ethdev.c | 3 ++-
>  drivers/net/mlx5/mlx5_rss.c    | 7 +++++++
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
> index f5511ce70..365101af9 100644
> --- a/drivers/net/mlx5/mlx5_ethdev.c
> +++ b/drivers/net/mlx5/mlx5_ethdev.c
> @@ -329,7 +329,8 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
>  	if (use_app_rss_key &&
>  	    (dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len !=
>  	     rss_hash_default_key_len)) {
> -		/* MLX5 RSS only support 40bytes key. */
> +		DRV_LOG(ERR, "port %u RSS key len must be %zu Bytes long",
> +			dev->data->port_id, rss_hash_default_key_len);
>  		rte_errno = EINVAL;
>  		return -rte_errno;
>  	}
> diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
> index 5ac650163..ceaa570ef 100644
> --- a/drivers/net/mlx5/mlx5_rss.c
> +++ b/drivers/net/mlx5/mlx5_rss.c
> @@ -48,6 +48,13 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev,
>  		return -rte_errno;
>  	}
>  	if (rss_conf->rss_key && rss_conf->rss_key_len) {
> +		if (rss_conf->rss_key_len != rss_hash_default_key_len) {
> +			DRV_LOG(ERR,
> +				"port %u RSS key len must be %zu Bytes long",
> +				dev->data->port_id, rss_hash_default_key_len);
> +			rte_errno = ENOTSUP;

Should be EINVAL when values are incorrect.

> +			return -rte_errno;
> +		}
>  		priv->rss_conf.rss_key = rte_realloc(priv->rss_conf.rss_key,
>  						     rss_conf->rss_key_len, 0);
>  		if (!priv->rss_conf.rss_key) {
> -- 
> 2.12.0

Thanks,

-- 
Nélio Laranjeiro
6WIND

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] net/mlx5: fix RSS key len query
  2018-03-26 10:12 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix RSS key len query Shahaf Shuler
@ 2018-03-26 11:33   ` Nélio Laranjeiro
  0 siblings, 0 replies; 7+ messages in thread
From: Nélio Laranjeiro @ 2018-03-26 11:33 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: adrien.mazarguil, yskoh, dev, stable

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,

-- 
Nélio Laranjeiro
6WIND

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/mlx5: enforce RSS key length limitation
  2018-03-26 11:17 ` [dpdk-dev] [PATCH 1/2] net/mlx5: enforce RSS key length limitation Nélio Laranjeiro
@ 2018-03-27  5:55   ` Shahaf Shuler
  2018-03-27  7:15     ` Nélio Laranjeiro
  0 siblings, 1 reply; 7+ messages in thread
From: Shahaf Shuler @ 2018-03-27  5:55 UTC (permalink / raw)
  To: Nélio Laranjeiro; +Cc: Adrien Mazarguil, Yongseok Koh, dev, stable

Monday, March 26, 2018 2:18 PM, Nélio Laranjeiro:
> On Mon, Mar 26, 2018 at 01:12:18PM +0300, Shahaf Shuler wrote:
> > @@ -48,6 +48,13 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev,
> >  		return -rte_errno;
> >  	}
> >  	if (rss_conf->rss_key && rss_conf->rss_key_len) {
> > +		if (rss_conf->rss_key_len != rss_hash_default_key_len) {
> > +			DRV_LOG(ERR,
> > +				"port %u RSS key len must be %zu Bytes
> long",
> > +				dev->data->port_id,
> rss_hash_default_key_len);
> > +			rte_errno = ENOTSUP;
> 
> Should be EINVAL when values are incorrect.

OK.

Considering it is the only comment in this series, are you OK with me changing it while applying to next-net-mlx? 

> 
> > +			return -rte_errno;
> > +		}
> >  		priv->rss_conf.rss_key = rte_realloc(priv->rss_conf.rss_key,
> >  						     rss_conf->rss_key_len, 0);
> >  		if (!priv->rss_conf.rss_key) {
> > --
> > 2.12.0
> 
> Thanks,
> 
> --
> Nélio Laranjeiro
> 6WIND

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/mlx5: enforce RSS key length limitation
  2018-03-27  5:55   ` Shahaf Shuler
@ 2018-03-27  7:15     ` Nélio Laranjeiro
  0 siblings, 0 replies; 7+ messages in thread
From: Nélio Laranjeiro @ 2018-03-27  7:15 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: Adrien Mazarguil, Yongseok Koh, dev, stable

On Tue, Mar 27, 2018 at 05:55:32AM +0000, Shahaf Shuler wrote:
> Monday, March 26, 2018 2:18 PM, Nélio Laranjeiro:
> > On Mon, Mar 26, 2018 at 01:12:18PM +0300, Shahaf Shuler wrote:
> > > @@ -48,6 +48,13 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev,
> > >  		return -rte_errno;
> > >  	}
> > >  	if (rss_conf->rss_key && rss_conf->rss_key_len) {
> > > +		if (rss_conf->rss_key_len != rss_hash_default_key_len) {
> > > +			DRV_LOG(ERR,
> > > +				"port %u RSS key len must be %zu Bytes
> > long",
> > > +				dev->data->port_id,
> > rss_hash_default_key_len);
> > > +			rte_errno = ENOTSUP;
> > 
> > Should be EINVAL when values are incorrect.
> 
> OK.
> 
> Considering it is the only comment in this series, are you OK with me
> changing it while applying to next-net-mlx? 

Sure,

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

-- 
Nélio Laranjeiro
6WIND

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] net/mlx5: enforce RSS key length limitation
  2018-03-26 10:12 [dpdk-dev] [PATCH 1/2] net/mlx5: enforce RSS key length limitation Shahaf Shuler
  2018-03-26 10:12 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix RSS key len query Shahaf Shuler
  2018-03-26 11:17 ` [dpdk-dev] [PATCH 1/2] net/mlx5: enforce RSS key length limitation Nélio Laranjeiro
@ 2018-03-28  6:08 ` Shahaf Shuler
  2 siblings, 0 replies; 7+ messages in thread
From: Shahaf Shuler @ 2018-03-28  6:08 UTC (permalink / raw)
  To: Shahaf Shuler, Nélio Laranjeiro, Adrien Mazarguil, Yongseok Koh
  Cc: dev, stable

Monday, March 26, 2018 1:12 PM, Shahaf Shuler:
> Subject: [dpdk-dev] [PATCH 1/2] net/mlx5: enforce RSS key length limitation
> 
> RSS hash key must be 40 Bytes long.
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---

Series applied to next-net-mlx with ENOTSUP->EINVAL modification. Thanks. 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-03-28  6:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-26 10:12 [dpdk-dev] [PATCH 1/2] net/mlx5: enforce RSS key length limitation Shahaf Shuler
2018-03-26 10:12 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix RSS key len query Shahaf Shuler
2018-03-26 11:33   ` Nélio Laranjeiro
2018-03-26 11:17 ` [dpdk-dev] [PATCH 1/2] net/mlx5: enforce RSS key length limitation Nélio Laranjeiro
2018-03-27  5:55   ` Shahaf Shuler
2018-03-27  7:15     ` Nélio Laranjeiro
2018-03-28  6:08 ` Shahaf Shuler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).