[v2,0/4] ethdev: add template table insertion and matching types
Message ID | 20230126232802.3960109-1-akozyrev@nvidia.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> 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 29A1A42498; Fri, 27 Jan 2023 00:28:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1FFF40697; Fri, 27 Jan 2023 00:28:33 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2044.outbound.protection.outlook.com [40.107.244.44]) by mails.dpdk.org (Postfix) with ESMTP id 8C2F3400D7 for <dev@dpdk.org>; Fri, 27 Jan 2023 00:28:32 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ic0X14deDCW7hYWkCbQlzpef4zwQDps6NoE6k0ReZi1zuElySKkVnKKpOw82H4kIwmH5SFIf+/T0IgThcOwmfeQkZai3H+VEB72+nhV9ZidpGtnn4P7m0T81OT+tSt4g6zTrhMUT7BJS3gox6DsMAiZ9x+Y5mmfyWwPeAYwniIG4+Uv+b5NUrUutIt1hdfnJiBLNkwYmp2Vd3Q/rkttXx2ZsrqOMxuJ4Y9Q/xacjDpUpRM3fd3bANpDKUELJjCvewgsyoAQfcozrU0WufQCvhyXN0BAZDKBUDCry/yQiq9fIvxj5DiF+PMPgJlWMIfJD5GVCAZsLudCtbc3/M02Hiw== 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=i1LFAvhX7kqZgvqc5jMMbbtN+Wf4jlE/epvO6Wr5LhM=; b=kFoenWjTT5uCm2KKnFh5VjrtlquoG76frV4cQAG0R3xNhQwDit9R+vANKt0evQ9F1vByWecGt5Q1hfVNmxzV4eTdxPdwKI64+AQ6BFq6vikWTu7YjkLNB55gpzn+SmQA6IxOeme2fXLJV5a64jK8poikn0OcjZZaE5XRsQDyfWltb6MexqXf2DeucL8eKGvxYvAT+2g2CVNIC9TnI4shUOEyPxD/bZXDB8iYKAAnKGASd49MuOrmaMCrf5l1OmhDBkHVKOGDqDbGVtQkVMMetBAnEEgtJsJi/GhpwdjeH35ihp2mSoxs8gqbMjp2KtZub8Cp28acq8jE+0IrANhVUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=i1LFAvhX7kqZgvqc5jMMbbtN+Wf4jlE/epvO6Wr5LhM=; b=V9ItYWgprbRYNL6mzc4krmw1/fmiQhoroFwVK1VSWa/WC1C9Iz+AuPlAUArpQgxxziNoD3LU2L6MEcczJIps/kKIfSzpu4kJG/LAckJj3xNi6j9Kq40XxuXptdUsyFshVen2s/TpSg2BksJujITUHN+ZOWNfF2YAQRpZ5ihIJJJGxdyI+gbs+e64AoU+QbtFHAKaJ2VFNRNVUengNk8W6heGkoq+ml5jyowRVco9dwUkrVboVygghBIiBqthUk5mH8+yBJxto7szGgfONasX3ndwzm68IUkDTRg318s1HjXPaR7Hs11jrgz1VzIHL8hxzegfi84lVl8pfFY2jto9sQ== Received: from BN9PR03CA0576.namprd03.prod.outlook.com (2603:10b6:408:10d::11) by MN2PR12MB4583.namprd12.prod.outlook.com (2603:10b6:208:26e::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Thu, 26 Jan 2023 23:28:30 +0000 Received: from BN8NAM11FT071.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10d:cafe::5) by BN9PR03CA0576.outlook.office365.com (2603:10b6:408:10d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22 via Frontend Transport; Thu, 26 Jan 2023 23:28:30 +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 BN8NAM11FT071.mail.protection.outlook.com (10.13.177.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22 via Frontend Transport; Thu, 26 Jan 2023 23:28:30 +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; Thu, 26 Jan 2023 15:28:23 -0800 Received: from pegasus01.mtr.labs.mlnx (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; Thu, 26 Jan 2023 15:28:21 -0800 From: Alexander Kozyrev <akozyrev@nvidia.com> To: <dev@dpdk.org> CC: <thomas@monjalon.net>, <ferruh.yigit@amd.com>, <andrew.rybchenko@oktetlabs.ru>, <orika@nvidia.com> Subject: [PATCH v2 0/4] ethdev: add template table insertion and matching types Date: Fri, 27 Jan 2023 01:27:58 +0200 Message-ID: <20230126232802.3960109-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.18.2 In-Reply-To: <20230121052158.2928238-1-akozyrev@nvidia.com> References: <20230121052158.2928238-1-akozyrev@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.37] 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: BN8NAM11FT071:EE_|MN2PR12MB4583:EE_ X-MS-Office365-Filtering-Correlation-Id: e640dbd6-5a74-4d48-16c6-08dafff50891 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: MCoXMLXG1p4J/UPTA4g8GYyYE+P57KUEKtKr/D7xAxJzKk7lfS6MYru7fi640B1hD/Bx1pham97aTSE07l81uWSOnS3bZj+t4roEMiSFoLwho+OUxBVIW+4obI9lkJg+9zx4jB2RfqaDJJGe3LnEaVFjsxM43ZBqES1nZTx4antxn+bizSEsJmBa2GwSthZA70p6Ztxi/L8govnBmnyos+pLedtcYJwtgnIlKd+174YDc/egu5V07kHGFRCsMLtOSojDzCl70MgsvlwSLOnvk8NXzBK3qwm3XvVG/KJpffvzUxKk5VLAextctO3tQAfaa9Etw1525AolTKgWfMbHnboHHfPDwoMwqmt9nO5gpW3sugFqH4BHX1nvsERQBtBsL3yMD6Ls2nx4Np3wqbE0QNTNINy8ec0Bj5IPF86XsO98SxZrU8reaDNQqjDMjETbES5tPnunhNYkCF8FIV481flYgvu4LT9d7wNJTtsZED+zvPbERM8TzLWDMvyPRxysAPjpL1thjIwaKv/sz+0jMOgg/vt1Tok+cfcc6ZYW1tIG+Bt+1aYL/9ASKeTf40/yEKYWkAhwYueMB9YtmrEen5R0azLMyDX0ZXy7FKEHo6Run+KfZS3fXQ8OvRfzyWi1SAhTjVuR+/4eI3S3AyQiyZfHPXD8Eh0t2PICWA2EE5fX4J3lIQ7542y91OF/NpHZAtKsI07oqXk/ga1C9M2YEfz7map9fj3Bpib6JnIFE7bmuFtlDfftwnzTGMboYZub1KQUG73MfJKqf0JnjZBDKP5A9sxDQ1GG80rG7AUlh2g= 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)(376002)(396003)(346002)(136003)(39860400002)(451199018)(40470700004)(36840700001)(46966006)(86362001)(356005)(7636003)(36860700001)(82740400003)(8676002)(70586007)(6916009)(41300700001)(5660300002)(8936002)(54906003)(36756003)(4326008)(82310400005)(70206006)(316002)(40480700001)(40460700003)(2906002)(47076005)(426003)(336012)(2616005)(83380400001)(478600001)(966005)(1076003)(16526019)(26005)(6666004)(186003)(107886003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2023 23:28:30.0112 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e640dbd6-5a74-4d48-16c6-08dafff50891 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: BN8NAM11FT071.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4583 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Message
Alexander Kozyrev
Jan. 26, 2023, 11:27 p.m. UTC
Bring more flexibility and control over both flow rule insertion and packet matching mechanisms. Introduce 2 new flow table types: 1. Allow a user to specify the insertion type used in template tables. The insertion type is responsible for choosing the appropriate key value used to map inserted flow rules into a template table. Flow rules can be inserted by calculating the hash value for the pattern or inserted by index via the new create_by_index() API. The idea of the index-based insertion is to avoid additional matches and simply execute predefined actions after jumping to the index. The insertion into an already occupied index results in an error. The old rule must be destroyed first. An index cannot be bigger than the size of the table, otherwise, the rule is rejected as well. 2. Allow a user to specify the hash calculation function used in template tables. The hash calculation type is responsible for the calculation of the flow rule index a packet would hit upon arrival at the table. Control over this is useful for applications with custom RSS algorithms, for example. An application can select various packet fields to serve as a hash calculation source and jump to the appropriate flow rule location. The RSS hash result will be used as the index in the table. For the linear hash function, the mapping is one-to-one and the hash result is the index. For other hash functions, the index is the hash result module table size. The RSS hash result can be retrieved via modify_field API: HASH_RESULT. RFC: https://patchwork.dpdk.org/project/dpdk/patch/20221214022110.393410-1-akozyrev@nvidia.com/ v2: changed the behavior in case of insertion into the same index. Alexander Kozyrev (4): ethdev: add template table insertion type ethdev: add template table hash calculation function app/testpmd: add template table insertion type app/testpmd: add template table hash calculation function app/test-pmd/cmdline_flow.c | 166 +++++++++++++++++++++++-- app/test-pmd/config.c | 10 +- app/test-pmd/testpmd.h | 2 +- doc/guides/prog_guide/rte_flow.rst | 20 +++ doc/guides/rel_notes/release_23_03.rst | 10 ++ lib/ethdev/rte_flow.c | 24 ++++ lib/ethdev/rte_flow.h | 95 ++++++++++++++ lib/ethdev/rte_flow_driver.h | 11 ++ lib/ethdev/version.map | 3 + 9 files changed, 330 insertions(+), 11 deletions(-)