From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D7B8EA0518; Sun, 2 Aug 2020 14:27:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 26C442E8F; Sun, 2 Aug 2020 14:27:36 +0200 (CEST) Received: from qq.com (out203-205-251-80.mail.qq.com [203.205.251.80]) by dpdk.org (Postfix) with ESMTP id 15DDD11A2 for ; Sun, 2 Aug 2020 14:27:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1596371249; bh=WjA7GmLoZqiDS+9ulsxUa24jpxsSS3AwImldXDwpwaE=; h=From:To:Cc:Subject:Date; b=CIOqLainwrqjFOFBYaFJDbIsjvtUsWv67zBZniUuWgS2VFEsLBaNgdjsxfpTvkqZ2 AHgULsbIrDmx7gAflH2m7KZf3XlEvNNHNWWi3boPKTqv2WGwwCI1DSQVNx6aMqn2dC VYvyCfTio7byONeL9YrTr0KeN+7DJiBSjiBbMzAg= Received: from www.localdomain ([23.251.52.157]) by newxmesmtplogicsvrszc7.qq.com (NewEsmtp) with SMTP id 6DCB4A76; Sun, 02 Aug 2020 20:27:28 +0800 X-QQ-mid: xmsmtpt1596371248tdmuuc47k Message-ID: X-QQ-XMAILINFO: MU+lyYOpa9XVmGaKMRtIvNkkWdTardZ8bpKinM290gkTKE1z925o6HL0+2qZMg 8OS5a4p1ljQbaCdbdbLP9h3OjU4trbZgMgkFwKK1yAb8uOa+RwgrsIPS5vrlOqCoWOYS8UOS/CH5 HdvBUSGPLwR/us0LO8vvtrWAhmvTKSIPohfqGFDAxdnT/xo0FS11/9IrRo3csPzKYJE7SMx185yG eXydpoN32N7fB7wcAlafDTOOSEM+2FvBQlHzdrBrfdCT/9e+MASAx5Ihf08JtJ9WfuhLDtSbw3pY 459eIC1f4s2wKJAzHMBBDFsvWH8aFHLJEzKdJQjbssXCc4PayVKQJAmlG2Acmhlngp5S2Ue0d+v0 BFhJWmbyFFBdXQZVHdgT+pI/08sqf6YeS8QxQUsFYIa1cYtqbt8V42QYjFvTFEL0Uf3ylq1eDZiQ bjXi5WFnoVGfRbGsE2vecxtbYVCC8cP/pDGJCYlR12E/v1HbenqBtzeQJwR6Vk9SPb+a2ym1ozXX njqYuJ12I7asAlazt3STZlOPnmENvHOvUS1jD6kETUnItmdtPNsj5n8AJw1IPMZEGLLStF76yfK5 QD/78GujAlEP5lPRv8AHNKRYyPxI3iEsaMacyvEo0cXbhsawhBV7tWdO/mEA4uN6uvZ+NJrAudQW 7W3ZFAqqEUsOcsmJJFEbdukri9vcmcdjp3LguB/XviNr2jtjyFqPt9zRVHaULR6RGKAAMKmmahIz voNOKoD67AT8o= From: 1913909813@qq.com To: dev@dpdk.org Cc: hezhiguang3@huawei.com Date: Sun, 2 Aug 2020 20:27:27 +0800 X-OQ-MSGID: <1596371247-22698-1-git-send-email-1913909813@qq.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/bonding: fix deadloop when update RSS RETA X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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