dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: 1913909813@qq.com
To: dev@dpdk.org
Cc: hezhiguang3@huawei.com
Subject: [dpdk-dev] [PATCH] net/bonding: fix deadloop when update RSS RETA
Date: Sun,  2 Aug 2020 20:27:27 +0800	[thread overview]
Message-ID: <tencent_4FD49847E9C6112495FF444080E6C2D39F06@qq.com> (raw)

From: Zhiguang He <191390813@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@dpdk.org

Signed-off-by: Zhiguang He <1913909813@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



             reply	other threads:[~2020-08-02 12:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-02 12:27 1913909813 [this message]
2020-08-03  2:23 ` [dpdk-dev] [PATCH] net/bonding: fix deadloop when update RSS RETA Wei Hu (Xavier)
2020-08-05 15:49   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_4FD49847E9C6112495FF444080E6C2D39F06@qq.com \
    --to=1913909813@qq.com \
    --cc=dev@dpdk.org \
    --cc=hezhiguang3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).