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 02A6EA0548 for ; Sun, 28 Nov 2021 15:55:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F09F04068A; Sun, 28 Nov 2021 15:55:25 +0100 (CET) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2079.outbound.protection.outlook.com [40.107.94.79]) by mails.dpdk.org (Postfix) with ESMTP id DEB554274A for ; Sun, 28 Nov 2021 15:55:24 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SpF+8J8wQ9efxugPBl69xluRFRNygPXcYcucB6Fb4Sgol++AolMC+fUdMGurOn2+5M0W3pE/JTDYKrETJdZNPdV43POe5J/hxsFu6y4r7wD8TNTHwmwCM7+39QGVsp+j4b1WsIFZU1ogPRgO2qoB6a5ATdQFInqb7OUiXZ+UVT+0G3+px4g+aN8U+J4bFGXRCIR1UBC+yRWx0Pwbz4vfwCuilK7pLFF4gFjoKyTiS5qZV4novOvvct/TVgqq96Z0/dn5pHkRv4gbG7cqHp0jJWItiiFQry9+vJfG82Tj4rVx1lE4jXaZwjw1mLfVQSuvsbzaUCoTdpPx1miV+EJOgQ== 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=oNoJUETLhAHvShuvlTTW+Ai7jy5nYCFn9yy3B8oCSHw=; b=Vd+5iThwdIekYRY4OV762xm9lnXyRBpfTUFZNDiq+TamirYutVY6Rn5ZEXx0VNQaCJIOQmp0U+naITFFMGhZZ5S+GoUZbevkalgnAz8mntEPyKaeW4/TYavFqsSxAfwCBIq0+jjkkCUqEQQ+iHmxZc1Pdh7sSuArOM0BVdYpScVCFkwxKyMkCw29OscRQU/CmbSn2p/mvy2MgZ/Ap8RauZ87DHRsI3x97VJijia21thFwN6vepM7mQH8ji//AVJG5xbnMHshNJ7EZI2ltqqQHKI/muBn5f+3mXLG5BSTA9DIwGCNpQm6fkIhVOj2tmvviKbSRTjT+KTnfR7GEMNpug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none 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=oNoJUETLhAHvShuvlTTW+Ai7jy5nYCFn9yy3B8oCSHw=; b=om/uY5Yga2yntWE2ZBnfn0pqtn6fjHeV35kW4VXLNVApfaFZgEt+YgbbGrqu27/T3zr9HoTa+1G/NoupXYlUbm2NVNv/euUO7/FeDVn0nAyJY+WWh6/kpUSCDrvo1NespBxjAuPCCwYrZWqc2CWBLdikZgc1iMUM5U+8dPlUFLP6yn8PNVD8Xi7E++llcOgZT75TD9GZuS1CNEzSMnmqbdmuEPuvbsB16PPrG/Q2Rmsjsb1hJSGUoUZskR5pzP3T9mhvCHz1BSU3osBzoZj+d+DBCQQur3S/zNueRzcUM02FMdz+YM5Aa1TV8j9ZTSwE5Brc2MjT2LUtBl8cPKPQmQ== Received: from DM5PR06CA0071.namprd06.prod.outlook.com (2603:10b6:3:37::33) by DM4PR12MB5245.namprd12.prod.outlook.com (2603:10b6:5:398::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Sun, 28 Nov 2021 14:55:23 +0000 Received: from DM6NAM11FT004.eop-nam11.prod.protection.outlook.com (2603:10b6:3:37:cafe::b3) by DM5PR06CA0071.outlook.office365.com (2603:10b6:3:37::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.22 via Frontend Transport; Sun, 28 Nov 2021 14:55:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) 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.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT004.mail.protection.outlook.com (10.13.172.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4734.22 via Frontend Transport; Sun, 28 Nov 2021 14:55:23 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 28 Nov 2021 14:55:21 +0000 From: Xueming Li To: Jiawei Wang CC: Luca Boccassi , Viacheslav Ovsiienko , dpdk stable Subject: patch 'net/mlx5: fix tag ID conflict with sample action' has been queued to stable release 20.11.4 Date: Sun, 28 Nov 2021 22:53:12 +0800 Message-ID: <20211128145423.3974892-9-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211128145423.3974892-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> <20211128145423.3974892-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a5de3d81-d5d4-41a1-62b7-08d9b27f1ae0 X-MS-TrafficTypeDiagnostic: DM4PR12MB5245: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gfSmAAANhMJ55NWhE4OFO8lQVIYKuOl691kr2vLUkdDosfv65ewuH7pY+P046gg+HCNNMZxCrZjsJ0d0Y8PFZNDaWvyJMdBmuGRsm/lXfkOpu+EgrhCSShZ2i22P5xZAnS+AF3eBORmnGCR4dagJDgp84rrHvQzJyuB7hASxT3ByW4gOff+nz6EB8Kr+85kH77k35NJbKMvYI1UANQMo5eszsEuz+xA+sVuVnYdBhEATzi1dOj3lBiZKTP/NpCr+UX8v9OBmGdeLUyHibSb65ip7iHjo1kWBY0COaNLzw+MKjRhoi74LdQOpaU7F/m1vl9Vj65nEouAd24tqCGlYqkUm8ZR505J+e2XdLMqzs7YpItTcjJrHwx11z/T2PXMg8m9+yv8TTho4BkjGlzGAJPwuj14pPx3fgjNEde9PNtqvNpmyhsls8YfHPAaW2TCby3CuyEZqWRSlnOghHrauBERUIJplPsqIxuF4GAGMiJ67HEeN5Ron8Bsoz5MsRCNlsFw1YRO+4YUAMTW1JhRDRpbk4cl/5pck4qTQB0FIHS4mPLBcfCB6cn4gLsN+QUiBz0vqr3LQPwntsm4fGXTdtz9r0J0ZAZZAc2UXmUEpUbO+ZMLnilGkgAEiqxDFy71lqCAibij0Xsr/zrzbhpK2tA6yEIb8LIBiRKz5INcJ44bD7OQ0kO8p3VdAy9a3p7HnhBXOdpkxZafuyb5+eOv+qkA7HlspvyPjAEFHZKJAaqmsqgIMptXaaC9yOmRYtdsKvYTE9uC44ZyWLeQraJrPIM3MF4DrFKB5w8t2sRfLMdKq3kI2GkN7Dv++6oxtHndufiRmsNJERFuYL9/LpEvI/g== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(4326008)(6286002)(6862004)(47076005)(316002)(6636002)(5660300002)(356005)(82310400004)(26005)(70586007)(8936002)(83380400001)(7636003)(2906002)(86362001)(36860700001)(336012)(70206006)(4001150100001)(2616005)(426003)(7696005)(1076003)(36756003)(966005)(16526019)(186003)(54906003)(508600001)(53546011)(37006003)(55016003)(8676002)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2021 14:55:23.0010 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a5de3d81-d5d4-41a1-62b7-08d9b27f1ae0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT004.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5245 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 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/30/21. 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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/2a9a0c9d63e2bfcb01b8d16eebb23b60a561a6eb Thanks. Xueming Li --- >From 2a9a0c9d63e2bfcb01b8d16eebb23b60a561a6eb Mon Sep 17 00:00:00 2001 From: Jiawei Wang Date: Wed, 3 Nov 2021 15:07:59 +0200 Subject: [PATCH] net/mlx5: fix tag ID conflict with sample action Cc: Xueming Li [ upstream commit a9b6ea45bed6acb2d95c93bc177f9d5cb53275ef ] For the flows containing sample action, the tag action was added implicitly to store the unique flow index into metadata register in the split prefix subflow, and then match on this index in the split suffix subflow. The metadata register for flow index of sample split subflows was also used to store application metadata TAG 0 item, this might cause TAG 0 corruption in the flows with sample actions. This patch uses the same metadata register C index as used for ASO action since it's reserved and not used directly by the application, and adds the checking in validation to make sure not to conflict with ASO CT in the same flow. Fixes: b4c0ddbfcc58 ("net/mlx5: split sample flow into two sub-flows") Signed-off-by: Jiawei Wang Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 3 ++- drivers/net/mlx5/mlx5_flow.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 1fa361b318..b8e11a43f5 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -835,6 +835,7 @@ mlx5_flow_get_reg_id(struct rte_eth_dev *dev, REG_C_3; case MLX5_MTR_COLOR: case MLX5_ASO_FLOW_HIT: /* Both features use the same REG_C. */ + case MLX5_SAMPLE_ID: MLX5_ASSERT(priv->mtr_color_reg != REG_NON); return priv->mtr_color_reg; case MLX5_COPY_MARK: @@ -4656,7 +4657,7 @@ flow_sample_split_prep(struct rte_eth_dev *dev, if (!fdb_tx) { /* Prepare the prefix tag action. */ set_tag = (void *)(actions_pre + actions_n + 1); - ret = mlx5_flow_get_reg_id(dev, MLX5_APP_TAG, 0, error); + ret = mlx5_flow_get_reg_id(dev, MLX5_SAMPLE_ID, 0, error); if (ret < 0) return ret; set_tag->id = ret; diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 56af30c2bb..c7021c2110 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -81,6 +81,7 @@ enum mlx5_feature_name { MLX5_MTR_COLOR, MLX5_MTR_SFX, MLX5_ASO_FLOW_HIT, + MLX5_SAMPLE_ID, }; /* Default queue number. */ -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-28 22:41:03.964883622 +0800 +++ 0008-net-mlx5-fix-tag-ID-conflict-with-sample-action.patch 2021-11-28 22:41:03.213542911 +0800 @@ -1 +1 @@ -From a9b6ea45bed6acb2d95c93bc177f9d5cb53275ef Mon Sep 17 00:00:00 2001 +From 2a9a0c9d63e2bfcb01b8d16eebb23b60a561a6eb Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit a9b6ea45bed6acb2d95c93bc177f9d5cb53275ef ] @@ -19 +21,0 @@ -Cc: stable@dpdk.org @@ -24,4 +26,3 @@ - drivers/net/mlx5/mlx5_flow.c | 3 ++- - drivers/net/mlx5/mlx5_flow.h | 1 + - drivers/net/mlx5/mlx5_flow_dv.c | 4 ++++ - 3 files changed, 7 insertions(+), 1 deletion(-) + drivers/net/mlx5/mlx5_flow.c | 3 ++- + drivers/net/mlx5/mlx5_flow.h | 1 + + 2 files changed, 3 insertions(+), 1 deletion(-) @@ -30 +31 @@ -index 29134b4825..f657980737 100644 +index 1fa361b318..b8e11a43f5 100644 @@ -33 +34,2 @@ -@@ -907,6 +907,7 @@ mlx5_flow_get_reg_id(struct rte_eth_dev *dev, +@@ -835,6 +835,7 @@ mlx5_flow_get_reg_id(struct rte_eth_dev *dev, + REG_C_3; @@ -35,2 +37 @@ - case MLX5_ASO_FLOW_HIT: - case MLX5_ASO_CONNTRACK: + case MLX5_ASO_FLOW_HIT: /* Both features use the same REG_C. */ @@ -38 +38,0 @@ - /* All features use the same REG_C. */ @@ -41 +41,3 @@ -@@ -5581,7 +5582,7 @@ flow_sample_split_prep(struct rte_eth_dev *dev, + case MLX5_COPY_MARK: +@@ -4656,7 +4657,7 @@ flow_sample_split_prep(struct rte_eth_dev *dev, + if (!fdb_tx) { @@ -43,2 +45 @@ - append_index++; - set_tag = (void *)(actions_pre + actions_n + append_index); + set_tag = (void *)(actions_pre + actions_n + 1); @@ -49 +50 @@ - mlx5_ipool_malloc(priv->sh->ipool + set_tag->id = ret; @@ -51 +52 @@ -index 4026255ce4..696d294ca5 100644 +index 56af30c2bb..c7021c2110 100644 @@ -54,2 +55,3 @@ -@@ -109,6 +109,7 @@ enum mlx5_feature_name { - MLX5_MTR_ID, +@@ -81,6 +81,7 @@ enum mlx5_feature_name { + MLX5_MTR_COLOR, + MLX5_MTR_SFX, @@ -57 +58,0 @@ - MLX5_ASO_CONNTRACK, @@ -62,15 +62,0 @@ -diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c -index 8fa7829341..0beaf7b62d 100644 ---- a/drivers/net/mlx5/mlx5_flow_dv.c -+++ b/drivers/net/mlx5/mlx5_flow_dv.c -@@ -5574,6 +5574,10 @@ flow_dv_validate_action_sample(uint64_t *action_flags, - RTE_FLOW_ERROR_TYPE_ACTION, action, - "wrong action order, jump should " - "be after sample action"); -+ if (*action_flags & MLX5_FLOW_ACTION_CT) -+ return rte_flow_error_set(error, EINVAL, -+ RTE_FLOW_ERROR_TYPE_ACTION, action, -+ "Sample after CT not supported"); - act = sample->actions; - for (; act->type != RTE_FLOW_ACTION_TYPE_END; act++) { - if (actions_n == MLX5_DV_MAX_NUMBER_OF_ACTIONS)