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 3B00BA0547 for ; Mon, 22 Nov 2021 15:23:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 27D9D41152; Mon, 22 Nov 2021 15:23:16 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2063.outbound.protection.outlook.com [40.107.102.63]) by mails.dpdk.org (Postfix) with ESMTP id F05154003C; Mon, 22 Nov 2021 15:23:13 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=baX5wKOJjTwBIONN+T8+K+kkMoQooW+sjc4tXGwToVXdDx6H6Wibh5jVwL0oYmRs4CjW/x5h3wSVxAc3db9GVEgXZzcztxf/Od/8bxPZ+yyaHI2guTi2fIlpfAdFKXTnw8kAenLDIDrd8Lf+TOOqC+xHHz2EdfmMfTAewWnpkNv44ZQajI2jpluOu7ZVlfIsf3rwD3LCLDIqugUA/p8+IPP0vIP/QEevTKTPGNEsfmPAFpe7vnlBRqun2jQdofdcEPipGC+QWmQDFzBSUI34FSAW5iXQsP3Ja++inwsFQQJGJ5gyfJ2t8uRiuNhZ0n0nojPJ6A3Jbqs6cMRT3qmoZw== 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=38vgmdss48CX+InKXGm4MdMQGq6bc/xLCXfXOso0gCk=; b=ApqXeTb/mp5YJL0ltLDZ8THVUS/b0TfswxPyWSLZTzoipJXq0g69li8x0ESA0lbNe/IPlfKdkQl9Z65rvePhGtCeADSiYaT02o/jV7LuN5T0uW1CJDaBljnovQtozALtcFFWY06ynaHjNESxuA3eFvsRtmZ5p9fTMrYZ4mLCDV2zKRzxbg+6coej6xG5du8+cF4DAk7vKJSHR56aKyhISbSdAp5dZfhTQuPdHz3orMUyLFePueGTSiKDIktXsqUW8t4RUn/jDDuh2FDD2rF/luUvHm/XGmLJGp+8LKz2h9D7FexzyXyUrbaCv4PGpkEBzqVHi68OIwNHztM81BxG6A== 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=38vgmdss48CX+InKXGm4MdMQGq6bc/xLCXfXOso0gCk=; b=ng4FkBToBvnU3VbWNVurvJxm8zYK0aeg1KwSou2A/h/egaoszy+kfI5Kwq7TifvYqmNEwMOOOSixLt+EehVqELF7WarR+SVN8ALoaUiB7OSsMmdtO/a4zygw6Sw7nFR2zkhMmjxPiGavLM6bhlv8fuxc1BufVBWHaeq5v4wOlU8FjVN5PUgEJedAnXbJDQg+ZuXaLgCTsZKRtu2RQy4iDBOMyq4bqIweAL9KZwes2Opd3IC0dx7dNf+MBIRuK9Zc//hkVmeqrpPsV2VmznNhCmjgwAX1sVG1LNgSliSXMo0sTtaPr/N8UGMfaKuKN2C32IUWEjiysxfY3u60iFvx1A== Received: from BN9PR03CA0385.namprd03.prod.outlook.com (2603:10b6:408:f7::30) by BN9PR12MB5193.namprd12.prod.outlook.com (2603:10b6:408:11a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.24; Mon, 22 Nov 2021 14:23:11 +0000 Received: from BN8NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f7:cafe::5) by BN9PR03CA0385.outlook.office365.com (2603:10b6:408:f7::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.22 via Frontend Transport; Mon, 22 Nov 2021 14:23:11 +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 BN8NAM11FT048.mail.protection.outlook.com (10.13.177.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4713.20 via Frontend Transport; Mon, 22 Nov 2021 14:23:10 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 22 Nov 2021 14:23:08 +0000 From: Jiawei Wang To: , , CC: , , Subject: [PATCH] net/mlx5: fix flow mark value missing on combination split Date: Mon, 22 Nov 2021 16:22:52 +0200 Message-ID: <20211122142252.20374-1-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.6] 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: bb439b14-6d4f-4e7d-4610-08d9adc39c77 X-MS-TrafficTypeDiagnostic: BN9PR12MB5193: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gkZ2iBLU90Pic5fYcY4WczoziQ3Z07xVYhN0gNdCdRacaxa/NMv4NCSeDihY3Aq1CkSJ/XcfuK3FDciUuBeF7SUCISgcEKfPbwLMnJK2hZWg0bQLYveNPdlrNviqzFEXkgQHtEiiEUnJ2ujOB9VtrP0BioKplPSIadN0Kca3/WQ0/QT8SPGpYlVoFnrr4RmdpNeN4VzQ5Ko5MlNUop5Y2xI8qJXyntwKz2QfiNopAy0bGSxp6k51+ds6wVL8LJdsAAuxfBnJvVdG9r0LWpkB7/HE9sumyBXPX/WlnKwR0zFtqsJiflcfTWppEfiZQWWjZJXWLyNIHXg5kjTFvjl/dB7bWX00Lnx/8H9GnOrufub7i9vV7G0jgY41ubIejEgFVwYHJDYz29gxQCVN5mAqy0ElV68fQUHp2woLgt2sXApRA5SuCVf/ZJG8XNk4v39RL+Phk1ffEYLiB2n8h5DdRt05UgUEhc+EyakFuiA+Onc5WJ43KwY8gk48f6PDDn/zFDki9vNyLBs0UTwnuhMP8JaKjNb0PYU5MJXosEFFciFhAxG3E/NTCf6E+n1ZbfXUw1dED20XOT3sCEE6fwBKjapJemuajXcRZjRqo6X70pH97ORzLGPNgrY5y7YGi312JOSU+GWX7AGwyqsNW8lrlYe0obgiF0kwgCAYv8ixoHE5ct7uj2mkKC4Zix8d2V4+2mnNWqhzEGea87CrXUWdJA== 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)(46966006)(36840700001)(1076003)(2906002)(356005)(7696005)(8936002)(6636002)(2616005)(86362001)(54906003)(83380400001)(336012)(5660300002)(4326008)(55016002)(8676002)(26005)(47076005)(186003)(82310400003)(508600001)(6666004)(450100002)(36860700001)(70206006)(70586007)(36756003)(316002)(110136005)(7636003)(426003)(6286002)(16526019); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2021 14:23:10.3047 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bb439b14-6d4f-4e7d-4610-08d9adc39c77 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: BN8NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5193 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 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") Cc: stable@dpdk.org Signed-off-by: Jiawei Wang Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 5 ++--- drivers/net/mlx5/mlx5_flow.h | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index a30ce695aa..f34e4b88aa 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -6096,7 +6096,6 @@ flow_create_split_meter(struct rte_eth_dev *dev, goto exit; } /* Add the prefix subflow. */ - flow_split_info->prefix_mark = 0; 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; 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; flow_split_info->table_id = MLX5_MTR_TABLE_ID_SUFFIX; } /* Add the prefix subflow. */ @@ -6281,7 +6280,7 @@ flow_create_split_sample(struct rte_eth_dev *dev, } 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 * MLX5_SCALE_FLOW_GROUP_BIT of 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 1de2f2edb0..1f54649c69 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -1111,13 +1111,13 @@ 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. */ uint32_t table_id; /**< Flow table identifier. */ + uint64_t prefix_layers; /**< Prefix subflow layers. */ }; typedef int (*mlx5_flow_validate_t)(struct rte_eth_dev *dev, -- 2.18.1