From patchwork Tue Oct 15 16:35:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kozyrev X-Patchwork-Id: 146024 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 83C2045B44; Tue, 15 Oct 2024 18:37:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1DCF340670; Tue, 15 Oct 2024 18:37:00 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2079.outbound.protection.outlook.com [40.107.244.79]) by mails.dpdk.org (Postfix) with ESMTP id 501C94066F for ; Tue, 15 Oct 2024 18:36:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WcPfOP/kqtrAP1MfzeJ7e1zdILc8BzWd9Cr5pvS1+jw6zq++BY5RvEpCUr7hklG0F2gW5I2ylk7ruvmOMll/XY1ASN4iOr4VFjZ6WyxXXziUKkhnNQqhBi8/lOTG6HtWQKSyBe1R3yz7wH9kkaKbqBgSNBQD3kymX9qHlOSldihtlanylhovI03UCH70DmXxNdQSgKhPR7UcVnVeiwD1W5Wyo7d92s5kkuvn9UgfOeeMZavttIJRkEeZDloSlYcxX9Ttta0dCSGN+3nqwdbevgHB81tSD5nvNvvHodQC2mXEDAjgsRa1Xa9qKXb1Q7IHoxO/eypuLQ26jyOQPonEEA== 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=Jan8FYSG6p/Toh86LmFFRkgtW9Wzund03shXxWe9ehY=; b=tV/DfnVpUz9Q+nVzL8AI6RAylV1CxJBCWi3Qr1wRHnp6aH1u6Ts6ZrEDBMX0+TWMFhPzX2yYa3ukf9KxPYYWwm8Oyqz0N/Ag8/laKqUV+PALLIhUCWT8+B+xeBrVhXvYD9rvL9igZUVBFmjUt+e2uf3x18WNbHAvbJegHlLlOAiw6KXioChKhvXj5qyXqJqvBEdsjVb0ut/PZRbIawVhTqVN43d2z1f9+o6T6bJ3kG6552t1w0bMtaoKUvpAZebLpdRVCFoZODy35FfIwI0H0ABDYjQEnFFtQzq16ymPbVYJmWeGLwxXh1doR7YYnTA4XvgzMO1OkS0JsFAKWGgeiQ== 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=Jan8FYSG6p/Toh86LmFFRkgtW9Wzund03shXxWe9ehY=; b=ELz8pcA2jWeJbDtSkszRJ0HfBQmAuTssOiQLqUzjm4J1QrcHFFo+lddVUI8HVZGdlkNNdegfna5dsEXcUoi1cRFfk9hsX5d7eHR1Xa+BAIHkGn/hxA983zfZJCQMkHxOyTUD+IquauANx0bQHC87R9zV3PSpFIGFoCYxMbw7bNBYiivL21lNbH2gJ7qie4kC4lMxBYC37yXurTlx/NSHtN/f+grDEEVCQOPV67GEtXi0WrWl6MjLsvHBFTCQTtVanalnbke1NdpCyCdxaYFTqZP+V64Ke+w9FQWcqjOPxsDGDeASvzzpa52mVbApdR5xXssJ2cVlB/BlIYQNseMRxA== Received: from BYAPR07CA0041.namprd07.prod.outlook.com (2603:10b6:a03:60::18) by SA1PR12MB7294.namprd12.prod.outlook.com (2603:10b6:806:2b8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Tue, 15 Oct 2024 16:36:49 +0000 Received: from CO1PEPF000042A8.namprd03.prod.outlook.com (2603:10b6:a03:60:cafe::b6) by BYAPR07CA0041.outlook.office365.com (2603:10b6:a03:60::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17 via Frontend Transport; Tue, 15 Oct 2024 16:36:49 +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 CO1PEPF000042A8.mail.protection.outlook.com (10.167.243.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17 via Frontend Transport; Tue, 15 Oct 2024 16:36:48 +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, 15 Oct 2024 09:36:31 -0700 Received: from pegasus01.mtr.labs.mlnx (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, 15 Oct 2024 09:36:28 -0700 From: Alexander Kozyrev To: CC: , , , , , , , , Subject: [PATCH 3/5] net/mlx5: create array ste matcher Date: Tue, 15 Oct 2024 19:35:55 +0300 Message-ID: <20241015163557.581447-3-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20241015163557.581447-1-akozyrev@nvidia.com> References: <20241015163557.581447-1-akozyrev@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.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: CO1PEPF000042A8:EE_|SA1PR12MB7294:EE_ X-MS-Office365-Filtering-Correlation-Id: 97b438e3-9b9f-40d1-3edf-08dced3790eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: 5s9re2QOHhTKbzqZsBPy2RLrEX9PYk6W+O6DZoWXTYlaZmfqvKgBS/eqe+PWmGAAao3fk3As9HbDOI6rj0BOvRpwC41xHazyLKisxTGC/5wzGgyBOnoRGNoIa1jt74NIyS9G9R0lotjlt6PKbJq2rKcW5XzcqHLRxSqQ76+R0V/E5dvykWQueNUv9xGvMqnvnhFmzRBWhxPmr1lrMEx3djhB4E1Tp5pfhFJIdzELmJwqdZi8YUOSozyWssMDYsqmELpMzSG2SRiWtcTcEIOX4l3fOMeF3Td1GLcRGt4TvW7P1vczCDf5Ke57fT4gWId2QKrRmGzMKJY88hn6S+CM3HU0l15nd+tS6zxueiHsWvTvz+rGA6AOo0GmlPL9m+A2nQ5nlFzxwDINvKOeff2ejjA608bHcwe9gbXQPMaVuLbHOHGJ/D/UrB/MOmlQQzBuoL6acaegnBhc2Yq1jmZ7fzaqkioJahNQLm4uWbXALUCFcra5j6vNAU8u2pIKH0FMnCZTWiZk1VaEyAfr092FmUJ9heQns6Mu24Uegns6bWcv5gpb5upTM613FSxAQHQeyNKaGGuMa1FNu/8PGoegu6vquvJ99jBL7dqThryNjOMfI1CY21fBSTHWutbGy2OdQ7cSLbLTb2Y4t+3kbzG3dqQ0AHD3buBeVII9BLQ2TORs5nPzK6uKDIHkKWtvYxAat3m2N4TIyi4nOMeagjsTikrtYZcRxrKRbmLI0XzBkg5QuvU+fujiwDUx4EGTtq+8aADpHT7nLdAB9uL6FGWp3cfUQcFqPeQdoEMe6LpOfiaTgklm9Qkl4zXiOuWl9H5sLUXUJXVRNWHly7Aa7Y8c9LJegAR578dB4mLY6ACblICRnwJ5kH6XcYI1Ht8W5VcTIOBMquMx569aqcd97umnONzNrAtQYKkRSYRaXRlm2YbAPkOT3N4qNwX9gqlZEAJkGrMzzV7PlAYpF4VJqy5NRNONuSjRXTVlwAgALKldCfAzYkyPPgAMWsl6lPhk75Im9DeK5Exihls778X+lyaRWFnP1uyUXATqBFBIxm2iWJTv2zu/TYZMoui6doIaOsLeYqSJ2tN47aJlaWbdYPlImkTD3VIy4g60eNdPzULjbXFdE/We+FcSW0gUZHlJrLSG4NeP4Y+o3aMEKtkbOBbxzrQTZ6pvjS1RQOUe6Tf2VFFPmbxroEf5rXQBJlxXw8lBTl23Wq/PVcm+1t+LuFpVSikQ1Wz75S/Vv1U6okgzg49simpeSkh7kq5msiE7yJRdLVrrz1zKWkJgFOODIB1t5TRzbiCN/SErhtw5zOFw8fQ4rEjPS09Lv9vuTRQF9wh/WSAx9Ki/6Z6+7WakFDDXjIczBE2buyvGPOGOb3pPoK8AUY+tEQydr7Kju75xkdQ6 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)(36860700013)(1800799024)(376014)(82310400026); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 16:36:48.8681 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97b438e3-9b9f-40d1-3edf-08dced3790eb 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: CO1PEPF000042A8.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7294 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 Create an array STE matcher for a template table in case of insertion by index with pattern is selected. Packets will be matched on a pattern at the index. This table is isolated from any other tables in a group. That means packets missed the rule won't go to a lower priority tables, but proceed with the default miss instead. Signed-off-by: Alexander Kozyrev --- drivers/net/mlx5/mlx5_flow_hw.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index b9807f347d..6434937562 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -5157,8 +5157,15 @@ flow_hw_table_create(struct rte_eth_dev *dev, matcher_attr.optimize_using_rule_idx = true; matcher_attr.mode = MLX5DR_MATCHER_RESOURCE_MODE_RULE; matcher_attr.insert_mode = flow_hw_matcher_insert_mode_get(attr->insertion_type); - if (matcher_attr.insert_mode == MLX5DR_MATCHER_INSERT_BY_INDEX) - matcher_attr.match_mode = MLX5DR_MATCHER_MATCH_MODE_ALWAYS_HIT; + if (matcher_attr.insert_mode == MLX5DR_MATCHER_INSERT_BY_INDEX) { + if (attr->insertion_type == RTE_FLOW_TABLE_INSERTION_TYPE_INDEX_WITH_PATTERN) { + matcher_attr.isolated = true; + matcher_attr.match_mode = MLX5DR_MATCHER_MATCH_MODE_DEFAULT; + } else { + matcher_attr.isolated = false; + matcher_attr.match_mode = MLX5DR_MATCHER_MATCH_MODE_ALWAYS_HIT; + } + } if (attr->hash_func == RTE_FLOW_TABLE_HASH_FUNC_CRC16) { DRV_LOG(ERR, "16-bit checksum hash type is not supported"); rte_errno = ENOTSUP;