From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id EEDE2C4345F for ; Wed, 1 May 2024 07:43:13 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C9177402A7; Wed, 1 May 2024 09:43:12 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 797674021E for ; Wed, 1 May 2024 09:43:11 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 52D8E22038; Wed, 1 May 2024 09:43:11 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH v4] net/netvsc: fix number Tx queues > Rx queues Date: Wed, 1 May 2024 09:43:06 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F40B@smartserver.smartshare.dk> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v4] net/netvsc: fix number Tx queues > Rx queues Thread-Index: AQHaj0LlOhmlskdRP0OAUkt+bSOHnLGCE4Aw References: From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Alan Elder" , "Long Li" , "Ferruh Yigit" , "Andrew Rybchenko" Cc: , "Stephen Hemminger" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > From: Alan Elder [mailto:alan.elder@microsoft.com] > Sent: Monday, 15 April 2024 16.41 >=20 > The previous code allowed the number of Tx queues to be set higher = than the > number of Rx queues. If a packet was sent on a Tx queue with index > >=3D number Rx queues there was a segfault due to accessing beyond the = end of > the dev->data->rx_queues[] array. >=20 > #0 rte_spinlock_trylock (sl =3D invalid address) at = /include/rte_spinlock.h L63 > #1 hn_process_events at /drivers/net/netvsc/hn_rxtx.c L 1129 > #2 hn_xmit_pkts at /drivers/net/netvsc/hn_rxtx.c L1553 >=20 > This commit fixes the issue by creating an Rx queue for every Tx queue = meaning > that an event buffer is allocated to handle receiving Tx completion = messages. >=20 > mbuf pool and Rx ring are not allocated for these additional Rx queues = and RSS > configuration ensures that no packets are received on them. >=20 > Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device") > Cc: sthemmin@microsoft.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Alan Elder > --- Is there any requirements to the order the application must call = rte_eth_rx_queue_setup() and rte_eth_tx_queue_setup()? I.e. does it work if rte_eth_tx_queue_setup() is called before = rte_eth_rx_queue_setup(), and in the opposite order? Although the ethdev documentation says: "The functions exported by the application Ethernet API to setup a = device designated by its port identifier must be invoked in the = following order: rte_eth_dev_configure() rte_eth_tx_queue_setup() rte_eth_rx_queue_setup() rte_eth_dev_start()", I would assume the order of calling rte_eth_tx_queue_setup() and = rte_eth_rx_queue_setup() doesn't matter. And the rte_eth_dev_reset() function documentation has rx/tx queue setup = in the opposite order: "After calling rte_eth_dev_reset(), the application should use = rte_eth_dev_configure(), rte_eth_rx_queue_setup(), = rte_eth_tx_queue_setup(), and rte_eth_dev_start() to reconfigure the = device as appropriate."