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 17723A0350; Tue, 22 Feb 2022 09:52:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A89CF40DF6; Tue, 22 Feb 2022 09:52:22 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2040.outbound.protection.outlook.com [40.107.244.40]) by mails.dpdk.org (Postfix) with ESMTP id C2E9B40DF4 for ; Tue, 22 Feb 2022 09:52:20 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fX6qU/rTcTVR9bSoUo0ZGJmTrc/1BD+Kkv+/k/8+mhpi0m9HAygMMj1dFhUGOvAnc9nngmnztepLMwEzyb8cg64DRJ18Pt6+a7ilMycIb77156JuQPNIbrS8771TXGxYVXSSAPSur5hsyh9lUrjiwiAiQah3ouj4PVv9ErjhENCPcBCqEl5v+NNOLJ/8My60EzepzTpmpLh89XlwXolxCTtTMHrhSyOeK+5TTucHP5C/+Mk4qaogYfjdZ2DqAjLji6/cyHC0zWmS7hOCJachMqfHJ6hPAL55E4a0nypZDkb1SQAmbkwEXjM+nJaw7a5BAfNydxmMpilz9vJ4LRyhOw== 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=Vtrx/TxVJiehENLQn29BHAG9aKGDkH59eErGX2DV6FM=; b=KHaEiAL4XozzpFUjc9E+cpfgw5uDbyK/Ssu8xPr/Um4B7RSnvaeqx0jQd5Q+uOv5mDo9JxtsKSwe5POY/BsSk0JkJNhOB2hUU+M0FUhnIDpSHgbUXEtacCmexiknnIQNLLUJKguxW4Bual+aoAh6b56oxXG0KrGPylosNWwHzekjzIyJQgrfswGywt89asPv3o4wvkb5zxC3FE+7wJQHaAGj+Ny5TsY9eMsgxaAFsPDAMyxtFX1+sPYcN+dj/vR8AFTFEGp4sSkhWoJzUcNRyAVUybN4La3sGWnOjaAWu14nRk8jhLPf0Z0MLGgrXuWI9RZlRoTF7SBV6liFf8IFOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) 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 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=Vtrx/TxVJiehENLQn29BHAG9aKGDkH59eErGX2DV6FM=; b=Hua7t/lnomY2SIshDAcveP709kt/bF+WSrxdjraBkFbHPuEvSLNh3VYPgatH7Bd4p/XhESlBLrv3uuMCsu6w67RfM3hUhfFlmaYFOgsH3kK0IWQc+QfyHtmdrwfal98vM+veWRl9ViM5LBlZXPipqTag5hvEme9oj/Ncg/mzkxMpUCTz3UYNVGqRYPlPE7o1LbVE2Ka5tw5sgy+7p4VwNmpFy9gedI2K8NUvPLo8Gch/pmbGvUtgvFWUlsRFO8XW0e8VFNvnw5MQ/kRUuk6oFtdfp2q57g9RyMEqisf9NSgsMeqFeKo+T/uUWkfnUzXOHVPwDiYm1tqzKgPnzc+nOg== Received: from MW4PR04CA0053.namprd04.prod.outlook.com (2603:10b6:303:6a::28) by DM6PR12MB2731.namprd12.prod.outlook.com (2603:10b6:5:45::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.26; Tue, 22 Feb 2022 08:52:17 +0000 Received: from CO1NAM11FT042.eop-nam11.prod.protection.outlook.com (2603:10b6:303:6a:cafe::dd) by MW4PR04CA0053.outlook.office365.com (2603:10b6:303:6a::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.16 via Frontend Transport; Tue, 22 Feb 2022 08:52:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by CO1NAM11FT042.mail.protection.outlook.com (10.13.174.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4995.15 via Frontend Transport; Tue, 22 Feb 2022 08:52:17 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 22 Feb 2022 08:52:16 +0000 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.986.9; Tue, 22 Feb 2022 00:52:13 -0800 From: Suanming Mou To: , CC: , , Subject: [PATCH v2 00/14] net/mlx5: add hardware steering Date: Tue, 22 Feb 2022 10:51:42 +0200 Message-ID: <20220222085156.27137-1-suanmingm@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20220210162926.20436-1-suanmingm@nvidia.com> References: <20220210162926.20436-1-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain 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-Office365-Filtering-Correlation-Id: ed24eed7-44d2-4882-add4-08d9f5e0a0fa X-MS-TrafficTypeDiagnostic: DM6PR12MB2731:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WvfSfD14zYFfjlgMkKbB8QQ5LjWaYBw4vBWnvriDiWDvtjD7nSA3c2K8KOkOuMSiNk0o3bISD6JHu5Fim0sNo37wJBez9B95uj/cm/mQygaSy6LvmEpk9q1ltMc0qvCqzOj5OlMrl+jeh85coWW9v4E6sjUrjVdMaOeKI5Bs/ZlA37aXxkRcSOKuxvlbfpx31hMPgsBRxyG4MnsdIZ8ONBR9r20Rk+IFreUlzeWCf3YuA2O9k9ojGlQXNukgSXeQTPA3M1sfRaKuyAqUgRhSix6+Q7aJZqEqLQUfGqcz4ce9QCil3BC93EIHD9YTbBHVyMDjR0oDqrSQIDsQ/Ika6QVCRxWMhHcQEV1GW4gp8bv+J2tF3GOmD/gvdyfAew6XQ2EU2QVnOYzrkundpS/cP54JfttSfF4N4g9zUOeZjUzKARVOE/dyqmTVTgPqrsPG7J90AAmp6kgoQoeZXE/I2zhGrObbOpzv5Y9BPhbVoP/04YcgVehUYXQc+Gu93Psy4dIaNALoQSr2x4MDmrx045t8M1RqPRuDvicuyArrmyPB60kBZBBY3pHlCSzrRFLnRWuw1Vg3Uqit0Hsz0R+rK9s0Qt0g8qP5QXiCegPWQT80/vM3Vvkg05SSYFz0orKvz9sl964YQ5rrQbcQcnST/3T9AH0tof1mNEcoZASF+QKyv9q8iJ+BcbTCaQHrkrx7MgRSqoKeKfRU9noNcKYmzA== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(36756003)(6666004)(40460700003)(2616005)(7696005)(508600001)(55016003)(47076005)(2906002)(36860700001)(6636002)(1076003)(16526019)(5660300002)(110136005)(54906003)(26005)(8936002)(186003)(316002)(82310400004)(426003)(356005)(336012)(81166007)(83380400001)(70586007)(70206006)(6286002)(8676002)(4326008)(86362001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2022 08:52:17.0804 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed24eed7-44d2-4882-add4-08d9f5e0a0fa X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT042.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2731 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 The Connect-X steering is a lookup hardware mechanism that accesses flow tables, matches packets to the rules, and performs specified actions. Historically, mlx5 PMD implements several software engines to manage steering hardware facility: - FW Steering - Verbs/Direct Verbs, uses FW calls to manage flows - SW Steering - DevX/mlx5dv, uses WQEs to access table memory directly However, there are still some disadvantages: - performance is limited, we should invoke firmware either to manage the entire flow, or to handle some internal steering objects - organizing and preparing flow infrastructure (actions, matchers, groups, etc.) on the flow inserting is sure to cause slow flow insertion - security, exposing the low-level steering entries directly to the userspace may cause security risks A new hardware WQE based steering operation with codename "HW Steering" is going to be introduced to get rid of the security risks. And it will take advantage of the recently new introduced async queue-based rte_flow APIs to prepare everything in advance to achieve high insertion rate. In this new HW steering engine, the original SW steering rte_flow API will not be supported in the first implementation, only the new async queue-based flow operations is going to be supported. A new steering mode parameter for dv_flow_en will be introduced and user will be able to engage the new steering engine. *** THIS PATCH SET DEPENDS ON THE NEW RTE_FLOW ASYNC API *** --- v2: - New HW steering low-level abstract code added. - commit message improvement. - add protection for rte_flow and rte_flow_async callbacks. - rebase to rte_flow_async v9. - fix some rte_flow error not filled bugs. Suanming Mou (14): net/mlx5: introduce hardware steering operation net/mlx5: add HW steering low-level abstract code net/mlx5: introduce hardware steering enable routine net/mlx5: add port flow configuration net/mlx5: add pattern template management net/mlx5: add action template management net/mlx5: add table management net/mlx5: add basic flow queue operation net/mlx5: add flow flush function net/mlx5: add flow jump action net/mlx5: add queue and RSS action net/mlx5: add mark action net/mlx5: add indirect action net/mlx5: add header reformat action doc/guides/nics/mlx5.rst | 19 +- doc/guides/rel_notes/release_22_03.rst | 6 + drivers/net/mlx5/linux/mlx5_flow_os.h | 1 + drivers/net/mlx5/linux/mlx5_os.c | 22 +- drivers/net/mlx5/meson.build | 2 + drivers/net/mlx5/mlx5.c | 55 +- drivers/net/mlx5/mlx5.h | 66 +- drivers/net/mlx5/mlx5_devx.c | 10 + drivers/net/mlx5/mlx5_dr.c | 383 ++++ drivers/net/mlx5/mlx5_dr.h | 456 +++++ drivers/net/mlx5/mlx5_flow.c | 721 ++++++- drivers/net/mlx5/mlx5_flow.h | 287 +++ drivers/net/mlx5/mlx5_flow_dv.c | 186 +- drivers/net/mlx5/mlx5_flow_hw.c | 2335 +++++++++++++++++++++++ drivers/net/mlx5/mlx5_flow_verbs.c | 7 +- drivers/net/mlx5/mlx5_rx.h | 9 +- drivers/net/mlx5/mlx5_rxq.c | 85 +- drivers/net/mlx5/windows/mlx5_flow_os.h | 1 + 18 files changed, 4471 insertions(+), 180 deletions(-) create mode 100644 drivers/net/mlx5/mlx5_dr.c create mode 100644 drivers/net/mlx5/mlx5_dr.h create mode 100644 drivers/net/mlx5/mlx5_flow_hw.c -- 2.25.1