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 E73A2A0548 for ; Sun, 28 Nov 2021 16:02:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E17924068A; Sun, 28 Nov 2021 16:02:11 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2079.outbound.protection.outlook.com [40.107.237.79]) by mails.dpdk.org (Postfix) with ESMTP id E17A742735 for ; Sun, 28 Nov 2021 16:02:10 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K0GVGnWcXNK4OmCQKx+3lK90gWl/HgH6+Rp5KN/bTZLnHVLxlo0RKc8CveWm4xoLrJ4NcMOx5FBVr10JOJtMOY17MRpmOm8Ja2Vj6DJ3Vr9GPyYsHbuFCm4KqL7gii/AYMxRnvlN11MM+cIoWZLaQ6Ds46bSVoev5A5gjI8/kgLp7sg3vFFe4ZvoguOMGiv5GFNSco/SvU1qJ+jmcWU6G3rXxZ3x138DL2OPvEcoKR+nJqfatuxYNpdKbrx/eY/vDefBlxjIMZRmsOos78NJbwG0pXs5ojGpiJxWLhWCcsUs7MXV0P6PEPpvJsMY7lKjsntuAF3FQRAuITGn3SEsJw== 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=WtVteBetFIvQeS5PIl2MJ/0/WedSMQXYgQwOXRG8b3w=; b=IZCvS/pcAxghfF4l75By1FJr9sB4olzf9oyhGpLHaiNu1pZBck6p+Yw5gDAK8dYHtbBqyxsSNytREx8YJWwXoiWiKxv+PP42x2tOJ/f0/ToOQuVN1q0spUuH+IzhMX7qxBE2wMIAu+S0pMuhLspmzSECrGCyqnrILkWUpCeoxfqd2lEe9wMGcDpjCJExYxZsu5hbxuP7AzuaqDPo2l3/6ynedSoQZkmqGKSLHQs6AFCL16VA2X7+1XGJSE1b/56ZSTenIOj3BD/5Y+sY63gg+akLCMv7AKa6RWPpuYXIJD6xAKDqlj9PYTrfu24+uKD7uM0iN0H6f0/38SJ5jKugpw== 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=WtVteBetFIvQeS5PIl2MJ/0/WedSMQXYgQwOXRG8b3w=; b=LVJAIksTWYtfRJi5NxY+VNNO1EQ8g6/oK3eaOrO6lJT/JMrvjEck5nzaIabyoEdfE/YeJbbH4t/gBkZ4KEawRfu7DagktW+6MGco+9oPeUl4IpL3uUgPrfG+cgiMxH9+PYRy87PLZMRJwgiZZOjiL3bMVcDWlzbVmpkRHJQg3MLnFLyc7LO9GBRHg7zNnrDZVZ1FJZ+2GEibZl84l3xxIiK2um8bQUvtQQfWmY7kt9nPPgexzKkGXUFcvmkqml6pM1EtYnUKP44TPEITOme7q8C9VKmDGLPl8Isw4WyEEn8wCsWks5OoX6epnP2pPcIgIp0K6RrRny92aD9/ve5Qhg== Received: from BN1PR10CA0019.namprd10.prod.outlook.com (2603:10b6:408:e0::24) by DM5PR12MB2440.namprd12.prod.outlook.com (2603:10b6:4:b6::39) 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 15:02:09 +0000 Received: from BN8NAM11FT026.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e0:cafe::a4) by BN1PR10CA0019.outlook.office365.com (2603:10b6:408:e0::24) 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 15:02:09 +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 BN8NAM11FT026.mail.protection.outlook.com (10.13.177.51) 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 15:02:09 +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 15:02:07 +0000 From: Xueming Li To: Jiawei Wang CC: Luca Boccassi , Viacheslav Ovsiienko , dpdk stable Subject: patch 'net/mlx5: fix flow mark with sampling and metering' has been queued to stable release 20.11.4 Date: Sun, 28 Nov 2021 22:54:11 +0800 Message-ID: <20211128145423.3974892-68-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: 2ea961ad-35f8-4721-96ac-08d9b2800d1b X-MS-TrafficTypeDiagnostic: DM5PR12MB2440: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M050OgKl5ZzXkbtF53vhDWKFbAA/FB1RQBT4mi1OKVgqQWUcKfJKxB+I2Z0xHHuF6CL74xyYCHyznkPqfg61n18Zj6HmNYNWkxN42N/JYTCne5wVtQuOYKZeeUkvtP8Y+kZmMTPpX/oXyFRAhYv1hxT0pUfXatfhRcp1CM/xsz3/p/OVmol4eShDYyr+Y/Fwm6W86c95bwB00tz/RWGq7oFrzYfoqG6iTarCrduoSYNvhnN3n9H8F65ZAhtSqpKzz/MLZgprCTIe0VlC5LywmyivPs+D/93yFqvT2MkBRcrELtgfSynnp2+GeBl2C5tF02hJSD59bc8nyh45zN7lu9Sm3Pb8DBcZcwxQ0SlhSxxhofGWc0mzhXoOWdY1LnswRRdykdk01r9fTdt/8M5lApIAl0eGyQnYO7EP5bEP/HD0/1T4UHrAOOGW6oyM3qm/N01hVpPTIg1Dq1BD5mta6iTp9V3RwUDgqhMO951TCbJZgAW51Wk5/BdF3T2CiT57eCzM9QPlrJDraQJPKUt8vupO6GnraZ3ZD6FKZTdyAkj1+aJTY8a6Ggvu2wwfWFw8eS3gHwuJYD66G/iIMVc22GhPkKAMF/V6XBoygklbAZOKwxWYR3qFoepSjqVxSaUzZayvXKqMxVXZ35GIGlH64Ym8sA6HJZti0XGb7Qnv0/d2r50+rYuD9H7itCbmnN7LiTDyedxe64gmZsf+54DEMQ0IkvP9bJM9SRqu87uGw9smOrZo9KgxNGvsw4mhsnq7OyPBMPLDWFD7fMAVj+LahBUwIhQ1nZvylZLKpp4V5gNDY490DESyGNnbUge+jra/52eAwiVoESU7F3euSESe/A== 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)(6862004)(508600001)(316002)(83380400001)(336012)(86362001)(2616005)(36860700001)(47076005)(966005)(6636002)(53546011)(426003)(7636003)(1076003)(36756003)(54906003)(16526019)(70206006)(7696005)(5660300002)(70586007)(4326008)(55016003)(8676002)(37006003)(4001150100001)(6286002)(186003)(2906002)(82310400004)(26005)(8936002)(6666004)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2021 15:02:09.3406 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ea961ad-35f8-4721-96ac-08d9b2800d1b 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: BN8NAM11FT026.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2440 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/6e5d1776da0318075b1239bc078b9a6e39a9b68b Thanks. Xueming Li --- >From 6e5d1776da0318075b1239bc078b9a6e39a9b68b Mon Sep 17 00:00:00 2001 From: Jiawei Wang Date: Mon, 22 Nov 2021 16:22:52 +0200 Subject: [PATCH] net/mlx5: fix flow mark with sampling and metering Cc: Xueming Li [ upstream commit 693c7d4b1e12024cd429ef563e9df5cc2c477aee ] If there are sample action and the meter action in the same flow, mlx5 PMD performs several levels of splitting. For example, sampling feature splits the original flow into prefix subflow with sample action, and suffix subflow with the rest of actions. Then, metering feature splits the sampling suffix subflow into its own meter subflows. If mark action was added before the sample and meter action, the flow mark flag was kept in the sample subflows but reset on handling the metering split, causing the flow mark value missed. This patch keeps the flow mark flag of previous subflow, and then the following meter subflows handle the flow mark correctly. Fixes: 9ade91dfe85d ("net/mlx5: fix group value of sample suffix flow") Signed-off-by: Jiawei Wang Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 5 ++--- drivers/net/mlx5/mlx5_flow.h | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index ba5ad7b87d..3c35b87964 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -5063,7 +5063,6 @@ flow_create_split_meter(struct rte_eth_dev *dev, goto exit; } /* Add the prefix subflow. */ - flow_split_info->prefix_mark = 0; ret = flow_create_split_inner(dev, flow, &dev_flow, attr, items, pre_actions, flow_split_info, error); @@ -5078,7 +5077,7 @@ flow_create_split_meter(struct rte_eth_dev *dev, MLX5_FLOW_TABLE_LEVEL_SUFFIX; flow_split_info->prefix_layers = flow_get_prefix_layer_flags(dev_flow); - flow_split_info->prefix_mark = dev_flow->handle->mark; + flow_split_info->prefix_mark |= dev_flow->handle->mark; } /* Add the prefix subflow. */ ret = flow_create_split_metadata(dev, flow, @@ -5209,7 +5208,7 @@ flow_create_split_sample(struct rte_eth_dev *dev, sfx_table_key.table_id; flow_split_info->prefix_layers = flow_get_prefix_layer_flags(dev_flow); - flow_split_info->prefix_mark = dev_flow->handle->mark; + flow_split_info->prefix_mark |= dev_flow->handle->mark; /* Suffix group level already be scaled with factor, set * skip_scale to 1 to avoid scale again in translation. */ diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index c7021c2110..ed9e9f7240 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -1126,11 +1126,11 @@ struct mlx5_flow_workspace { }; struct mlx5_flow_split_info { - bool external; + uint32_t external:1; /**< True if flow is created by request external to PMD. */ - uint8_t skip_scale; /**< Skip the scale the table with factor. */ + uint32_t prefix_mark:1; /**< Prefix subflow mark flag. */ + uint32_t skip_scale:8; /**< Skip the scale the table with factor. */ uint32_t flow_idx; /**< This memory pool index to the flow. */ - uint32_t prefix_mark; /**< Prefix subflow mark flag. */ uint64_t prefix_layers; /**< Prefix subflow layers. */ }; -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-28 22:41:06.648923770 +0800 +++ 0067-net-mlx5-fix-flow-mark-with-sampling-and-metering.patch 2021-11-28 22:41:03.420205836 +0800 @@ -1 +1 @@ -From 693c7d4b1e12024cd429ef563e9df5cc2c477aee Mon Sep 17 00:00:00 2001 +From 6e5d1776da0318075b1239bc078b9a6e39a9b68b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 693c7d4b1e12024cd429ef563e9df5cc2c477aee ] @@ -19 +21,0 @@ -Cc: stable@dpdk.org @@ -25,2 +27,2 @@ - drivers/net/mlx5/mlx5_flow.h | 8 ++++---- - 2 files changed, 6 insertions(+), 7 deletions(-) + drivers/net/mlx5/mlx5_flow.h | 6 +++--- + 2 files changed, 5 insertions(+), 6 deletions(-) @@ -29 +31 @@ -index a30ce695aa..f34e4b88aa 100644 +index ba5ad7b87d..3c35b87964 100644 @@ -32 +34 @@ -@@ -6096,7 +6096,6 @@ flow_create_split_meter(struct rte_eth_dev *dev, +@@ -5063,7 +5063,6 @@ flow_create_split_meter(struct rte_eth_dev *dev, @@ -37,5 +39,5 @@ - skip_scale_restore = flow_split_info->skip_scale; - flow_split_info->skip_scale |= - 1 << MLX5_SCALE_JUMP_FLOW_GROUP_BIT; -@@ -6129,7 +6128,7 @@ flow_create_split_meter(struct rte_eth_dev *dev, - MLX5_FLOW_TABLE_LEVEL_METER; + ret = flow_create_split_inner(dev, flow, &dev_flow, + attr, items, pre_actions, + flow_split_info, error); +@@ -5078,7 +5077,7 @@ flow_create_split_meter(struct rte_eth_dev *dev, + MLX5_FLOW_TABLE_LEVEL_SUFFIX; @@ -46 +47,0 @@ - flow_split_info->table_id = MLX5_MTR_TABLE_ID_SUFFIX; @@ -49,2 +50,3 @@ -@@ -6281,7 +6280,7 @@ flow_create_split_sample(struct rte_eth_dev *dev, - } + ret = flow_create_split_metadata(dev, flow, +@@ -5209,7 +5208,7 @@ flow_create_split_sample(struct rte_eth_dev *dev, + sfx_table_key.table_id; @@ -56,2 +58,2 @@ - * MLX5_SCALE_FLOW_GROUP_BIT of skip_scale to 1 to avoid scale - * again in translation. + * skip_scale to 1 to avoid scale again in translation. + */ @@ -59 +61 @@ -index 1de2f2edb0..1f54649c69 100644 +index c7021c2110..ed9e9f7240 100644 @@ -62 +64 @@ -@@ -1111,13 +1111,13 @@ struct mlx5_flow_workspace { +@@ -1126,11 +1126,11 @@ struct mlx5_flow_workspace { @@ -74,3 +76 @@ -- uint64_t prefix_layers; /**< Prefix subflow layers. */ - uint32_t table_id; /**< Flow table identifier. */ -+ uint64_t prefix_layers; /**< Prefix subflow layers. */ + uint64_t prefix_layers; /**< Prefix subflow layers. */ @@ -79 +78,0 @@ - typedef int (*mlx5_flow_validate_t)(struct rte_eth_dev *dev,