From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 524E9A00C2 for ; Tue, 1 Nov 2022 03:21:13 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28DA740685; Tue, 1 Nov 2022 03:21:13 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 3840440223; Tue, 1 Nov 2022 03:21:11 +0100 (CET) Received: from kwepemi500012.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N1YfC22WlzHv9w; Tue, 1 Nov 2022 10:20:51 +0800 (CST) Received: from [10.78.134.87] (10.78.134.87) by kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 1 Nov 2022 10:21:07 +0800 Message-ID: Date: Tue, 1 Nov 2022 10:21:06 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.0.3 Subject: Re: [PATCH] net/bonding: set initial value of descriptor count alignment To: Ivan Malov , CC: "Li, WeiyuanX" , Chas Williams , Hari Kumar Vemula , , Andrew Rybchenko References: <20221031131744.2340150-1-ivan.malov@oktetlabs.ru> From: "humin (Q)" In-Reply-To: <20221031131744.2340150-1-ivan.malov@oktetlabs.ru> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.78.134.87] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500012.china.huawei.com (7.221.188.12) X-CFilter-Loop: Reflected X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Acked-by: Min Hu (Connor) 在 2022/10/31 21:17, Ivan Malov 写道: > The driver had once been broken by patch [1] looking to have > a non-zero "nb_max" value in a use case not involving adding > any back-end ports. That was addressed afterwards ([2]). But, > as per report [3], similar test cases exist which attempt to > setup Rx queues on a void bond before attaching any back-end > ports. Rx queue setup, in turn, involves device info get API > invocation, and one of the checks on received data causes an > exception (division by zero). The "nb_align" value is indeed > zero at that time, but, as explained in [2], such test cases > are totally incorrect since a bond device must have at least > one back-end port plugged before any ethdev APIs can be used. > > Once again, to avoid any problems with fixing the test cases, > this patch adjusts the bond PMD itself to workaround the bug. > > [1] commit 5be3b40fea60 ("net/bonding: fix values of descriptor limits") > [2] commit d03c0e83cc00 ("net/bonding: fix descriptor limit reporting") > [3] https://bugs.dpdk.org/show_bug.cgi?id=1118 > > Fixes: d03c0e83cc00 ("net/bonding: fix descriptor limit reporting") > Cc: stable@dpdk.org > > Signed-off-by: Ivan Malov > Reviewed-by: Andrew Rybchenko > --- > drivers/net/bonding/rte_eth_bond_pmd.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c > index dc74852137..145cb7099f 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -3426,6 +3426,8 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode) > */ > internals->rx_desc_lim.nb_max = UINT16_MAX; > internals->tx_desc_lim.nb_max = UINT16_MAX; > + internals->rx_desc_lim.nb_align = 1; > + internals->tx_desc_lim.nb_align = 1; > > memset(internals->active_slaves, 0, sizeof(internals->active_slaves)); > memset(internals->slaves, 0, sizeof(internals->slaves));