[dpdk-dev] [PATCH] net/bonding: fix deadloop when update RSS RETA

1913909813 at qq.com 1913909813 at qq.com
Sun Aug 2 14:27:27 CEST 2020


From: Zhiguang He <191390813 at qq.com>

when parament 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 at dpdk.org

Signed-off-by: Zhiguang He <1913909813 at qq.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 116e2f2..cdbd815 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2935,7 +2935,8 @@ struct bwg_slave {
 		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;
-- 
1.8.3.1




More information about the dev mailing list