From patchwork Tue Jan 31 09:33:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Vesker X-Patchwork-Id: 122722 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 E903941B8D; Tue, 31 Jan 2023 10:34:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D795641151; Tue, 31 Jan 2023 10:34:33 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2064.outbound.protection.outlook.com [40.107.92.64]) by mails.dpdk.org (Postfix) with ESMTP id BED9741148 for ; Tue, 31 Jan 2023 10:34:31 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SyDW5YUUFQIkfVMWALkxnTmdrMhX20XZUzyXXhIprlC1ZrJSN3pacLH9jVkKNCB3UhYJIDKZrgCfQUszY0n/B3sFL9qLwnE+KM4crBEAx59bC75I2GUsH7QePPIHPGT2yXpipjwjJl/smzZkUfQ9ZqWcXrnCfByon0OXg05eHvrmI5vZzyu4id6RCdZF3q5Zq84j7UDj5e7z2r3QW3geZqXKxXCfGldS0Hem/rkEGEpTkieIpvKOUjTx0qh9mFKG9ItPxUG8O685KcRvqiTw+EZXR+Sfo4mjJjmZzYpsetXlP05tAGy0dyPU/ILJ1McdvzpzSxVpu/qOZ2jwp82kTg== 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=C0YmU6wcZczNoy498RcOwEsVvbBHR4tWUPishWpYk3M=; b=jzpC5zwS9gNxAKfbRQo9+yR2kks00j812XfqtJzEcdfNhub5cNJWapgwT1BPaXIkmbxlwwMWB08H/TTjElkOMmOeGBf8j7a6XmJKKd8z2HPkwQlUQbQqd53hDYeYjkrDikBuO/xFj5p/ji5JRzscXNdkW1j5vaxUnWVfSE0pXAWDSMlE43u6twhgfuqZ624zbhWSabPjykaO+Q8Qqp2EWDJ/b1LMFjE3WnLUmpoJkBbA63MSf5QEpPin2jXArootyfnEzIirL7aViSYOJYLUqB9ZV/mzQezyM4nzCvTt5C8GOxRtK+b5fMIwPa17bHgv7VvsqbisxMspSKtwIKLH4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=monjalon.net 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 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=C0YmU6wcZczNoy498RcOwEsVvbBHR4tWUPishWpYk3M=; b=Yii6ulr+pS+Nb2/UmQTUVJvbEXVSjGcVkeKlYvhNYNw+m4FfMY8dQwLNtfNBBGfikfjeBv4cJzq7yoKzupf36PxppnennoXngu3BzysyF3uy0y6XjH/GgvrbPsgI/ROju1nwFOFcwEVQfAyBJSZG3WJwi9ZTcqA3SiS3PMHj1nLF/gvpQDOVgxSdZbW9OCtq6MUa+R/A6xnQ1TsaLVyE5MIuxUJHqtc6rYL3IibpcFh/7FOdoGdI0azBS4yAiiTn46PRQkXC1S0G+qAUDCO8sYt5rlESR10xiiJdwYxHCoAgE2NsjvbloAzukesI2YdKRqQkcKVY0pFhW86y6C32Ug== Received: from MW4PR03CA0156.namprd03.prod.outlook.com (2603:10b6:303:8d::11) by SA1PR12MB6701.namprd12.prod.outlook.com (2603:10b6:806:251::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 09:34:29 +0000 Received: from CO1NAM11FT078.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8d:cafe::93) by MW4PR03CA0156.outlook.office365.com (2603:10b6:303:8d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.37 via Frontend Transport; Tue, 31 Jan 2023 09:34:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT078.mail.protection.outlook.com (10.13.175.177) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.21 via Frontend Transport; Tue, 31 Jan 2023 09:34:29 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 31 Jan 2023 01:34:04 -0800 Received: from nvidia.com (10.126.231.37) 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.986.36; Tue, 31 Jan 2023 01:34:02 -0800 From: Alex Vesker To: , , CC: , , Subject: [v1 00/16] net/mlx5/hws: support range and partial hash matching Date: Tue, 31 Jan 2023 11:33:29 +0200 Message-ID: <20230131093346.1261066-1-valex@nvidia.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Originating-IP: [10.126.231.37] 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: CO1NAM11FT078:EE_|SA1PR12MB6701:EE_ X-MS-Office365-Filtering-Correlation-Id: 33a91ad7-222b-4562-a9ee-08db036e5a03 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wpGemNaUaEkVLZeDVWC8r+KqHFLXMjWt8I0hfyRORtsAzBmEdpYwZu+uk3z2O+cjQki2QSSmqWvR9PMNomqO0IAbiB6tU4joMwEPseEyly1/quDE0ywWP3A1THH5BubeltChnJngNxqsrRNRvgao6bP2WJT0ztcxIhXIEk60EWlYJvgke4v0Nk4730m31GsULSUzn/trchAGyBpFNxGzxEcNyttwPbXqQxkN8t1KhgO35hL1eh64+W3s+6+n5d5KXUWonsThZU8hkpfwkOXaerGZDdbZJNsFd8uNKIlnaOWIcEwjfHE0d4PMEaZ2g5uG/SGE0HI+996+UVXRLGY1LQcYnhAG4aAmpFhJNQmbZTTkO8IZw/i3yuIq8KJr/TOfBwbrKq+nRmQroMrQCpvJ7i/I9FCn1vYbfzJaBrDW9sHXMGwFmcELvKM8Mtbg8+VdlMZJJ2yqWa1VGD7iGIpTJkbcqw8c5QQpnQg8mkt8dPqQZeLxundXDP+5sxAr1giMXVTdxH+29mcpBB/Jt8QEdnASrTLCQu2i5SursqmH1pcBC7qatxoWeQDQKn35kztxY4b4MNpisesmRq5eHvrQ3Wt7ukWEGaZZOLBbmJZrdlm/dEpbHmd6+M9hZCpjCO2ODqQVAFBcMi98Bm1Csl/0Ultn3wzsVrDb9RPbam0FW4GvCmAYx5GZTett6amC3otrBICvjbcfLcLUzOdOzFLKCg== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(136003)(39860400002)(346002)(396003)(376002)(451199018)(36840700001)(40470700004)(46966006)(8936002)(2906002)(55016003)(8676002)(4326008)(336012)(478600001)(36756003)(40460700003)(5660300002)(186003)(107886003)(6666004)(16526019)(26005)(6286002)(7696005)(2616005)(40480700001)(86362001)(1076003)(426003)(47076005)(41300700001)(82310400005)(356005)(83380400001)(70586007)(70206006)(7636003)(82740400003)(316002)(36860700001)(110136005)(54906003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 09:34:29.3438 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33a91ad7-222b-4562-a9ee-08db036e5a03 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT078.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6701 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 ConnectX and BlueField devices which support HWS are capable of performing advanced match, range-match and hashing operations on packet headers. This patch-set introduces support for (1) range matching - allows combining range and exact match over provided item fields using spec, last and mask. A useful example for Range and exact match is matching exact IP and port range. This series also introduces (2) partial hash, which allows using the same matcher and performing partial hashing in case of multiple match templates are provided. The matcher create code finds the union and intersection fields to split the hash and match in a way the HW can support. This increases the match templates combinations possible although it may limit the maximum PPS. Since (1) and (2) are not fully support on current HW the implementation is done on top of a HW like FW API using WQEs. Alex Vesker (16): net/mlx5/hws: support synchronous drain net/mlx5/hws: matcher remove AT and MT limitation net/mlx5/hws: support GTA WQE write using FW command net/mlx5/hws: add capability query for gen wqe command net/mlx5/hws: align RTC create command with PRM format net/mlx5/hws: add send FW match STE using gen WQE net/mlx5/hws: add send FW range STE WQE net/mlx5/hws: move matcher size check to function net/mlx5/hws: support range match net/mlx5/hws: redesign definer create net/mlx5/hws: support partial hash net/mlx5/hws: add range definer creation support net/mlx5/hws: add FW WQE rule creation logic net/mlx5/hws: add debug dump support for range and hash net/mlx5/hws: rename pattern cache object net/mlx5/hws: cache definer for reuse drivers/common/mlx5/mlx5_prm.h | 53 +- drivers/net/mlx5/hws/mlx5dr.h | 6 +- drivers/net/mlx5/hws/mlx5dr_cmd.c | 72 ++- drivers/net/mlx5/hws/mlx5dr_cmd.h | 27 +- drivers/net/mlx5/hws/mlx5dr_context.c | 12 +- drivers/net/mlx5/hws/mlx5dr_context.h | 1 + drivers/net/mlx5/hws/mlx5dr_debug.c | 41 +- drivers/net/mlx5/hws/mlx5dr_debug.h | 4 +- drivers/net/mlx5/hws/mlx5dr_definer.c | 750 +++++++++++++++++++++---- drivers/net/mlx5/hws/mlx5dr_definer.h | 44 +- drivers/net/mlx5/hws/mlx5dr_internal.h | 2 +- drivers/net/mlx5/hws/mlx5dr_matcher.c | 279 ++++++--- drivers/net/mlx5/hws/mlx5dr_matcher.h | 43 +- drivers/net/mlx5/hws/mlx5dr_pat_arg.c | 49 +- drivers/net/mlx5/hws/mlx5dr_pat_arg.h | 6 +- drivers/net/mlx5/hws/mlx5dr_rule.c | 193 ++++++- drivers/net/mlx5/hws/mlx5dr_rule.h | 2 + drivers/net/mlx5/hws/mlx5dr_send.c | 169 +++++- drivers/net/mlx5/hws/mlx5dr_send.h | 24 +- drivers/net/mlx5/mlx5_flow_hw.c | 2 +- 20 files changed, 1475 insertions(+), 304 deletions(-)