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 3047043E57 for ; Sat, 13 Apr 2024 14:55:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2911940C35; Sat, 13 Apr 2024 14:55:13 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2066.outbound.protection.outlook.com [40.107.92.66]) by mails.dpdk.org (Postfix) with ESMTP id 25F44400D6 for ; Sat, 13 Apr 2024 14:55:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R8qQXTLqRjVyQQjpi5g4uIKzQv2qZ731ohBSaTpSsvfIn29p2rPSrKrNZQeU/2KdN7V6nXZvAGgv5u9N5hWPVT37JTNPkSlw4HmWTd8cidBofWO0B7e5SGMNgXBJC1Bacd3zFLqQMrBikyrSx2n/YBxZwaEEZFPLbyF8nXoHiHnQeUNwYeltfOClWDbnjdopbB2H8Z/eVZkGTShNKULSefccOY0WZ5HDzF5rcvHRFlk1Lp/LLLkI0YMVETm6IynTjPY5Qd2uN/KBHDJKAHs4G/xhimd6z5VClkkb+FsJCemTzV3D/kEau8Z8Dg0AcJtwcXK8zbnQRfZaUUskTu2HVQ== 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=Mpb9yoLPfbeHbMLBmdKm7D23/1ambEG5UVacyS8UWU0=; b=mvH0ObbNmBEm+2gRd4h7w7jQlESLCjOADJJvetUEO/F4WIDh9++OllPoEkD/KtIe3cjxMKFHUQJb4AM3uC57wczzKF5JdMg7z0FYBIwAAKkGhofSnZB8J5S/oNVaXusRinklXAitDpm/4isYD9Op15sUH4fNDxAQ7rxm9VUlolVOzrnfXdbXZ3RVT3HZHnhRGc4ptyXFmU4IoxXiWHss/5TfnZ1WR9e2S8c2eVVuDCZvJ+8KGNxugBGucEEgYr95XJvcnsSy+adaIeqi99dzk2Cf/dah5RvZdQwAbfZRZzFgUaeoOQHhAZ9ZwWywELBHc0CHqqwGLC6VKEJWvqCzEg== 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=Mpb9yoLPfbeHbMLBmdKm7D23/1ambEG5UVacyS8UWU0=; b=S7D+HiH423BPUfI42hm9XpG1ySVyiAO/w/6OoDZFICPX+UE4pOmSgtNjAVIbYPqJygDq8zTkhSAd3xB+QzDMGvHA/yXOkXYqQkfIvRXkvNNf5Q76zkvJgGOU3peSAmcFltpKN4FZiBTLJ9Bha45oCANIcEm9KTbDl5QpPgmhI0PoOJ+YdPaQrFBeNSm+66s6SBFR3tid0Oic7bmTCe5i20lDf+z5pPCM77EpHDvwr2W2ALMmWeuhXvLat3GgxAJtWxCQqFNr6Ojf6B583lQ0N+sDKHU4FUhRCLRVEKqGyGKeqGAkn3cDJdr7H8GKwJ0kj3AEoQPj59pUmAUr0oVYYg== Received: from SJ0PR03CA0053.namprd03.prod.outlook.com (2603:10b6:a03:33e::28) by CH2PR12MB4215.namprd12.prod.outlook.com (2603:10b6:610:ab::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.43; Sat, 13 Apr 2024 12:55:07 +0000 Received: from SJ1PEPF00001CDC.namprd05.prod.outlook.com (2603:10b6:a03:33e:cafe::ba) by SJ0PR03CA0053.outlook.office365.com (2603:10b6:a03:33e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.26 via Frontend Transport; Sat, 13 Apr 2024 12:55:06 +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 SJ1PEPF00001CDC.mail.protection.outlook.com (10.167.242.4) 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:55:06 +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; Sat, 13 Apr 2024 05:54:52 -0700 Received: from nvidia.com (10.126.230.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:54:51 -0700 From: Xueming Li To: Dariusz Sosnowski CC: Ori Kam , dpdk stable Subject: patch 'net/mlx5: fix connection tracking action validation' has been queued to stable release 23.11.1 Date: Sat, 13 Apr 2024 20:48:54 +0800 Message-ID: <20240413125005.725659-54-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.230.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: SJ1PEPF00001CDC:EE_|CH2PR12MB4215:EE_ X-MS-Office365-Filtering-Correlation-Id: f4632d19-576a-46d8-bc19-08dc5bb8f1bb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kQoK6rvKC8FTDlbSvZMn8Ig+9cSdYXb7lCwt1v4mGowzg4HGZJUWN83P5OdXvw7SbmjhU9SGMeU/oBJCG9xK5+Ir0KvDEYnCRXaVpA22MH2mWJp7d3QuSzfxIRRLZ5uJ6yMYSQFH5/JZjT91wyly1m4ghfC7oyl1myez41XgDigMePUbN24cIKYtMeOgOs2JSyc8BB4u8E4b5dCxZs64rxGYFwFp2LZoTmvnzoBWK8icgQP6IIRtfQlKEUslTWh3oRwe6WtEDaBBpWH9ifkrzDvQqsYRKloZIMxJO6+DEngOfe0hR4lLg+drw7w4vD6ChemYGfONeMXxiJa7v9IYvfm7cDatQR/ADpdt8LbqTaF+XL2mJxbwzNL+m9ybi0O1vGaEy8ZAiTQ2voq3gG8rosPE8wmDaJaDHxE+AtaifbtDQLOh4EZEwwsKX9yWEasB6KEBXKAQvTfCXqep7m1HssdgY+VD7WADpg38s+DUig6XCeE8H11S3q6SxCOCof9lpM+Rt3IhgqxS12wT4VWfL1prcmVjXRHgf8lj0FkfIHlpo2fK5HSPMNTOsiRRRZVIRL/LnRPZhR3SrSoYpkC0Ta7xz0vcR7mwwvWPBhJ8klJWJvVVybT0AbltKbuVyDQGRCFGQ8IOq3ZyIVMur2Thkn0IlYYCVYScAuCmDzfh2Ky+7WI9hsZsR5LoF0SSPumgWJx0oIVmqa0ajxWLz1xNOJlYXWEZf/fAGCn3cP8Y/+Mz317yjBWn/1dLpWgHuIDe 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)(1800799015)(82310400014)(36860700004)(376005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2024 12:55:06.6865 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4632d19-576a-46d8-bc19-08dc5bb8f1bb 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: SJ1PEPF00001CDC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4215 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=527857d5c23773f18c6bc166c227f6ded034d6e2 Thanks. Xueming Li --- >From 527857d5c23773f18c6bc166c227f6ded034d6e2 Mon Sep 17 00:00:00 2001 From: Dariusz Sosnowski Date: Tue, 27 Feb 2024 15:52:22 +0200 Subject: [PATCH] net/mlx5: fix connection tracking action validation Cc: Xueming Li [ upstream commit bd2db022c1ad154cd996b7b858c9f04f5a458416 ] In mlx5 PMD, handles to indirect connection tracking flow actions are encoded as 32-bit unsigned integers, where port ID is stored in bits 28-25. Because of this, connection tracking flow actions cannot be created on ports with IDs higher than 15. This patch adds missing validation. Fixes: 463170a7c934 ("net/mlx5: support connection tracking with HWS") Signed-off-by: Dariusz Sosnowski Acked-by: Ori Kam --- drivers/net/mlx5/mlx5_flow_dv.c | 9 +++++++++ drivers/net/mlx5/mlx5_flow_hw.c | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 79fde3de8e..c0d9e4fb82 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -13629,6 +13629,13 @@ flow_dv_translate_create_conntrack(struct rte_eth_dev *dev, return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "Connection is not supported"); + if (dev->data->port_id >= MLX5_INDIRECT_ACT_CT_MAX_PORT) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + "CT supports port indexes up to " + RTE_STR(MLX5_ACTION_CTX_CT_MAX_PORT)); + return 0; + } idx = flow_dv_aso_ct_alloc(dev, error); if (!idx) return rte_flow_error_set(error, rte_errno, @@ -16321,6 +16328,8 @@ flow_dv_action_create(struct rte_eth_dev *dev, case RTE_FLOW_ACTION_TYPE_CONNTRACK: ret = flow_dv_translate_create_conntrack(dev, action->conf, err); + if (!ret) + break; idx = MLX5_INDIRECT_ACT_CT_GEN_IDX(PORT_ID(priv), ret); break; default: diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index c748e48e31..4927975461 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -9857,6 +9857,13 @@ flow_hw_conntrack_create(struct rte_eth_dev *dev, uint32_t queue, "CT is not enabled"); return 0; } + if (dev->data->port_id >= MLX5_INDIRECT_ACT_CT_MAX_PORT) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + "CT supports port indexes up to " + RTE_STR(MLX5_ACTION_CTX_CT_MAX_PORT)); + return 0; + } ct = mlx5_ipool_zmalloc(pool->cts, &ct_idx); if (!ct) { rte_flow_error_set(error, rte_errno, -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-04-13 20:43:06.700172408 +0800 +++ 0054-net-mlx5-fix-connection-tracking-action-validation.patch 2024-04-13 20:43:04.987753945 +0800 @@ -1 +1 @@ -From bd2db022c1ad154cd996b7b858c9f04f5a458416 Mon Sep 17 00:00:00 2001 +From 527857d5c23773f18c6bc166c227f6ded034d6e2 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit bd2db022c1ad154cd996b7b858c9f04f5a458416 ] @@ -13 +15,0 @@ -Cc: stable@dpdk.org @@ -23 +25 @@ -index 75a8a223ab..ddf19e9a51 100644 +index 79fde3de8e..c0d9e4fb82 100644 @@ -26 +28 @@ -@@ -13889,6 +13889,13 @@ flow_dv_translate_create_conntrack(struct rte_eth_dev *dev, +@@ -13629,6 +13629,13 @@ flow_dv_translate_create_conntrack(struct rte_eth_dev *dev, @@ -40 +42 @@ -@@ -16586,6 +16593,8 @@ flow_dv_action_create(struct rte_eth_dev *dev, +@@ -16321,6 +16328,8 @@ flow_dv_action_create(struct rte_eth_dev *dev, @@ -50 +52 @@ -index c8440262d8..43bde71c93 100644 +index c748e48e31..4927975461 100644 @@ -53 +55 @@ -@@ -10346,6 +10346,13 @@ flow_hw_conntrack_create(struct rte_eth_dev *dev, uint32_t queue, +@@ -9857,6 +9857,13 @@ flow_hw_conntrack_create(struct rte_eth_dev *dev, uint32_t queue,