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 A347346211 for ; Thu, 13 Feb 2025 11:02:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E91942EE7; Thu, 13 Feb 2025 11:02:39 +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 C944942F0F for ; Thu, 13 Feb 2025 11:02:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739440958; 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=3PQ0t7hOAqHLVHXDVMLtQi7k9gOxjpbzq37heqGrwyE=; b=UI6ULGWSKOM6Bo5wYVvJVD+uuQjVRmyXJ2Zrhp4JP/6CsZ/J9BZWxLSCPMtetXzf7y9kqE r+V0Grw1QsMhPqlRu/xLNdV9yBw5/FXlazUlPn495WaAaqO2jil879zzAO77TPFi7Yrjna MNaa8N46TiqmTqyhJrGPWB9xN1+EJxw= Received: from mx-prod-mc-02.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-602-cZbDVDScOeqSFgM0WKN_6A-1; Thu, 13 Feb 2025 05:02:33 -0500 X-MC-Unique: cZbDVDScOeqSFgM0WKN_6A-1 X-Mimecast-MFC-AGG-ID: cZbDVDScOeqSFgM0WKN_6A Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1359E18EB2CF; Thu, 13 Feb 2025 10:02:32 +0000 (UTC) Received: from rh.Home (unknown [10.45.224.21]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8AD071800360; Thu, 13 Feb 2025 10:02:30 +0000 (UTC) From: Kevin Traynor To: Maayan Kashani Cc: Bing Zhao , dpdk stable Subject: patch 'net/mlx5: fix crash in non-template metadata split' has been queued to stable release 24.11.2 Date: Thu, 13 Feb 2025 09:58:40 +0000 Message-ID: <20250213095933.362078-73-ktraynor@redhat.com> In-Reply-To: <20250213095933.362078-1-ktraynor@redhat.com> References: <20250213095933.362078-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: KkWCdon6ivZ14A_tRlPDtFN4dZUFnO_cE2mhNsKo1NQ_1739440952 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.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/17/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/f00e13b2b500eb17b3f25cba1aa78e49c3a0ebc5 Thanks. Kevin --- >From f00e13b2b500eb17b3f25cba1aa78e49c3a0ebc5 Mon Sep 17 00:00:00 2001 From: Maayan Kashani Date: Tue, 28 Jan 2025 09:54:04 +0200 Subject: [PATCH] net/mlx5: fix crash in non-template metadata split [ upstream commit 51470cd861f952d79970972d8c3f1929ddc298f3 ] For switch dev mode, there is a rule split in case of using mark action. First rule will have the mark action, tag it with rule ID number and jump to the second rule that matches the tag and perform the rest of the actions (like RSS or queue). First, fix the crash when accessing RSS queue[0] instead of queue index, same as for queue action handling for hairpin RX queue check. Second, set tag action is not supported in HWS, so, replaced set tag action with modify field action. Used same tag index for both action and matching. Fixes: 821a6a5cc495 ("net/mlx5: add metadata split for compatibility") Signed-off-by: Maayan Kashani Acked-by: Bing Zhao --- drivers/net/mlx5/mlx5_nta_split.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/net/mlx5/mlx5_nta_split.c b/drivers/net/mlx5/mlx5_nta_split.c index b26f305bca..6a85ab7fd1 100644 --- a/drivers/net/mlx5/mlx5_nta_split.c +++ b/drivers/net/mlx5/mlx5_nta_split.c @@ -14,4 +14,6 @@ #ifdef HAVE_MLX5_HWS_SUPPORT +#define BITS_PER_BYTE 8 + /* * Generate new actions lists for prefix and suffix flows. @@ -45,9 +47,8 @@ mlx5_flow_nta_split_qrss_actions_prep(struct rte_eth_dev *dev, { struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_rte_flow_action_set_tag *set_tag; + struct rte_flow_action_modify_field *set_tag; struct rte_flow_action_jump *jump; const int qrss_idx = qrss - actions; uint32_t flow_id = 0; - int ret = 0; /* Allocate the new subflow ID and used to be matched later. */ @@ -68,14 +69,14 @@ mlx5_flow_nta_split_qrss_actions_prep(struct rte_eth_dev *dev, actions_n++; set_tag = (void *)(prefix_act + actions_n); - /* Reuse ASO reg, should always succeed. Consider to use REG_C_6. */ - ret = flow_hw_get_reg_id_by_domain(dev, RTE_FLOW_ITEM_TYPE_METER_COLOR, - MLX5DR_TABLE_TYPE_NIC_RX, 0); - MLX5_ASSERT(ret != (int)REG_NON); - set_tag->id = (enum modify_reg)ret; /* Internal SET_TAG action to set flow ID. */ - set_tag->data = flow_id; + set_tag->operation = RTE_FLOW_MODIFY_SET; + set_tag->width = sizeof(flow_id) * BITS_PER_BYTE; + set_tag->src.field = RTE_FLOW_FIELD_VALUE; + memcpy(&set_tag->src.value, &flow_id, sizeof(flow_id)); + set_tag->dst.field = RTE_FLOW_FIELD_TAG; + set_tag->dst.tag_index = RTE_PMD_MLX5_LINEAR_HASH_TAG_INDEX; /* Construct new actions array and replace QUEUE/RSS action. */ prefix_act[qrss_idx] = (struct rte_flow_action) { - .type = (enum rte_flow_action_type)MLX5_RTE_FLOW_ACTION_TYPE_TAG, + .type = RTE_FLOW_ACTION_TYPE_MODIFY_FIELD, .conf = set_tag, }; @@ -133,6 +134,7 @@ mlx5_flow_nta_split_qrss_items_prep(struct rte_eth_dev *dev, q_tag_spec->data = qrss_id; q_tag_spec->id = (enum modify_reg) - flow_hw_get_reg_id_by_domain(dev, RTE_FLOW_ITEM_TYPE_METER_COLOR, - MLX5DR_TABLE_TYPE_NIC_RX, 0); + flow_hw_get_reg_id_by_domain(dev, RTE_FLOW_ITEM_TYPE_TAG, + MLX5DR_TABLE_TYPE_NIC_RX, + RTE_PMD_MLX5_LINEAR_HASH_TAG_INDEX); MLX5_ASSERT(q_tag_spec->id != REG_NON); } @@ -212,10 +214,10 @@ mlx5_flow_nta_split_metadata(struct rte_eth_dev *dev, } else if (action_flags & MLX5_FLOW_ACTION_RSS) { rss = (const struct rte_flow_action_rss *)actions->conf; - if (mlx5_rxq_is_hairpin(dev, rss->queue[0])) + if (mlx5_rxq_is_hairpin(dev, rss->queue_num)) return 0; } /* The prefix and suffix flows' actions. */ pefx_act_size = sizeof(struct rte_flow_action) * (actions_n + 1) + - sizeof(struct rte_flow_action_set_tag) + + sizeof(struct rte_flow_action_modify_field) + sizeof(struct rte_flow_action_jump); sfx_act_size = sizeof(struct rte_flow_action) * 2; -- 2.48.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-02-12 17:29:42.342156631 +0000 +++ 0073-net-mlx5-fix-crash-in-non-template-metadata-split.patch 2025-02-12 17:29:34.452946538 +0000 @@ -1 +1 @@ -From 51470cd861f952d79970972d8c3f1929ddc298f3 Mon Sep 17 00:00:00 2001 +From f00e13b2b500eb17b3f25cba1aa78e49c3a0ebc5 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 51470cd861f952d79970972d8c3f1929ddc298f3 ] + @@ -19 +20,0 @@ -Cc: stable@dpdk.org