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 5FB07430CE; Tue, 22 Aug 2023 11:05:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 25D1E42FB2; Tue, 22 Aug 2023 11:05:35 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2075.outbound.protection.outlook.com [40.107.237.75]) by mails.dpdk.org (Postfix) with ESMTP id D610A4021D for ; Tue, 22 Aug 2023 11:05:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h0GZgndaZeSirZQ3DmWEPYQm9hnamz3VLLIwlKumv6JcQX0uf0XFSJpdNVjb/v6gdz2BF/uJ1ArGdOof3dUWCgsGgJYDXPzJ3fhjaNYYZspYC3jnhv+oQB+F7rqpDuHKif0OXg7FtcVQ1U+QfQvHSVbi2oBe9e2Joo7e6qRTgcjmAazPEpoMf3KLkwIyxWgkajYRo+F/UQN6Md9MV1kWd2YIGN0n6sLEKCjyFKYuAOWy98xeSjcWHhwLa2oNXly6teGshNIg9zS/McRekk4RRA9/iMNjMumA5HC2p1bBHJK/ykAOhxgTd8Zwntr0jp2PQFXEeOr+qlIZ+i3DiU4cVg== 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=nHQEl5a1BULvRtAU71IHLUcvEOrCgu/n3LUDSlvnU8s=; b=RKuGPEF98L2zsTiA/xFxN/kAZMacf6EA76NAUGLjl0epXMPDZmyzaJWA7BsMDbQ9Iahy4R3zVVy9qXBtRAUGhmULqXG537iuvqzZqmvTIRlXM5RESFZU38TDiv2QBidqxHmOL5qSgGReasayE8j6H5WgnEJ0cYC4KALGjOpstr2saAaRjiSS4H7epcw55JU3W+OGMMoh6+/nHo+OXXtuaQM4J8Q6Q4NOkBKV50DovByUbI7sMDo2wKlO7tj6qIHX8ygo+J4LabDvFSMXr/o4mfaM55A42ZzEWWqNEWBZam/pv688yEju69yj1KyDTOgUNzXzylrYZawl6kS7WQb+hA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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=nHQEl5a1BULvRtAU71IHLUcvEOrCgu/n3LUDSlvnU8s=; b=cOLH5pmah98YCu7uPSo40QQojZG8ArTIsJyEkYHoo4Wj4iaaQddgD5JL2c3bsJPA47lQIwzs3I0qev1VUV/p2IF/05VBW7qg0+5DY2ofvd3Rt6gOt1AkUtNxVxKaavzaWfwtZU53kxxTKtOJ4YSB8xvJ8/Kz+PbtnjosipleP9gADdysOsaiLcC+ZKPdUKRZha3esDdWGTj90VwlO8NW7yYbx0dhk5zZqQe/E4XQLSFVl+6oLGllQPW57EpgahkOx6tBu2v+qYIxhHLsRZcNHRSnYHl+y93qkobsi3NZzG18OlZFfkRNuUKi/DAy59O0q156MIeTP6J4yPl//+2XIw== Received: from CY5PR15CA0242.namprd15.prod.outlook.com (2603:10b6:930:66::18) by SA3PR12MB7974.namprd12.prod.outlook.com (2603:10b6:806:307::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Tue, 22 Aug 2023 09:05:31 +0000 Received: from CY4PEPF0000E9CF.namprd03.prod.outlook.com (2603:10b6:930:66:cafe::83) by CY5PR15CA0242.outlook.office365.com (2603:10b6:930:66::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Tue, 22 Aug 2023 09:05:31 +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 CY4PEPF0000E9CF.mail.protection.outlook.com (10.167.241.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Tue, 22 Aug 2023 09:05:30 +0000 Received: from rnnvmail205.nvidia.com (10.129.68.10) 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.5; Tue, 22 Aug 2023 02:05:18 -0700 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Tue, 22 Aug 2023 02:05:18 -0700 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37 via Frontend Transport; Tue, 22 Aug 2023 02:05:16 -0700 From: Michael Baum To: CC: Ori Kam , Aman Singh , "Yuying Zhang" , Ferruh Yigit , "Thomas Monjalon" Subject: [PATCH v1 1/2] ethdev: add random item support Date: Tue, 22 Aug 2023 12:05:04 +0300 Message-ID: <20230822090505.3242455-2-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230822090505.3242455-1-michaelba@nvidia.com> References: <20230822090505.3242455-1-michaelba@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9CF:EE_|SA3PR12MB7974:EE_ X-MS-Office365-Filtering-Correlation-Id: c3fd1959-8747-4ca9-1ed1-08dba2eeef95 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: knzdymEQHVQ04+O9M7+l5T2x77Aik+5GRb/AailVIoUftY0jZf5sRABulIpqXcdALlaz3X9ApiC4MoXSzzqWGzxnwX7xXnmb2WYd4mRnWiSlTbR8cW7mx00b7cqXLUXwZssF9hjC78c85BWF0ehxapVQNRgrYaFlre0gvelpI9u+jgGXq07Ch4ukBsGgokAsOpDFdHuwf2/F9gxu4fVy6TikEdQTsZlaGUskIaCHIVpmYkagM9/K52Rulk9e4rXp+CGd2B+AZeNLSmOWQkSQx6MyeBxZEU1YseUOSxox1H3JxQCrbOnGoQXSQv+yUUlfPQKxxfAqAg69UayZvyLbGTUL6vuzDM9z2QYI4fqc/cMarMwz2gOhB7wFwaZLXWX032Xh6n5US8wFRPKxYPU47K/mR0KKJ3sZIl4CmA69Hi5rp6t4D3TZ+Yjy7Ap/bU7R1Kksm7Dy5aTZxOfj2PpnHX65GnoKRmYDCzd6TzbhCg3O9usJVm17ilgL2BtEElRBFgiE0xCkO83Ro4WhJrsNBwP55G9BR4phFXc046KO7EUZ3a+2x6TiGf0v2ZK6j6QV+1umal0qtUtypE8QyVNr9pqnfGuUgK+1D1C1PdJXBHtcwDZljgNhosYHwHhyooSNUv3uCVWQM2gIgipsv6x0mxwOxnU/KG5nEyovTL3zhO7zrczSEBDO8eOEhqRKnhLqRZYo6Rp5yWbXk+D5IRbeoWBMFwt4t13Ol4NfjgnmTz+clM4oeK1v6ftQtW3qy9fU 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:(13230031)(4636009)(396003)(136003)(39860400002)(376002)(346002)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(6916009)(70586007)(70206006)(316002)(8936002)(8676002)(2616005)(4326008)(7636003)(1076003)(40460700003)(41300700001)(36756003)(82740400003)(356005)(478600001)(55016003)(6666004)(40480700001)(2906002)(83380400001)(36860700001)(86362001)(47076005)(7696005)(426003)(336012)(5660300002)(26005)(6286002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 09:05:30.7406 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c3fd1959-8747-4ca9-1ed1-08dba2eeef95 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: CY4PEPF0000E9CF.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7974 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 Add support for a new item type "RTE_FLOW_ITEM_TYPE_RANDOM". This item enables to match on some random value as a part of flow rule. Signed-off-by: Michael Baum --- doc/guides/nics/features/default.ini | 1 + doc/guides/prog_guide/rte_flow.rst | 11 +++++++++ doc/guides/rel_notes/release_23_11.rst | 4 ++++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 33 ++++++++++++++++++++++++++ 5 files changed, 50 insertions(+) diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini index 2011e97127..0a790dafe8 100644 --- a/doc/guides/nics/features/default.ini +++ b/doc/guides/nics/features/default.ini @@ -139,6 +139,7 @@ pppoes = pppoe_proto_id = quota = raw = +random = represented_port = sctp = tag = diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 5bc998a433..5ad699dff7 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -1566,6 +1566,17 @@ Matches an InfiniBand base transport header in RoCE packet. - ``hdr``: InfiniBand base transport header definition (``rte_ib.h``). +Item: ``RANDOM`` +^^^^^^^^^^^^^^^^ + +Matches a random value. + +This value is not based on the packet data/headers. +Application shouldn't assume that this value is kept during the life time of +the packet. + +- ``value``: Random value. + Actions ~~~~~~~ diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst index 4411bb32c1..1e90bf83e7 100644 --- a/doc/guides/rel_notes/release_23_11.rst +++ b/doc/guides/rel_notes/release_23_11.rst @@ -72,6 +72,10 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Added flow matching of Infiniband BTH.** + + Added ``RTE_FLOW_ITEM_RANDOM`` to match random value. + Removed Items ------------- diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 271d854f78..51db3e5aec 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -136,6 +136,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = { sizeof(struct rte_flow_item_icmp6_nd_opt_tla_eth)), MK_FLOW_ITEM(MARK, sizeof(struct rte_flow_item_mark)), MK_FLOW_ITEM(META, sizeof(struct rte_flow_item_meta)), + MK_FLOW_ITEM(RANDOM, sizeof(struct rte_flow_item_random)), MK_FLOW_ITEM(TAG, sizeof(struct rte_flow_item_tag)), MK_FLOW_ITEM(GRE_KEY, sizeof(rte_be32_t)), MK_FLOW_ITEM(GRE_OPTION, sizeof(struct rte_flow_item_gre_opt)), diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 2ebb76dbc0..b5228b293c 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -688,6 +688,19 @@ enum rte_flow_item_type { * @see struct rte_flow_item_ib_bth. */ RTE_FLOW_ITEM_TYPE_IB_BTH, + + /** + * [META] + * + * Matches a random value. + * + * This value is not based on the packet data/headers. + * Application shouldn't assume that this value is kept during the life + * time of the packet. + * + * @see struct rte_flow_item_random. + */ + RTE_FLOW_ITEM_TYPE_RANDOM, }; /** @@ -2031,6 +2044,25 @@ static const struct rte_flow_item_ib_bth rte_flow_item_ib_bth_mask = { }; #endif +/** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * + * RTE_FLOW_ITEM_TYPE_RANDOM + * + * Matches a random value. + */ +struct rte_flow_item_random { + uint32_t value; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_RANDOM. */ +#ifndef __cplusplus +static const struct rte_flow_item_random rte_flow_item_random_mask = { + .value = UINT32_MAX, +}; +#endif + /** * Matching pattern item definition. * @@ -3875,6 +3907,7 @@ enum rte_flow_field_id { RTE_FLOW_FIELD_GENEVE_OPT_CLASS,/**< GENEVE option class. */ RTE_FLOW_FIELD_GENEVE_OPT_DATA, /**< GENEVE option data. */ RTE_FLOW_FIELD_MPLS, /**< MPLS header. */ + RTE_FLOW_FIELD_RANDOM /**< Random value. */ }; /** -- 2.25.1