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 28A0745CD1; Wed, 13 Nov 2024 08:20:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F174640E0A; Wed, 13 Nov 2024 08:20:34 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2055.outbound.protection.outlook.com [40.107.92.55]) by mails.dpdk.org (Postfix) with ESMTP id AB982400D6; Wed, 13 Nov 2024 08:20:33 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vBp7wCHTSIjKZRA+gwe6JPtIM+TxPuyb1K/S0YxZcW5w+54vKbxg3GQ7srTsT5g864Mw3RLVjk8+6m44qbaTb2BTs7oUSnsz2HE1LUORcLQAzt6+NM3tnI/NTdeyNeg2voPEmTH7n0xouuAoPMF+cu0ql/P/JmtG/bLDfYEQo9pmzBfCh0sSlsF0jY5JwinMHngD4QkWQqMJnEzJoSKegiz8Aj6o2UKb8LR2GkKxwO6m5noQbc8ArsmbC4HfAzNT68xvgL60s4kQusjjuSLvJdlqeo03LcONdT1asfMCb4Q6JINd5Zrh6hJWX5cxwgVwiWlUcrH0tbHhMIHUyfm0Rg== 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=a9DsC3X8W/B/Gvhnm5/CrcFvi8690mrMPn0Q3YiGz6A=; b=LftSbrAb+bj2A9YThWEopwEWomD2RXG9PF7I5yn/Y0GnigETbAcfE3QIWmTPbKYRnHYOZ+O5BJAGEnLoJ5cPHPpEDOJC6MgOC28NQwaWHgEsNNSMPveEu6Y+orwT4+whwM1iY6GzeNl860P0UbkabCYyoc1xvliKp50ahNLeT0cmcfCbDjDrdLwoToHnsDqATmTWbv84ijXeNh/KLq4OeuxcJZ/zGrahC20JU0a3G6hRx37Wn45cIojVYJ0p0Zjsz+7407bTiCttCeNzvOzea+xvsA0i8hCVrayCbjpH6U2OC7JD5Y6g5HQQxUPwvpny716Oo1JG4CqC6kOvWWiGSg== 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=a9DsC3X8W/B/Gvhnm5/CrcFvi8690mrMPn0Q3YiGz6A=; b=CxFyxsK3e/cFtgVbppPPWouLVI589VPWgonT3KapnGDkgDjpZ8PcV2pfeUCho3hZ/38YU2RBCLNX746P1Imy70/P03sPdU1bK0U78FSBqSrSML7zTVFCA3uEkHDUteMcxWUgYDGQ5qTDLSvRVK8AEz1v8rR/8vG5eL0fBIHeM+HEsOD2iBBXJ9078w3LtTUArqLwK2MOLgKuEtQvw2GcQjHT0FIH/g/5J4wOv07UeanQxQQMJCxOx0aQXMSN5KJS4byAq/Ob9y+d+SzGRahqRe0TB/pX8cBtBfT2jCof/50aaUXGvi44vgzGkSsAP2dtGzEjzt7kHvLNb5+7FsSyqw== Received: from CH2PR19CA0026.namprd19.prod.outlook.com (2603:10b6:610:4d::36) by DM4PR12MB5939.namprd12.prod.outlook.com (2603:10b6:8:6a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.17; Wed, 13 Nov 2024 07:20:31 +0000 Received: from CH1PEPF0000AD81.namprd04.prod.outlook.com (2603:10b6:610:4d:cafe::87) by CH2PR19CA0026.outlook.office365.com (2603:10b6:610:4d::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28 via Frontend Transport; Wed, 13 Nov 2024 07:20:31 +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 CH1PEPF0000AD81.mail.protection.outlook.com (10.167.244.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Wed, 13 Nov 2024 07:20:30 +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; Tue, 12 Nov 2024 23:20:11 -0800 Received: from nvidia.com (10.126.231.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; Tue, 12 Nov 2024 23:20:08 -0800 From: Bing Zhao To: , , , CC: , , , Subject: [PATCH] net/mlx5: fix the default RSS flows creation order Date: Wed, 13 Nov 2024 09:19:52 +0200 Message-ID: <20241113071952.7581-1-bingz@nvidia.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.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: CH1PEPF0000AD81:EE_|DM4PR12MB5939:EE_ X-MS-Office365-Filtering-Correlation-Id: d6227397-0319-4503-07eb-08dd03b3a7f9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?uT05TWW5WPM610dNprcT45lg253Kc1+OuvD3y0hFkyw9QOlSCmDbTLJx+Lc2?= =?us-ascii?Q?f2+vJuh8V5rQHTG8+WT0DqsCNcd3t+qsloR1WuYAfIMz4zOCVNGII3V9BIJV?= =?us-ascii?Q?8UpAKf+g0/2+F0FL6xpH1d2RWjdh4xAboY74LkTlIUIqybpPDYM3LvOGjQaF?= =?us-ascii?Q?A1akah5tScG2T2+GAO/KGgad2XaN82OrKWDs1MzHilbUU1KtE4f9+jgyvAPr?= =?us-ascii?Q?4Ovl0m0t4dfgZ/Hq4tV3hyVgfMFX3OBzXfOuwd66OE7ZlBrvKBr79/w1c1Bc?= =?us-ascii?Q?9tOU6nzQBZDEtU0PzxGB8hgthzUU5cusqwe7xZ3AvxJ3Dq6gvDBOPTEaL4GJ?= =?us-ascii?Q?a2o+JVWtAd3wF4+ehz9EGR4YqVkNRK3HXhruVYo/9/87JeBAckVS3b7MSrMs?= =?us-ascii?Q?6MFq82XeXnlhNg4H/on4EvcnD/tMjK3/7h1oWqfzr5AkmZQ8noGNceoYrXlm?= =?us-ascii?Q?u/ibhVRQCnCF4tNFheWVwqd/HSQxhMhwntpUw/FIX+mw4AmgXPa7E9RPuImZ?= =?us-ascii?Q?ya8FK9ncmU05E06piW2KbsQpU9FK2GaiKChW1+TvNlVMWISzZYBwghYHLvQB?= =?us-ascii?Q?pasCYlnaeM2IKbkvF20thhBWiXGCE7ngI/xd07zFodKP6GWVCDeWxR1pijBa?= =?us-ascii?Q?9uKF/tICaAWp2ETihB1VIDYAce/QCbrH+ncvStnFDkFEyZ3tQFyyXdGI63tx?= =?us-ascii?Q?iV1tbstcU2OpaD4pyFLEExHTw4ESP60CBTWwW7PgZCqZzTbAv/t2HFOIO1Da?= =?us-ascii?Q?MrD8zDokjRVdsPy9QJ5hFTTqOcZkspFyKxW9BVZi3MVUV/fkkNEXZuH/bRLf?= =?us-ascii?Q?gl4uccUPKm29uoOK4PObZNwauCQCZW5aZOBFcuF8usHdizdIite6GfD68T35?= =?us-ascii?Q?2LUsPYzkBaqGonPim/3LG4n9tBHI2hfnsKrQ7Umi7q8xb8hbmbNHbvzGGBGa?= =?us-ascii?Q?2XkMgOxWdxJjo2NBBlkNe+tKEKHND/Sv6VbktjdbvKZ2RcGjfiZ5aXiuReSP?= =?us-ascii?Q?fECw5oq+OYQpnZ/lcefEUFHxazfQETcKvuBJj9L46Y6EJK2UPVU4jv3mOPcn?= =?us-ascii?Q?hHtAXA87zMxCQR6Uoo0fqIGCgCrYM/fvkG10Qs9P0ngCmbt6hEfBmZkL7XMD?= =?us-ascii?Q?jDSmUzkJdYzzex4f5GX6ARG2Vbviu+Ah5tjzegz6i598n0Kq8hgiGG4OW4YY?= =?us-ascii?Q?z1KkYVHYnrtEhrvpulHmyRfwQGtrjSGJ6RiObwoBAA4RZfasiOwqUYY0oCmB?= =?us-ascii?Q?mrmS2+PESM/twGa4H1ifvFo7EsBF1HgKSBuzXryoZ7Px7Rv4eqMC70Z/YcxC?= =?us-ascii?Q?7WFh8zvx5jJSFgnJIWVd/PT51Ib8L3PcdnpNrhuiT/5R8sSXkl98pB41/1Pj?= =?us-ascii?Q?OUTNVcEW7sM9Sk55mRyWpZDPtdh3kYXPqeN32XgZunkwA4E0yw=3D=3D?= 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)(1800799024)(36860700013)(82310400026)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 07:20:30.7060 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d6227397-0319-4503-07eb-08dd03b3a7f9 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: CH1PEPF0000AD81.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5939 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org In both SWS and HWS mode, default ingress RSS flows are always created via the driver on the root table. In the current driver, the first created flow rules will be matched firstly when: 1. >= 2 rules can be matched on the root table. 2. the rules have the same priority. All MC / BC flow rules would have the same priority and discard the input priority from the user space in the driver. All rules have a fixed priority 32 when the Ethernet destination MAC is a MC or BC address. In SWS non-template API, all the device rules are added into the list and applied in a reverse order. This patch syncs default flow rule creation order between SWS and HWS. The order should be: 1. IPv4(6) + TCP/UDP, if required. 2. IPv4(6) only, if required. 3. None IP traffic. Fixes: 9fa7c1cddb85 ("net/mlx5: create control flow rules with HWS") Cc: dsosnowski@nvidia.com Cc: stable@dpdk.org Signed-off-by: Bing Zhao Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_flow.h | 8 ++++---- drivers/net/mlx5/mlx5_flow_hw.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 693e07218d..702878c1d8 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -2941,13 +2941,13 @@ enum mlx5_flow_ctrl_rx_eth_pattern_type { /* All types of RSS actions used in control flow rules. */ enum mlx5_flow_ctrl_rx_expanded_rss_type { - MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_NON_IP = 0, - MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV4, + MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV6_UDP = 0, + MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV6_TCP, MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV4_UDP, MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV4_TCP, MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV6, - MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV6_UDP, - MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV6_TCP, + MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_IPV4, + MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_NON_IP, MLX5_FLOW_HW_CTRL_RX_EXPANDED_RSS_MAX, }; diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 2a9ef71cd8..a75bcd5c67 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -16157,7 +16157,7 @@ mlx5_flow_hw_ctrl_flows(struct rte_eth_dev *dev, uint32_t flags) struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_flow_hw_ctrl_rx *hw_ctrl_rx; unsigned int i; - unsigned int j; + int j; int ret = 0; RTE_SET_USED(priv); -- 2.34.1