All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Min Hu (Connor)" <humin29@huawei.com>
To: Ke Zhang <ke1x.zhang@intel.com>, <chas3@att.com>, <dev@dpdk.org>
Subject: Re: [PATCH v3 1/1] net/bonding: fix rss key configuration when the key length is 52
Date: Wed, 13 Apr 2022 17:01:35 +0800	[thread overview]
Message-ID: <3f20d3e3-9a6e-7cfc-5181-5af5ff751d28@huawei.com> (raw)
In-Reply-To: <20220411054003.60095-1-ke1x.zhang@intel.com>

Acked-by: Min Hu (Connor) <humin29@huawei.com>

在 2022/4/11 13:40, Ke Zhang 写道:
> when creating a bonding device, if the slave device's rss key length
> = standard_rss_key length + extended_hash_key length, then bonding
> device will be same as slave, in function bond_ethdev_configure(),
> the default_rss_key length is 40, it is not matched, so it should
> calculate a new key for bonding device if the default key could not
> be used.
> 
> Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
> ---
>   drivers/net/bonding/rte_eth_bond_pmd.c | 17 +++++++++++------
>   1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
> index b305b6a35b..5cbe89031b 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -3617,13 +3617,18 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
>   			       internals->rss_key_len);
>   		} else {
>   			if (internals->rss_key_len > sizeof(default_rss_key)) {
> -				RTE_BOND_LOG(ERR,
> -				       "There is no suitable default hash key");
> -				return -EINVAL;
> +				/*
> +				 * If the rss_key includes standard_rss_key and
> +				 * extended_hash_key, the rss key length will be
> +				 * larger than default rss key length, so it should
> +				 * re-calculate the hash key.
> +				 */
> +				for (i = 0; i < internals->rss_key_len; i++)
> +					internals->rss_key[i] = (uint8_t)rte_rand();
> +			} else {
> +				memcpy(internals->rss_key, default_rss_key,
> +					internals->rss_key_len);
>   			}
> -
> -			memcpy(internals->rss_key, default_rss_key,
> -			       internals->rss_key_len);
>   		}
>   
>   		for (i = 0; i < RTE_DIM(internals->reta_conf); i++) {
> 

  reply	other threads:[~2022-04-13  9:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07  9:36 [PATCH] net/bonding: fix rss key configuration when the key length is 52 Ke Zhang
2022-04-08  2:32 ` Min Hu (Connor)
2022-04-11  3:06   ` Zhang, Ke1X
2022-04-12 15:19     ` Stephen Hemminger
2022-04-13  9:03       ` Min Hu (Connor)
2022-04-13 16:12         ` Stephen Hemminger
2022-04-11  3:02 ` [PATCH v2 1/1] " Ke Zhang
2022-04-11  3:41   ` Min Hu (Connor)
2022-04-11  5:40   ` [PATCH v3 " Ke Zhang
2022-04-13  9:01     ` Min Hu (Connor) [this message]
2022-05-04 16:32       ` Ferruh Yigit

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=3f20d3e3-9a6e-7cfc-5181-5af5ff751d28@huawei.com \
    --to=humin29@huawei.com \
    --cc=chas3@att.com \
    --cc=dev@dpdk.org \
    --cc=ke1x.zhang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.