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 AF624430CF; Tue, 22 Aug 2023 12:36:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A30C42D0C; Tue, 22 Aug 2023 12:36:33 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2067.outbound.protection.outlook.com [40.107.92.67]) by mails.dpdk.org (Postfix) with ESMTP id 6CCE340041 for ; Tue, 22 Aug 2023 12:36:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GRqBe66FEPS1TQXCQD/W8CRIbZ4qxep53sgRk1xMqU0guEhZYDpsFHeFS0S/P3DXzKZBdu4Ec/jzYSG+zOmT4I+GDQVqqE0jJ74NiEjkZ5HQ8+RcF0Jk4T0RGGJudP3dB7HITQU2rERvV875P4EoWuoHz5U+nNvCkzCe/+/0mHyIyJz0KKmwZ8ptYsJ2+nCWm5v8Iifeq50dmURqj2fmHaHPJkKqO2ytZ0sEYt916lKASKkfMuiKCk8ds1h00mJv52XGCFatdpmN5r/P/VUEF0v1lPjN18Bo+lj4sJAYp2vsZXdXiUeIz2TiA60MVeuaBWq2Rt44iVXrH/swZ3VOMw== 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=0fXpyAfFlQejenIJtVHs6kzDExwCx8qAKaLXvIwIAwo=; b=UlFh295rSQYGXLB6h2pJ3Q1PmSiwMQKgDUacfrChr9KTnQbmXSd439ts5pICSHQ/mw1/noQcmPtrR09ZjjFMchAKiSdMrExiLQyCYelRr+OxfOTxZnUGmxOyINuv5tu9GPyCWXkzIF31FE2aGJvOb9HOJxGcGx5STNNfTIrjqWxYN5ZMgtZsH4gr3zQ2wNWG7uoxqGYxr9lCgJWTL6LzZOlzlP15phqoY7URVaA+EI5IGOoz3m7EhYDIw7Od1BuTc+4cs2GDuJIlxJltS3KAgy0PRygw200sib6ZA5KMWddgTxoldJrXPSjXQY3h2/XOR16pCtCcQHLBrsOOPZnIMw== 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=0fXpyAfFlQejenIJtVHs6kzDExwCx8qAKaLXvIwIAwo=; b=B5CwM2jWXmwj25NDpaRYS6lM3CvIhd4GewofDtz2dYylREBOInctjsJv4Z0FUTXd+1cIrB9viOqXcsoQxeWauZSp1xKsnM+hVWBTRjnS6V/YHrki2TryKSlRtITnDaj4U1zPIy3Lsg/7DXPilU6vbXkGpBipisNQuOrVVnQt/W56K2Aks7guNH4K6fdWxz08SQlN4WvvHG7ap7Klfo2C5aqFJuF1Gy3XWnpL5Z72VVmf4hHvhZ4fzbGlYxnQb72IdbJV06WD4Pf1oPmXacapS3lLl/DCsdXPToOLlD8/6NrG5V7tS9mIKWiZ4Ij92YuHh8NtskO+1T8pQODYw8ppmA== Received: from CY5PR19CA0090.namprd19.prod.outlook.com (2603:10b6:930:83::13) by MN2PR12MB4454.namprd12.prod.outlook.com (2603:10b6:208:26c::18) 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 10:36:28 +0000 Received: from CY4PEPF0000EE33.namprd05.prod.outlook.com (2603:10b6:930:83:cafe::ae) by CY5PR19CA0090.outlook.office365.com (2603:10b6:930:83::13) 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 10:36:28 +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 CY4PEPF0000EE33.mail.protection.outlook.com (10.167.242.39) 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 10:36:28 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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 03:36:16 -0700 Received: from rnnvmail202.nvidia.com (10.129.68.7) 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.37; Tue, 22 Aug 2023 03:36:15 -0700 Received: from nvidia.com (10.127.8.13) by mail.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.37 via Frontend Transport; Tue, 22 Aug 2023 03:36:14 -0700 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , Viacheslav Ovsiienko , Ori Kam , Suanming Mou Subject: [PATCH 2/2] net/mlx5: add random item support Date: Tue, 22 Aug 2023 13:36:00 +0300 Message-ID: <20230822103600.3247680-3-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230822103600.3247680-1-michaelba@nvidia.com> References: <20230822103600.3247680-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: CY4PEPF0000EE33:EE_|MN2PR12MB4454:EE_ X-MS-Office365-Filtering-Correlation-Id: 2dfae625-7bd8-40fd-cbb0-08dba2fba478 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JfB9Or8XHt+55vv+Jdv39oALkrudagALTLJ8Pwp9bCUyxSTdEgHAwb/xQP4mmp3XTSgYk5UbGf3zkusUMHUyh57NPcda5eFsRcoYysLqA1tivPdlScztqLGFKrfLah0l9oXimBEFRYrnCqnHrawWbav/f3M7pCY4bSt/2W3Rl8Uo8gqA/mu+GjgzdJA+YlG60vbkG5NNl4qI5dEQOWy3ugwN9cIFkaUMD58hnGGPJ93Zna6SpHCJO2tGKLXAkIT2Bv+K0bSuCqChoXVzqXsWaJGVMcnbw+x6Q7oi3aBOslaXikRbsqntYZVMkZ66VAT18iaypzpsluqzxQM6Pq32Q8TFgiArQ8ocn8MItMKlN7/mi3V872BcGQ7zIhbJe7hqgMck9rw8OWulv+fES1c8zbXTt5cYVRs/2AVEZrLlx5bq7taYy82tiZz+E3gIqzT2YNkLYCqffCzl4dZgP8AuPOglL3dVSGgP+mwBeXcQhVtTrVPR4o9B6T1LxLo5uHpNspdLepA/7Syp6yVdnLcro1za+yYQ4Bc51y/yQhk0hqzJKlNNEVkMtarG2lXJG4opQUxiSyIoAhQPJ6LiVYwPQc29z+pR+4hWlGTv124lVolZcB9FPd7J+ch4ZAj6mdyIEriy+X++vvJTfuF40KhAV5NU9J4TSd7jvUQqHwxo+CKTwaA86shpgHgl3B+E3Pcl1fhNUxCtJXI/HZHoA3BdY4emLWXRyfDBf8PprguCKL2hsCKqQ62pKB/UuY+OTYA5 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)(376002)(346002)(39860400002)(1800799009)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(6916009)(70206006)(70586007)(316002)(8676002)(8936002)(2616005)(107886003)(4326008)(7636003)(40460700003)(36756003)(41300700001)(1076003)(82740400003)(356005)(478600001)(6666004)(55016003)(40480700001)(83380400001)(2906002)(86362001)(7696005)(47076005)(36860700001)(336012)(426003)(5660300002)(26005)(6286002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2023 10:36:28.1990 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2dfae625-7bd8-40fd-cbb0-08dba2fba478 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: CY4PEPF0000EE33.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4454 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 --- doc/guides/nics/features/mlx5.ini | 1 + doc/guides/nics/mlx5.rst | 10 +++++++++- doc/guides/rel_notes/release_23_11.rst | 4 ++++ drivers/net/mlx5/mlx5_flow_dv.c | 5 +++++ drivers/net/mlx5/mlx5_flow_hw.c | 5 +++++ 5 files changed, 24 insertions(+), 1 deletion(-) diff --git a/doc/guides/nics/features/mlx5.ini b/doc/guides/nics/features/mlx5.ini index c0e0b779cf..5606f435f2 100644 --- a/doc/guides/nics/features/mlx5.ini +++ b/doc/guides/nics/features/mlx5.ini @@ -86,6 +86,7 @@ nvgre = Y port_id = Y port_representor = 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 eac67a7864..f754fab3e1 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -165,7 +165,7 @@ Features - Sub-Function. - Matching on represented port. - Matching on aggregated affinity. - +- Matching on random value. Limitations ----------- @@ -554,6 +554,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`` @@ -712,6 +713,13 @@ Limitations - The NIC egress flow rules on representor port are not supported. +- Match on random value: + + - Supported only with HW Steering enabled (``dv_flow_en`` = 2). + - Supported only in table with ``nb_flows=1``. + - NIC ingress 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_23_11.rst b/doc/guides/rel_notes/release_23_11.rst index 1e90bf83e7..8a4c04ed75 100644 --- a/doc/guides/rel_notes/release_23_11.rst +++ b/doc/guides/rel_notes/release_23_11.rst @@ -76,6 +76,10 @@ New Features Added ``RTE_FLOW_ITEM_RANDOM`` to match random value. +* **Updated NVIDIA mlx5 net driver.** + + * Added support for random value matching. + Removed Items ------------- diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index a8dd9920e6..1238d00073 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -5385,6 +5385,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 5395969eb0..6fe6103a37 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -3893,6 +3893,10 @@ flow_hw_validate_action_modify_field(const struct rte_flow_action *action, return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, action, "modifying Geneve VNI 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"); /* Due to HW bug, tunnel MPLS header is read only. */ if (action_conf->dst.field == RTE_FLOW_FIELD_MPLS) return rte_flow_error_set(error, EINVAL, @@ -5375,6 +5379,7 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev, case RTE_FLOW_ITEM_TYPE_ESP: case RTE_FLOW_ITEM_TYPE_FLEX: case RTE_FLOW_ITEM_TYPE_IB_BTH: + case RTE_FLOW_ITEM_TYPE_RANDOM: break; case RTE_FLOW_ITEM_TYPE_INTEGRITY: /* -- 2.25.1