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 97DBC48B69 for ; Fri, 21 Nov 2025 12:24:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 924F54026F; Fri, 21 Nov 2025 12:24:02 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 6F5B5402EE for ; Fri, 21 Nov 2025 12:24:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763724240; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wqjvTKPZElqMKpTIlxfA/kXMTaQN4ZgOC4LHbZ1ADdU=; b=AKLpCcBE3ZXFiegUApPvJWvaZMC3XhAOouibZC3cH6rg2RIo1tlK4ZlY5+FPXgfqnmT9GJ isVSOLODnYuh20VvyYt1HGk1quw+MSPEURp9nWK67WzPQS9aoGfQbdk4huYhfktED+Zd9w 6ZbyxeHP3dF2t4aGR3iGGCtBLnCEepA= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-295-UtlbYSe0Pgi8Moa9G9jT3A-1; Fri, 21 Nov 2025 06:23:58 -0500 X-MC-Unique: UtlbYSe0Pgi8Moa9G9jT3A-1 X-Mimecast-MFC-AGG-ID: UtlbYSe0Pgi8Moa9G9jT3A_1763724237 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A5F0B1954B06; Fri, 21 Nov 2025 11:23:57 +0000 (UTC) Received: from rh.redhat.com (unknown [10.42.28.165]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 739C230044DB; Fri, 21 Nov 2025 11:23:56 +0000 (UTC) From: Kevin Traynor To: Maxime Leroy Cc: Hemant Agrawal , dpdk stable Subject: patch 'net/dpaa2: clear active VDQ state when freeing Rx queues' has been queued to stable release 24.11.4 Date: Fri, 21 Nov 2025 11:20:51 +0000 Message-ID: <20251121112128.485623-67-ktraynor@redhat.com> In-Reply-To: <20251121112128.485623-1-ktraynor@redhat.com> References: <20251121112128.485623-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: D3S9-lGDxjFTxIUc_OH8Q8p6IXUSuCGDuY54e-8GEug_1763724237 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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 Hi, FYI, your patch has been queued to stable release 24.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/26/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/81aeed2d39aac27302eebe15e80a3d1d9be30e24 Thanks. Kevin --- >From 81aeed2d39aac27302eebe15e80a3d1d9be30e24 Mon Sep 17 00:00:00 2001 From: Maxime Leroy Date: Fri, 14 Nov 2025 11:54:52 +0530 Subject: [PATCH] net/dpaa2: clear active VDQ state when freeing Rx queues [ upstream commit 360a8d674c36e628523bdd83bedd27ce34b3091b ] When using the prefetch Rx path (dpaa2_dev_prefetch_rx), the driver keeps track of one outstanding VDQCR command per DPIO portal in the global rte_global_active_dqs_list[] array. Each queue_storage_info_t also stores the active result buffer and portal index: qs->active_dqs qs->active_dpio_id Before issuing a new pull command, dpaa2_dev_prefetch_rx() checks for an active entry and spins on qbman_check_command_complete() until the corresponding VDQCR completes. On port close / hotplug remove, dpaa2_free_rx_tx_queues() frees all per-lcore queue_storage_info_t structures and their dq_storage[] buffers, but never clears the global rte_global_active_dqs_list[] entries. After a detach/attach sequence (or "del/add" in grout), the prefetch Rx path still sees an active entry for the portal and spins forever on a stale dq buffer that has been freed and will never be completed by hardware. In gdb, dq->dq.tok stays 0 and dpaa2_dev_prefetch_rx() loops in: while (!qbman_check_command_complete(get_swp_active_dqs(idx))) ; Fix this by clearing the active VDQ state before freeing queue storage. For each Rx queue and lcore, if qs->active_dqs is non-NULL, call clear_swp_active_dqs(qs->active_dpio_id) and set qs->active_dqs to NULL. Then dpaa2_queue_storage_free() can safely free q_storage and dq_storage[]. After this change, a DPNI detach/attach sequence no longer leaves stale entries in rte_global_active_dqs_list[], and the prefetch Rx loop does not hang waiting for a completion from a previous device instance. Reproduction: - grout: grcli interface add port dpni.1 devargs fslmc:dpni.1 grcli interface del dpni.1 grcli interface add port dpni.1 devargs fslmc:dpni.1 -> Rx was stuck in qbman_check_command_complete(), now works. - testpmd: dpdk-testpmd -n1 -a fslmc:dpni.65535 -- -i --forward-mode=rxonly testpmd> port attach fslmc:dpni.1 testpmd> port start all testpmd> start testpmd> stop testpmd> port stop all testpmd> port detach 0 testpmd> port attach fslmc:dpni.1 testpmd> port start all testpmd> start -> Rx was hanging, now runs normal Fixes: 12d98eceb8ac ("bus/fslmc: enhance QBMAN DQ storage logic") Signed-off-by: Maxime Leroy Acked-by: Hemant Agrawal --- .mailmap | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index 8af58f1614..06fd64f764 100644 --- a/.mailmap +++ b/.mailmap @@ -998,5 +998,5 @@ Mauro Annarumma Maxime Coquelin Maxime Gouin -Maxime Leroy +Maxime Leroy Md Fahad Iqbal Polash Megha Ajmera diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index c9dc0fbdf0..83ff6e0a04 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -482,4 +482,25 @@ fail: } +static void +dpaa2_clear_queue_active_dps(struct dpaa2_queue *q, int num_lcores) +{ + int i; + + for (i = 0; i < num_lcores; i++) { + struct queue_storage_info_t *qs = q->q_storage[i]; + + if (!qs) + continue; + + if (qs->active_dqs) { + while (!qbman_check_command_complete(qs->active_dqs)) + continue; /* wait */ + + clear_swp_active_dqs(qs->active_dpio_id); + qs->active_dqs = NULL; + } + } +} + static void dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev) @@ -496,4 +517,6 @@ dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev) for (i = 0; i < priv->nb_rx_queues; i++) { dpaa2_q = priv->rx_vq[i]; + dpaa2_clear_queue_active_dps(dpaa2_q, + RTE_MAX_LCORE); dpaa2_queue_storage_free(dpaa2_q, RTE_MAX_LCORE); -- 2.51.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-11-21 11:05:11.675357497 +0000 +++ 0067-net-dpaa2-clear-active-VDQ-state-when-freeing-Rx-que.patch 2025-11-21 11:05:09.545201519 +0000 @@ -1 +1 @@ -From 360a8d674c36e628523bdd83bedd27ce34b3091b Mon Sep 17 00:00:00 2001 +From 81aeed2d39aac27302eebe15e80a3d1d9be30e24 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 360a8d674c36e628523bdd83bedd27ce34b3091b ] + @@ -60 +61,0 @@ -Cc: stable@dpdk.org @@ -70 +71 @@ -index 50a59a596a..2678c4a9de 100644 +index 8af58f1614..06fd64f764 100644 @@ -73 +74 @@ -@@ -1038,5 +1038,5 @@ Mauro Annarumma +@@ -998,5 +998,5 @@ Mauro Annarumma @@ -81 +82 @@ -index fcda267e0b..f2b24fc953 100644 +index c9dc0fbdf0..83ff6e0a04 100644 @@ -84 +85 @@ -@@ -632,4 +632,25 @@ fail: +@@ -482,4 +482,25 @@ fail: @@ -110 +111 @@ -@@ -646,4 +667,6 @@ dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev) +@@ -496,4 +517,6 @@ dpaa2_free_rx_tx_queues(struct rte_eth_dev *dev)