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 D416143787; Mon, 25 Dec 2023 11:25:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E972C402DA; Mon, 25 Dec 2023 11:24:55 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id 64AAD402C6 for ; Mon, 25 Dec 2023 11:24:54 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F6tbnaYthq8dxjge6lWB2lqFyLR94x7V60+GHVcx1P6nsCgCwW1YrCZw13ZUFNEMcDF1yNm1CCe4BbKemO+ajSBHca3gIWyVbFRoWhi7YShvJLKnwuBmggiXXcQyJRY7Kq5a+4OKQMjmfXGmfGcDoqUWEjoCW9pEILsqOfOmLYBC4zaWsCtThumdnHkKj9n1WNI1OoRXT190uogcXX8y6b+LrdFcAiDlirjLMyMsRgRpkGtTZatBml+rf2vf3sFC177X79n2I8eKQfUf91SiQpnTZ82Z322x9nJqVUo4EhZAGtxEbrDFRfc5Q4886BRYWnVDLLiE36AxPbQ/RSK+PA== 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=7FXrOaiDtQssVtIWiW4UnoJKkpt3m/D0g5GzGu/4y0s=; b=NbHJffrRmaBXkEgDQ6aacs22S1TycqdQln/0Rh5HI98Xj3BLTMN5Cqn+GTpKs4MfdAiiyXbFneyBhS4WbOERm2/e/+JJkG/FWL6XzVBAmeoKGvLcUwR1tXymVCQWyaTlLlqpso3KXSfE7SGimPYRO6VtLn8YUOUWpkJlrCnc3Q99M/M9mPO/TrAHfhkthd6J/CKA3dgQyZXAf7fbwj+/NMRu5gAINZbK3FVZAqyXm6AprZ16X768Mo0Oty+ZjxIhY0NQyuo1BJHbvPKHuUG29/sDeqtEAjoqMjhpen5irNGSW3NusOhdix3K1ImwSltEP+nzmn73F5ELJPanCPgLQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) 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=7FXrOaiDtQssVtIWiW4UnoJKkpt3m/D0g5GzGu/4y0s=; b=Lxfq30vKXNo/PMZWrWPpFRTpMliQBgRte2/hJM+xuG+U/Nlv99mCGe51xpXMbBar9pBYftNBKnLw9ltyQ/hcOXXt+mDgc4RpL/UjIBPSDfxzqwGzUA8bkGcbtvT9F4cXVOAGn1rn8rRkOKHx64zM6z5AXU4jV+VqCqJLLKAEWDC36FSBQ9FOSucZJjdjF8kA1hLNtnJS+IopbIHzFFGNk9hXBIhYGlpqw51VxNJWDBbLZVxqjRXe81HOQHo3ZaPu3hZwxZ5Je1zpnUn0GoYy+ceitxE6faCRYme0/wz/gSAOKLJ8SfJkv21J46ekBolsRF79aJtc2G9zyfTE9CRSDg== Received: from BYAPR04CA0005.namprd04.prod.outlook.com (2603:10b6:a03:40::18) by MN6PR12MB8489.namprd12.prod.outlook.com (2603:10b6:208:474::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.26; Mon, 25 Dec 2023 10:24:51 +0000 Received: from SJ1PEPF00001CE1.namprd05.prod.outlook.com (2603:10b6:a03:40:cafe::1f) by BYAPR04CA0005.outlook.office365.com (2603:10b6:a03:40::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.26 via Frontend Transport; Mon, 25 Dec 2023 10:24:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by SJ1PEPF00001CE1.mail.protection.outlook.com (10.167.242.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.14 via Frontend Transport; Mon, 25 Dec 2023 10:24:50 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 25 Dec 2023 02:24:48 -0800 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 25 Dec 2023 02:24:47 -0800 Received: from nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41 via Frontend Transport; Mon, 25 Dec 2023 02:24:46 -0800 From: Michael Baum To: CC: Matan Azrad , Dariusz Sosnowski , Raslan Darawsheh , Viacheslav Ovsiienko , Ori Kam , Suanming Mou Subject: [PATCH v4 2/2] net/mlx5: add random item support Date: Mon, 25 Dec 2023 12:24:35 +0200 Message-ID: <20231225102435.2419716-3-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231225102435.2419716-1-michaelba@nvidia.com> References: <20231214151248.1654878-1-michaelba@nvidia.com> <20231225102435.2419716-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: SJ1PEPF00001CE1:EE_|MN6PR12MB8489:EE_ X-MS-Office365-Filtering-Correlation-Id: f56faddb-a209-4a7c-3847-08dc0533b9ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /LlxoO6R2ai16kCdhiyd30R4mkwDr99AI6engl5krJlksPz8ApwcqmWVdQ2pJy0WKsfJ5FxLUxG5G485ENn7XqgMFP3JPOZBOYrsi+aIY1J9vS93CZwKxNKh6kolmh/zW3Wi3yyRjG8FnjnIEuC/2Z+6i5xrE/5ZbMS5wdxjsee86Q9XeTbZULATCcRzf8hDzd6l3T0xMnkmwX7bfRXaKSH6C6kemJRH6wYMVTC7W+RWYdiOYmwsFrAy8PUkRfBNPTvk2ErpPS+5TzyxXDeAtLZIDTgkiTrgY1Eln/VXRXRcZw1YdIunFyLuUPTU7+NfuGSskVVDkFSKlDvXXpdYgocubpSinAAB4MHIxpPuZLRnEBwzplmZKZgloHGa2sv44NSpAeBhHM4eY9D47uH+ERXoZ9ZdJlKSP3hG3IrIX7IcFT382vGlndXCEC1w8Z0PGAB4zObrDv28Ao5YRyqSUI2hcOliZLQDQ/7P8H09SdH1AMuBe4dKTohmn9tAoLiJwmRcClsDTBFv8eayIXqjGSwzK/GrvI2y8e/15/xS1xLmqM8kiJWIDVqNXrNija7DksugzGcw+UY1rcqhXPr0L9QOgteNmM3bAJSqyDI6GI8c0qXtIydnCxZ6VxOAzrK0MSNEHxXaxc8t/vxW30qU2uGXvL5flyJmz4uDPgvA7a46dfT5zMuWLrNCiM0j1m83rN4cK93/qLVyEqLqiKJ14u8uJ+pEa6WBHRXX4IVpi9YRcKW7EcXjS38tAXoOAlDs X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(396003)(39860400002)(376002)(346002)(136003)(230922051799003)(451199024)(1800799012)(82310400011)(186009)(64100799003)(46966006)(40470700004)(36840700001)(47076005)(7636003)(356005)(36860700001)(41300700001)(86362001)(6286002)(1076003)(107886003)(55016003)(26005)(336012)(426003)(36756003)(2616005)(83380400001)(40480700001)(40460700003)(82740400003)(478600001)(6916009)(316002)(70586007)(6666004)(70206006)(7696005)(54906003)(8676002)(8936002)(5660300002)(4326008)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Dec 2023 10:24:50.1437 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f56faddb-a209-4a7c-3847-08dc0533b9ff X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00001CE1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR12MB8489 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 | 3 +++ drivers/net/mlx5/mlx5_flow_dv.c | 5 +++++ drivers/net/mlx5/mlx5_flow_hw.c | 5 +++++ 5 files changed, 23 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 6b52fb93c5..971c229850 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 @@ -564,6 +565,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`` @@ -770,6 +772,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 819cef7f20..93e58b55ca 100644 --- a/doc/guides/rel_notes/release_24_03.rst +++ b/doc/guides/rel_notes/release_24_03.rst @@ -60,6 +60,9 @@ New Features * Added ``RTE_FLOW_ITEM_TYPE_RANDOM`` to match random value. * Added ``RTE_FLOW_FIELD_RANDOM`` to represent it in field API. +* **Updated NVIDIA mlx5 net driver.** + + * 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 115d730317..67a44095d7 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -5396,6 +5396,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 da873ae2e2..af4e9abd89 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -5047,6 +5047,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, @@ -6807,6 +6811,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