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 759B948A44 for ; Fri, 31 Oct 2025 15:36:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6ED4F40150; Fri, 31 Oct 2025 15:36:41 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 2074F40150 for ; Fri, 31 Oct 2025 15:36:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1761921399; 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=s1aVM/oNN+Xk1Wd3Wz3lrKB74OwJXa3p7KUr7oWSL1Y=; b=Za3nl3gY9848SDBejYnizGzD+TSVRf/qdLp7RLk4p/gpCOwp9Fx/B0dyrqM/4fYgpmorY/ Fu1O4IP+c0K1nFa2kC/XwrcQZGXruIa+eqUs/MHAutoUXhSNBz/NS2lhdUFgIFlRjmf/QS Zp14ZTgtTVtA9S8feaprims7he34XQw= 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-456-sV3IWFOTPoKjP5mVaViiwg-1; Fri, 31 Oct 2025 10:36:36 -0400 X-MC-Unique: sV3IWFOTPoKjP5mVaViiwg-1 X-Mimecast-MFC-AGG-ID: sV3IWFOTPoKjP5mVaViiwg_1761921395 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 51A2A19560B3; Fri, 31 Oct 2025 14:36:35 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.50]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BBF7C180057E; Fri, 31 Oct 2025 14:36:33 +0000 (UTC) From: Kevin Traynor To: Gregory Etelson Cc: Dariusz Sosnowski , dpdk stable Subject: patch 'net/mlx5: fix storage of shared Rx queues' has been queued to stable release 24.11.4 Date: Fri, 31 Oct 2025 14:32:35 +0000 Message-ID: <20251031143421.324432-33-ktraynor@redhat.com> In-Reply-To: <20251031143421.324432-1-ktraynor@redhat.com> References: <20251031143421.324432-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: LiN8Mm3qTXumAloNDQdEzxKsYfc98VsX64BKg_cLCUY_1761921395 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/05/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/01461927dfb1d9f392b22daefa8f020743d1815d Thanks. Kevin --- >From 01461927dfb1d9f392b22daefa8f020743d1815d Mon Sep 17 00:00:00 2001 From: Gregory Etelson Date: Thu, 31 Jul 2025 13:41:38 +0300 Subject: [PATCH] net/mlx5: fix storage of shared Rx queues [ upstream commit a0a7903376f2252b06ae272b2c3b69e9b939de04 ] The MLX5 PMD maintains 2 lists for Rx queues: - mlx5_priv::rxqsctrl - for non-shared and shared Rx queues - mlx5_dev_ctx_shared::shared_rxqs - for shared Rx queues only The PMD used the `rxqsctrl` as the primary list for Rx queues maintenance. The PMD wipes out port mlx5_priv object after an application closed the port. If PMD shared Rx queues between the transfer proxy port and representor ports and closed the transfer proxy port before representor, the representor port cannot iterate its shared Rx queues because Rx queues list head was wiped out. The patch separates Rx queue storage list according to the list type: - shared Rx queues are stored in the `shared_rxqs` only - non-shared Rx queues are stored in the `rxqsctrl` list only. Fixes: 6886b5f39d66 ("net/mlx5: fix hairpin queue release") Signed-off-by: Gregory Etelson Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/linux/mlx5_os.c | 13 ++++++++++--- drivers/net/mlx5/mlx5_flow.c | 6 ++++++ drivers/net/mlx5/mlx5_rxq.c | 6 ++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 37819932d1..695911008d 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -748,11 +748,18 @@ mlx5_os_free_shared_dr(struct mlx5_priv *priv) { struct mlx5_dev_ctx_shared *sh = priv->sh; -#ifdef HAVE_MLX5DV_DR - int i; -#endif + struct mlx5_rxq_ctrl *rxq_ctrl; + int i = 0; MLX5_ASSERT(sh && sh->refcnt); if (sh->refcnt > 1) return; + LIST_FOREACH(rxq_ctrl, &sh->shared_rxqs, next) { + DRV_LOG(DEBUG, "port %u Rx Queue %u still referenced", + priv->dev_data->port_id, rxq_ctrl->rxq.idx); + ++i; + } + if (i > 0) + DRV_LOG(WARNING, "port %u some Rx queues still remain %d", + priv->dev_data->port_id, i); MLX5_ASSERT(LIST_EMPTY(&sh->shared_rxqs)); #ifdef HAVE_MLX5DV_DR diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 5039a81b14..944d422f97 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1652,4 +1652,7 @@ flow_rxq_mark_flag_set(struct rte_eth_dev *dev) rxq_ctrl->rxq.mark = 1; } + LIST_FOREACH(rxq_ctrl, &opriv->sh->shared_rxqs, next) { + rxq_ctrl->rxq.mark = 1; + } opriv->mark_enabled = 1; } @@ -1658,4 +1661,7 @@ flow_rxq_mark_flag_set(struct rte_eth_dev *dev) rxq_ctrl->rxq.mark = 1; } + LIST_FOREACH(rxq_ctrl, &priv->sh->shared_rxqs, next) { + rxq_ctrl->rxq.mark = 1; + } priv->mark_enabled = 1; } diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 508d27d318..82958565de 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1979,6 +1979,7 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, tmpl->share_qid = conf->share_qid; LIST_INSERT_HEAD(&priv->sh->shared_rxqs, tmpl, share_entry); + } else { + LIST_INSERT_HEAD(&priv->rxqsctrl, tmpl, next); } - LIST_INSERT_HEAD(&priv->rxqsctrl, tmpl, next); rte_atomic_store_explicit(&tmpl->ctrl_ref, 1, rte_memory_order_relaxed); return tmpl; @@ -2311,5 +2312,6 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx) if (rxq_ctrl->rxq.shared) LIST_REMOVE(rxq_ctrl, share_entry); - LIST_REMOVE(rxq_ctrl, next); + else + LIST_REMOVE(rxq_ctrl, next); mlx5_free(rxq_ctrl->rxq.rq_win_data); mlx5_free(rxq_ctrl); -- 2.51.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-10-31 13:53:53.281949523 +0000 +++ 0033-net-mlx5-fix-storage-of-shared-Rx-queues.patch 2025-10-31 13:53:52.078523499 +0000 @@ -1 +1 @@ -From a0a7903376f2252b06ae272b2c3b69e9b939de04 Mon Sep 17 00:00:00 2001 +From 01461927dfb1d9f392b22daefa8f020743d1815d Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit a0a7903376f2252b06ae272b2c3b69e9b939de04 ] + @@ -26 +27,0 @@ -Cc: stable@dpdk.org @@ -37 +38 @@ -index 2bc8ca9284..85b3fabaf5 100644 +index 37819932d1..695911008d 100644 @@ -63 +64 @@ -index 7c6811b523..cc9ec73dfe 100644 +index 5039a81b14..944d422f97 100644 @@ -66 +67 @@ -@@ -1653,4 +1653,7 @@ flow_rxq_mark_flag_set(struct rte_eth_dev *dev) +@@ -1652,4 +1652,7 @@ flow_rxq_mark_flag_set(struct rte_eth_dev *dev) @@ -74 +75 @@ -@@ -1659,4 +1662,7 @@ flow_rxq_mark_flag_set(struct rte_eth_dev *dev) +@@ -1658,4 +1661,7 @@ flow_rxq_mark_flag_set(struct rte_eth_dev *dev) @@ -83 +84 @@ -index 77c5848c37..1425886a22 100644 +index 508d27d318..82958565de 100644 @@ -86 +87 @@ -@@ -2034,6 +2034,7 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, +@@ -1979,6 +1979,7 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, @@ -95 +96 @@ -@@ -2366,5 +2367,6 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx) +@@ -2311,5 +2312,6 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx)