patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
To: Shahaf Shuler <shahafs@mellanox.com>
Cc: adrien.mazarguil@6wind.com, yskoh@mellanox.com, dev@dpdk.org,
	stable@dpdk.org
Subject: Re: [dpdk-stable] [PATCH 1/2] net/mlx5: enforce RSS key length limitation
Date: Mon, 26 Mar 2018 13:17:55 +0200	[thread overview]
Message-ID: <20180326111755.wmr2gzvvrujc3jco@laranjeiro-vm.dev.6wind.com> (raw)
In-Reply-To: <20180326101219.91229-1-shahafs@mellanox.com>

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

  parent reply	other threads:[~2018-03-26 11:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 10:12 Shahaf Shuler
2018-03-26 10:12 ` [dpdk-stable] [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 ` Nélio Laranjeiro [this message]
2018-03-27  5:55   ` [dpdk-stable] [PATCH 1/2] net/mlx5: enforce RSS key length limitation Shahaf Shuler
2018-03-27  7:15     ` Nélio Laranjeiro
2018-03-28  6:08 ` [dpdk-stable] [dpdk-dev] " Shahaf Shuler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180326111755.wmr2gzvvrujc3jco@laranjeiro-vm.dev.6wind.com \
    --to=nelio.laranjeiro@6wind.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=shahafs@mellanox.com \
    --cc=stable@dpdk.org \
    --cc=yskoh@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).