From patchwork Thu Oct 20 15:57:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Vesker X-Patchwork-Id: 118807 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 2D7A4A0553; Thu, 20 Oct 2022 17:59:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C29C6410EE; Thu, 20 Oct 2022 17:58:59 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2044.outbound.protection.outlook.com [40.107.95.44]) by mails.dpdk.org (Postfix) with ESMTP id 29C6D40694 for ; Thu, 20 Oct 2022 17:58:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X6/9t4jEEb+lKKRew8ga7ACgNZsWovhFHuKVLH8YQ2A8cXV4TvDl4Khof/Jw9mGBz5dfSHGib6ka0LbR2ZAK/N/X4bolhgWjmmnWMX6sXAgKCf07pvNpnEnJTDkOtLoPvVdr4M3O4pZfImPvGbk1jXqkjf2F71O4mMFUm3wa40Tq38Ct18XU2CICVNzYUWu7dtxYvribC96aYVgGeMgxNJ+6LQ6A4QBFZsDeMyfUGzt4BGe+2l1i5k4VKhMIDN9RYq/z6cz32BYmHOe5Dy8zAs36RoKcmU3rtGhS/L5HBBeuYf6LtndwYwB1O72fRKaYZkVEcU1I8/KWN87PEK6BIQ== 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=HLddx76+656L/zmN9fwH1V+jgDddLC4qfelADJkc0GY=; b=I0YWcg+cj186H5pTg0T1N1uDmp2pyzOHqrpvf4F1lXPZnoS6l5ebDSXXwfYu8hXhSDrKo1lANJcSXeKkhJNP1dqPnPkkEyMBcBi4FMDvi/R4muN55ipnJdkOVoq3rpK/4CURIGp4SeYW0bzf2V2wR4tizlggTIOaixDDdkwyOGv8+6nb8eDjEtjlAijDG9Q7yeMqIJpN5bQiVoFFyxtCtAXC0/KPiL16aMtAd/HCJ4eiWpQ8yQHtDbKR1OxLJ+O84yBDcyWzWouK51yu50aQ3/Zp4Dc3Kuu/XbI3uzfX37tIP7oUMHZU0jq+pmhCezZwgyDtw6al7Ps0543VXunLEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none (sender ip is 216.228.117.161) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject 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=HLddx76+656L/zmN9fwH1V+jgDddLC4qfelADJkc0GY=; b=QlCd+DxtB5KBdAY+5HLHAYC8Gg5pHOr3vAgS6vQpLKynhHhntZzX9xjOSm1qRyo8hwi+lBiAI2qAx0Q3vHQVm5I6wZaeBP6UJvyW7R0CVpNYkCgdxOLpZh3J523wCW2RLerJmML/lCV/CTB8gJoxOOpVZShJPvG09eKKhuWQ4cZ7CCilEI0RcPd9VxCUVSH++yrPhfFWUBu76Ttm/6Y7mpDiNM4Hs+DqIAGjhylT6wcG7uOVlc4VMCF7OzlkiCiJJ82dXBae7uCR0YtC4jkD9PFOhL/fpCzhm9IPFE5mgRvjk3CC49qmomVcY+KfTqLMlf2arWY+RHWiRn23C8F0cw== Received: from BN9P223CA0028.NAMP223.PROD.OUTLOOK.COM (2603:10b6:408:10b::33) by CH2PR12MB4922.namprd12.prod.outlook.com (2603:10b6:610:65::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.30; Thu, 20 Oct 2022 15:58:56 +0000 Received: from BN8NAM11FT105.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10b:cafe::25) by BN9P223CA0028.outlook.office365.com (2603:10b6:408:10b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.35 via Frontend Transport; Thu, 20 Oct 2022 15:58:56 +0000 X-MS-Exchange-Authentication-Results: spf=none (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=nvidia.com; Received-SPF: None (protection.outlook.com: nvidia.com does not designate permitted sender hosts) Received: from mail.nvidia.com (216.228.117.161) by BN8NAM11FT105.mail.protection.outlook.com (10.13.176.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.16 via Frontend Transport; Thu, 20 Oct 2022 15:58:55 +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.26; Thu, 20 Oct 2022 08:58:45 -0700 Received: from nvidia.com (10.126.230.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.986.29; Thu, 20 Oct 2022 08:58:43 -0700 From: Alex Vesker To: , , , CC: , Subject: [v6 00/18] net/mlx5: Add HW steering low level support Date: Thu, 20 Oct 2022 18:57:30 +0300 Message-ID: <20221020155749.16643-1-valex@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20220922190345.394-1-valex@nvidia.com> References: <20220922190345.394-1-valex@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT105:EE_|CH2PR12MB4922:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b541cdc-db27-44bd-aa54-08dab2b3fe30 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: Whel+uBZsgdI/aDvl/ncPa23nSvJ7MYSErvEixsORcGP/NiEY/bMlZHJxJfjf+I5MmpKDiynzUAapzOloBhaNoc21nJ/bDbbIb50OiphUgKJcoLO3J3RM1Ie0x9/qSAcRDcuNtzAmikNpA29r9MSayyQ7lCRjNIVG5vksqj/bJLlWEHYapLVTMecCmYiGpa+rJTuEBrIX5i4wJta67EWEsb8dLL6AcJ/LhBZKmAkPFb41N38IQM2t6W1rsSPhJRmHh6CGtvFqoQmmy4UdHkBuih/yIhx2csWfbc3vjAyrDItJhy6i79oKy4oT7R3yc11M7YNxdTu8KzYJl2XOUYc7VRTSOhVq/TtBlegfCwIJKpdNAdb1wldiH5ysrHHxFzRqPhgtiYFm278DPb5HKoQWtol0WUIbVibp749JM5QV8zvvFlrUxFd3sbUnubdykvcXH6MUvSl9AM6zNXJG2yQ/FLS57MejJXXtiqn5ISmbLyzTaL9MkFepOxE1DKsPrT26n8ThNItlYKCsfAlS4d0EXhIs2akov1c0O7hleZOHgtjujKrw/OV+p22hoS9C9mnjC+5wu1xyU5zIepDQcVVreONfpNKc9TGmlZ1kCxguXl8M4FNkMRkQWD/V1gvnys6x1oA6fBoLswrXoGmzk+ptHJ9jBAEBWOfOe0aNnIbimizWcSun/hor4MTOQWDwqDLHdYsouvffCFJH0NhAe5ItnaN8lpjQu5gk8t9hsc4HHEINp9oCKW2Xi3tDR/1DcCXFuSCA1L7U1D4AaJTZy4pkg== 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:(13230022)(4636009)(136003)(39860400002)(346002)(376002)(396003)(451199015)(46966006)(40470700004)(36840700001)(36756003)(336012)(36860700001)(86362001)(82740400003)(5660300002)(1076003)(426003)(47076005)(26005)(16526019)(2906002)(2616005)(186003)(7636003)(83380400001)(356005)(41300700001)(316002)(4326008)(7696005)(54906003)(6666004)(70586007)(478600001)(6636002)(70206006)(40480700001)(82310400005)(55016003)(8936002)(110136005)(8676002)(6286002)(107886003)(40460700003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2022 15:58:55.7338 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b541cdc-db27-44bd-aa54-08dab2b3fe30 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: BN8NAM11FT105.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4922 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 Mellanox ConnetX devices supports packet matching, packet modification and redirection. These functionalities are also referred to as flow-steering. To configure a steering rule, the rule is written to the device owned memory, this memory is accessed and cached by the device when processing a packet. The highlight of this patchset is supporting HW Steering (HWS) which is the new technology supported in new ConnectX devices, HWS allows configuring steering rules directly to the HW using special HW queues with minimal CPU effort. This patchset is the internal low layer implementation for HWS used by the mlx5 PMD. The mlx5dr (direct rule) is layer that bridges between the PMD and the HW by configuring the HW offloads based on the PMD logic v2: Fix check patch and cosmetic changes v3: -Fix unsupported items -Fix compilation with mlx5dv dependency v4: -Fix compile on Windows v5: -Fix compile on old rdma-core or no rdma core v6: -Fix meson style and improve configure -Checkpatch and compilation fixes -Fix action number issue Alex Vesker (8): net/mlx5: Add additional glue functions for HWS net/mlx5/hws: Add HWS send layer net/mlx5/hws: Add HWS definer layer net/mlx5/hws: Add HWS context object net/mlx5/hws: Add HWS table object net/mlx5/hws: Add HWS matcher object net/mlx5/hws: Add HWS rule object net/mlx5/hws: Enable HWS Bing Zhao (2): common/mlx5: query set capability of registers net/mlx5: provide the available tag registers Dariusz Sosnowski (1): net/mlx5: add port to metadata conversion Erez Shitrit (3): net/mlx5/hws: Add HWS command layer net/mlx5/hws: Add HWS pool and buddy net/mlx5/hws: Add HWS action object Hamdan Igbaria (1): net/mlx5/hws: Add HWS debug layer Suanming Mou (3): net/mlx5: split flow item translation net/mlx5: split flow item matcher and value translation net/mlx5: add hardware steering item translation function doc/guides/nics/features/default.ini | 1 + doc/guides/nics/features/mlx5.ini | 1 + doc/guides/nics/mlx5.rst | 5 +- doc/guides/rel_notes/release_22_11.rst | 4 + drivers/common/mlx5/linux/meson.build | 11 +- drivers/common/mlx5/linux/mlx5_glue.c | 121 +- drivers/common/mlx5/linux/mlx5_glue.h | 17 + drivers/common/mlx5/mlx5_devx_cmds.c | 30 + drivers/common/mlx5/mlx5_devx_cmds.h | 2 + drivers/common/mlx5/mlx5_prm.h | 652 ++++- drivers/net/mlx5/hws/meson.build | 18 + drivers/net/mlx5/{mlx5_dr.h => hws/mlx5dr.h} | 201 +- drivers/net/mlx5/hws/mlx5dr_action.c | 2237 +++++++++++++++ drivers/net/mlx5/hws/mlx5dr_action.h | 253 ++ drivers/net/mlx5/hws/mlx5dr_buddy.c | 200 ++ drivers/net/mlx5/hws/mlx5dr_buddy.h | 22 + drivers/net/mlx5/hws/mlx5dr_cmd.c | 948 +++++++ drivers/net/mlx5/hws/mlx5dr_cmd.h | 230 ++ drivers/net/mlx5/hws/mlx5dr_context.c | 223 ++ drivers/net/mlx5/hws/mlx5dr_context.h | 40 + drivers/net/mlx5/hws/mlx5dr_debug.c | 462 ++++ drivers/net/mlx5/hws/mlx5dr_debug.h | 28 + drivers/net/mlx5/hws/mlx5dr_definer.c | 1968 ++++++++++++++ drivers/net/mlx5/hws/mlx5dr_definer.h | 585 ++++ drivers/net/mlx5/hws/mlx5dr_internal.h | 93 + drivers/net/mlx5/hws/mlx5dr_matcher.c | 919 +++++++ drivers/net/mlx5/hws/mlx5dr_matcher.h | 76 + drivers/net/mlx5/hws/mlx5dr_pat_arg.c | 511 ++++ drivers/net/mlx5/hws/mlx5dr_pat_arg.h | 83 + drivers/net/mlx5/hws/mlx5dr_pool.c | 672 +++++ drivers/net/mlx5/hws/mlx5dr_pool.h | 152 ++ drivers/net/mlx5/hws/mlx5dr_rule.c | 528 ++++ drivers/net/mlx5/hws/mlx5dr_rule.h | 50 + drivers/net/mlx5/hws/mlx5dr_send.c | 844 ++++++ drivers/net/mlx5/hws/mlx5dr_send.h | 275 ++ drivers/net/mlx5/hws/mlx5dr_table.c | 248 ++ drivers/net/mlx5/hws/mlx5dr_table.h | 44 + drivers/net/mlx5/linux/mlx5_os.c | 12 +- drivers/net/mlx5/meson.build | 7 +- drivers/net/mlx5/mlx5.c | 9 +- drivers/net/mlx5/mlx5.h | 8 +- drivers/net/mlx5/mlx5_defs.h | 2 + drivers/net/mlx5/mlx5_devx.c | 2 +- drivers/net/mlx5/mlx5_dr.c | 383 --- drivers/net/mlx5/mlx5_flow.c | 29 +- drivers/net/mlx5/mlx5_flow.h | 174 +- drivers/net/mlx5/mlx5_flow_dv.c | 2567 +++++++++--------- drivers/net/mlx5/mlx5_flow_hw.c | 115 +- 48 files changed, 14368 insertions(+), 1694 deletions(-) create mode 100644 drivers/net/mlx5/hws/meson.build rename drivers/net/mlx5/{mlx5_dr.h => hws/mlx5dr.h} (67%) create mode 100644 drivers/net/mlx5/hws/mlx5dr_action.c create mode 100644 drivers/net/mlx5/hws/mlx5dr_action.h create mode 100644 drivers/net/mlx5/hws/mlx5dr_buddy.c create mode 100644 drivers/net/mlx5/hws/mlx5dr_buddy.h create mode 100644 drivers/net/mlx5/hws/mlx5dr_cmd.c create mode 100644 drivers/net/mlx5/hws/mlx5dr_cmd.h create mode 100644 drivers/net/mlx5/hws/mlx5dr_context.c create mode 100644 drivers/net/mlx5/hws/mlx5dr_context.h create mode 100644 drivers/net/mlx5/hws/mlx5dr_debug.c create mode 100644 drivers/net/mlx5/hws/mlx5dr_debug.h create mode 100644 drivers/net/mlx5/hws/mlx5dr_definer.c create mode 100644 drivers/net/mlx5/hws/mlx5dr_definer.h create mode 100644 drivers/net/mlx5/hws/mlx5dr_internal.h create mode 100644 drivers/net/mlx5/hws/mlx5dr_matcher.c create mode 100644 drivers/net/mlx5/hws/mlx5dr_matcher.h create mode 100644 drivers/net/mlx5/hws/mlx5dr_pat_arg.c create mode 100644 drivers/net/mlx5/hws/mlx5dr_pat_arg.h create mode 100644 drivers/net/mlx5/hws/mlx5dr_pool.c create mode 100644 drivers/net/mlx5/hws/mlx5dr_pool.h create mode 100644 drivers/net/mlx5/hws/mlx5dr_rule.c create mode 100644 drivers/net/mlx5/hws/mlx5dr_rule.h create mode 100644 drivers/net/mlx5/hws/mlx5dr_send.c create mode 100644 drivers/net/mlx5/hws/mlx5dr_send.h create mode 100644 drivers/net/mlx5/hws/mlx5dr_table.c create mode 100644 drivers/net/mlx5/hws/mlx5dr_table.h delete mode 100644 drivers/net/mlx5/mlx5_dr.c