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 159A943B7D for ; Tue, 5 Mar 2024 11:00:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0CD9E4026B; Tue, 5 Mar 2024 11:00:05 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2066.outbound.protection.outlook.com [40.107.95.66]) by mails.dpdk.org (Postfix) with ESMTP id 175DF4014F for ; Tue, 5 Mar 2024 11:00:04 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kET/tF2YcGMhDr65H8T2ASIh5FTu2uFMGfzatZcDCX3EGvRFg/Vuu5CKlcntzXKIyzznDPVt0TjlEbdH3Fe7io2GfUD7FcWnQ6PKt/AG9AuabT2hifx0RWq6H6Cfv9u2jyWYqsQ27qD5HWo6Tb5cuVlIcJkSrEnt4AA4duNNsiKSN+4RNYI3Bn/Wkplw6RtmfOid75pv/nDt72sXLKJtXe+5URg83FoxTL6zT5o+DALHfWNwNTikZ842OUKL2MtOscC0FTHGYA9TNETI7BpTkbq5L9c16NZ3OCG3Dn3qdnP6zbESa29U8ZFT88XpnODjs6yANyHEQB+qUi/ma2GbuA== 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=i3a0y9eYHcOI1F56ssUg/SNu8w/4QwaRDYhRRJTbohs=; b=N6MRWfvyMzEcU7APc3r5+KrcjV5R35j832cA13PkyW6k1MhaxnBNHcsbESTWJSzZQ4X73FVb+tzN9bErXpuj0G6LYf5bK6RmpcPNZ44eumqVtJgSTPS72ZyAlj3h6QowBhNI/km4C6l4yCn1CE6RRik07gr317EOaUpiDSf8mG/fivzqSE75J7eXFviFzvTnQANIEomeRKDbQ8UVqhUZaUKQqhehCgfdVal9Ts3yIpJ1LN+rDJCxXWCKlZ8KtLlsefQeQSVnHUyXiR/92rZFpHh2bZTLpPi1845UDrws6lre8fkRfe1BurGUiytTm112FXFgMzAXYy7x4bNtsBs3gg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=i3a0y9eYHcOI1F56ssUg/SNu8w/4QwaRDYhRRJTbohs=; b=f3jN4CcCN627bmjBDDNe1czjKPtC/maSIH3V5p0sSAB8x9dj8y8shPi5Ab8II8vJrwO9ZThb67+CbDsFtq0bs+bJzn6Slt3ite2ZKJblKGk9Apv6oHP2lXttmu9cAUXxXTlR2UNJ0qHPsjMTtERdw/6W0f0Vr7iZbPOGs0AYdzCE/wIslkjn2ffB9neBaGkt0DXC9x/Ks9HLJew+iHQvjGY7Ag9A8/wE8HYbzORf5po/5V4CzpBBVTTbgjbVl9yv0vwC4bDmJQYELprf0QkXf6Rk4IMBEW4lGUD7A/mHEbvpxnnsXmJe3moQ2oYRHfK7JCI/79G4TVOvgEKQ2caZGA== Received: from SA0PR11CA0204.namprd11.prod.outlook.com (2603:10b6:806:1bc::29) by DS0PR12MB9324.namprd12.prod.outlook.com (2603:10b6:8:1b6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.38; Tue, 5 Mar 2024 10:00:01 +0000 Received: from SA2PEPF00001506.namprd04.prod.outlook.com (2603:10b6:806:1bc:cafe::e8) by SA0PR11CA0204.outlook.office365.com (2603:10b6:806:1bc::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39 via Frontend Transport; Tue, 5 Mar 2024 10:00:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SA2PEPF00001506.mail.protection.outlook.com (10.167.242.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Tue, 5 Mar 2024 10:00:01 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 5 Mar 2024 01:59:46 -0800 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; Tue, 5 Mar 2024 01:59:44 -0800 From: Xueming Li To: Michael Baum CC: Suanming Mou , dpdk stable Subject: patch 'net/mlx5: fix GENEVE option item translation' has been queued to stable release 23.11.1 Date: Tue, 5 Mar 2024 17:47:53 +0800 Message-ID: <20240305094757.439387-133-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240305094757.439387-1-xuemingl@nvidia.com> References: <20240305094757.439387-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: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF00001506:EE_|DS0PR12MB9324:EE_ X-MS-Office365-Filtering-Correlation-Id: 014c8c98-4bc4-484b-976a-08dc3cfb05e8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Gc+fyV/qtNOVtRpXJDebvo/5rP9O3Z9C7n4ZcOptWj1Nb5yqItMJcqN1oYhT146KZMitq28jrkPqC1fZwzAheqlcjVLHFYA3RmtThzhIVUU3o337bZHksQ3fcP6Pcb1HSlMpmSRDdLK1rWg8C22BjqLAs4Sy0J9qQAB2nAv4rYHvxbKT/KHY2s9bRSrXR/u95VkufkTSei8+GAqS33C4HHnuWIisM2XpLHr3Aa+qPrJLLYbArXynvk4qbP4ilZ0PO3tuwjQ5GqbcugBdH2mNwjJkg9hrBFrTwKhGHVZmW/Nt94x/gO1pc1Djkcam15yDmzCU9GtiOsfNtkaIWYgnkvtsiVdTuoUwL4fSV6w43+BDHgtO9E44MNftExXBbAZYfglLnDjn2l+1jqRbwa/dwIxRmg3VqXqNC5E5MFMjEX9rfM0xPidZ6jA3vf4gmK/slSzPhAheLar2t+tByDLsEuhdDfbJPII0D1rQz1z4W5+ophV6YssqmedJ3mh9uFBpjoOahJq/92Nr438VVYJhUpc0uGmMWFBYqvJ+RSaWLh+lJqZZ+KbnX08iRvJTkfy1s7hTcsihGTnogMgxpJQIBT7Xv611LS/hIf/lf3zssbR+T5jypaT2t0kAeIlGxHejzUYi7Wc4kU4T+E07vxTB6Nlg0yL3LNQDstRsC3zlP8plnekZHgz3jgI/JVumYYd+RmZ6UwTOqkjjedxNbTy9wvTjRseqyS/0Ojqi1odtmpGmWmfWuDIcmzQOla1gFxfg X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(376005)(82310400014)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2024 10:00:01.2104 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 014c8c98-4bc4-484b-976a-08dc3cfb05e8 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF00001506.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9324 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 03/31/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=5982bea06b43581987e94f280e4e597e08181149 Thanks. Xueming Li --- >From 5982bea06b43581987e94f280e4e597e08181149 Mon Sep 17 00:00:00 2001 From: Michael Baum Date: Thu, 25 Jan 2024 15:30:25 +0200 Subject: [PATCH] net/mlx5: fix GENEVE option item translation Cc: Xueming Li [ upstream commit efcf8a5e634e6b3ca45dfc842e0c3be64d8a44bf ] The "flow_dv_translate_item_geneve_opt()" function is called twice per flow rule, for either matcher focusing the mask or value focusing the spec. The spec is always provided and its field "option_len" indicates the data size for both spec and mask. For using it, function has another pointer "geneve_opt_vv" representing the spec regardless to focusing while the "geneve_opt_v" pointer represents the mask for matcher and spec for rule creation. The current implementation has 2 issues: 1. geneve_opt_v get the spec in rule creation as sane as geneve_opt_vv, but function use if-else which is bacicly has same value. 2. function uses "option_len" from "geneve_opt_v" instead of "geneve_opt_v" even when the focus is on mask, for HWS the mask value may be 0 even data is valid. This patch refactors the function implementation to avoid those issues. Fixes: cd4ab742064a ("net/mlx5: split flow item matcher and value translation") Signed-off-by: Michael Baum Acked-by: Suanming Mou --- drivers/net/mlx5/mlx5_flow_dv.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 3fbfea74fb..79fde3de8e 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -9978,13 +9978,13 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key, { const struct rte_flow_item_geneve_opt *geneve_opt_m; const struct rte_flow_item_geneve_opt *geneve_opt_v; - const struct rte_flow_item_geneve_opt *geneve_opt_vv = item->spec; + const struct rte_flow_item_geneve_opt *orig_spec = item->spec; void *misc3_v = MLX5_ADDR_OF(fte_match_param, key, misc_parameters_3); rte_be32_t opt_data_key = 0, opt_data_mask = 0; - uint32_t *data; + size_t option_byte_len; int ret = 0; - if (MLX5_ITEM_VALID(item, key_type)) + if (MLX5_ITEM_VALID(item, key_type) || !orig_spec) return -1; MLX5_ITEM_UPDATE(item, key_type, geneve_opt_v, geneve_opt_m, &rte_flow_item_geneve_opt_mask); @@ -9997,21 +9997,15 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key, return ret; } } - /* Set the data. */ - if (key_type == MLX5_SET_MATCHER_SW_V) - data = geneve_opt_vv->data; - else - data = geneve_opt_v->data; - if (data) { - memcpy(&opt_data_key, data, - RTE_MIN((uint32_t)(geneve_opt_v->option_len * 4), - sizeof(opt_data_key))); - memcpy(&opt_data_mask, geneve_opt_m->data, - RTE_MIN((uint32_t)(geneve_opt_v->option_len * 4), - sizeof(opt_data_mask))); + /* Convert the option length from DW to bytes for using memcpy. */ + option_byte_len = RTE_MIN((size_t)(orig_spec->option_len * 4), + sizeof(rte_be32_t)); + if (geneve_opt_v->data) { + memcpy(&opt_data_key, geneve_opt_v->data, option_byte_len); + memcpy(&opt_data_mask, geneve_opt_m->data, option_byte_len); MLX5_SET(fte_match_set_misc3, misc3_v, - geneve_tlv_option_0_data, - rte_be_to_cpu_32(opt_data_key & opt_data_mask)); + geneve_tlv_option_0_data, + rte_be_to_cpu_32(opt_data_key & opt_data_mask)); } return ret; } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-05 17:39:34.941850032 +0800 +++ 0132-net-mlx5-fix-GENEVE-option-item-translation.patch 2024-03-05 17:39:31.093566504 +0800 @@ -1 +1 @@ -From efcf8a5e634e6b3ca45dfc842e0c3be64d8a44bf Mon Sep 17 00:00:00 2001 +From 5982bea06b43581987e94f280e4e597e08181149 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit efcf8a5e634e6b3ca45dfc842e0c3be64d8a44bf ] @@ -25 +27,0 @@ -Cc: stable@dpdk.org @@ -34 +36 @@ -index 4f8062d0ab..afcec4a63d 100644 +index 3fbfea74fb..79fde3de8e 100644 @@ -37 +39 @@ -@@ -10103,13 +10103,13 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key, +@@ -9978,13 +9978,13 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key, @@ -54 +56 @@ -@@ -10122,21 +10122,15 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key, +@@ -9997,21 +9997,15 @@ flow_dv_translate_item_geneve_opt(struct rte_eth_dev *dev, void *key,