From: Zhiguang He Date: Sun, 2 Aug 2020 12:27:27 +0000 (+0800) Subject: net/bonding: fix dead loop on RSS RETA update X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=eb8939538fddced05b906c34ba9f545bf6717ad2;p=dpdk.git net/bonding: fix dead loop on RSS RETA update When parameter reta_size < RTE_RETA_GROUP_SIZE, reta_count will be 0. Then this function will be deadloop. Fixes: 734ce47f71e0 ("bonding: support RSS dynamic configuration") Cc: stable@dpdk.org Signed-off-by: Zhiguang He Acked-by: Wei Hu (Xavier) --- diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 116e2f29de..cdbd8151ed 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2935,7 +2935,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;