From patchwork Wed Feb 1 07:27:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Vesker X-Patchwork-Id: 122779 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 D90A241B9B; Wed, 1 Feb 2023 08:28:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D75A427E9; Wed, 1 Feb 2023 08:28:57 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2066.outbound.protection.outlook.com [40.107.96.66]) by mails.dpdk.org (Postfix) with ESMTP id 570F541611 for ; Wed, 1 Feb 2023 08:28:56 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n4mYkNfcOJunKTXN4yBzzENTI9W6oNzt2K2CI6jZ1RSLjqhMJ+rElZNAUSzgY85ikn/lc48Ac4xHpJ1ZS8QxOIWwc/gE6T+wj/ZZsgEDKneieftAHb7kLZic8u/mrS4TKsRgizeSDSIMVXM6OWLr1zOPD428zpBlSvoUOxOuMkZ9Xk/dPAYsFV9Dc5W6dp5hGFjC1rQzCG/2Yqf99dOAax41mmXjz7wknhpGwuG5yy+V0eGPOuK7XI2lwrFNubHH4/DBIbumN2qVttwBIxS0FCI7AtybG+RNuHTSwxuUgEeQagl+A5EcqlOUKEtWtQ2Hk1AL2dIKnZ4jdqQ+4GdXMQ== 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=mGOIz69wBPjcTLlI2grmXLgQXeySd6sIhBuLpiMIbhQ=; b=W7Qu53W0SkFdbM2f1zq2T+zyIFYhIEiB0Q7LxeZtpx0AUei7oJmMEwlNspGXXKA/URONeIKJxF1lSMhZSk18bhSzu81OFFwE+Q3u/iBSHuqYUDo/r1T9ChJowSa4vRFwKjckiGtBbZcX3xANgHaFQbyLA9zBCGfvSz/SDK4RE4qvHrXEZ9phJeopogKcrgTs77eW8Ls7vfdKZx1qnC2zGKl38Ct0+nSmCmgkugos2t4H8cpmNW4QThmi/cI73sK7pNqalpji31KXs3peqNCht92S137jrccB46roJDbqZ0RuHdbihCGnwusBoGzqmcQVlkJH1x6o/Mzz0PKVp8PGPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=mGOIz69wBPjcTLlI2grmXLgQXeySd6sIhBuLpiMIbhQ=; b=cGej4FQgS5wEeBvAnCGIb6JYG37/TXOBemJYySt/ARu8DwNo/Rg++Qm8JtxT8D6ZZ6fpNe/+5UTZXian0QWVLi2dRyXNBq7OH7tr5LnjDeC5oTc4q7lADgyt8XK5HbR3Uq1xJjmufPy4PZjttsZxEShGOEYIq65LfxqakNk/iHi1H/idagBlgOg+3aey1e/7fLzJhsevBtrtZaOBzPQWKrDDUCj+NsIFYkRBLUZwFgjiSaKsxy7ISqsPVj/8Zc0eiVxdC3so1X8GdB6oQY5WiYx0hrlbPpkOdtu773B6NO8dlddUrpdBUmjdQ5ZCh8nqmFHq5hj/kzYI649e4to/2Q== Received: from BN8PR15CA0026.namprd15.prod.outlook.com (2603:10b6:408:c0::39) by PH8PR12MB6892.namprd12.prod.outlook.com (2603:10b6:510:1bc::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Wed, 1 Feb 2023 07:28:54 +0000 Received: from BN8NAM11FT068.eop-nam11.prod.protection.outlook.com (2603:10b6:408:c0:cafe::19) by BN8PR15CA0026.outlook.office365.com (2603:10b6:408:c0::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.25 via Frontend Transport; Wed, 1 Feb 2023 07:28:54 +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 BN8NAM11FT068.mail.protection.outlook.com (10.13.177.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.24 via Frontend Transport; Wed, 1 Feb 2023 07:28:53 +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.986.36; Tue, 31 Jan 2023 23:28:37 -0800 Received: from nvidia.com (10.126.230.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 23:28:34 -0800 From: Alex Vesker To: , , CC: , , Subject: [v2 00/16] net/mlx5/hws: support range and partial hash matching Date: Wed, 1 Feb 2023 09:27:59 +0200 Message-ID: <20230201072815.1329101-1-valex@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230131093346.1261066-1-valex@nvidia.com> References: <20230131093346.1261066-1-valex@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.37] 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: BN8NAM11FT068:EE_|PH8PR12MB6892:EE_ X-MS-Office365-Filtering-Correlation-Id: dc5f9a67-d142-4276-0de1-08db0425f8ff 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: PA+ztWY1vsjGrvNKkk0PtBhh0lsso7IAdRL4ZQ1GJf2b12r0sB3e21605P3AtEW2dy04FgnXP2ybYa5TtMq8GGcKVyU0PLw/PinIRqjNtVRgfow1rEjV/7fPqliNk43StJeC6gu2XjyjmssCSXhaxeI37rFK1RokTawzDKxCl63uaKA5hanRBx8ikTg1uuDcgnLMlGCDzDd2AR+UESQW20zAdO6agmyg0yQgnkowAAydSXrSSseNnOqiP6hv8U2B4UU0EroCVt86wiuN2DiPUXG3UV90Opu7B5zWh3/n4M1R8+/Zma0nrMwvCSUKOgHqILspfmp8/idu44e9joFKmY6xoskBC5AF+0AsplhT7Z6Xs2FPc3EN28GmWNrmTJ5HIMyXKtCOlSjpkDXngA5x1NLsSlv2XgkArkndaOGxapGW3rpA1givI3+d7hkYrfDXw4xo4iGD/Jb5xkssHj89LKYhJyts3Ipilvcmpe8cMznvR5u8Lx6gp38dNcKYqq2hBNtL6tH+CWlEJ/LtOeB0KsXkYv4b4YqK1FxvxylRGAyt/l9C5xoIXA8BAeBwihog3eS2OSEhcGYNIM5eRLNc5xXVk86UtXiDikFBi4tl8bYp1sz4OPRSAj6mKE8WpIMEH7Y9XiCWzlADEG/RMNxtoLVTeXJFsOlTXToKJJLj0SWeqM8kpK8W5R5YW4D+XkM1b+zy3oAaiQ5JWbXdYAO0qw== 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:(13230025)(4636009)(376002)(39860400002)(136003)(346002)(396003)(451199018)(36840700001)(46966006)(40470700004)(41300700001)(55016003)(6666004)(83380400001)(86362001)(40480700001)(2616005)(107886003)(82310400005)(426003)(47076005)(336012)(356005)(36860700001)(7636003)(82740400003)(316002)(8676002)(70586007)(4326008)(70206006)(54906003)(110136005)(36756003)(1076003)(40460700003)(26005)(7696005)(16526019)(478600001)(6286002)(186003)(2906002)(8936002)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2023 07:28:53.8791 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dc5f9a67-d142-4276-0de1-08db0425f8ff 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: BN8NAM11FT068.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6892 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. v2: -Fix missed checkpatch comments 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(-)