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 389DB43E57 for ; Sat, 13 Apr 2024 14:52:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 307F7402E1; Sat, 13 Apr 2024 14:52:02 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2057.outbound.protection.outlook.com [40.107.236.57]) by mails.dpdk.org (Postfix) with ESMTP id 5F48840294 for ; Sat, 13 Apr 2024 14:52:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZX1e0hZ2eNRVgsk6m3S3/BBZZKlSSGLI3cMNGjgHjju/RzMrsybcokMVWoqZwl0ew/ZxDhpb3VfGq67bpABOT3f3kShx44cS84NaEvVjH9WDe8GIfAzVDeBEKhYW0VUVbb/cBqptSo6t6kU53i2goa5af31jPEaLBv8Zog2/o4LA4dSI+bdZ8f3+PR/6DGJzb30Db3pD9LU+FplZEPPO9kxjwKhOqzWbQZKuJhprS8hwM8MHOR3Eam1CNyG0P2fpwNw2kvazSWyucCani9mQGBkTuiXtFub22WHrJz9vGRj0Hq1sKwcM9nT8qK2MRAJ/6kIcUtAUppfjsnt9o9ak7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ys4WmkA4YmZw/7L50g3frPuacmTz6ZXqPKZMSvQ7g5M=; b=ObxOhLeoTx4LbttdfFk40T/Ffpl1wQVWIpAh3mjawPs2oZWgamYSsujAIRcs6LAJWgeHg/Ny7VW3M0gUwLkKTe3rgxcGdPC01ksmdbbdud2kaGLty7QXVhVGSpXJLtC734wzS2du3RZDORr58cmSs1RgbICTyGsf73lJQzx/kE/1hgZySDai5SNfrsbJnNz/zdKGFfk7GYuSvtC0/k109jSKfEyynbwzrHJXlFV8fKmvqxsB3i/9j/cqS97AjrwtifS1XXOnRYLffFVK5zwM9kwxUTOsmsK9tPLLQrWiC4nSjit/zGBYlDj1UNS4c1qwa5vq7nOv8x1nDX44CMUHIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ys4WmkA4YmZw/7L50g3frPuacmTz6ZXqPKZMSvQ7g5M=; b=VChHcuQILRvTvq/tCIsHGjpvd46TLBn6cR0D/QqCb+OgYDx0DRc+Px9/1LP777pBha346J9AiOd19N6+UeMWq3wS2X/qAsHlKSsQleef/JaC89uH5C8pRQd430cQwJByyjkkzZrOZutanjhYVou3zoX7A4RIIlVesRBCVVJcCs5DZls+rlBIOWJtyxqm48qppWFGsjFBoCn6oGmPk2vz5z4p+Bdkd6Qll3E68FhbtXxVOlgfexxoaUhWaja8u7yKgHdsfDay7pCdgfgLlhoqnHx33JV1N6ycrE7b3BoiOlwO8nX6NXS8ls6ESFW7agXtk0wODT48oZlmlwPjEraspw== Received: from BL1PR13CA0348.namprd13.prod.outlook.com (2603:10b6:208:2c6::23) by MW4PR12MB7382.namprd12.prod.outlook.com (2603:10b6:303:222::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Sat, 13 Apr 2024 12:51:58 +0000 Received: from BL02EPF00021F6D.namprd02.prod.outlook.com (2603:10b6:208:2c6:cafe::6b) by BL1PR13CA0348.outlook.office365.com (2603:10b6:208:2c6::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.16 via Frontend Transport; Sat, 13 Apr 2024 12:51:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL02EPF00021F6D.mail.protection.outlook.com (10.167.249.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Sat, 13 Apr 2024 12:51:57 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sat, 13 Apr 2024 05:51:48 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Sat, 13 Apr 2024 05:51:47 -0700 From: Xueming Li To: Rongwei Liu CC: Dariusz Sosnowski , dpdk stable Subject: patch 'net/mlx5: fix modify flex item' has been queued to stable release 23.11.1 Date: Sat, 13 Apr 2024 20:48:16 +0800 Message-ID: <20240413125005.725659-16-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240413125005.725659-1-xuemingl@nvidia.com> References: <20240305094757.439387-1-xuemingl@nvidia.com> <20240413125005.725659-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00021F6D:EE_|MW4PR12MB7382:EE_ X-MS-Office365-Filtering-Correlation-Id: 17b30b6b-3607-41c4-f821-08dc5bb88138 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8Xz1q3NdnAUn/cv3xs+FcNNJOj4ixWx8lFF1x2FAL2IWTN06VrPuofLZUsbeB4yP7BvrkimAphWni4GF4TMtHgX3VoSjJfQTRGPel/1Wj8fSYqFXUuCD/vbTFXyEiT16kKfHKzB3T1yZHF/b+DYGcGdufheDy/JIkkejP3qwIccKL848o0u8HAp0IqMmF/Z4lkRoqCgYlWgGMCRNYCdyGaTA3hM2MQPvjH+JIhlQ+SikX1WoUtJNMwFISS7YUP+imUF8ln6tktkjsqBiQgtaSaABTXeUMAG2KqoSTdHn7BImuGED5F/AxKqEGhxWWRX5yZRIlUTygsEs8gbB3zEtdO1Wfrz/vGidwcoIyVcYdjDtxqlNjm+9ok6IzLNDSWIrcplf+oFP+wHRGwDmN6LOGLn4stGebi5+ETaAjBmhgG6lkNF80gz50osx3X4p5N45joAYgHmfm1vjtpSUVDfCvr92SbX1jTpjhJ2P1dki9PnbFcU1rRLK5So9blHyVoPdAcD0R+VhIb6O7r1Xi4Wfh6d5DMnJs94+Y78mrYj7luOwH1Sc7cS4yKbSvTFhcfHlcOPsrYeSwwW+5EDIy52CIdk8cXSARPUVpkYnNV1meoBMFRWYxYq5CtpN1OleObRS2La0RErZCjEY7GYHkC8XJBb2EqT+0CAycPadMecxC9e5bSB6nncnz8nJexBLI6J/6zClwR3MftObhU/dPSHJtgMLUsOtgnurXPikYo6FcHxhcuLwLx1y0sH6yFDU7Y4x X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(1800799015)(82310400014)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2024 12:51:57.7997 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 17b30b6b-3607-41c4-f821-08dc5bb88138 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00021F6D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7382 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 23.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/15/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=61ce57b13af50c7ccb2dd937fc1d3e82e45d5bcf Thanks. Xueming Li --- >From 61ce57b13af50c7ccb2dd937fc1d3e82e45d5bcf Mon Sep 17 00:00:00 2001 From: Rongwei Liu Date: Fri, 23 Feb 2024 05:21:55 +0200 Subject: [PATCH] net/mlx5: fix modify flex item Cc: Xueming Li [ upstream commit 74f98c1586e73663b4ed69b7dbd3d085776d93df ] In the rte_flow_field_data structure, the flex item handle is part of union with other members like level/tag_index. If the user wants to modify the flex item as source or destination, there should not be any checking against zero. Fixes: c23626f27b09 ("ethdev: add MPLS header modification") Signed-off-by: Rongwei Liu Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_flow.c | 2 +- drivers/net/mlx5/mlx5_flow_hw.c | 40 ++++++++++++++++++--------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 85e8c77c81..3e31945f99 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2504,7 +2504,7 @@ int flow_validate_modify_field_level(const struct rte_flow_action_modify_data *data, struct rte_flow_error *error) { - if (data->level == 0) + if (data->level == 0 || data->field == RTE_FLOW_FIELD_FLEX_ITEM) return 0; if (data->field != RTE_FLOW_FIELD_TAG && data->field != (enum rte_flow_field_id)MLX5_RTE_FLOW_FIELD_META_REG) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index da873ae2e2..bda1ecf121 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -4975,15 +4975,17 @@ flow_hw_validate_action_modify_field(struct rte_eth_dev *dev, ret = flow_validate_modify_field_level(&action_conf->dst, error); if (ret) return ret; - if (action_conf->dst.tag_index && - !flow_modify_field_support_tag_array(action_conf->dst.field)) - return rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, action, - "destination tag index is not supported"); - if (action_conf->dst.class_id) - return rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, action, - "destination class id is not supported"); + if (action_conf->dst.field != RTE_FLOW_FIELD_FLEX_ITEM) { + if (action_conf->dst.tag_index && + !flow_modify_field_support_tag_array(action_conf->dst.field)) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, action, + "destination tag index is not supported"); + if (action_conf->dst.class_id) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, action, + "destination class id is not supported"); + } if (mask_conf->dst.level != UINT8_MAX) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, action, @@ -4998,15 +5000,17 @@ flow_hw_validate_action_modify_field(struct rte_eth_dev *dev, "destination field mask and template are not equal"); if (action_conf->src.field != RTE_FLOW_FIELD_POINTER && action_conf->src.field != RTE_FLOW_FIELD_VALUE) { - if (action_conf->src.tag_index && - !flow_modify_field_support_tag_array(action_conf->src.field)) - return rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, action, - "source tag index is not supported"); - if (action_conf->src.class_id) - return rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, action, - "source class id is not supported"); + if (action_conf->src.field != RTE_FLOW_FIELD_FLEX_ITEM) { + if (action_conf->src.tag_index && + !flow_modify_field_support_tag_array(action_conf->src.field)) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, action, + "source tag index is not supported"); + if (action_conf->src.class_id) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, action, + "source class id is not supported"); + } if (mask_conf->src.level != UINT8_MAX) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, action, -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-04-13 20:43:05.641364891 +0800 +++ 0016-net-mlx5-fix-modify-flex-item.patch 2024-04-13 20:43:04.927754023 +0800 @@ -1 +1 @@ -From 74f98c1586e73663b4ed69b7dbd3d085776d93df Mon Sep 17 00:00:00 2001 +From 61ce57b13af50c7ccb2dd937fc1d3e82e45d5bcf Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 74f98c1586e73663b4ed69b7dbd3d085776d93df ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org @@ -18,3 +20,3 @@ - drivers/net/mlx5/mlx5_flow.c | 2 +- - drivers/net/mlx5/mlx5_flow_hw.c | 6 ++++-- - 2 files changed, 5 insertions(+), 3 deletions(-) + drivers/net/mlx5/mlx5_flow.c | 2 +- + drivers/net/mlx5/mlx5_flow_hw.c | 40 ++++++++++++++++++--------------- + 2 files changed, 23 insertions(+), 19 deletions(-) @@ -23 +25 @@ -index 2b2ae62618..d8ed1ed6f6 100644 +index 85e8c77c81..3e31945f99 100644 @@ -26,2 +28,2 @@ -@@ -2384,7 +2384,7 @@ int - flow_validate_modify_field_level(const struct rte_flow_field_data *data, +@@ -2504,7 +2504,7 @@ int + flow_validate_modify_field_level(const struct rte_flow_action_modify_data *data, @@ -36 +38 @@ -index bcf43f5457..5b269b9c82 100644 +index da873ae2e2..bda1ecf121 100644 @@ -39 +41 @@ -@@ -5036,7 +5036,8 @@ flow_hw_validate_action_modify_field(struct rte_eth_dev *dev, +@@ -4975,15 +4975,17 @@ flow_hw_validate_action_modify_field(struct rte_eth_dev *dev, @@ -43,7 +45,24 @@ -- if (!flow_hw_modify_field_is_geneve_opt(action_conf->dst.field)) { -+ if (action_conf->dst.field != RTE_FLOW_FIELD_FLEX_ITEM && -+ !flow_hw_modify_field_is_geneve_opt(action_conf->dst.field)) { - if (action_conf->dst.tag_index && - !flow_modify_field_support_tag_array(action_conf->dst.field)) - return rte_flow_error_set(error, EINVAL, -@@ -5061,7 +5062,8 @@ flow_hw_validate_action_modify_field(struct rte_eth_dev *dev, +- if (action_conf->dst.tag_index && +- !flow_modify_field_support_tag_array(action_conf->dst.field)) +- return rte_flow_error_set(error, EINVAL, +- RTE_FLOW_ERROR_TYPE_ACTION, action, +- "destination tag index is not supported"); +- if (action_conf->dst.class_id) +- return rte_flow_error_set(error, EINVAL, +- RTE_FLOW_ERROR_TYPE_ACTION, action, +- "destination class id is not supported"); ++ if (action_conf->dst.field != RTE_FLOW_FIELD_FLEX_ITEM) { ++ if (action_conf->dst.tag_index && ++ !flow_modify_field_support_tag_array(action_conf->dst.field)) ++ return rte_flow_error_set(error, EINVAL, ++ RTE_FLOW_ERROR_TYPE_ACTION, action, ++ "destination tag index is not supported"); ++ if (action_conf->dst.class_id) ++ return rte_flow_error_set(error, EINVAL, ++ RTE_FLOW_ERROR_TYPE_ACTION, action, ++ "destination class id is not supported"); ++ } + if (mask_conf->dst.level != UINT8_MAX) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, action, +@@ -4998,15 +5000,17 @@ flow_hw_validate_action_modify_field(struct rte_eth_dev *dev, @@ -53,6 +72,23 @@ -- if (!flow_hw_modify_field_is_geneve_opt(action_conf->src.field)) { -+ if (action_conf->src.field != RTE_FLOW_FIELD_FLEX_ITEM && -+ !flow_hw_modify_field_is_geneve_opt(action_conf->src.field)) { - if (action_conf->src.tag_index && - !flow_modify_field_support_tag_array(action_conf->src.field)) - return rte_flow_error_set(error, EINVAL, +- if (action_conf->src.tag_index && +- !flow_modify_field_support_tag_array(action_conf->src.field)) +- return rte_flow_error_set(error, EINVAL, +- RTE_FLOW_ERROR_TYPE_ACTION, action, +- "source tag index is not supported"); +- if (action_conf->src.class_id) +- return rte_flow_error_set(error, EINVAL, +- RTE_FLOW_ERROR_TYPE_ACTION, action, +- "source class id is not supported"); ++ if (action_conf->src.field != RTE_FLOW_FIELD_FLEX_ITEM) { ++ if (action_conf->src.tag_index && ++ !flow_modify_field_support_tag_array(action_conf->src.field)) ++ return rte_flow_error_set(error, EINVAL, ++ RTE_FLOW_ERROR_TYPE_ACTION, action, ++ "source tag index is not supported"); ++ if (action_conf->src.class_id) ++ return rte_flow_error_set(error, EINVAL, ++ RTE_FLOW_ERROR_TYPE_ACTION, action, ++ "source class id is not supported"); ++ } + if (mask_conf->src.level != UINT8_MAX) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, action,