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 DBB3C439C1; Thu, 25 Jan 2024 13:37:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5342242DFD; Thu, 25 Jan 2024 13:37:41 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2057.outbound.protection.outlook.com [40.107.243.57]) by mails.dpdk.org (Postfix) with ESMTP id 44EB042DF2 for ; Thu, 25 Jan 2024 13:37:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FdUbeMeGRL2BlI8j1YkvrMAs9M8pI377Mqc/NlNZ/NlNjKqUKLg+MdbA6AWuhl43DKBF+mP+DecwIAaGuIsGXZQfPyzfXIPJGQRu9kFItKpFMaFhk0oDrOV2UZr+BNK6dGIAx6Smb0arZOJy3/GSikp3JogbH018TE+vaZseb3PsG7tMU5WHvR2w2SoDOIdaS/UXuPaSyX+a7vN6x7BkE4JQd1OTGQutMMxufI6EFSbGwwuXKInlzdMpDla/l9nJMDTozymFvxzIyyJQV8dVkmEioORSv9GZQIu/j1wqZKRm81cjw9OWLxOfbKcvM2VR7Du59eRuG25tmafTUucCQg== 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=LCOcETh0rLuxwdNu2Fa63K+R+MPQbL7GlYNCZCXKK4U=; b=Nk8Jh2ZrUsxbxFse9si/vQkHwbGE+yI0S7sD8j7LqhetGsAf9qWhew2CLvhSBfdjzOGR+WrHhhJrklwfyJmTtzhiE9NRSoQKPpL9aOm44Lr1Flo3EPAit6HV3hkEG/bZBitwSf57srMXhMsfQTCnBvTI0s2baVIxCRd9QWZLaMqaZg6zLke3o6LIIi9ZgUUCFE5vnDcNfI9lHJXiBUIe/rmU89t5UnEPKAEo+khcaP3jLvikCezU+rmNthszpPJeM56W4urRmNl43xIX2EAD9dDvv5DQtmLlQoy5JjrCGxefEnNpnR5pOMHK4q48pSj6+ibmqUWTekp7d/yw/SWKrQ== 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 (0) 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=LCOcETh0rLuxwdNu2Fa63K+R+MPQbL7GlYNCZCXKK4U=; b=koHqwxCEfo66IGFTXlcP+1e2V7YHfOZ7oVYi8NZgYy3mETpizLYiIrGCLUSioDUSwopA8m9GSKvRYRJ3UmJoPXdUv/hFOJRtPmKF+/ltVDJ+snpwlQinD4S0PNY80s9F0mmog+cTweYTbEixpBGPfEIzUcwZjYu7Rf/OHYv4/SAw7jfIuj8mzvjWizg+aEiClVqjrf2Xz5nAlxnDSh5/ua+0Bsx4cIouhrDBInMTUuImJ0ysyLsQSbWbNlwvQ5ipdfX2XlBQ09GfZ5UpxFvqpgou0rjWdDd8PyJNYDh0L1bu4nqAqSvjtX4KW4QM6FIWnf2gF4Fu+lGftFhAIMMd9w== Received: from DS7PR06CA0035.namprd06.prod.outlook.com (2603:10b6:8:54::9) by CY8PR12MB8216.namprd12.prod.outlook.com (2603:10b6:930:78::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.26; Thu, 25 Jan 2024 12:37:38 +0000 Received: from DS2PEPF00003445.namprd04.prod.outlook.com (2603:10b6:8:54:cafe::c) by DS7PR06CA0035.outlook.office365.com (2603:10b6:8:54::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.26 via Frontend Transport; Thu, 25 Jan 2024 12:37:38 +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 DS2PEPF00003445.mail.protection.outlook.com (10.167.17.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.16 via Frontend Transport; Thu, 25 Jan 2024 12:37:37 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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.41; Thu, 25 Jan 2024 04:37:21 -0800 Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 25 Jan 2024 04:37:20 -0800 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.41 via Frontend Transport; Thu, 25 Jan 2024 04:37:18 -0800 From: Michael Baum To: CC: Matan Azrad , Dariusz Sosnowski , Raslan Darawsheh , Viacheslav Ovsiienko , Ori Kam , Suanming Mou Subject: [PATCH v5 2/2] net/mlx5: add random item support Date: Thu, 25 Jan 2024 14:37:08 +0200 Message-ID: <20240125123708.571526-3-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240125123708.571526-1-michaelba@nvidia.com> References: <20231225102435.2419716-1-michaelba@nvidia.com> <20240125123708.571526-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: DS2PEPF00003445:EE_|CY8PR12MB8216:EE_ X-MS-Office365-Filtering-Correlation-Id: 151675e4-e00e-4cf8-d37e-08dc1da26a0a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cDDMFrFGC/fFuH2G89Rxx1Wk65RL1VvqRG5azMyoXuYmKscQhWJBBRTXph1La98zq2v3tPlTRalpOYNx66vJX3cp9LpGg8y/cBED0aEQ55ykKPqO2RzCc9F5JgRHGnXis90RGE18fvnWKI/9pLfrkwKynG4+z5cYMOzNjQg4NYh2BFNLH+ukRDUhHQagh0OpBjBQr5Xfv2So2xYA0gezT3R7rTGqVSS0MrcBJIA5FZGxiJx3cp/Dh9o1EzsDsBzbDD5fbw2JITW93ZLkTLBYqr/54RcEir6xhB6nehSBMPXFHSvjU5LDrJcH3+Zlqxbytyro2+yV4zi3qMB8XmuqVsDkhKiKxdk4lJo5J2lCChBI/mGX2IBsll1plBQiXv2dF+Go4mdCdZetvwRqNea44GqIVn9bk+fQWIXTW6CAJB5gQQJVHVAsybWiyrCbkFCAkqI/2tRrMmPg7qzi3DKaanvL6LbKDdlOJr2D+DvTZotmyI+OKPkxzKmDLqNj4ffcpgQ09Y46U1H5RyqG0+X8rD7o7R16fZrvSW4BSjLMuBcUoXAsam/kC1aQ610JGw8fCF2cri+lJ4N2N/DE41pah6dxe5fZtv+U5jR9+KDyRNQba1EU0jgItmGYICR2QQmb4/sUYQC7VubJ7YFtnOdcXhywyBGmjcC/QPzkI76qQCAFpjpJevdM2u7XJSuWDGXrpBh5Ec1YVih7FHXR3ZuOY2hFg5JXZSpyABhxtwaMSNCOMOs9QjGMLgcvM6cogjIu 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:(13230031)(4636009)(376002)(346002)(136003)(396003)(39860400002)(230922051799003)(186009)(451199024)(64100799003)(82310400011)(1800799012)(40470700004)(46966006)(36840700001)(83380400001)(41300700001)(47076005)(336012)(426003)(6286002)(26005)(2616005)(1076003)(107886003)(7636003)(82740400003)(356005)(36860700001)(8936002)(8676002)(4326008)(5660300002)(478600001)(2906002)(7696005)(6666004)(54906003)(6916009)(70586007)(316002)(70206006)(36756003)(86362001)(55016003)(40480700001)(40460700003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2024 12:37:37.9207 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 151675e4-e00e-4cf8-d37e-08dc1da26a0a 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: DS2PEPF00003445.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8216 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 random item in HWS mode. Signed-off-by: Michael Baum Acked-by: Dariusz Sosnowski --- doc/guides/nics/features/mlx5.ini | 1 + doc/guides/nics/mlx5.rst | 9 +++++++++ doc/guides/rel_notes/release_24_03.rst | 1 + drivers/net/mlx5/mlx5_flow_dv.c | 5 +++++ drivers/net/mlx5/mlx5_flow_hw.c | 5 +++++ 5 files changed, 21 insertions(+) diff --git a/doc/guides/nics/features/mlx5.ini b/doc/guides/nics/features/mlx5.ini index 0739fe9d63..6261b7d657 100644 --- a/doc/guides/nics/features/mlx5.ini +++ b/doc/guides/nics/features/mlx5.ini @@ -88,6 +88,7 @@ port_id = Y port_representor = Y ptype = Y quota = Y +random = Y tag = Y tcp = Y udp = Y diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index 27384d5a86..f8930cb902 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -167,6 +167,7 @@ Features - Sub-Function. - Matching on represented port. - Matching on aggregated affinity. +- Matching on random value. Limitations @@ -571,6 +572,7 @@ Limitations - Modification of the MPLS header is supported only in HWS and only to copy from, the encapsulation level is always 0. - Modification of the 802.1Q Tag, VXLAN Network or GENEVE Network ID's is not supported. + - Modify field action using ``RTE_FLOW_FIELD_RANDOM`` is not supported. - Encapsulation levels are not supported, can modify outermost header fields only. - Offsets cannot skip past the boundary of a field. - If the field type is ``RTE_FLOW_FIELD_MAC_TYPE`` @@ -777,6 +779,13 @@ Limitations - In HW steering (``dv_flow_en`` = 2): - not supported on guest port. +- Match on random value: + + - Supported only with HW Steering enabled (``dv_flow_en`` = 2). + - Supported only in table with ``nb_flows=1``. + - NIC ingress/egress flow in group 0 is not supported. + - Supports matching only 16 bits (LSB). + - During live migration to a new process set its flow engine as standby mode, the user should only program flow rules in group 0 (``fdb_def_rule_en=0``). Live migration is only supported under SWS (``dv_flow_en=1``). diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst index 5e545da867..a1dfea263c 100644 --- a/doc/guides/rel_notes/release_24_03.rst +++ b/doc/guides/rel_notes/release_24_03.rst @@ -75,6 +75,7 @@ New Features * Added support for VXLAN-GPE matching in HW Steering flow engine (``dv_flow_en`` = 2). + * Added support for ``RTE_FLOW_ITEM_TYPE_RANDOM`` flow item. Removed Items ------------- diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index bc0572a763..88b5c20758 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -5496,6 +5496,11 @@ flow_dv_validate_action_modify_field(struct rte_eth_dev *dev, RTE_FLOW_ERROR_TYPE_ACTION, action, "modifications of the MPLS header " "is not supported"); + if (dst_data->field == RTE_FLOW_FIELD_RANDOM || + src_data->field == RTE_FLOW_FIELD_RANDOM) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, action, + "modifications of random value is not supported"); if (dst_data->field == RTE_FLOW_FIELD_MARK || src_data->field == RTE_FLOW_FIELD_MARK) if (config->dv_xmeta_en == MLX5_XMETA_MODE_LEGACY || diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 48b70c0c29..f06d2ce273 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -5085,6 +5085,10 @@ flow_hw_validate_action_modify_field(struct rte_eth_dev *dev, return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, action, "modifying vlan_type is not supported"); + if (flow_hw_modify_field_is_used(action_conf, RTE_FLOW_FIELD_RANDOM)) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, action, + "modifying random value is not supported"); if (flow_hw_modify_field_is_used(action_conf, RTE_FLOW_FIELD_GENEVE_VNI)) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, action, @@ -6851,6 +6855,7 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev, case RTE_FLOW_ITEM_TYPE_FLEX: case RTE_FLOW_ITEM_TYPE_IB_BTH: case RTE_FLOW_ITEM_TYPE_PTYPE: + case RTE_FLOW_ITEM_TYPE_RANDOM: break; case RTE_FLOW_ITEM_TYPE_INTEGRITY: /* -- 2.25.1