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 B6F82A0518; Mon, 3 Aug 2020 04:23:41 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D91B22BE1; Mon, 3 Aug 2020 04:23:40 +0200 (CEST) Received: from huawei.com (szxga04-in.huawei.com [45.249.212.190]) by dpdk.org (Postfix) with ESMTP id 755182952 for ; Mon, 3 Aug 2020 04:23:38 +0200 (CEST) Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C2F57A7DED43CB8B3E92; Mon, 3 Aug 2020 10:23:34 +0800 (CST) Received: from [10.69.31.206] (10.69.31.206) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Mon, 3 Aug 2020 10:23:29 +0800 To: <1913909813@qq.com> References: CC: , , "Wei Hu (Xavier)" , From: "Wei Hu (Xavier)" Message-ID: <13361623-2be8-18cf-14e2-2e5d6abce2c9@huawei.com> Date: Mon, 3 Aug 2020 10:23:28 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.69.31.206] X-CFilter-Loop: Reflected Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [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" Hi, Zhiguang He On 2020/8/2 20:27, 1913909813@qq.com wrote: > 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> Acked-by: Wei Hu (Xavier) Thank you for fixing this issue. Xavier > --- > 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;