From patchwork Thu Jan 25 13:30:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Baum X-Patchwork-Id: 136164 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6F720439C1; Thu, 25 Jan 2024 14:33:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3488A42E91; Thu, 25 Jan 2024 14:31:52 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2088.outbound.protection.outlook.com [40.107.102.88]) by mails.dpdk.org (Postfix) with ESMTP id 3061642E7B for ; Thu, 25 Jan 2024 14:31:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cNZlk2Bwn2nahYmX50S+oe2S6oqQuWL8+IOx/UAdwsBuZ1Mcj2Uk51MAiYUzK87ySi23/9lN7Y6N5OE0LU0r6IKH654xBGi8GFY9GRv1VQi6qJBYpBICQ12WUISbM0ClNFlovn9Q0MwaXlBbZVF4z8WU2enVJBT0NI2uNcWxBCqcsCz4uUJ6prqDWPeDcsUpEQkA6liZSHJPkX4czJPj3sidEWjwUqsiHQBtrnHDsqN+J6T2hyCbQCnVbUcmd8WIpNiRyFhnfFOigRe2FzcTdxUWt+Hzup+pVRPqxNt8a1vOal3bOTzvpZTGoCjYdgAyd33CsXVpn2/iiEyHQ2y6Yw== 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=kHlMv5hTV5mJ9pfz8J8vVK07GsFKD/AvM5ksTwyNdfE=; b=CQUQ+h1NgjykJqaFzl0j/61B+Gc13FyYCydZ1lKeH8EXsiya0Quz0AXM3jbwmbFgndr6MYhNCILi7KOoBKR38qUkZgnbcyDpVhrRF1WUu8GWpNRErOjucr4h30lfhT6oJEBnXVN1YiC+YVAeiRkvra1Aum/5KIHP2Y/RBDfApoQDToo5graF988rR/iE5cAadkdvHA438f6DUu07KeR8fl7koc/veArpAjpeq/ihVZMq1kQd2Qmmqhy3z/BylTlhtiitpjYtzd717VyAYEQViyvIkRhD6LVn9JqcLUZ/J7zoGzc+9ZmZZ1XBd9K0qMB3XcRNoeTaHImtPUCuM7Vtmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) 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=kHlMv5hTV5mJ9pfz8J8vVK07GsFKD/AvM5ksTwyNdfE=; b=n4hZXVgtWbW5tjEkgM3H/w2GKUDGRxRyeIYY5ADWneYM+oiyxq2Baj6krFqE7BF74VkRtdFcRcoLjiAVsTe3fHNi/isTdoPRq2ahK0WmJH98EE7Et9vl5CDO6pY3EApom2OQlfV2oI4vecUwzKlqjd9z1MB3T969BiSmY2m/WLVq+xt5WXQYhB8S7w+70EuFN67klYfxtIV+0b8C3Cop7yZMQoQv3Lp2CWl/rVl9UCHFY3gtwg4iimeFfcoOywA21O7GGywK5MdOtgNZy1GKcvm2jdNW8n0/oH8bzj/IGi4YCqR3da6pECgzsim80zULLv25dPsWxlnUbMejq5g/Cg== Received: from CY5PR17CA0052.namprd17.prod.outlook.com (2603:10b6:930:12::30) by DM4PR12MB8449.namprd12.prod.outlook.com (2603:10b6:8:17f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Thu, 25 Jan 2024 13:31:46 +0000 Received: from CY4PEPF0000EDD7.namprd03.prod.outlook.com (2603:10b6:930:12:cafe::7f) by CY5PR17CA0052.outlook.office365.com (2603:10b6:930:12::30) 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 13:31:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) 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.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by CY4PEPF0000EDD7.mail.protection.outlook.com (10.167.241.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.16 via Frontend Transport; Thu, 25 Jan 2024 13:31:45 +0000 Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) 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 05:31:40 -0800 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail203.nvidia.com (10.126.190.182) 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 05:31:39 -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; Thu, 25 Jan 2024 05:31:37 -0800 From: Michael Baum To: CC: Matan Azrad , Raslan Darawsheh , Dariusz Sosnowski , Viacheslav Ovsiienko , Ori Kam , Suanming Mou Subject: [PATCH v2 20/23] net/mlx5: add GENEVE option support for profile 0 Date: Thu, 25 Jan 2024 15:30:40 +0200 Message-ID: <20240125133043.575860-21-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240125133043.575860-1-michaelba@nvidia.com> References: <20231203112543.844014-1-michaelba@nvidia.com> <20240125133043.575860-1-michaelba@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD7:EE_|DM4PR12MB8449:EE_ X-MS-Office365-Filtering-Correlation-Id: c4b07c4a-9db1-4c5d-355a-08dc1da9f9eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kvcCNAQCzdVisHxRnyJ8r918crzgocCdo3FOKIh44/LRqrG0qZw1HootrisnZ7Kr8jhSmUjWiFtuTtQ0RmZeWS+qUSYiCMvR3nY4AV7qgIZKGVlGh4jg6YxflVWaG1S8ZYVnRWFWIMcnBMwu9aj8edRbfyuk5N7BGvzJvBhfHJ/ptg3OKJkbV4wJ2i8U2svC0uVRTCwtJjQD1+JsWcOKwHzNztLCGDOfLr95RytBAYa3j96YmAhD4nPWy1oc7kKP3lH5bZUCya4B9xZataNceFb7j0QEPUdF3yPNafef2nMwLuSWz5i3+XD+4dafFCqPVWEB7JLP+98RDoG649qin11GEHU8ytLHkxf2MfBCLuIj+I9mLTyT/F9G+xMefkYOLGXUVKhVgN6ez1kPqvcfSBD74L28RsHqTyw2QflOjnlVtHRvUvXZFHsdvWRbAxUSw7vAgBTqpn98GbpAZIgArl8eEWngF/CyZqVbC7FTUYwv/z8qmO75V1tVr183cbo3Iz9tSRA3yDt7Y+Uct+lu2fN63L7RdtvpOAoFdyMLMuwKVvjsL23XJxFJlxGsQqY8VkTELW8AhkDVRQBATcT6y7RdX5sAFd25qcclBRcdhVEzP14MGCnwGXrGBHv2kWQqbesv5h0dKo2D/dEOuZV6TQSBEe0/sILx/Pw2kID/MKSIA60aNZD11mOKE0VSwI6ys7UcOQxApLLV3WaIO/2kVO4oF8dKCBvtZ3Z4hL9tVW0vUWB6+qi7UhzhQJzNrhiA X-Forefront-Antispam-Report: CIP:216.228.118.233; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge2.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(376002)(136003)(346002)(39860400002)(396003)(230922051799003)(451199024)(64100799003)(1800799012)(186009)(82310400011)(46966006)(36840700001)(40470700004)(40460700003)(55016003)(40480700001)(1076003)(54906003)(70586007)(5660300002)(316002)(6916009)(36860700001)(426003)(8676002)(70206006)(26005)(6666004)(4326008)(8936002)(6286002)(336012)(2616005)(30864003)(107886003)(83380400001)(2906002)(47076005)(356005)(7636003)(478600001)(36756003)(41300700001)(86362001)(82740400003)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2024 13:31:45.8450 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c4b07c4a-9db1-4c5d-355a-08dc1da9f9eb 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.233]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000EDD7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB8449 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 matching and modifying GENEVE option for FLEX_PARSER_PROFILE_ENABLE=0. Before this patch it is supported when FLEX_PARSER_PROFILE_ENABLE=8 in HW steering and when FLEX_PARSER_PROFILE_ENABLE=0 in SW steering. Signed-off-by: Michael Baum Acked-by: Suanming Mou --- doc/guides/nics/mlx5.rst | 9 ++- doc/guides/platform/mlx5.rst | 6 +- drivers/net/mlx5/mlx5_flow_geneve.c | 114 +++++++++++++++++++++------- 3 files changed, 95 insertions(+), 34 deletions(-) diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index 62fd27d859..a6d00ecd2b 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -355,6 +355,7 @@ Limitations - Multiple of same Geneve TLV option isn't supported at the same pattern template. - Supported only when ``FLEX_PARSER_PROFILE_ENABLE`` = 8. + - Supported also when ``FLEX_PARSER_PROFILE_ENABLE`` = 0 for single DW only. - VF: flow rules created on VF devices can only match traffic targeted at the configured MAC addresses (see ``rte_eth_dev_mac_addr_add()``). @@ -2445,8 +2446,14 @@ Limitations ~~~~~~~~~~~ * Supported only in HW steering (``dv_flow_en`` = 2). -* Supported only when ``FLEX_PARSER_PROFILE_ENABLE`` = 8. * Supported for FW version **xx.37.0142** and above. +* Parser creation can be done only for E-Switch manager. +* Supported for multiple DW only when ``FLEX_PARSER_PROFILE_ENABLE`` = 8. +* Supported for single DW also when ``FLEX_PARSER_PROFILE_ENABLE`` = 0 with some limitations: + + - ``sample_len`` must be equal to ``option_len`` and not bigger than 1. + - ``match_on_class_mode`` different than 1 is not supported. + - ``offset`` must be 0. Testpmd driver specific commands diff --git a/doc/guides/platform/mlx5.rst b/doc/guides/platform/mlx5.rst index d16508d0da..a66cf778d1 100644 --- a/doc/guides/platform/mlx5.rst +++ b/doc/guides/platform/mlx5.rst @@ -536,12 +536,10 @@ Below are some firmware configurations listed. or FLEX_PARSER_PROFILE_ENABLE=1 -- enable Geneve TLV option flow matching in SW steering:: +- enable Geneve TLV option flow matching:: FLEX_PARSER_PROFILE_ENABLE=0 - -- enable Geneve TLV option flow matching in HW steering:: - + or FLEX_PARSER_PROFILE_ENABLE=8 - enable GTP flow matching:: diff --git a/drivers/net/mlx5/mlx5_flow_geneve.c b/drivers/net/mlx5/mlx5_flow_geneve.c index 2c8dc39e74..f3ee414d02 100644 --- a/drivers/net/mlx5/mlx5_flow_geneve.c +++ b/drivers/net/mlx5/mlx5_flow_geneve.c @@ -18,6 +18,8 @@ #define MAX_GENEVE_OPTION_TOTAL_DATA_SIZE \ (MAX_GENEVE_OPTION_DATA_SIZE * MAX_GENEVE_OPTIONS_RESOURCES) +#define INVALID_SAMPLE_ID (UINT8_MAX) + /** * Single DW inside GENEVE TLV option. */ @@ -265,6 +267,8 @@ mlx5_geneve_tlv_options_unregister(struct mlx5_priv *priv, * Pointer to header layout structure to update. * @param resource * Pointer to single sample context to fill. + * @param sample_id + * The flex parser id for single DW or UINT8_MAX for multiple DWs. * * @return * 0 on success, a negative errno otherwise and rte_errno is set. @@ -274,7 +278,7 @@ mlx5_geneve_tlv_option_create_sample(void *ctx, struct mlx5_devx_geneve_tlv_option_attr *attr, struct mlx5_devx_match_sample_info_query_attr *query_attr, struct mlx5_hl_data *match_data, - struct mlx5_geneve_tlv_resource *resource) + struct mlx5_geneve_tlv_resource *resource, uint8_t sample_id) { struct mlx5_devx_obj *obj; int ret; @@ -282,7 +286,10 @@ mlx5_geneve_tlv_option_create_sample(void *ctx, obj = mlx5_devx_cmd_create_geneve_tlv_option(ctx, attr); if (obj == NULL) return -rte_errno; - ret = mlx5_devx_cmd_query_geneve_tlv_option(ctx, obj, query_attr); + if (sample_id == INVALID_SAMPLE_ID) + ret = mlx5_devx_cmd_query_geneve_tlv_option(ctx, obj, query_attr); + else + ret = mlx5_devx_cmd_match_sample_info_query(ctx, sample_id, query_attr); if (ret) { claim_zero(mlx5_devx_cmd_destroy(obj)); return ret; @@ -335,20 +342,22 @@ should_configure_sample_for_dw0(const struct rte_pmd_mlx5_geneve_tlv *spec) * Pointer to user configuration. * @param option * Pointer to single GENEVE TLV option to fill. + * @param sample_id + * The flex parser id for single DW or UINT8_MAX for multiple DWs. * * @return * 0 on success, a negative errno otherwise and rte_errno is set. */ static int mlx5_geneve_tlv_option_create(void *ctx, const struct rte_pmd_mlx5_geneve_tlv *spec, - struct mlx5_geneve_tlv_option *option) + struct mlx5_geneve_tlv_option *option, uint8_t sample_id) { struct mlx5_devx_geneve_tlv_option_attr attr = { .option_class = spec->option_class, .option_type = spec->option_type, .option_data_len = spec->option_len, .option_class_ignore = spec->match_on_class_mode == 1 ? 0 : 1, - .offset_valid = 1, + .offset_valid = sample_id == INVALID_SAMPLE_ID ? 1 : 0, }; struct mlx5_devx_match_sample_info_query_attr query_attr = {0}; struct mlx5_geneve_tlv_resource *resource; @@ -356,12 +365,14 @@ mlx5_geneve_tlv_option_create(void *ctx, const struct rte_pmd_mlx5_geneve_tlv *s int ret; if (should_configure_sample_for_dw0(spec)) { + MLX5_ASSERT(sample_id == INVALID_SAMPLE_ID); attr.sample_offset = 0; resource = &option->resources[resource_id]; ret = mlx5_geneve_tlv_option_create_sample(ctx, &attr, &query_attr, &option->match_data[0], - resource); + resource, + INVALID_SAMPLE_ID); if (ret) return ret; resource_id++; @@ -379,7 +390,8 @@ mlx5_geneve_tlv_option_create(void *ctx, const struct rte_pmd_mlx5_geneve_tlv *s ret = mlx5_geneve_tlv_option_create_sample(ctx, &attr, &query_attr, &option->match_data[i], - resource); + resource, + sample_id); if (ret) goto error; resource_id++; @@ -467,6 +479,8 @@ mlx5_geneve_tlv_option_copy(struct rte_pmd_mlx5_geneve_tlv *dst, * A list of GENEVE TLV options to create parser for them. * @param nb_options * The number of options in TLV list. + * @param sample_id + * The flex parser id for single DW or UINT8_MAX for multiple DWs. * * @return * A pointer to GENEVE TLV options parser structure on success, @@ -475,7 +489,7 @@ mlx5_geneve_tlv_option_copy(struct rte_pmd_mlx5_geneve_tlv *dst, static struct mlx5_geneve_tlv_options * mlx5_geneve_tlv_options_create(struct mlx5_dev_ctx_shared *sh, const struct rte_pmd_mlx5_geneve_tlv tlv_list[], - uint8_t nb_options) + uint8_t nb_options, uint8_t sample_id) { struct mlx5_geneve_tlv_options *options; const struct rte_pmd_mlx5_geneve_tlv *spec; @@ -495,7 +509,7 @@ mlx5_geneve_tlv_options_create(struct mlx5_dev_ctx_shared *sh, for (i = 0; i < nb_options; ++i) { spec = &tlv_list[i]; ret = mlx5_geneve_tlv_option_create(sh->cdev->ctx, spec, - &options->options[i]); + &options->options[i], sample_id); if (ret < 0) goto error; /* Copy the user list for comparing future configuration. */ @@ -705,6 +719,12 @@ mlx5_is_same_geneve_tlv_options(const struct mlx5_geneve_tlv_options *options, return true; } +static inline bool +multiple_dws_supported(struct mlx5_hca_attr *attr) +{ + return attr->geneve_tlv_option_offset && attr->geneve_tlv_sample; +} + void * mlx5_geneve_tlv_parser_create(uint16_t port_id, const struct rte_pmd_mlx5_geneve_tlv tlv_list[], @@ -715,8 +735,7 @@ mlx5_geneve_tlv_parser_create(uint16_t port_id, struct rte_eth_dev *dev; struct mlx5_priv *priv; struct mlx5_hca_attr *attr; - uint8_t total_dws = 0; - uint8_t i; + uint8_t sample_id; /* * Validate the input before taking a lock and before any memory @@ -742,34 +761,71 @@ mlx5_geneve_tlv_parser_create(uint16_t port_id, return NULL; } attr = &priv->sh->cdev->config.hca_attr; - MLX5_ASSERT(MAX_GENEVE_OPTIONS_RESOURCES <= - attr->max_geneve_tlv_options); - if (!attr->geneve_tlv_option_offset || !attr->geneve_tlv_sample || - !attr->query_match_sample_info || !attr->geneve_tlv_opt) { - DRV_LOG(ERR, "Not enough capabilities to support GENEVE TLV parser, maybe old FW version"); + if (!attr->query_match_sample_info || !attr->geneve_tlv_opt) { + DRV_LOG(ERR, "Not enough capabilities to support GENEVE TLV parser, is this device eswitch manager?"); rte_errno = ENOTSUP; return NULL; } - if (nb_options > MAX_GENEVE_OPTIONS_RESOURCES) { + DRV_LOG(DEBUG, "Max DWs supported for GENEVE TLV option is %u", + attr->max_geneve_tlv_options); + if (nb_options > attr->max_geneve_tlv_options) { DRV_LOG(ERR, "GENEVE TLV option number (%u) exceeds the limit (%u).", - nb_options, MAX_GENEVE_OPTIONS_RESOURCES); + nb_options, attr->max_geneve_tlv_options); rte_errno = EINVAL; return NULL; } - for (i = 0; i < nb_options; ++i) { - if (mlx5_geneve_tlv_option_validate(attr, &tlv_list[i]) < 0) { - DRV_LOG(ERR, "GENEVE TLV option %u is invalid.", i); + if (multiple_dws_supported(attr)) { + uint8_t total_dws = 0; + uint8_t i; + + MLX5_ASSERT(attr->max_geneve_tlv_options >= MAX_GENEVE_OPTIONS_RESOURCES); + for (i = 0; i < nb_options; ++i) { + if (mlx5_geneve_tlv_option_validate(attr, &tlv_list[i]) < 0) { + DRV_LOG(ERR, "GENEVE TLV option %u is invalid.", i); + return NULL; + } + total_dws += mlx5_geneve_tlv_option_get_nb_dws(&tlv_list[i]); + } + if (total_dws > MAX_GENEVE_OPTIONS_RESOURCES) { + DRV_LOG(ERR, + "Total requested DWs (%u) exceeds the limit (%u).", + total_dws, MAX_GENEVE_OPTIONS_RESOURCES); + rte_errno = EINVAL; return NULL; } - total_dws += mlx5_geneve_tlv_option_get_nb_dws(&tlv_list[i]); - } - if (total_dws > MAX_GENEVE_OPTIONS_RESOURCES) { - DRV_LOG(ERR, - "Total requested DWs (%u) exceeds the limit (%u).", - total_dws, MAX_GENEVE_OPTIONS_RESOURCES); - rte_errno = EINVAL; - return NULL; + /* Multiple DWs is supported, each of the has sample ID given later. */ + sample_id = INVALID_SAMPLE_ID; + DRV_LOG(DEBUG, "GENEVE TLV parser supports multiple DWs, FLEX_PARSER_PROFILE_ENABLE == 8"); + } else { + const struct rte_pmd_mlx5_geneve_tlv *option = &tlv_list[0]; + + if (option->offset != 0) { + DRV_LOG(ERR, + "GENEVE TLV option offset %u is required but not supported.", + option->offset); + rte_errno = ENOTSUP; + return NULL; + } + if (option->sample_len != option->option_len) { + DRV_LOG(ERR, + "GENEVE TLV option length (%u) should be equal to sample length (%u).", + option->option_len, option->sample_len); + rte_errno = ENOTSUP; + return NULL; + } + if (option->match_on_class_mode != 1) { + DRV_LOG(ERR, + "GENEVE TLV option match_on_class_mode %u is invalid for flex parser profile 0.", + option->match_on_class_mode); + rte_errno = EINVAL; + return NULL; + } + if (mlx5_geneve_tlv_option_validate(attr, option) < 0) + return NULL; + /* Single DW is supported, its sample ID is given. */ + sample_id = attr->geneve_tlv_option_sample_id; + DRV_LOG(DEBUG, "GENEVE TLV parser supports only single DW, FLEX_PARSER_PROFILE_ENABLE == 0"); } /* Take lock for this physical device and manage the options. */ phdev = mlx5_get_locked_physical_device(priv); @@ -793,7 +849,7 @@ mlx5_geneve_tlv_parser_create(uint16_t port_id, goto exit; } /* Create GENEVE TLV options for this physical device. */ - options = mlx5_geneve_tlv_options_create(priv->sh, tlv_list, nb_options); + options = mlx5_geneve_tlv_options_create(priv->sh, tlv_list, nb_options, sample_id); if (!options) { mlx5_unlock_physical_device(); return NULL;