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 A51A1A00C2; Fri, 14 Oct 2022 13:49:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F271C42DC4; Fri, 14 Oct 2022 13:49:28 +0200 (CEST) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 93A6242D9B for ; Fri, 14 Oct 2022 13:49:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fgX0kJby9ZU4uG3vJz7krmki2vbcyDpLg9jUrnaWBMq8ArBiymN+j1UcHPrWqVF36flsL/qnSROzSPtb1pprSq4w5ACVmfgiNWydvx6OMZnN2aVIdB/4zQKabsXAZ4xJave5U/fAwdrWb/q7Bkdi79TF6bmBTMjGh4UgTjRn0fYlvRTWto4GcHCbGx4+E0dc5bQhPGDfD6NazNq9iIFhuPWK5r8tOHgCEbL1NeUj2xDevvtlKNkR/L02IVQ9q/OyU+fLLRGivE/fi9E8z7BD6JH6ESGvv4kmwT+6ru9LT+IqoqQuxCFbEBts7IKDXX/ohCHIZ7X+iDQHWMvrcCa3tw== 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=J2UavE2EvxDfpLpM3opcXBSsgdeY552Wbfd8sBVxQgY=; b=lpCvI6SXzVg3EggZyH48GQSNICx4bI4Jg83JtD/ICyFaLS6hr5ocZGY+m6Tp7gG9Fn5iDgVsl8qzDLIactq+9zUTdoOaeYORF0rOWtcLWGi7zuGeTeB2WQehmPuMJYzqNxqv0WJr7tD8ul7QRRyPj483YZrxKmGMat551BzenIIG3cVtn7Wan1++d0K1CCNF/dznRKO9qTFTq+7pGQzEOhL1yFBAyZgM5rRBofJAn8s7XjiSVL7Oda3aX7OaWXoU2+fKrUnD1rQwVLYh8VeB3MvbECMTGInkVVy4mgbmxq5yKWhrYvBdSBWAYX+kQjDA+AfrbWAtzMF1O8NwqSPUCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=monjalon.net 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=J2UavE2EvxDfpLpM3opcXBSsgdeY552Wbfd8sBVxQgY=; b=PNHWBgKNT2i1Csu3igU4VSHPwciN1ivMt7hNpseNZjyY1YXYfG64i+y4tkrR0vTlruNyOzSeQFPlakZkQpZcubZQ+35JREdMoe2aTrFwH6Qx4A/pXhJbkJIUl6I1Y5zs2fbZ34nIgE6bI6ggKnC0sqLQzn9EC2Qoj/Wrv5VkDQuGKiT7OoAHYRqX+L2a9kbEeI6+ntQIXYFoZmS8LnijZ7JzCNEO2kvypmWbmbbFLprI2/gEWh7ZIDIp54h92K+cuIv2xTFaMMRjxXPb8MFGwLog2bd+/8Yfyy0BDtJEVmqsZQlgnZXI3ENphUFyJc3WWqu3DNV0SzfbjZyRdiW/KA== Received: from BN9PR03CA0206.namprd03.prod.outlook.com (2603:10b6:408:f9::31) by MW5PR12MB5621.namprd12.prod.outlook.com (2603:10b6:303:193::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.26; Fri, 14 Oct 2022 11:49:23 +0000 Received: from BN8NAM11FT069.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f9:cafe::57) by BN9PR03CA0206.outlook.office365.com (2603:10b6:408:f9::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.30 via Frontend Transport; Fri, 14 Oct 2022 11:49:23 +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 BN8NAM11FT069.mail.protection.outlook.com (10.13.176.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.20 via Frontend Transport; Fri, 14 Oct 2022 11:49:23 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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.26; Fri, 14 Oct 2022 04:49:08 -0700 Received: from nvidia.com (10.126.230.35) 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.29; Fri, 14 Oct 2022 04:49:05 -0700 From: Alex Vesker To: , , , , Matan Azrad CC: , Subject: [v3 03/18] net/mlx5: add hardware steering item translation function Date: Fri, 14 Oct 2022 14:48:18 +0300 Message-ID: <20221014114833.13389-4-valex@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20221014114833.13389-1-valex@nvidia.com> References: <20220922190345.394-1-valex@nvidia.com> <20221014114833.13389-1-valex@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT069:EE_|MW5PR12MB5621:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c693ee3-9277-4655-c5b8-08daadda2345 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GKiUXle6VIKHwPAUrJ6huwGCzBBkzCV5YIz5MuHq9eTc2mxw/Usc5U13jrdmcJBTOFzEkXmn/X/riJmOgRrFujvltDaIm9jn5vwmUEU6n1QX12el0g52ljpl3okmc3SnfonbdxsgCXHqhx2to7C3pIsDmrX1DdhMxcSkEWyu84j+kp2OgwThJSc/xWwyhc/To8Q8sJHEC3l3EgxHbJAo76nT08NpK2YmynRYEGstqZn/0ck+37QdpR191X7sAKq7sad2uLRJgpzC13xnjDoslHHI+p+30a4ht36n29Gz9xprnufQ0sF3A7JXWV+cL+pjIK8F6GYSnS5tVmRyuv7RCTo0J9DGNLsfvuHX4ZKzKq60NfAFoVneT7mBxwJj86L1DRJufJCfkwp6e4JNaoYS2Mz168OvN3W5YhsQelzItBFX/ilvcHizMaYDLQz2hxkQwCqSERbT4nm4fSSM3wsvKyA5WIC0h5x9VQJsW+6pTmum/91slg61Xh7nbLvaWGKcS0soYeI8YmcCkmJr93LFz/QCTS+AUmySttM9cT962FggHVRBBrsftCbiOAAMNq0nwNtVazsymk4uHfDAW0vJdTUdrvUYeEhGzE6qV7Xx1GLLTs5wzd96SdCBDAiT1T6LswcIyhEw3EbXTlZRvrRAW7VeVSMYRwRbvkbG1jczDzCTJhBGI+j9WFORrA8cN/wEZIsFwS8LjIbp5WNV2wre+EdzCUoqGCkSGRfYJpqkMpfzSni6xk0or3XznXIsA0kBst8poQF6cdiDVMMrA/y0kw== 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:(13230022)(4636009)(136003)(376002)(39860400002)(396003)(346002)(451199015)(46966006)(40470700004)(36840700001)(316002)(2906002)(36756003)(86362001)(426003)(36860700001)(47076005)(8936002)(186003)(6666004)(40480700001)(5660300002)(41300700001)(107886003)(4326008)(336012)(40460700003)(55016003)(83380400001)(7696005)(6286002)(70206006)(2616005)(1076003)(70586007)(16526019)(8676002)(26005)(7636003)(82310400005)(356005)(478600001)(6636002)(54906003)(110136005)(82740400003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2022 11:49:23.0566 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c693ee3-9277-4655-c5b8-08daadda2345 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: BN8NAM11FT069.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR12MB5621 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 From: Suanming Mou As hardware steering root table flows still work under FW steering mode. This commit provides shared item tranlsation code for hardware steering root table flows. Signed-off-by: Suanming Mou --- drivers/net/mlx5/mlx5_flow.c | 10 +-- drivers/net/mlx5/mlx5_flow.h | 52 ++++++++++++- drivers/net/mlx5/mlx5_flow_dv.c | 134 ++++++++++++++++++++++++-------- 3 files changed, 155 insertions(+), 41 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index e4744b0a67..81bed6f6a3 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -7108,7 +7108,7 @@ mlx5_flow_create_devx_sq_miss_flow(struct rte_eth_dev *dev, uint32_t txq) struct rte_flow_item_port_id port_spec = { .id = MLX5_PORT_ESW_MGR, }; - struct mlx5_rte_flow_item_tx_queue txq_spec = { + struct mlx5_rte_flow_item_sq txq_spec = { .queue = txq, }; struct rte_flow_item pattern[] = { @@ -7118,7 +7118,7 @@ mlx5_flow_create_devx_sq_miss_flow(struct rte_eth_dev *dev, uint32_t txq) }, { .type = (enum rte_flow_item_type) - MLX5_RTE_FLOW_ITEM_TYPE_TX_QUEUE, + MLX5_RTE_FLOW_ITEM_TYPE_SQ, .spec = &txq_spec, }, { @@ -7504,16 +7504,16 @@ mlx5_ctrl_flow_source_queue(struct rte_eth_dev *dev, .egress = 1, .priority = 0, }; - struct mlx5_rte_flow_item_tx_queue queue_spec = { + struct mlx5_rte_flow_item_sq queue_spec = { .queue = queue, }; - struct mlx5_rte_flow_item_tx_queue queue_mask = { + struct mlx5_rte_flow_item_sq queue_mask = { .queue = UINT32_MAX, }; struct rte_flow_item items[] = { { .type = (enum rte_flow_item_type) - MLX5_RTE_FLOW_ITEM_TYPE_TX_QUEUE, + MLX5_RTE_FLOW_ITEM_TYPE_SQ, .spec = &queue_spec, .last = NULL, .mask = &queue_mask, diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 2ebb8496f2..288e09d5ba 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -28,7 +28,7 @@ enum mlx5_rte_flow_item_type { MLX5_RTE_FLOW_ITEM_TYPE_END = INT_MIN, MLX5_RTE_FLOW_ITEM_TYPE_TAG, - MLX5_RTE_FLOW_ITEM_TYPE_TX_QUEUE, + MLX5_RTE_FLOW_ITEM_TYPE_SQ, MLX5_RTE_FLOW_ITEM_TYPE_VLAN, MLX5_RTE_FLOW_ITEM_TYPE_TUNNEL, }; @@ -95,7 +95,7 @@ struct mlx5_flow_action_copy_mreg { }; /* Matches on source queue. */ -struct mlx5_rte_flow_item_tx_queue { +struct mlx5_rte_flow_item_sq { uint32_t queue; }; @@ -159,7 +159,7 @@ enum mlx5_feature_name { #define MLX5_FLOW_LAYER_GENEVE (1u << 26) /* Queue items. */ -#define MLX5_FLOW_ITEM_TX_QUEUE (1u << 27) +#define MLX5_FLOW_ITEM_SQ (1u << 27) /* Pattern tunnel Layer bits (continued). */ #define MLX5_FLOW_LAYER_GTP (1u << 28) @@ -196,6 +196,9 @@ enum mlx5_feature_name { #define MLX5_FLOW_ITEM_PORT_REPRESENTOR (UINT64_C(1) << 41) #define MLX5_FLOW_ITEM_REPRESENTED_PORT (UINT64_C(1) << 42) +/* Meter color item */ +#define MLX5_FLOW_ITEM_METER_COLOR (UINT64_C(1) << 44) + /* Outer Masks. */ #define MLX5_FLOW_LAYER_OUTER_L3 \ (MLX5_FLOW_LAYER_OUTER_L3_IPV4 | MLX5_FLOW_LAYER_OUTER_L3_IPV6) @@ -1006,6 +1009,18 @@ flow_items_to_tunnel(const struct rte_flow_item items[]) return items[0].spec; } +/* HW steering flow attributes. */ +struct mlx5_flow_attr { + uint32_t port_id; /* Port index. */ + uint32_t group; /* Flow group. */ + uint32_t priority; /* Original Priority. */ + /* rss level, used by priority adjustment. */ + uint32_t rss_level; + /* Action flags, used by priority adjustment. */ + uint32_t act_flags; + uint32_t tbl_type; /* Flow table type. */ +}; + /* Flow structure. */ struct rte_flow { uint32_t dev_handles; @@ -1766,6 +1781,32 @@ mlx5_translate_tunnel_etypes(uint64_t pattern_flags) int flow_hw_q_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error); + +/* + * Convert rte_mtr_color to mlx5 color. + * + * @param[in] rcol + * rte_mtr_color. + * + * @return + * mlx5 color. + */ +static inline int +rte_col_2_mlx5_col(enum rte_color rcol) +{ + switch (rcol) { + case RTE_COLOR_GREEN: + return MLX5_FLOW_COLOR_GREEN; + case RTE_COLOR_YELLOW: + return MLX5_FLOW_COLOR_YELLOW; + case RTE_COLOR_RED: + return MLX5_FLOW_COLOR_RED; + default: + break; + } + return MLX5_FLOW_COLOR_UNDEFINED; +} + int mlx5_flow_group_to_table(struct rte_eth_dev *dev, const struct mlx5_flow_tunnel *tunnel, uint32_t group, uint32_t *table, @@ -2122,4 +2163,9 @@ int mlx5_flow_get_item_vport_id(struct rte_eth_dev *dev, bool *all_ports, struct rte_flow_error *error); +int flow_dv_translate_items_hws(const struct rte_flow_item *items, + struct mlx5_flow_attr *attr, void *key, + uint32_t key_type, uint64_t *item_flags, + uint8_t *match_criteria, + struct rte_flow_error *error); #endif /* RTE_PMD_MLX5_FLOW_H_ */ diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 0589cafc30..0cf757898d 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -216,31 +216,6 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr, attr->valid = 1; } -/* - * Convert rte_mtr_color to mlx5 color. - * - * @param[in] rcol - * rte_mtr_color. - * - * @return - * mlx5 color. - */ -static inline int -rte_col_2_mlx5_col(enum rte_color rcol) -{ - switch (rcol) { - case RTE_COLOR_GREEN: - return MLX5_FLOW_COLOR_GREEN; - case RTE_COLOR_YELLOW: - return MLX5_FLOW_COLOR_YELLOW; - case RTE_COLOR_RED: - return MLX5_FLOW_COLOR_RED; - default: - break; - } - return MLX5_FLOW_COLOR_UNDEFINED; -} - struct field_modify_info { uint32_t size; /* Size of field in protocol header, in bytes. */ uint32_t offset; /* Offset of field in protocol header, in bytes. */ @@ -7342,8 +7317,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, return ret; last_item = MLX5_FLOW_ITEM_TAG; break; - case MLX5_RTE_FLOW_ITEM_TYPE_TX_QUEUE: - last_item = MLX5_FLOW_ITEM_TX_QUEUE; + case MLX5_RTE_FLOW_ITEM_TYPE_SQ: + last_item = MLX5_FLOW_ITEM_SQ; break; case MLX5_RTE_FLOW_ITEM_TYPE_TAG: break; @@ -8223,7 +8198,7 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, * work due to metadata regC0 mismatch. */ if ((!attr->transfer && attr->egress) && priv->representor && - !(item_flags & MLX5_FLOW_ITEM_TX_QUEUE)) + !(item_flags & MLX5_FLOW_ITEM_SQ)) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, NULL, @@ -11242,9 +11217,9 @@ flow_dv_translate_item_tx_queue(struct rte_eth_dev *dev, const struct rte_flow_item *item, uint32_t key_type) { - const struct mlx5_rte_flow_item_tx_queue *queue_m; - const struct mlx5_rte_flow_item_tx_queue *queue_v; - const struct mlx5_rte_flow_item_tx_queue queue_mask = { + const struct mlx5_rte_flow_item_sq *queue_m; + const struct mlx5_rte_flow_item_sq *queue_v; + const struct mlx5_rte_flow_item_sq queue_mask = { .queue = UINT32_MAX, }; void *misc_v = @@ -13184,9 +13159,9 @@ flow_dv_translate_items(struct rte_eth_dev *dev, flow_dv_translate_mlx5_item_tag(dev, key, items, key_type); last_item = MLX5_FLOW_ITEM_TAG; break; - case MLX5_RTE_FLOW_ITEM_TYPE_TX_QUEUE: + case MLX5_RTE_FLOW_ITEM_TYPE_SQ: flow_dv_translate_item_tx_queue(dev, key, items, key_type); - last_item = MLX5_FLOW_ITEM_TX_QUEUE; + last_item = MLX5_FLOW_ITEM_SQ; break; case RTE_FLOW_ITEM_TYPE_GTP: flow_dv_translate_item_gtp(key, items, tunnel, key_type); @@ -13226,6 +13201,99 @@ flow_dv_translate_items(struct rte_eth_dev *dev, return 0; } +/** + * Fill the HW steering flow with DV spec. + * + * @param[in] items + * Pointer to the list of items. + * @param[in] attr + * Pointer to the flow attributes. + * @param[in] key + * Pointer to the flow matcher key. + * @param[in] key_type + * Key type. + * @param[in, out] item_flags + * Pointer to the flow item flags. + * @param[out] error + * Pointer to the error structure. + * + * @return + * 0 on success, a negative errno value otherwise and rte_errno is set. + */ +int +flow_dv_translate_items_hws(const struct rte_flow_item *items, + struct mlx5_flow_attr *attr, void *key, + uint32_t key_type, uint64_t *item_flags, + uint8_t *match_criteria, + struct rte_flow_error *error) +{ + struct mlx5_flow_rss_desc rss_desc = { .level = attr->rss_level }; + struct rte_flow_attr rattr = { + .group = attr->group, + .priority = attr->priority, + .ingress = !!(attr->tbl_type == MLX5DR_TABLE_TYPE_NIC_RX), + .egress = !!(attr->tbl_type == MLX5DR_TABLE_TYPE_NIC_TX), + .transfer = !!(attr->tbl_type == MLX5DR_TABLE_TYPE_FDB), + }; + struct mlx5_dv_matcher_workspace wks = { + .action_flags = attr->act_flags, + .item_flags = item_flags ? *item_flags : 0, + .external = 0, + .next_protocol = 0xff, + .attr = &rattr, + .rss_desc = &rss_desc, + }; + int ret; + + for (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) { + if (!mlx5_flow_os_item_supported(items->type)) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ITEM, + NULL, "item not supported"); + ret = flow_dv_translate_items(&rte_eth_devices[attr->port_id], + items, &wks, key, key_type, NULL); + if (ret) + return ret; + } + if (wks.item_flags & MLX5_FLOW_LAYER_VXLAN_GPE) { + flow_dv_translate_item_vxlan_gpe(key, + wks.tunnel_item, + wks.item_flags, + key_type); + } else if (wks.item_flags & MLX5_FLOW_LAYER_GENEVE) { + flow_dv_translate_item_geneve(key, + wks.tunnel_item, + wks.item_flags, + key_type); + } else if (wks.item_flags & MLX5_FLOW_LAYER_GRE) { + if (wks.tunnel_item->type == RTE_FLOW_ITEM_TYPE_GRE) { + flow_dv_translate_item_gre(key, + wks.tunnel_item, + wks.item_flags, + key_type); + } else if (wks.tunnel_item->type == RTE_FLOW_ITEM_TYPE_GRE_OPTION) { + flow_dv_translate_item_gre_option(key, + wks.tunnel_item, + wks.gre_item, + wks.item_flags, + key_type); + } else if (wks.tunnel_item->type == RTE_FLOW_ITEM_TYPE_NVGRE) { + flow_dv_translate_item_nvgre(key, + wks.tunnel_item, + wks.item_flags, + key_type); + } else { + MLX5_ASSERT(false); + } + } + + if (match_criteria) + *match_criteria = flow_dv_matcher_enable(key); + if (item_flags) + *item_flags = wks.item_flags; + return 0; +} + /** * Fill the SW steering flow with DV spec. * -- 2.18.1