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 4555543B27; Wed, 14 Feb 2024 08:31:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E17B42FEB; Wed, 14 Feb 2024 08:30:58 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2061.outbound.protection.outlook.com [40.107.220.61]) by mails.dpdk.org (Postfix) with ESMTP id 5587542FA1 for ; Wed, 14 Feb 2024 08:30:56 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ip6Yqnd+78+Rv8K8/e+AVcFThudQKxbf1iqvPKlJr4s9f0CLxktFe6oJcwFjDW0yneai1T4Qd0SwnLd6yFZu8/UwzSQUelnxLlXMLqBWA913qxlAoKvq0hfCjslZbfMCF3qXaKUd/Jx7QL8F9+XjkK63NwYq4E0Ai2kQz8hbQeuzC00ed6F1A59getXRg/jBPiu3z5NH6s+B6udsecaX0FVmV45FZI25np1dxskrOCGKWJZ1UolWl8noHtuSnibicdMRLGdhWXxDI74kHLvLeIow24ukxHEyiuWYq/jndVwfDKAd9bR4PkS5CzHzeoQzfbtWzfzg67EpdR++s1qHrA== 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=bFckA/oUUf7JfVRB5Nm0SJ6+TFYe+8yav6TQK+J7DhM=; b=mwuKS1q+a5KcnztJwq0trHP++Y06+XHDJdeEWLQVgwVZmVBfR0/UU8MF6wa0At+Xgn/ioZdkwjon1lL/C0ya8MytbQ4aPJcR7XdLMTwwyygaeVoZtCxR/6+qf73oy7JFdNTwFrttxCnssGbiZnjGXxIUxVXXiQt+SMe8g9RGnrn74GkypckOk5pD7HNSzNWaF4vV7OxmfBxTh9B3VT0rrC1ggOhSo9uNSxu0gQO0/U55Ve6hRBytagPkVIBFo6BsnLiul8u892qC2dOG2HWes516btZhfPM7SDhAHpAJ0z8iJ9YPucVkbrV7RiWfdruxS1M8kFz9Ic+pDT7kNQignQ== 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=bFckA/oUUf7JfVRB5Nm0SJ6+TFYe+8yav6TQK+J7DhM=; b=YbYA5CAZi4hzU0bOQJmdKEFg/FQH+TkZqFDp3eBUMAgK/u4umxKPyKU6ynIYCZShA3CAhXJRr06LjHL+6hqy+KjcuPRtYhS6gsoy4S2QkHW9UwPKEn6bIhrJPQqK1Qb5VuL2NLlhANxCcoYd06Y0CInb8Adj1u8uYgRL5QE94cdplDQElt+UoKxKtX+wT20iO3qgBQOUmpbUggAUY/8xtmVyIzB4IEh2fDg580l/AwoVQhFaxTlQERZxm9VvSxrFYUJ4V3lOSo2T8GnczghopKzDGrHY8BKtsCahmAKgZ7hE21GkZxIf0+I/EEAIKR3RMyDFXlWLeNAsMKinqJ4iKg== Received: from DM6PR08CA0037.namprd08.prod.outlook.com (2603:10b6:5:1e0::11) by SJ2PR12MB8009.namprd12.prod.outlook.com (2603:10b6:a03:4c7::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Wed, 14 Feb 2024 07:30:53 +0000 Received: from DS1PEPF0001709B.namprd05.prod.outlook.com (2603:10b6:5:1e0:cafe::eb) by DM6PR08CA0037.outlook.office365.com (2603:10b6:5:1e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.40 via Frontend Transport; Wed, 14 Feb 2024 07:30:53 +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 DS1PEPF0001709B.mail.protection.outlook.com (10.167.18.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25 via Frontend Transport; Wed, 14 Feb 2024 07:30:52 +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; Tue, 13 Feb 2024 23:30:35 -0800 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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.1258.12; Tue, 13 Feb 2024 23:30:35 -0800 Received: from nvidia.com (10.127.8.13) by mail.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.1258.12 via Frontend Transport; Tue, 13 Feb 2024 23:30:33 -0800 From: Michael Baum To: CC: Matan Azrad , Dariusz Sosnowski , Raslan Darawsheh , Viacheslav Ovsiienko , Ori Kam , Suanming Mou Subject: [PATCH v5 3/3] net/mlx5/hws: add compare ESP sequence number support Date: Wed, 14 Feb 2024 09:30:15 +0200 Message-ID: <20240214073015.2060103-4-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240214073015.2060103-1-michaelba@nvidia.com> References: <20240207161414.1583125-1-michaelba@nvidia.com> <20240214073015.2060103-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: DS1PEPF0001709B:EE_|SJ2PR12MB8009:EE_ X-MS-Office365-Filtering-Correlation-Id: c1d6fb0a-5f3e-48a3-b50f-08dc2d2ee001 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bUxHewhdq+P4EvLNdgiKkiAMBn1E6W/jGDbPcULwKrztI0r+ou0z8sM3TZ2BfTJy1UlkVWQb04x9QhXZJW1JgyLDhtJXJgJErB7bR3+cKQEZ3Dr5coQaYZ+mKAAlifTc2Zg68Z8XrXa2AL+DfjTxsDvXNWydlD4SKIXz6tEeqG8wDGZHBD42Udj9ULkxSJzcO6ttF7GFlkKspmc5NIzqKunt0FgxGJChJdOE/JgVS2EBNPBfYmIBKYQNnHMrPowxtSwJslK19XEdtI7IwBtx9NrRCqJV2gKXpD9Rtk8YE+bP2kPVrE2xB8It9I555v7ohKtrKPlzMD7SiujBoEt8U8z0pfkg5R2ZjWP/D4fp0eZFQHo3dKZzt/BHvuRWudGkATSvOiM+e8xLPS0W8YVULxe9vk2NdFQLmcrH5WFN69RqFtqNIItckTCCxknHG6OKs410mlR/XndBNvRwB1qI4wzPkAWgPiDAGLkBenzLkBIW6vURDQIZAht+aCIf054bh+v0rZxPdY6YhNRrOgVSdlzv3Y/18IwB1fy6HNVDG8X41We++8BJXFyOwL44U3SrcdnOFXuTGENvFvUJ474jF9qi6TngSaggcgBl8huXj+w= 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)(346002)(136003)(39860400002)(376002)(396003)(230922051799003)(82310400011)(186009)(451199024)(64100799003)(1800799012)(40470700004)(36840700001)(46966006)(6666004)(54906003)(316002)(55016003)(2906002)(5660300002)(70206006)(86362001)(426003)(4326008)(8676002)(8936002)(6916009)(70586007)(7696005)(478600001)(6286002)(26005)(41300700001)(2616005)(107886003)(36756003)(1076003)(83380400001)(7636003)(356005)(336012)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2024 07:30:52.8159 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1d6fb0a-5f3e-48a3-b50f-08dc2d2ee001 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: DS1PEPF0001709B.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8009 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 compare item with "RTE_FLOW_FIELD_ESP_SEQ_NUM" field. Signed-off-by: Michael Baum --- doc/guides/nics/mlx5.rst | 1 + drivers/net/mlx5/hws/mlx5dr_definer.c | 22 ++++++++++++++++++++-- drivers/net/mlx5/mlx5_flow_hw.c | 3 +++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index 43ef8a99dc..b793f1ef58 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -823,6 +823,7 @@ Limitations - Only single item is supported per pattern template. - Only 32-bit comparison is supported or 16-bits for random field. - Only supported for ``RTE_FLOW_FIELD_META``, ``RTE_FLOW_FIELD_TAG``, + ``RTE_FLOW_FIELD_ESP_SEQ_NUM``, ``RTE_FLOW_FIELD_RANDOM`` and ``RTE_FLOW_FIELD_VALUE``. - The field type ``RTE_FLOW_FIELD_VALUE`` must be the base (``b``) field. - The field type ``RTE_FLOW_FIELD_RANDOM`` can only be compared with diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c index 2d86175ca2..b29d7451e7 100644 --- a/drivers/net/mlx5/hws/mlx5dr_definer.c +++ b/drivers/net/mlx5/hws/mlx5dr_definer.c @@ -396,10 +396,20 @@ mlx5dr_definer_compare_base_value_set(const void *item_spec, value = (const uint32_t *)&b->value[0]; - if (a->field == RTE_FLOW_FIELD_RANDOM) + switch (a->field) { + case RTE_FLOW_FIELD_RANDOM: *base = htobe32(*value << 16); - else + break; + case RTE_FLOW_FIELD_TAG: + case RTE_FLOW_FIELD_META: *base = htobe32(*value); + break; + case RTE_FLOW_FIELD_ESP_SEQ_NUM: + *base = *value; + break; + default: + break; + } MLX5_SET(ste_match_4dw_range_ctrl_dw, ctrl, base0, 1); } @@ -2887,6 +2897,14 @@ mlx5dr_definer_conv_item_compare_field(const struct rte_flow_field_data *f, fc->compare_idx = dw_offset; DR_CALC_SET_HDR(fc, random_number, random_number); break; + case RTE_FLOW_FIELD_ESP_SEQ_NUM: + fc = &cd->fc[MLX5DR_DEFINER_FNAME_ESP_SEQUENCE_NUMBER]; + fc->item_idx = item_idx; + fc->tag_set = &mlx5dr_definer_compare_set; + fc->tag_mask_set = &mlx5dr_definer_ones_set; + fc->compare_idx = dw_offset; + DR_CALC_SET_HDR(fc, ipsec, sequence_number); + break; default: DR_LOG(ERR, "%u field is not supported", f->field); goto err_notsup; diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index b5741f0817..4d6fb489b2 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -6725,6 +6725,7 @@ flow_hw_item_compare_field_validate(enum rte_flow_field_id arg_field, switch (arg_field) { case RTE_FLOW_FIELD_TAG: case RTE_FLOW_FIELD_META: + case RTE_FLOW_FIELD_ESP_SEQ_NUM: break; case RTE_FLOW_FIELD_RANDOM: if (base_field == RTE_FLOW_FIELD_VALUE) @@ -6743,6 +6744,7 @@ flow_hw_item_compare_field_validate(enum rte_flow_field_id arg_field, case RTE_FLOW_FIELD_TAG: case RTE_FLOW_FIELD_META: case RTE_FLOW_FIELD_VALUE: + case RTE_FLOW_FIELD_ESP_SEQ_NUM: break; default: return rte_flow_error_set(error, ENOTSUP, @@ -6759,6 +6761,7 @@ flow_hw_item_compare_width_supported(enum rte_flow_field_id field) switch (field) { case RTE_FLOW_FIELD_TAG: case RTE_FLOW_FIELD_META: + case RTE_FLOW_FIELD_ESP_SEQ_NUM: return 32; case RTE_FLOW_FIELD_RANDOM: return 16; -- 2.25.1