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 8316F45610 for ; Fri, 12 Jul 2024 13:03:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D3A040653; Fri, 12 Jul 2024 13:03:30 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2084.outbound.protection.outlook.com [40.107.93.84]) by mails.dpdk.org (Postfix) with ESMTP id 6F45F40261 for ; Fri, 12 Jul 2024 13:03:29 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cXqZcTQjBf4FPWsTISB1Jdzf3+3aRFcGM624eUe+YCjp/+gRd/Pw0mO0p18S6sn0Q2n/SvIYSM0IFVqp4rIemvSZR464CluR88yVLT0i0WT8a+4PNj3ySLww2MGSICShwY6boKFWzmo5RM+CBx5tS2jtIEl+Y8iNZfPoOc32ozVItKEfuT47U9SbuqsClA918u0ER8F0H/VWEPik+DTqIyDk4x49jgBOKBifpi1//nFNaYMhZPZEX3vl4TFuRhWUlF8EpxgmuY+Gs7BNfZUm1LBJseYiufZI8EsmR60pvHDZe+RqyFV1YJ6nqj4WAJrhuL+zqiQZLxyg+8Iz2qL4/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=FOKVc5rRkuw5kuptT6EVe28o1qESobUdK5I17dvM/Ys=; b=sKrnxTfGaPGFsP33GiHZxfCILOQ3fryWVX5uZaiDJaHa21fu6Sto6V//55INX0o7m+eD8IAMyJqVbTlvOY2Br657mnjlPfCPAmma8p00Zn/9QVXB3bOu/9IOhSAytT7KmT16InJ2Bu1lXmUAySO2Rx3N96D7rteanR9pYU6455Qx7XTSA61tuAHHrfo0ZOvUlqGBDr4hDxaH1xaSR9V1Mnu3ElF/ApHAQfg7o5g6+wQTqdjJ5RKVqY99JjUJrbsQeqmTYaWYQB+RStsh71N0WIYaPUOb1IGXAPBsN6tApVQjPiAn9Bf4xAVCbTtRqKZ956nPYC5Db0BNRiW7XErkTg== 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=FOKVc5rRkuw5kuptT6EVe28o1qESobUdK5I17dvM/Ys=; b=lOAF9UKCGgK/YGAOrhDUVfD8MDXAOC3a3Oi6AdotTYIWo6EY0eStlM5wuHinG6bCWhsFDMGdL5EcwUeyR1qrEiFFzG4vFznPwZ3pQ/cYo5Pew+PHeY9XMwtGlyGP7SnHmhoGtMnoGuINON6uF4gNlCtzrsCvLQ+1Ag4Y2WlU8NvY6RRnDUaxLGuBw/NGOSWQqZ2cLodezihU9N1+siDobk7qm2wcJ0Q0kSwLO5Ng+gPHiWwUVICLceUEvsQziTECU9S+/VqhgJwxwCufQfEFFIczhurNi8foAFzrJIC9ynz/0W66dFI41pRKnRXjiuwq/d2K/ndGvl1xttS0S8O49Q== Received: from BYAPR03CA0036.namprd03.prod.outlook.com (2603:10b6:a02:a8::49) by SA3PR12MB8021.namprd12.prod.outlook.com (2603:10b6:806:305::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Fri, 12 Jul 2024 11:03:26 +0000 Received: from SJ5PEPF000001EB.namprd05.prod.outlook.com (2603:10b6:a02:a8:cafe::db) by BYAPR03CA0036.outlook.office365.com (2603:10b6:a02:a8::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23 via Frontend Transport; Fri, 12 Jul 2024 11:03:26 +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 SJ5PEPF000001EB.mail.protection.outlook.com (10.167.242.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Fri, 12 Jul 2024 11:03:26 +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.1544.4; Fri, 12 Jul 2024 04:03:13 -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.1544.4; Fri, 12 Jul 2024 04:03:11 -0700 From: Xueming Li To: Gregory Etelson CC: Dariusz Sosnowski , dpdk stable Subject: patch 'net/mlx5: fix access to flow template operations' has been queued to stable release 23.11.2 Date: Fri, 12 Jul 2024 19:01:44 +0800 Message-ID: <20240712110153.309690-14-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240712110153.309690-1-xuemingl@nvidia.com> References: <20240712104528.308638-1-xuemingl@nvidia.com> <20240712110153.309690-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: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001EB:EE_|SA3PR12MB8021:EE_ X-MS-Office365-Filtering-Correlation-Id: 64f4bce8-c05a-41d4-c5a2-08dca2624119 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?LA4XQuZNiWVkfvxkHZs+OOs4JbXe6TfO5/ygP0nzfeup3qa28bV0gWIYkKKw?= =?us-ascii?Q?ppc1RHn9czydACn3TliI+Y4nhp5X7jqVQKjYyW8YCzPq7+YkCtOoxz/W2591?= =?us-ascii?Q?q2G90ksAM6ZFLO5w8NwA/e4VhNRWPv89cylOe/VgjBbMvEbvnlYK69Rcfvm6?= =?us-ascii?Q?u5rYos/T8rNwP9vJiTn0JYlgxtRCqakewXJDX2DK6so+62LxeUTf3JcKq/7s?= =?us-ascii?Q?/3cQLHSxu+o7LkYp6p4Mmfa8TyQ7GtDuIyOQXiZ6abB+u+DYBiXEiB64vanY?= =?us-ascii?Q?qI4ohAumI4P5BAQvzC+kO7F7lEwGwabXKOg2ZW6OrDumpvKps3eI+I2FPmZz?= =?us-ascii?Q?caHy6vZ4t5ggOLQ2aKMvLvzKBvzDpf8mLmHj5ybnAOf9CyahaNsxHC8V5p/z?= =?us-ascii?Q?VYrS7qO9R8NJ3+C00lnikqOuoqXMM9+ZOgOpiPyhTsp9iSu/t37hWXcwZh1G?= =?us-ascii?Q?IzCcjJe8yPHkXBfg7+wmw4u90yDRk04/1c89kX03FT/cDziiFKqZealBmyYW?= =?us-ascii?Q?LrG0dYh6JtP/sB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28Ylqg+2Ed/a?= =?us-ascii?Q?aADCULZvGJkGVmQGpV3KKpDol63Hdfet?= 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:(13230040)(376014)(1800799024)(36860700013)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2024 11:03:26.1845 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 64f4bce8-c05a-41d4-c5a2-08dca2624119 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: SJ5PEPF000001EB.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8021 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.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 07/14/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=aba6289d562f7583deb7654bed08e0e101db8f70 Thanks. Xueming Li --- >From aba6289d562f7583deb7654bed08e0e101db8f70 Mon Sep 17 00:00:00 2001 From: Gregory Etelson Date: Sun, 2 Jun 2024 09:00:49 +0300 Subject: [PATCH] net/mlx5: fix access to flow template operations Cc: Xueming Li [ upstream commit acbb57b25d30147d1fd0edf1e8314a0a3d3c38c9 ] PMD activates HWS template API context during port configuration. There was no validation that the HWS context was activated before the PMD tried to process other template function calls. The patch adds HWS context validation. Fixes: b401400db24e ("net/mlx5: add port flow configuration") Signed-off-by: Gregory Etelson Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_flow_hw.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 9667bad68e..fa6ae623c9 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -124,6 +124,20 @@ mlx5_tbl_multi_pattern_process(struct rte_eth_dev *dev, static __rte_always_inline enum mlx5_indirect_list_type flow_hw_inlist_type_get(const struct rte_flow_action *actions); +static bool +mlx5_hw_ctx_validate(const struct rte_eth_dev *dev, struct rte_flow_error *error) +{ + const struct mlx5_priv *priv = dev->data->dev_private; + + if (!priv->dr_ctx) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + "non-template flow engine was not configured"); + return false; + } + return true; +} + static __rte_always_inline int mlx5_multi_pattern_reformat_to_index(enum mlx5dr_action_type type) { @@ -5754,6 +5768,8 @@ mlx5_flow_hw_actions_validate(struct rte_eth_dev *dev, int ret; const struct rte_flow_action_ipv6_ext_remove *remove_data; + if (!mlx5_hw_ctx_validate(dev, error)) + return -rte_errno; /* FDB actions are only valid to proxy port. */ if (attr->transfer && (!priv->sh->config.dv_esw_en || !priv->master)) return rte_flow_error_set(error, EINVAL, @@ -6766,6 +6782,8 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev, bool items_end = false; uint32_t tag_bitmap = 0; + if (!mlx5_hw_ctx_validate(dev, error)) + return -rte_errno; if (!attr->ingress && !attr->egress && !attr->transfer) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ATTR, NULL, "at least one of the direction attributes" @@ -10269,6 +10287,8 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue, bool aso = false; bool force_job = action->type == RTE_FLOW_ACTION_TYPE_METER_MARK; + if (!mlx5_hw_ctx_validate(dev, error)) + return NULL; if (attr || force_job) { job = flow_hw_action_job_init(priv, queue, NULL, user_data, NULL, MLX5_HW_Q_JOB_TYPE_CREATE, @@ -11540,6 +11560,8 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue, } }; + if (!mlx5_hw_ctx_validate(dev, error)) + return NULL; if (!actions) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "No action list"); -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-07-12 18:40:18.265080128 +0800 +++ 0093-net-mlx5-fix-access-to-flow-template-operations.patch 2024-07-12 18:40:14.316594202 +0800 @@ -1 +1 @@ -From acbb57b25d30147d1fd0edf1e8314a0a3d3c38c9 Mon Sep 17 00:00:00 2001 +From aba6289d562f7583deb7654bed08e0e101db8f70 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit acbb57b25d30147d1fd0edf1e8314a0a3d3c38c9 ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org @@ -23 +25 @@ -index 53c6cc5961..e97afb0c86 100644 +index 9667bad68e..fa6ae623c9 100644 @@ -26 +28 @@ -@@ -206,6 +206,20 @@ mlx5_destroy_multi_pattern_segment(struct mlx5_multi_pattern_segment *segment); +@@ -124,6 +124,20 @@ mlx5_tbl_multi_pattern_process(struct rte_eth_dev *dev, @@ -47 +49 @@ -@@ -6399,6 +6413,8 @@ mlx5_flow_hw_actions_validate(struct rte_eth_dev *dev, +@@ -5754,6 +5768,8 @@ mlx5_flow_hw_actions_validate(struct rte_eth_dev *dev, @@ -56 +58,2 @@ -@@ -7528,6 +7544,8 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev, +@@ -6766,6 +6782,8 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev, + bool items_end = false; @@ -58 +60,0 @@ - int ret; @@ -65 +67 @@ -@@ -11259,6 +11277,8 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue, +@@ -10269,6 +10287,8 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue, @@ -74 +76 @@ -@@ -12541,6 +12561,8 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue, +@@ -11540,6 +11560,8 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue,