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 871B3A034C for ; Mon, 31 Oct 2022 14:17:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7EE1140A79; Mon, 31 Oct 2022 14:17:49 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 993DA40151; Mon, 31 Oct 2022 14:17:47 +0100 (CET) Received: from bree.oktetlabs.ru (bree.oktetlabs.ru [192.168.34.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPS id E361F5A; Mon, 31 Oct 2022 16:17:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru E361F5A Authentication-Results: shelob.oktetlabs.ru/E361F5A; dkim=none; dkim-atps=neutral From: Ivan Malov To: dev@dpdk.org Cc: "Li, WeiyuanX" , Chas Williams , "Min Hu (Connor)" , Hari Kumar Vemula , stable@dpdk.org, Andrew Rybchenko Subject: [PATCH] net/bonding: set initial value of descriptor count alignment Date: Mon, 31 Oct 2022 16:17:44 +0300 Message-Id: <20221031131744.2340150-1-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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)); -- 2.30.2