Skip to content

Commit

Permalink
net/bonding: fix dead loop on RSS RETA update
Browse files Browse the repository at this point in the history
[ upstream commit eb89395 ]

When parameter reta_size < RTE_RETA_GROUP_SIZE, reta_count will be 0.
Then this function will be deadloop.

Fixes: 734ce47 ("bonding: support RSS dynamic configuration")

Signed-off-by: Zhiguang He <hezhiguang3@huawei.com>
Acked-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
  • Loading branch information
Zhiguang He authored and kevintraynor committed Aug 28, 2020
1 parent ac24bef commit 6ae8b77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/bonding/rte_eth_bond_pmd.c
Expand Up @@ -2670,7 +2670,8 @@ bond_ethdev_rss_reta_update(struct rte_eth_dev *dev,
return -EINVAL;

/* Copy RETA table */
reta_count = reta_size / RTE_RETA_GROUP_SIZE;
reta_count = (reta_size + RTE_RETA_GROUP_SIZE - 1) /
RTE_RETA_GROUP_SIZE;

for (i = 0; i < reta_count; i++) {
internals->reta_conf[i].mask = reta_conf[i].mask;
Expand Down

0 comments on commit 6ae8b77

Please sign in to comment.