Skip to content

Commit

Permalink
net/bonding: fix RSS key config with extended key length
Browse files Browse the repository at this point in the history
[ upstream commit 94d9c7d ]

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.

Fixes: 6b1a001 ("net/bonding: fix RSS key length")

Signed-off-by: Ke Zhang <ke1x.zhang@intel.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
ke1zhang authored and kevintraynor committed May 24, 2022
1 parent 3192737 commit 8cf194f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions drivers/net/bonding/rte_eth_bond_pmd.c
Expand Up @@ -3616,13 +3616,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++) {
Expand Down

0 comments on commit 8cf194f

Please sign in to comment.