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 9500FA0C46; Sun, 18 Jul 2021 19:19:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 69DA5410EA; Sun, 18 Jul 2021 19:19:00 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2079.outbound.protection.outlook.com [40.107.244.79]) by mails.dpdk.org (Postfix) with ESMTP id 88C18410EA for ; Sun, 18 Jul 2021 19:18:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i6LHaSH0/tD9TAL8CIWRmvofC4llFWaTBWowR5EiZmQucX9/7f5v3/Zjkpz1aAyZUuhDmNh1DozBo+qoQugn1ucAoysK91IoEzmSz/66cKrA6LRhfYt7IJlRtcpEBPz9lY7sOlDvqUACrq4HfLPPQdMfAasVzbWKXXcLAtITuaI370oA8B+kA0H1J8iwHGY2TuHKxPrUCiM0PGVNf4DmNW2Zyytbyd9DsktvpiI7gX77dAukIqFUKRXjyVmB/2T3RVU1JSRWIpAWv+2an5MHwY3kW4OUOozqt65x3psTjrMmX+ZwgbBwwpuVMAELnr492Sijz4uLON1uIr67dKJNRw== 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-SenderADCheck; bh=B8XXxDru7DNlMCK9eFtgRyvFljEs9p/gq7HYIHhSOgk=; b=BzbIgjrbvpOMAHLOUDKLRtN81xxqNiN/TLDpsOLWp59Ul0SzASk6t/jW3dkvv5SD3Ru8HZW0CTjFFkq05QXUhKpcFwmn8Y2E92lh7pEonNNMrqE9L77ywyjc9GxxP1D2deOpRDbBrVrOsPQLsNviAEhxjXlq/GGejdxZ7NDENbNiFlYpxnajMn9KtV3SwfZ+IJgRPbOHyVNJ9hbfrrZexJvCwDvljShzcrMT/hHfkBZxSAg7Yua6LH+5Vm39Agwzu/VDDwK1Nhx49BhgQj49I+kkaruPcITZxuV1TRKHs7cwFJeIKhYpRVns9EzrO1oJ/a3Sq09PNxn0ctDFr9LwXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none 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=B8XXxDru7DNlMCK9eFtgRyvFljEs9p/gq7HYIHhSOgk=; b=Y7+xpLiDE3r8C6GdteoSIV6T5KGt51DI9j0S/xPN1S/N1tNVEacdRlXdC9pGAQvePUWglGbDkChc+mYWgLwLP78iXuyZ+vtF3yEgO0H8QHLUQsl/rlz7y0VKntqI24onmkcrDM5ZNVi9SMiWE07j7ElKAXl2O3O879ySl/mN0B4lYE5mxh9fCDaoaWnqBKw/h5j6sOD+tfH/CNtTF7LMXNyEABqJCrAQLYMGTom4sd3zYQDztru4adc4Izc4MTMAVX6HwJn1GHDOnJ+SXeCUBk96JWhEYx+UVe1tuJt9lgL4Roc0h7P7RF3usHVg6tzXUuUBP0Yv9xHQrixlOjP+nw== Received: from BN0PR04CA0084.namprd04.prod.outlook.com (2603:10b6:408:ea::29) by SA0PR12MB4349.namprd12.prod.outlook.com (2603:10b6:806:98::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21; Sun, 18 Jul 2021 17:18:54 +0000 Received: from BN8NAM11FT022.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ea:cafe::e3) by BN0PR04CA0084.outlook.office365.com (2603:10b6:408:ea::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21 via Frontend Transport; Sun, 18 Jul 2021 17:18:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT022.mail.protection.outlook.com (10.13.176.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4331.21 via Frontend Transport; Sun, 18 Jul 2021 17:18:54 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 18 Jul 2021 17:18:50 +0000 From: Bing Zhao To: , CC: , , , , , Date: Sun, 18 Jul 2021 20:18:11 +0300 Message-ID: <20210718171817.23822-2-bingz@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210718171817.23822-1-bingz@nvidia.com> References: <20210705155756.21443-1-bingz@nvidia.com> <20210718171817.23822-1-bingz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aaa16e39-8194-48ad-1d67-08d94a101ea7 X-MS-TrafficTypeDiagnostic: SA0PR12MB4349: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o/89uvJH3OsBUzyfggffwInR9ON2at1BF07iY2WEwRfF8Oa2x30Cgd9J5Qs3j5rKrXnYLJsBG0KVlDiCdJ9Jo29U+YICPhIAxMBUmVzEJK0Ps+7DgBCLmKqBne5APdmuxFRvJpVc5NlcBcQxG7k5OvhO+ZbbmBNxshju+x0jfZU8Pa7BOWix1DjeWwTBHCBWfzBB9xYIQh2W/0yiJXcxwp3SFGdlroPU8x4eAjo+3k/szbiBPpTVaK4bNTsZofFXn2uJwEJ28GDCeVr+H0aqEUyRF2V8VjpnmTjG0/8LZ6YA5iTl1CMioOHBEcQVHr0ZYJzbzvgK0K9RQSQCgf5eR6ittRDh2sH01IXiWruOavUUXC8qWENhRuEKmjZUAWGWkg6aerQFWbm3NFtLzB3N01g7pjm7XF8LoAg9nTCBlxK7mOiqioUWFMilZ2f94c+YOBN/0b4iwMGPsBPy/x8IBxgsIvB+XceVXQROYZMnr6FYhMhx4ksWQ8+oq2SUZOVAKxHKJ4v5hwBFDJxULX1zNz6tyeH18C2K6ZXKjutax0U44GEKynmOEcrmmZ/lq8PWCGa5FvGGOmdZqz9gtO38gRkMyvhBWmd8Uk7PzbeVLeBwAjQL98prRwGqEn8YEcjemyKLCTyTwsYSEMVqvKDUONFY40xebbn21j/t5pzfVpPT2gZ9fjkljUrfr1rkOCExlijVKTCQoGwBi0ss2xMojvIhINKQvL4ZLY0E5laSqE4= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(376002)(396003)(136003)(346002)(39860400002)(36840700001)(46966006)(82740400003)(316002)(110136005)(36756003)(83380400001)(6636002)(8676002)(47076005)(30864003)(1076003)(7696005)(54906003)(356005)(336012)(36906005)(26005)(2616005)(86362001)(36860700001)(426003)(107886003)(6666004)(34020700004)(2906002)(70206006)(4326008)(7636003)(82310400003)(8936002)(55016002)(6286002)(70586007)(478600001)(16526019)(5660300002)(186003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2021 17:18:54.2057 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aaa16e39-8194-48ad-1d67-08d94a101ea7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT022.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4349 Subject: [dpdk-dev] [PATCH v2 1/7] net/mlx5: handle yellow case in default meter policy 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 Sender: "dev" In order to support the yellow color for the default meter policy, the default policy action for yellow should be created together with the green policy. The default policy action for yellow action is the same as that for green. In the same table, the same matcher will be reused for yellow and the destination group will be the same. Signed-off-by: Bing Zhao --- drivers/net/mlx5/mlx5.h | 6 ++ drivers/net/mlx5/mlx5_flow_dv.c | 144 +++++++++++++++++++------------- 2 files changed, 93 insertions(+), 57 deletions(-) diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 94618e10fa..791696caf4 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -641,6 +641,12 @@ struct mlx5_dev_shared_port { #define MLX5_MTR_TABLE_ID_SUFFIX 1 /* Drop table_id on MLX5_FLOW_TABLE_LEVEL_METER. */ #define MLX5_MTR_TABLE_ID_DROP 2 +/* Priority of the meter policy matcher. */ +#define MLX5_MTR_POLICY_MATCHER_PRIO 0 +/* Default policy. */ +#define MLX5_MTR_POLICY_MODE_DEF 1 +/* Only green color valid. */ +#define MLX5_MTR_POLICY_MODE_OG 2 enum mlx5_meter_domain { MLX5_MTR_DOMAIN_INGRESS, diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index d250486950..cfc646c5e5 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -188,7 +188,7 @@ 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 @@ -197,7 +197,7 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr, * @return * mlx5 color. */ -static int +static inline int rte_col_2_mlx5_col(enum rte_color rcol) { switch (rcol) { @@ -15892,7 +15892,7 @@ flow_dv_destroy_mtr_drop_tbls(struct rte_eth_dev *dev) static void __flow_dv_destroy_domain_def_policy(struct rte_eth_dev *dev, - enum mlx5_meter_domain domain) + enum mlx5_meter_domain domain) { struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_flow_meter_def_policy *def_policy = @@ -15943,21 +15943,20 @@ __flow_dv_create_policy_flow(struct rte_eth_dev *dev, if (match_src_port && (priv->representor || priv->master)) { if (flow_dv_translate_item_port_id(dev, matcher.buf, value.buf, item, attr)) { - DRV_LOG(ERR, - "Failed to create meter policy flow with port."); + DRV_LOG(ERR, "Failed to create meter policy%d flow's" + " value with port.", color); return -1; } } flow_dv_match_meta_reg(matcher.buf, value.buf, - (enum modify_reg)color_reg_c_idx, - rte_col_2_mlx5_col(color), - UINT32_MAX); + (enum modify_reg)color_reg_c_idx, + rte_col_2_mlx5_col(color), UINT32_MAX); misc_mask = flow_dv_matcher_enable(value.buf); __flow_dv_adjust_buf_size(&value.size, misc_mask); - ret = mlx5_flow_os_create_flow(matcher_object, - (void *)&value, actions_n, actions, rule); + ret = mlx5_flow_os_create_flow(matcher_object, (void *)&value, + actions_n, actions, rule); if (ret) { - DRV_LOG(ERR, "Failed to create meter policy flow."); + DRV_LOG(ERR, "Failed to create meter policy%d flow.", color); return -1; } return 0; @@ -15991,13 +15990,13 @@ __flow_dv_create_policy_matcher(struct rte_eth_dev *dev, }; struct mlx5_flow_tbl_data_entry *tbl_data; struct mlx5_priv *priv = dev->data->dev_private; - uint32_t color_mask = (UINT32_C(1) << MLX5_MTR_COLOR_BITS) - 1; + const uint32_t color_mask = (UINT32_C(1) << MLX5_MTR_COLOR_BITS) - 1; if (match_src_port && (priv->representor || priv->master)) { if (flow_dv_translate_item_port_id(dev, matcher.mask.buf, value.buf, item, attr)) { - DRV_LOG(ERR, - "Failed to register meter drop matcher with port."); + DRV_LOG(ERR, "Failed to register meter policy%d matcher" + " with port.", priority); return -1; } } @@ -16007,7 +16006,7 @@ __flow_dv_create_policy_matcher(struct rte_eth_dev *dev, (enum modify_reg)color_reg_c_idx, 0, color_mask); matcher.priority = priority; matcher.crc = rte_raw_cksum((const void *)matcher.mask.buf, - matcher.mask.size); + matcher.mask.size); entry = mlx5_list_register(tbl_data->matchers, &ctx); if (!entry) { DRV_LOG(ERR, "Failed to register meter drop matcher."); @@ -16055,6 +16054,8 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, int i; int ret = mlx5_flow_get_reg_id(dev, MLX5_MTR_COLOR, 0, &flow_err); struct mlx5_sub_policy_color_rule *color_rule; + bool svport_match; + struct mlx5_sub_policy_color_rule *tmp_rules[RTE_COLORS] = {NULL}; if (ret < 0) return -1; @@ -16073,7 +16074,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, color_reg_c_idx = ret; for (i = 0; i < RTE_COLORS; i++) { TAILQ_INIT(&sub_policy->color_rules[i]); - if (i == RTE_COLOR_YELLOW || !acts[i].actions_n) + if (!acts[i].actions_n) continue; color_rule = mlx5_malloc(MLX5_MEM_ZERO, sizeof(struct mlx5_sub_policy_color_rule), @@ -16082,45 +16083,52 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, DRV_LOG(ERR, "No memory to create color rule."); goto err_exit; } + tmp_rules[i] = color_rule; + TAILQ_INSERT_TAIL(&sub_policy->color_rules[i], + color_rule, next_port); color_rule->src_port = priv->representor_id; + /* No use. */ attr.priority = i; - /* Create matchers for Color. */ - if (__flow_dv_create_policy_matcher(dev, - color_reg_c_idx, i, sub_policy, &attr, - (i != RTE_COLOR_RED ? match_src_port : false), - NULL, &color_rule->matcher, &flow_err)) { - DRV_LOG(ERR, "Failed to create color matcher."); + /* Create matchers for colors. */ + svport_match = (i != RTE_COLOR_RED) ? match_src_port : false; + if (__flow_dv_create_policy_matcher(dev, color_reg_c_idx, + MLX5_MTR_POLICY_MATCHER_PRIO, sub_policy, + &attr, svport_match, NULL, + &color_rule->matcher, &flow_err)) { + DRV_LOG(ERR, "Failed to create color%u matcher.", i); goto err_exit; } /* Create flow, matching color. */ if (__flow_dv_create_policy_flow(dev, color_reg_c_idx, (enum rte_color)i, color_rule->matcher->matcher_object, - acts[i].actions_n, - acts[i].dv_actions, - (i != RTE_COLOR_RED ? match_src_port : false), - NULL, &color_rule->rule, + acts[i].actions_n, acts[i].dv_actions, + svport_match, NULL, &color_rule->rule, &attr)) { - DRV_LOG(ERR, "Failed to create color rule."); + DRV_LOG(ERR, "Failed to create color%u rule.", i); goto err_exit; } - TAILQ_INSERT_TAIL(&sub_policy->color_rules[i], - color_rule, next_port); } return 0; err_exit: - if (color_rule) { - if (color_rule->rule) - mlx5_flow_os_destroy_flow(color_rule->rule); - if (color_rule->matcher) { - struct mlx5_flow_tbl_data_entry *tbl = - container_of(color_rule->matcher->tbl, - typeof(*tbl), tbl); - mlx5_list_unregister(tbl->matchers, + /* All the policy rules will be cleared. */ + do { + color_rule = tmp_rules[i]; + if (color_rule) { + if (color_rule->rule) + mlx5_flow_os_destroy_flow(color_rule->rule); + if (color_rule->matcher) { + struct mlx5_flow_tbl_data_entry *tbl = + container_of(color_rule->matcher->tbl, + typeof(*tbl), tbl); + mlx5_list_unregister(tbl->matchers, &color_rule->matcher->entry); + } + TAILQ_REMOVE(&sub_policy->color_rules[i], + color_rule, next_port); + mlx5_free(color_rule); } - mlx5_free(color_rule); - } + } while (i--); return -1; } @@ -16342,8 +16350,7 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain) sizeof(struct mlx5_flow_meter_def_policy), RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY); if (!def_policy) { - DRV_LOG(ERR, "Failed to alloc " - "default policy table."); + DRV_LOG(ERR, "Failed to alloc default policy table."); goto def_policy_error; } mtrmng->def_policy[domain] = def_policy; @@ -16359,26 +16366,48 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain) } def_policy->sub_policy.jump_tbl[RTE_COLOR_GREEN] = jump_tbl; tbl_data = container_of(jump_tbl, - struct mlx5_flow_tbl_data_entry, tbl); + struct mlx5_flow_tbl_data_entry, tbl); def_policy->dr_jump_action[RTE_COLOR_GREEN] = tbl_data->jump.action; - acts[RTE_COLOR_GREEN].dv_actions[0] = - tbl_data->jump.action; + acts[RTE_COLOR_GREEN].dv_actions[0] = tbl_data->jump.action; acts[RTE_COLOR_GREEN].actions_n = 1; + /* + * YELLOW has the same default policy as GREEN does. + * G & Y share the same table and action. The 2nd time of table + * resource getting is just to update the reference count for + * the releasing stage. + */ + jump_tbl = flow_dv_tbl_resource_get(dev, + MLX5_FLOW_TABLE_LEVEL_METER, + egress, transfer, false, NULL, 0, + 0, MLX5_MTR_TABLE_ID_SUFFIX, &error); + if (!jump_tbl) { + DRV_LOG(ERR, + "Failed to get meter suffix table."); + goto def_policy_error; + } + def_policy->sub_policy.jump_tbl[RTE_COLOR_YELLOW] = jump_tbl; + tbl_data = container_of(jump_tbl, + struct mlx5_flow_tbl_data_entry, tbl); + def_policy->dr_jump_action[RTE_COLOR_YELLOW] = + tbl_data->jump.action; + acts[RTE_COLOR_YELLOW].dv_actions[0] = tbl_data->jump.action; + acts[RTE_COLOR_YELLOW].actions_n = 1; /* Create jump action to the drop table. */ if (!mtrmng->drop_tbl[domain]) { mtrmng->drop_tbl[domain] = flow_dv_tbl_resource_get (dev, MLX5_FLOW_TABLE_LEVEL_METER, - egress, transfer, false, NULL, 0, - 0, MLX5_MTR_TABLE_ID_DROP, &error); + egress, transfer, false, NULL, 0, + 0, MLX5_MTR_TABLE_ID_DROP, &error); if (!mtrmng->drop_tbl[domain]) { - DRV_LOG(ERR, "Failed to create " - "meter drop table for default policy."); + DRV_LOG(ERR, "Failed to create meter " + "drop table for default policy."); goto def_policy_error; } } + /* all RED: unique Drop table for jump action. */ tbl_data = container_of(mtrmng->drop_tbl[domain], - struct mlx5_flow_tbl_data_entry, tbl); + struct mlx5_flow_tbl_data_entry, tbl); def_policy->dr_jump_action[RTE_COLOR_RED] = tbl_data->jump.action; acts[RTE_COLOR_RED].dv_actions[0] = tbl_data->jump.action; @@ -16388,15 +16417,14 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain) &def_policy->sub_policy, egress, transfer, false, acts); if (ret) { - DRV_LOG(ERR, "Failed to create " - "default policy rules."); - goto def_policy_error; + DRV_LOG(ERR, "Failed to create default policy rules."); + goto def_policy_error; } } return 0; def_policy_error: __flow_dv_destroy_domain_def_policy(dev, - (enum mlx5_meter_domain)domain); + (enum mlx5_meter_domain)domain); return -1; } @@ -16419,8 +16447,9 @@ flow_dv_create_def_policy(struct rte_eth_dev *dev) if (!priv->config.dv_esw_en && i == MLX5_MTR_DOMAIN_TRANSFER) continue; if (__flow_dv_create_domain_def_policy(dev, i)) { - DRV_LOG(ERR, - "Failed to create default policy"); + DRV_LOG(ERR, "Failed to create default policy"); + /* Rollback the created default policies for others. */ + flow_dv_destroy_def_policy(dev); return -1; } } @@ -16934,8 +16963,9 @@ flow_dv_meter_hierarchy_rule_create(struct rte_eth_dev *dev, goto err_exit; } if (__flow_dv_create_policy_matcher(dev, color_reg_c_idx, - i, sub_policy, &attr, true, item, - &color_rule->matcher, error)) { + MLX5_MTR_POLICY_MATCHER_PRIO, sub_policy, + &attr, true, item, + &color_rule->matcher, error)) { rte_flow_error_set(error, errno, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, "Failed to create hierarchy meter matcher."); -- 2.27.0