Skip to content

Commit

Permalink
net/bonding: fix RSS with early configure
Browse files Browse the repository at this point in the history
[ upstream commit 4986aea ]

RSS don't work when bond_ethdev_configure called before
rte_eth_bond_slave_add.

This is because internals->rss_key_len is 0 in bond_ethdev_configure().
If internals->rss_key_len is 0, internals->rss_key can not be set
properly.

e.g.:
doesn't work (examples/bond/main.c):
rte_eth_bond_create()
rte_eth_dev_configure()
rte_eth_bond_slave_add()
rte_eth_dev_start()

works (testpmd):
rte_eth_bond_create()
rte_eth_bond_slave_add()
rte_eth_dev_configure()
rte_eth_dev_start()

Fixing by using 'default_rss_key' when 'internals->rss_key_len' is 0.

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

Signed-off-by: Yu Wenjun <yuwenjun@cmss.chinamobile.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
Yu Wenjun authored and kevintraynor committed Feb 21, 2022
1 parent 6492c98 commit 961922e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/bonding/rte_eth_bond_pmd.c
Expand Up @@ -3511,6 +3511,11 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
if (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS) {
struct rte_eth_rss_conf *rss_conf =
&dev->data->dev_conf.rx_adv_conf.rss_conf;

if (internals->rss_key_len == 0) {
internals->rss_key_len = sizeof(default_rss_key);
}

if (rss_conf->rss_key != NULL) {
if (internals->rss_key_len > rss_conf->rss_key_len) {
RTE_BOND_LOG(ERR, "Invalid rss key length(%u)",
Expand Down

0 comments on commit 961922e

Please sign in to comment.