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 601BD46468 for ; Mon, 24 Mar 2025 17:18:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5786140DCB; Mon, 24 Mar 2025 17:18:11 +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 E9C1740DD5 for ; Mon, 24 Mar 2025 17:18:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742833089; 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=yyM1tsibupc3+SbqaZGJPo99Up7IVOhbvkPYydY5O14=; b=cJgYIy4xRLYKivDpfvNEj2TYFNnYeihBHVmozT3WLfROG+SgvTG0J7efPo99ftiEiT9nUC mlx/yrfLVThf1ElC9HSVHBUkZRSeFl1B7ak5kJFJ4vKDubOgHKYNjdQuU+5jRFxQkj8wKX IxooA4yuX7Jzvn/C33+07jGdqRhiMHE= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-86-YawPLRoMMzaH3E5IumHXcw-1; Mon, 24 Mar 2025 12:18:06 -0400 X-MC-Unique: YawPLRoMMzaH3E5IumHXcw-1 X-Mimecast-MFC-AGG-ID: YawPLRoMMzaH3E5IumHXcw_1742833085 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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 16A72180AF75; Mon, 24 Mar 2025 16:18:05 +0000 (UTC) Received: from rh.redhat.com (unknown [10.44.32.16]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 81C3730001A1; Mon, 24 Mar 2025 16:18:03 +0000 (UTC) From: Kevin Traynor To: Maayan Kashani Cc: Dariusz Sosnowski , dpdk stable Subject: patch 'net/mlx5: fix non-template set VLAN VID' has been queued to stable release 24.11.2 Date: Mon, 24 Mar 2025 16:16:18 +0000 Message-ID: <20250324161731.63950-11-ktraynor@redhat.com> In-Reply-To: <20250324161731.63950-1-ktraynor@redhat.com> References: <20250324161731.63950-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: 4_s9mRU7Wl4cX4VJb_5ZI077dS3WR9tiuk7r_bQrQ4Y_1742833085 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 03/28/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/a1aa7eba64735891ba7cff539aa9a0cfd586fe7e Thanks. Kevin --- >From a1aa7eba64735891ba7cff539aa9a0cfd586fe7e Mon Sep 17 00:00:00 2001 From: Maayan Kashani Date: Thu, 27 Feb 2025 12:45:27 +0200 Subject: [PATCH] net/mlx5: fix non-template set VLAN VID [ upstream commit 5fd4de3aef4cec5ca3395139135b1c58d43d5a9c ] Support set vlan vid in non template on top of HWS. Update relevant return errors in the relevant functions to avoid crash. Mask the vlan vid action in non template mode such that the action template create will use the vid value. Fixes: 00a0a6b80674 ("net/mlx5: support indirect actions in non-template setup") Signed-off-by: Maayan Kashani Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_flow_hw.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index e72b87d70f..fc78bf2e1d 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -671,4 +671,7 @@ flow_hw_action_flags_get(const struct rte_flow_action actions[], action_flags |= MLX5_FLOW_ACTION_OF_POP_VLAN; break; + case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID: + action_flags |= MLX5_FLOW_ACTION_OF_SET_VLAN_VID; + break; case RTE_FLOW_ACTION_TYPE_JUMP: action_flags |= MLX5_FLOW_ACTION_JUMP; @@ -7700,5 +7703,5 @@ err_actions_num: } -static void +static int flow_hw_set_vlan_vid(struct rte_eth_dev *dev, struct rte_flow_action *ra, @@ -7706,7 +7709,7 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev, struct rte_flow_action_modify_field *spec, struct rte_flow_action_modify_field *mask, - int set_vlan_vid_ix) + int set_vlan_vid_ix, + struct rte_flow_error *error) { - struct rte_flow_error error; const bool masked = rm[set_vlan_vid_ix].conf && (((const struct rte_flow_action_of_set_vlan_vid *) @@ -7715,5 +7718,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev, ra[set_vlan_vid_ix].conf; int width = mlx5_flow_item_field_width(dev, RTE_FLOW_FIELD_VLAN_ID, 0, - NULL, &error); + NULL, error); + MLX5_ASSERT(width); *spec = (typeof(*spec)) { .operation = RTE_FLOW_MODIFY_SET, @@ -7748,4 +7752,5 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev, rm[set_vlan_vid_ix].type = RTE_FLOW_ACTION_TYPE_MODIFY_FIELD; rm[set_vlan_vid_ix].conf = mask; + return 0; } @@ -7993,7 +7998,9 @@ __flow_hw_actions_template_create(struct rte_eth_dev *dev, &ra, &rm, act_num); - flow_hw_set_vlan_vid(dev, ra, rm, - &set_vlan_vid_spec, &set_vlan_vid_mask, - set_vlan_vid_ix); + ret = flow_hw_set_vlan_vid(dev, ra, rm, + &set_vlan_vid_spec, &set_vlan_vid_mask, + set_vlan_vid_ix, error); + if (ret) + goto error; action_flags |= MLX5_FLOW_ACTION_MODIFY_FIELD; } @@ -13506,4 +13513,8 @@ flow_nta_build_template_mask(const struct rte_flow_action actions[], mask->conf = conf; break; + case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID: + memset(conf, 0xff, sizeof(struct rte_flow_action_of_set_vlan_vid)); + mask->conf = conf; + break; default: break; -- 2.48.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-03-24 16:15:15.196284543 +0000 +++ 0011-net-mlx5-fix-non-template-set-VLAN-VID.patch 2025-03-24 16:15:14.737735447 +0000 @@ -1 +1 @@ -From 5fd4de3aef4cec5ca3395139135b1c58d43d5a9c Mon Sep 17 00:00:00 2001 +From a1aa7eba64735891ba7cff539aa9a0cfd586fe7e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 5fd4de3aef4cec5ca3395139135b1c58d43d5a9c ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 03cbf53f49..7f34af49de 100644 +index e72b87d70f..fc78bf2e1d 100644 @@ -24 +25 @@ -@@ -715,4 +715,7 @@ flow_hw_action_flags_get(const struct rte_flow_action actions[], +@@ -671,4 +671,7 @@ flow_hw_action_flags_get(const struct rte_flow_action actions[], @@ -32 +33 @@ -@@ -7814,5 +7817,5 @@ err_actions_num: +@@ -7700,5 +7703,5 @@ err_actions_num: @@ -39 +40 @@ -@@ -7820,7 +7823,7 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev, +@@ -7706,7 +7709,7 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev, @@ -49 +50 @@ -@@ -7829,5 +7832,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev, +@@ -7715,5 +7718,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev, @@ -57 +58 @@ -@@ -7862,4 +7866,5 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev, +@@ -7748,4 +7752,5 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev, @@ -63 +64 @@ -@@ -8107,7 +8112,9 @@ __flow_hw_actions_template_create(struct rte_eth_dev *dev, +@@ -7993,7 +7998,9 @@ __flow_hw_actions_template_create(struct rte_eth_dev *dev, @@ -76 +77 @@ -@@ -13750,4 +13757,8 @@ flow_nta_build_template_mask(const struct rte_flow_action actions[], +@@ -13506,4 +13513,8 @@ flow_nta_build_template_mask(const struct rte_flow_action actions[],