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 0C695468E4 for ; Thu, 12 Jun 2025 23:08:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06FA542E37; Thu, 12 Jun 2025 23:08:53 +0200 (CEST) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mails.dpdk.org (Postfix) with ESMTP id 4AEF842E37 for ; Thu, 12 Jun 2025 23:08:52 +0200 (CEST) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-450cf214200so12471865e9.1 for ; Thu, 12 Jun 2025 14:08:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1749762532; x=1750367332; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dQv4mEA6hp3GKL9GIW0VeqjpxLmn+sQI11dypVUb6/U=; b=VE2LtJoQLN84ZHq3WXurMezQAc+s2m7BrzJBubUyaSt5V3acya7dMHJfaL6OJSwwBY HawMKZcID62bHeTBrYTs9lOAjJifASWcLGr8DlRKdjCsS91WmsJ8us2VDfgz/r5NCuEv NWXenw5zfZ4Y1SbcWNWwLKuSuZ/79GnjyLDKvCJLQu4QuUZ8AVWZWckhZh0FvcOYRn1/ rGRts3Sck4UbbluAyxuxKkdOuT7qsOTm4YFVk60/yWAwQdstWJD3C/POgwRnMQGbA9ai TttSm6qG8yAua/ASSmrSIHRaV/WsZNWawiQFMj97qTKkfnkhtDWeeyUwVAFMw89XQcRc uLng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749762532; x=1750367332; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dQv4mEA6hp3GKL9GIW0VeqjpxLmn+sQI11dypVUb6/U=; b=gAhlOf6HcUBpu0cGXzAZ4BaETLyx5Id84LzvfMUZQg4aITLAZgpSwyWku4/QDT1/Xw aofqK4yT+7qqWRPRNJibbrBa/m/E4jJ+fGvhv8tCoq4a6LK2MvHZ4eOog4HjD+upztOQ 2P6yZLr+s3gg4if5URcjPHuGjw998uRo3/lEEitfZ970X5Bl2Hek81uZTjOjlSgnnZJ2 C7hGeQJ9+WHz+EWRutYGaWkwfc0G9z+qkrbiP0u94OuZQ4yraUbBDzV7I581X5VcT65v VPBFqC4Y49KMbRVIOO8G1X7K+xqNK2/NxgBLBUhE+FKxjx/ZTGXkW0vl1uMYgDoXRyQ+ 7yCQ== X-Forwarded-Encrypted: i=1; AJvYcCU4D1xv5S+RzLkI3kGmfXHmZSdvFjiXeae6Yrwqy3J9c4uIafB2db9CIhJkdZRDGZvVfRGF3eY=@dpdk.org X-Gm-Message-State: AOJu0Yy/vLKlYDd+l8xaW2XyMjsqpensM5rlK39HnabPrV54phAZOfld u8bgQsYuYF+NSf9Q2KNbO0elzDECtZTG2WLGK3UI1Vbtcx4Gl6gnE1AaXYFyNXTu X-Gm-Gg: ASbGncuriAWOryQO/A7LDhTulFZUaA3+CEktUm2UnRmiphh1IcXuDVMm+Fmpsq9OnAX npSS3R/F+iJ33KR80AxYcUOhqEYFiWS3l58TTR4qpTE4K9sKfRzE82mv4RuW4nSEdwdDRs55mgK C1yT+evAwWExXRMmY9tVxEQXuSG1ZutUVkQvFOexBSPAhBSBASYbcrA4mUfOLKYwjx8cmrBiQYY 0gi7od5U3t4/0hmPwhjoeqR5jgAtdU0Mq19Hlz/hwDe8saDIv6Xr3jwBXXcTSy0R8Ph19NK6R+G aV+3LlGa0hmHshbI4tL5qJ6qLlY4cIRJ4YzEo7HIE+CxGKj+d72Yo1Z1Z86f1tKoVrIE X-Google-Smtp-Source: AGHT+IHHTI5/iJDRpre0h0NLpGJBt/1CsCW2uP0JK+l4htCYRHy3tK/h9CtsZz8OCN257cVXXGNCgA== X-Received: by 2002:a05:600c:608c:b0:442:f44f:655 with SMTP id 5b1f17b1804b1-45334b5b1c0mr4794415e9.32.1749762531490; Thu, 12 Jun 2025 14:08:51 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:f2df:571a:ae4c:bef2]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-4532e1838e4sm32455575e9.40.2025.06.12.14.08.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jun 2025 14:08:50 -0700 (PDT) From: luca.boccassi@gmail.com To: Gregory Etelson Cc: Dariusz Sosnowski , dpdk stable Subject: patch 'net/mlx5: remove unsupported flow meter action in HWS' has been queued to stable release 22.11.9 Date: Thu, 12 Jun 2025 22:06:39 +0100 Message-ID: <20250612210733.2506558-22-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250612210733.2506558-1-luca.boccassi@gmail.com> References: <20250612210733.2506558-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 22.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/14/25. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/4901f59024732fd4bcdc09896e9cde2e91104884 Thanks. Luca Boccassi --- >From 4901f59024732fd4bcdc09896e9cde2e91104884 Mon Sep 17 00:00:00 2001 From: Gregory Etelson Date: Sun, 4 May 2025 08:23:50 +0300 Subject: [PATCH] net/mlx5: remove unsupported flow meter action in HWS [ upstream commit 645f240d1cd57d0be1b773c739a5845a7663eeed ] METER flow action is not supported in MLX5 HWS mode. Application must use METER_MARK flow action. The patch removes METER action from HWS code. Fixes: 48fbb0e93d06 ("net/mlx5: support flow meter mark indirect action with HWS") Signed-off-by: Gregory Etelson Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_flow_hw.c | 85 ----- drivers/net/mlx5/mlx5_flow_meter.c | 545 ----------------------------- 2 files changed, 630 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 7040dd863d..ec44151302 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -1167,35 +1167,6 @@ flow_hw_represented_port_compile(struct rte_eth_dev *dev, return 0; } -static __rte_always_inline int -flow_hw_meter_compile(struct rte_eth_dev *dev, - const struct mlx5_flow_template_table_cfg *cfg, - uint16_t aso_mtr_pos, - uint16_t jump_pos, - const struct rte_flow_action *action, - struct mlx5_hw_actions *acts, - struct rte_flow_error *error) -{ - struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_aso_mtr *aso_mtr; - const struct rte_flow_action_meter *meter = action->conf; - uint32_t group = cfg->attr.flow_attr.group; - - aso_mtr = mlx5_aso_meter_by_idx(priv, meter->mtr_id); - acts->rule_acts[aso_mtr_pos].action = priv->mtr_bulk.action; - acts->rule_acts[aso_mtr_pos].aso_meter.offset = aso_mtr->offset; - acts->jump = flow_hw_jump_action_register - (dev, cfg, aso_mtr->fm.group, error); - if (!acts->jump) - return -ENOMEM; - acts->rule_acts[jump_pos].action = (!!group) ? - acts->jump->hws_action : - acts->jump->root_action; - if (mlx5_aso_mtr_wait(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr)) - return -ENOMEM; - return 0; -} - static __rte_always_inline int flow_hw_cnt_compile(struct rte_eth_dev *dev, uint32_t start_pos, struct mlx5_hw_actions *acts) @@ -1389,7 +1360,6 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev, bool reformat_used = false; unsigned int of_vlan_offset; uint16_t action_pos; - uint16_t jump_pos; uint32_t ct_idx; int err; uint32_t target_grp = 0; @@ -1605,27 +1575,6 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev, masks, acts, action_pos, &sub_error)) goto err; break; - case RTE_FLOW_ACTION_TYPE_METER: - /* - * METER action is compiled to 2 DR actions - ASO_METER and FT. - * Calculated DR offset is stored only for ASO_METER and FT - * is assumed to be the next action. - */ - action_pos = at->actions_off[actions - at->actions]; - jump_pos = action_pos + 1; - if (actions->conf && masks->conf && - ((const struct rte_flow_action_meter *) - masks->conf)->mtr_id) { - err = flow_hw_meter_compile(dev, cfg, - action_pos, jump_pos, actions, acts, &sub_error); - if (err) - goto err; - } else if (__flow_hw_act_data_general_append(priv, acts, - actions->type, - actions - action_start, - action_pos)) - goto err; - break; case RTE_FLOW_ACTION_TYPE_AGE: flow_hw_translate_group(dev, cfg, attr->group, &target_grp, &sub_error); @@ -2198,7 +2147,6 @@ flow_hw_actions_construct(struct rte_eth_dev *dev, const struct rte_flow_action_raw_encap *raw_encap_data; const struct rte_flow_item *enc_item = NULL; const struct rte_flow_action_ethdev *port_action = NULL; - const struct rte_flow_action_meter *meter = NULL; const struct rte_flow_action_age *age = NULL; uint8_t *buf = job->encap_data; struct rte_flow_attr attr = { @@ -2348,28 +2296,6 @@ flow_hw_actions_construct(struct rte_eth_dev *dev, rule_acts[act_data->action_dst].action = priv->hw_vport[port_action->port_id]; break; - case RTE_FLOW_ACTION_TYPE_METER: - meter = action->conf; - mtr_id = meter->mtr_id; - aso_mtr = mlx5_aso_meter_by_idx(priv, mtr_id); - rule_acts[act_data->action_dst].action = - priv->mtr_bulk.action; - rule_acts[act_data->action_dst].aso_meter.offset = - aso_mtr->offset; - jump = flow_hw_jump_action_register - (dev, &table->cfg, aso_mtr->fm.group, NULL); - if (!jump) - goto error; - MLX5_ASSERT - (!rule_acts[act_data->action_dst + 1].action); - rule_acts[act_data->action_dst + 1].action = - (!!attr.group) ? jump->hws_action : - jump->root_action; - job->flow->jump = jump; - job->flow->fate_type = MLX5_FLOW_FATE_JUMP; - if (mlx5_aso_mtr_wait(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr)) - goto error; - break; case RTE_FLOW_ACTION_TYPE_AGE: age = action->conf; /* @@ -4082,10 +4008,6 @@ mlx5_flow_hw_actions_validate(struct rte_eth_dev *dev, /* TODO: Validation logic */ action_flags |= MLX5_FLOW_ACTION_DECAP; break; - case RTE_FLOW_ACTION_TYPE_METER: - /* TODO: Validation logic */ - action_flags |= MLX5_FLOW_ACTION_METER; - break; case RTE_FLOW_ACTION_TYPE_METER_MARK: ret = flow_hw_validate_action_meter_mark(dev, action, error); @@ -4321,13 +4243,6 @@ flow_hw_dr_actions_template_create(struct rte_flow_actions_template *at) action_types[mhdr_off] = type; } break; - case RTE_FLOW_ACTION_TYPE_METER: - at->actions_off[i] = curr_off; - action_types[curr_off++] = MLX5DR_ACTION_TYP_ASO_METER; - if (curr_off >= MLX5_HW_MAX_ACTS) - goto err_actions_num; - action_types[curr_off++] = MLX5DR_ACTION_TYP_FT; - break; case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN: type = mlx5_hw_dr_action_types[at->actions[i].type]; at->actions_off[i] = curr_off; diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c index 0ffe738ec5..4dd751f3d9 100644 --- a/drivers/net/mlx5/mlx5_flow_meter.c +++ b/drivers/net/mlx5/mlx5_flow_meter.c @@ -851,45 +851,6 @@ mlx5_flow_meter_policy_validate(struct rte_eth_dev *dev, return 0; } -#if defined(HAVE_MLX5_HWS_SUPPORT) -/** - * Callback to check MTR policy action validate for HWS - * - * @param[in] dev - * Pointer to Ethernet device. - * @param[in] actions - * Pointer to meter policy action detail. - * @param[out] error - * Pointer to the error structure. - * - * @return - * 0 on success, a negative errno value otherwise and rte_errno is set. - */ -static int -mlx5_flow_meter_policy_hws_validate(struct rte_eth_dev *dev, - struct rte_mtr_meter_policy_params *policy, - struct rte_mtr_error *error) -{ - struct mlx5_priv *priv = dev->data->dev_private; - const struct rte_flow_actions_template_attr attr = { - .transfer = priv->sh->config.dv_esw_en ? 1 : 0 }; - int ret; - int i; - - if (!priv->mtr_en || !priv->sh->meter_aso_en) - return -rte_mtr_error_set(error, ENOTSUP, - RTE_MTR_ERROR_TYPE_METER_POLICY, - NULL, "meter policy unsupported."); - for (i = 0; i < RTE_COLORS; i++) { - ret = mlx5_flow_actions_validate(dev, &attr, policy->actions[i], - policy->actions[i], NULL); - if (ret) - return ret; - } - return 0; -} -#endif - static int __mlx5_flow_meter_policy_delete(struct rte_eth_dev *dev, uint32_t policy_id, @@ -1215,344 +1176,6 @@ mlx5_flow_meter_policy_get(struct rte_eth_dev *dev, &policy_idx); } -#if defined(HAVE_MLX5_HWS_SUPPORT) -/** - * Callback to delete MTR policy for HWS. - * - * @param[in] dev - * Pointer to Ethernet device. - * @param[in] policy_id - * Meter policy id. - * @param[out] error - * Pointer to the error structure. - * - * @return - * 0 on success, a negative errno value otherwise and rte_errno is set. - */ -static int -mlx5_flow_meter_policy_hws_delete(struct rte_eth_dev *dev, - uint32_t policy_id, - struct rte_mtr_error *error) -{ - struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_flow_meter_policy *mtr_policy; - uint32_t i, j; - uint32_t nb_flows = 0; - int ret; - struct rte_flow_op_attr op_attr = { .postpone = 1 }; - struct rte_flow_op_result result[RTE_COLORS * MLX5_MTR_DOMAIN_MAX]; - - if (!priv->mtr_policy_arr) - return -rte_mtr_error_set(error, ENOTSUP, - RTE_MTR_ERROR_TYPE_UNSPECIFIED, - NULL, "Meter policy array is not allocated"); - /* Meter id must be valid. */ - if (policy_id >= priv->mtr_config.nb_meter_policies) - return -rte_mtr_error_set(error, EINVAL, - RTE_MTR_ERROR_TYPE_METER_POLICY_ID, - &policy_id, - "Meter policy id not valid."); - /* Meter policy must exist. */ - mtr_policy = mlx5_flow_meter_policy_find(dev, policy_id, NULL); - if (!mtr_policy->initialized) - return -rte_mtr_error_set(error, ENOENT, - RTE_MTR_ERROR_TYPE_METER_POLICY_ID, NULL, - "Meter policy does not exists."); - /* Check policy is unused. */ - if (mtr_policy->ref_cnt) - return -rte_mtr_error_set(error, EBUSY, - RTE_MTR_ERROR_TYPE_METER_POLICY_ID, - NULL, "Meter policy is in use."); - rte_spinlock_lock(&priv->hw_ctrl_lock); - for (i = 0; i < MLX5_MTR_DOMAIN_MAX; i++) { - for (j = 0; j < RTE_COLORS; j++) { - if (mtr_policy->hws_flow_rule[i][j]) { - ret = rte_flow_async_destroy(dev->data->port_id, - CTRL_QUEUE_ID(priv), &op_attr, - mtr_policy->hws_flow_rule[i][j], - NULL, NULL); - if (ret < 0) - continue; - nb_flows++; - } - } - } - ret = rte_flow_push(dev->data->port_id, CTRL_QUEUE_ID(priv), NULL); - while (nb_flows && (ret >= 0)) { - ret = rte_flow_pull(dev->data->port_id, - CTRL_QUEUE_ID(priv), result, - nb_flows, NULL); - nb_flows -= ret; - } - for (i = 0; i < MLX5_MTR_DOMAIN_MAX; i++) { - if (mtr_policy->hws_flow_table[i]) - rte_flow_template_table_destroy(dev->data->port_id, - mtr_policy->hws_flow_table[i], NULL); - } - for (i = 0; i < RTE_COLORS; i++) { - if (mtr_policy->hws_act_templ[i]) - rte_flow_actions_template_destroy(dev->data->port_id, - mtr_policy->hws_act_templ[i], NULL); - } - if (mtr_policy->hws_item_templ) - rte_flow_pattern_template_destroy(dev->data->port_id, - mtr_policy->hws_item_templ, NULL); - rte_spinlock_unlock(&priv->hw_ctrl_lock); - memset(mtr_policy, 0, sizeof(struct mlx5_flow_meter_policy)); - return 0; -} - -/** - * Callback to add MTR policy for HWS. - * - * @param[in] dev - * Pointer to Ethernet device. - * @param[out] policy_id - * Pointer to policy id - * @param[in] actions - * Pointer to meter policy action detail. - * @param[out] error - * Pointer to the error structure. - * - * @return - * 0 on success, a negative errno value otherwise and rte_errno is set. - */ -static int -mlx5_flow_meter_policy_hws_add(struct rte_eth_dev *dev, - uint32_t policy_id, - struct rte_mtr_meter_policy_params *policy, - struct rte_mtr_error *error) -{ - struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_flow_meter_policy *mtr_policy = NULL; - const struct rte_flow_action *act; - const struct rte_flow_action_meter *mtr; - struct mlx5_flow_meter_info *fm; - struct mlx5_flow_meter_policy *plc; - uint8_t domain_color = MLX5_MTR_ALL_DOMAIN_BIT; - bool is_rss = false; - bool is_hierarchy = false; - int i, j; - uint32_t nb_colors = 0; - uint32_t nb_flows = 0; - int color; - int ret; - struct rte_flow_pattern_template_attr pta = {0}; - struct rte_flow_actions_template_attr ata = {0}; - struct rte_flow_template_table_attr ta = { {0}, 0 }; - struct rte_flow_op_attr op_attr = { .postpone = 1 }; - struct rte_flow_op_result result[RTE_COLORS * MLX5_MTR_DOMAIN_MAX]; - const uint32_t color_mask = (UINT32_C(1) << MLX5_MTR_COLOR_BITS) - 1; - int color_reg_c_idx = mlx5_flow_get_reg_id(dev, MLX5_MTR_COLOR, - 0, NULL); - struct rte_flow_item_tag tag_spec = { - .data = 0, - .index = color_reg_c_idx - }; - struct rte_flow_item_tag tag_mask = { - .data = color_mask, - .index = 0xff}; - struct rte_flow_item pattern[] = { - [0] = { - .type = (enum rte_flow_item_type) - MLX5_RTE_FLOW_ITEM_TYPE_TAG, - .spec = &tag_spec, - .mask = &tag_mask, - }, - [1] = { .type = RTE_FLOW_ITEM_TYPE_END } - }; - - if (!priv->mtr_policy_arr) - return -rte_mtr_error_set(error, ENOTSUP, - RTE_MTR_ERROR_TYPE_METER_POLICY, - NULL, "Meter policy array is not allocated."); - if (policy_id >= priv->mtr_config.nb_meter_policies) - return -rte_mtr_error_set(error, ENOTSUP, - RTE_MTR_ERROR_TYPE_METER_POLICY_ID, - NULL, "Meter policy id not valid."); - mtr_policy = mlx5_flow_meter_policy_find(dev, policy_id, NULL); - if (mtr_policy->initialized) - return -rte_mtr_error_set(error, EEXIST, - RTE_MTR_ERROR_TYPE_METER_POLICY_ID, - NULL, "Meter policy already exists."); - if (!policy || - (!policy->actions[RTE_COLOR_RED] && - !policy->actions[RTE_COLOR_YELLOW] && - !policy->actions[RTE_COLOR_GREEN])) - return -rte_mtr_error_set(error, EINVAL, - RTE_MTR_ERROR_TYPE_METER_POLICY, - NULL, "Meter policy actions are not valid."); - if (policy->actions[RTE_COLOR_RED] == RTE_FLOW_ACTION_TYPE_END) - mtr_policy->skip_r = 1; - if (policy->actions[RTE_COLOR_YELLOW] == RTE_FLOW_ACTION_TYPE_END) - mtr_policy->skip_y = 1; - if (policy->actions[RTE_COLOR_GREEN] == RTE_FLOW_ACTION_TYPE_END) - mtr_policy->skip_g = 1; - if (mtr_policy->skip_r && mtr_policy->skip_y && mtr_policy->skip_g) - return -rte_mtr_error_set(error, ENOTSUP, - RTE_MTR_ERROR_TYPE_METER_POLICY_ID, - NULL, "Meter policy actions are empty."); - for (i = 0; i < RTE_COLORS; i++) { - act = policy->actions[i]; - while (act && act->type != RTE_FLOW_ACTION_TYPE_END) { - switch (act->type) { - case RTE_FLOW_ACTION_TYPE_PORT_ID: - /* fall-through. */ - case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT: - domain_color &= ~(MLX5_MTR_DOMAIN_INGRESS_BIT | - MLX5_MTR_DOMAIN_EGRESS_BIT); - break; - case RTE_FLOW_ACTION_TYPE_RSS: - is_rss = true; - /* fall-through. */ - case RTE_FLOW_ACTION_TYPE_QUEUE: - domain_color &= ~(MLX5_MTR_DOMAIN_EGRESS_BIT | - MLX5_MTR_DOMAIN_TRANSFER_BIT); - break; - case RTE_FLOW_ACTION_TYPE_METER: - is_hierarchy = true; - mtr = act->conf; - fm = mlx5_flow_meter_find(priv, - mtr->mtr_id, NULL); - if (!fm) - return -rte_mtr_error_set(error, EINVAL, - RTE_MTR_ERROR_TYPE_MTR_ID, NULL, - "Meter not found in meter hierarchy."); - plc = mlx5_flow_meter_policy_find(dev, - fm->policy_id, - NULL); - MLX5_ASSERT(plc); - domain_color &= MLX5_MTR_ALL_DOMAIN_BIT & - (plc->ingress << - MLX5_MTR_DOMAIN_INGRESS); - domain_color &= MLX5_MTR_ALL_DOMAIN_BIT & - (plc->egress << - MLX5_MTR_DOMAIN_EGRESS); - domain_color &= MLX5_MTR_ALL_DOMAIN_BIT & - (plc->transfer << - MLX5_MTR_DOMAIN_TRANSFER); - break; - default: - break; - } - act++; - } - } - if (priv->sh->config.dv_esw_en) - domain_color &= ~(MLX5_MTR_DOMAIN_EGRESS_BIT | - MLX5_MTR_DOMAIN_TRANSFER_BIT); - else - domain_color &= ~MLX5_MTR_DOMAIN_TRANSFER_BIT; - if (!domain_color) - return -rte_mtr_error_set(error, ENOTSUP, - RTE_MTR_ERROR_TYPE_METER_POLICY_ID, - NULL, "Meter policy domains are conflicting."); - mtr_policy->is_rss = is_rss; - mtr_policy->ingress = !!(domain_color & MLX5_MTR_DOMAIN_INGRESS_BIT); - pta.ingress = mtr_policy->ingress; - mtr_policy->egress = !!(domain_color & MLX5_MTR_DOMAIN_EGRESS_BIT); - pta.egress = mtr_policy->egress; - mtr_policy->transfer = !!(domain_color & MLX5_MTR_DOMAIN_TRANSFER_BIT); - pta.transfer = mtr_policy->transfer; - mtr_policy->group = MLX5_FLOW_TABLE_HWS_POLICY - policy_id; - mtr_policy->is_hierarchy = is_hierarchy; - mtr_policy->initialized = 1; - rte_spinlock_lock(&priv->hw_ctrl_lock); - mtr_policy->hws_item_templ = - rte_flow_pattern_template_create(dev->data->port_id, - &pta, pattern, NULL); - if (!mtr_policy->hws_item_templ) - goto policy_add_err; - for (i = 0; i < RTE_COLORS; i++) { - if (mtr_policy->skip_g && i == RTE_COLOR_GREEN) - continue; - if (mtr_policy->skip_y && i == RTE_COLOR_YELLOW) - continue; - if (mtr_policy->skip_r && i == RTE_COLOR_RED) - continue; - mtr_policy->hws_act_templ[nb_colors] = - rte_flow_actions_template_create(dev->data->port_id, - &ata, policy->actions[i], - policy->actions[i], NULL); - if (!mtr_policy->hws_act_templ[nb_colors]) - goto policy_add_err; - nb_colors++; - } - for (i = 0; i < MLX5_MTR_DOMAIN_MAX; i++) { - memset(&ta, 0, sizeof(ta)); - ta.nb_flows = RTE_COLORS; - ta.flow_attr.group = mtr_policy->group; - if (i == MLX5_MTR_DOMAIN_INGRESS) { - if (!mtr_policy->ingress) - continue; - ta.flow_attr.ingress = 1; - } else if (i == MLX5_MTR_DOMAIN_EGRESS) { - if (!mtr_policy->egress) - continue; - ta.flow_attr.egress = 1; - } else if (i == MLX5_MTR_DOMAIN_TRANSFER) { - if (!mtr_policy->transfer) - continue; - ta.flow_attr.transfer = 1; - } - mtr_policy->hws_flow_table[i] = - rte_flow_template_table_create(dev->data->port_id, - &ta, &mtr_policy->hws_item_templ, 1, - mtr_policy->hws_act_templ, nb_colors, - NULL); - if (!mtr_policy->hws_flow_table[i]) - goto policy_add_err; - nb_colors = 0; - for (j = 0; j < RTE_COLORS; j++) { - if (mtr_policy->skip_g && j == RTE_COLOR_GREEN) - continue; - if (mtr_policy->skip_y && j == RTE_COLOR_YELLOW) - continue; - if (mtr_policy->skip_r && j == RTE_COLOR_RED) - continue; - color = rte_col_2_mlx5_col((enum rte_color)j); - tag_spec.data = color; - mtr_policy->hws_flow_rule[i][j] = - rte_flow_async_create(dev->data->port_id, - CTRL_QUEUE_ID(priv), &op_attr, - mtr_policy->hws_flow_table[i], - pattern, 0, policy->actions[j], - nb_colors, NULL, NULL); - if (!mtr_policy->hws_flow_rule[i][j]) - goto policy_add_err; - nb_colors++; - nb_flows++; - } - ret = rte_flow_push(dev->data->port_id, - CTRL_QUEUE_ID(priv), NULL); - if (ret < 0) - goto policy_add_err; - while (nb_flows) { - ret = rte_flow_pull(dev->data->port_id, - CTRL_QUEUE_ID(priv), result, - nb_flows, NULL); - if (ret < 0) - goto policy_add_err; - for (j = 0; j < ret; j++) { - if (result[j].status == RTE_FLOW_OP_ERROR) - goto policy_add_err; - } - nb_flows -= ret; - } - } - rte_spinlock_unlock(&priv->hw_ctrl_lock); - return 0; -policy_add_err: - rte_spinlock_unlock(&priv->hw_ctrl_lock); - ret = mlx5_flow_meter_policy_hws_delete(dev, policy_id, error); - memset(mtr_policy, 0, sizeof(struct mlx5_flow_meter_policy)); - if (ret) - return ret; - return -rte_mtr_error_set(error, ENOTSUP, - RTE_MTR_ERROR_TYPE_UNSPECIFIED, - NULL, "Failed to create meter policy."); -} -#endif /** * Check meter validation. * @@ -1922,92 +1545,6 @@ error: NULL, "Failed to create devx meter."); } -#if defined(HAVE_MLX5_HWS_SUPPORT) -/** - * Create meter rules. - * - * @param[in] dev - * Pointer to Ethernet device. - * @param[in] meter_id - * Meter id. - * @param[in] params - * Pointer to rte meter parameters. - * @param[in] shared - * Meter shared with other flow or not. - * @param[out] error - * Pointer to rte meter error structure. - * - * @return - * 0 on success, a negative errno value otherwise and rte_errno is set. - */ -static int -mlx5_flow_meter_hws_create(struct rte_eth_dev *dev, uint32_t meter_id, - struct rte_mtr_params *params, int shared, - struct rte_mtr_error *error) -{ - struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_flow_meter_profile *profile; - struct mlx5_flow_meter_info *fm; - struct mlx5_flow_meter_policy *policy = NULL; - struct mlx5_aso_mtr *aso_mtr; - int ret; - - if (!priv->mtr_profile_arr || - !priv->mtr_policy_arr || - !priv->mtr_bulk.aso) - return -rte_mtr_error_set(error, ENOTSUP, - RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL, - "Meter bulk array is not allocated."); - /* Meter profile must exist. */ - profile = mlx5_flow_meter_profile_find(priv, params->meter_profile_id); - if (!profile->initialized) - return -rte_mtr_error_set(error, ENOENT, - RTE_MTR_ERROR_TYPE_METER_PROFILE_ID, - NULL, "Meter profile id not valid."); - /* Meter policy must exist. */ - policy = mlx5_flow_meter_policy_find(dev, - params->meter_policy_id, NULL); - if (!policy->initialized) - return -rte_mtr_error_set(error, ENOENT, - RTE_MTR_ERROR_TYPE_METER_POLICY_ID, - NULL, "Meter policy id not valid."); - /* Meter ID must be valid. */ - if (meter_id >= priv->mtr_config.nb_meters) - return -rte_mtr_error_set(error, EINVAL, - RTE_MTR_ERROR_TYPE_MTR_ID, - NULL, "Meter id not valid."); - /* Find ASO object. */ - aso_mtr = mlx5_aso_meter_by_idx(priv, meter_id); - fm = &aso_mtr->fm; - if (fm->initialized) - return -rte_mtr_error_set(error, ENOENT, - RTE_MTR_ERROR_TYPE_MTR_ID, - NULL, "Meter object already exists."); - /* Fill the flow meter parameters. */ - fm->meter_id = meter_id; - fm->policy_id = params->meter_policy_id; - fm->profile = profile; - fm->meter_offset = meter_id; - fm->group = policy->group; - /* Add to the flow meter list. */ - fm->active_state = 1; /* Config meter starts as active. */ - fm->is_enable = params->meter_enable; - fm->shared = !!shared; - fm->initialized = 1; - /* Update ASO flow meter by wqe. */ - ret = mlx5_aso_meter_update_by_wqe(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr, - &priv->mtr_bulk, NULL, true); - if (ret) - return -rte_mtr_error_set(error, ENOTSUP, - RTE_MTR_ERROR_TYPE_UNSPECIFIED, - NULL, "Failed to create devx meter."); - fm->active_state = params->meter_enable; - __atomic_add_fetch(&fm->profile->ref_cnt, 1, __ATOMIC_RELAXED); - __atomic_add_fetch(&policy->ref_cnt, 1, __ATOMIC_RELAXED); - return 0; -} -#endif - static int mlx5_flow_meter_params_flush(struct rte_eth_dev *dev, struct mlx5_flow_meter_info *fm, @@ -2114,58 +1651,6 @@ mlx5_flow_meter_destroy(struct rte_eth_dev *dev, uint32_t meter_id, return 0; } -/** - * Destroy meter rules. - * - * @param[in] dev - * Pointer to Ethernet device. - * @param[in] meter_id - * Meter id. - * @param[out] error - * Pointer to rte meter error structure. - * - * @return - * 0 on success, a negative errno value otherwise and rte_errno is set. - */ -static int -mlx5_flow_meter_hws_destroy(struct rte_eth_dev *dev, uint32_t meter_id, - struct rte_mtr_error *error) -{ - struct mlx5_priv *priv = dev->data->dev_private; - struct mlx5_aso_mtr *aso_mtr; - struct mlx5_flow_meter_info *fm; - struct mlx5_flow_meter_policy *policy; - - if (!priv->mtr_profile_arr || - !priv->mtr_policy_arr || - !priv->mtr_bulk.aso) - return -rte_mtr_error_set(error, ENOTSUP, - RTE_MTR_ERROR_TYPE_METER_POLICY, NULL, - "Meter bulk array is not allocated."); - /* Find ASO object. */ - aso_mtr = mlx5_aso_meter_by_idx(priv, meter_id); - fm = &aso_mtr->fm; - if (!fm->initialized) - return -rte_mtr_error_set(error, ENOENT, - RTE_MTR_ERROR_TYPE_MTR_ID, - NULL, "Meter object id not valid."); - /* Meter object must not have any owner. */ - if (fm->ref_cnt > 0) - return -rte_mtr_error_set(error, EBUSY, - RTE_MTR_ERROR_TYPE_UNSPECIFIED, - NULL, "Meter object is being used."); - /* Destroy the meter profile. */ - __atomic_sub_fetch(&fm->profile->ref_cnt, - 1, __ATOMIC_RELAXED); - /* Destroy the meter policy. */ - policy = mlx5_flow_meter_policy_find(dev, - fm->policy_id, NULL); - __atomic_sub_fetch(&policy->ref_cnt, - 1, __ATOMIC_RELAXED); - memset(fm, 0, sizeof(struct mlx5_flow_meter_info)); - return 0; -} - /** * Modify meter state. * @@ -2497,14 +1982,6 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { .meter_profile_add = mlx5_flow_meter_profile_hws_add, .meter_profile_delete = mlx5_flow_meter_profile_hws_delete, .meter_profile_get = mlx5_flow_meter_profile_get, - .meter_policy_validate = mlx5_flow_meter_policy_hws_validate, - .meter_policy_add = mlx5_flow_meter_policy_hws_add, - .meter_policy_delete = mlx5_flow_meter_policy_hws_delete, - .meter_policy_get = mlx5_flow_meter_policy_get, - .create = mlx5_flow_meter_hws_create, - .destroy = mlx5_flow_meter_hws_destroy, - .meter_enable = mlx5_flow_meter_enable, - .meter_disable = mlx5_flow_meter_disable, .meter_profile_update = mlx5_flow_meter_profile_update, .meter_dscp_table_update = NULL, .stats_update = NULL, @@ -2948,14 +2425,6 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) NULL, "MTR object meter profile invalid."); } } - if (priv->mtr_bulk.aso) { - for (i = 0; i < priv->mtr_config.nb_meters; i++) { - aso_mtr = mlx5_aso_meter_by_idx(priv, i); - fm = &aso_mtr->fm; - if (fm->initialized) - mlx5_flow_meter_hws_destroy(dev, i, error); - } - } if (priv->policy_idx_tbl) { MLX5_L3T_FOREACH(priv->policy_idx_tbl, i, entry) { policy_idx = *(uint32_t *)entry; @@ -2981,20 +2450,6 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) mlx5_l3t_destroy(priv->policy_idx_tbl); priv->policy_idx_tbl = NULL; } -#if defined(HAVE_MLX5_HWS_SUPPORT) - if (priv->mtr_policy_arr) { - struct mlx5_flow_meter_policy *policy; - - for (i = 0; i < priv->mtr_config.nb_meter_policies; i++) { - policy = mlx5_flow_meter_policy_find(dev, i, - &policy_idx); - if (policy->initialized) { - mlx5_flow_meter_policy_hws_delete(dev, i, - error); - } - } - } -#endif if (priv->mtr_profile_tbl) { MLX5_L3T_FOREACH(priv->mtr_profile_tbl, i, entry) { fmp = entry; -- 2.47.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-06-12 22:06:24.712944105 +0100 +++ 0022-net-mlx5-remove-unsupported-flow-meter-action-in-HWS.patch 2025-06-12 22:06:23.830043794 +0100 @@ -1 +1 @@ -From 645f240d1cd57d0be1b773c739a5845a7663eeed Mon Sep 17 00:00:00 2001 +From 4901f59024732fd4bcdc09896e9cde2e91104884 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 645f240d1cd57d0be1b773c739a5845a7663eeed ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -18,2 +19,2 @@ - drivers/net/mlx5/mlx5_flow_meter.c | 552 ----------------------------- - 2 files changed, 637 deletions(-) + drivers/net/mlx5/mlx5_flow_meter.c | 545 ----------------------------- + 2 files changed, 630 deletions(-) @@ -22 +23 @@ -index d58f3d10a1..281f23366f 100644 +index 7040dd863d..ec44151302 100644 @@ -25 +26 @@ -@@ -1795,35 +1795,6 @@ flow_hw_represented_port_compile(struct rte_eth_dev *dev, +@@ -1167,35 +1167,6 @@ flow_hw_represented_port_compile(struct rte_eth_dev *dev, @@ -53 +54 @@ -- if (mlx5_aso_mtr_wait(priv, aso_mtr, true)) +- if (mlx5_aso_mtr_wait(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr)) @@ -61 +62 @@ -@@ -2545,7 +2516,6 @@ __flow_hw_translate_actions_template(struct rte_eth_dev *dev, +@@ -1389,7 +1360,6 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev, @@ -63 +63,0 @@ - bool recom_used = false; @@ -64,0 +65 @@ + uint16_t action_pos; @@ -67 +68 @@ - int ret, err; + int err; @@ -69,2 +70,2 @@ -@@ -2813,27 +2783,6 @@ __flow_hw_translate_actions_template(struct rte_eth_dev *dev, - masks, acts, src_pos, dr_pos, &sub_error)) +@@ -1605,27 +1575,6 @@ __flow_hw_actions_translate(struct rte_eth_dev *dev, + masks, acts, action_pos, &sub_error)) @@ -79 +80,2 @@ -- jump_pos = dr_pos + 1; +- action_pos = at->actions_off[actions - at->actions]; +- jump_pos = action_pos + 1; @@ -84,2 +86 @@ -- dr_pos, jump_pos, actions, acts, -- &sub_error); +- action_pos, jump_pos, actions, acts, &sub_error); @@ -89,3 +90,3 @@ -- actions->type, -- src_pos, -- dr_pos)) +- actions->type, +- actions - action_start, +- action_pos)) @@ -95 +96 @@ - ret = flow_hw_translate_group(dev, cfg, attr->group, + flow_hw_translate_group(dev, cfg, attr->group, @@ -97,2 +98,2 @@ -@@ -3521,7 +3470,6 @@ flow_hw_actions_construct(struct rte_eth_dev *dev, - const struct rte_flow_action_ipv6_ext_push *ipv6_push; +@@ -2198,7 +2147,6 @@ flow_hw_actions_construct(struct rte_eth_dev *dev, + const struct rte_flow_action_raw_encap *raw_encap_data; @@ -103 +104 @@ - const struct rte_flow_action_nat64 *nat64_c = NULL; + uint8_t *buf = job->encap_data; @@ -105,3 +106,3 @@ -@@ -3694,28 +3642,6 @@ flow_hw_actions_construct(struct rte_eth_dev *dev, - rule_acts + act_data->action_dst, - act_data->shared_meter.id); +@@ -2348,28 +2296,6 @@ flow_hw_actions_construct(struct rte_eth_dev *dev, + rule_acts[act_data->action_dst].action = + priv->hw_vport[port_action->port_id]; @@ -126,3 +127,3 @@ -- flow->jump = jump; -- flow->flags |= MLX5_FLOW_HW_FLOW_FLAG_FATE_JUMP; -- if (mlx5_aso_mtr_wait(priv, aso_mtr, true)) +- job->flow->jump = jump; +- job->flow->fate_type = MLX5_FLOW_FATE_JUMP; +- if (mlx5_aso_mtr_wait(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr)) @@ -132 +132,0 @@ - aux = mlx5_flow_hw_aux(dev->data->port_id, flow); @@ -134,3 +134,4 @@ -@@ -7345,10 +7271,6 @@ mlx5_flow_hw_actions_validate(struct rte_eth_dev *dev, - } - action_flags |= MLX5_FLOW_ACTION_IPV6_ROUTING_REMOVE; + /* +@@ -4082,10 +4008,6 @@ mlx5_flow_hw_actions_validate(struct rte_eth_dev *dev, + /* TODO: Validation logic */ + action_flags |= MLX5_FLOW_ACTION_DECAP; @@ -143,3 +144,3 @@ - ret = flow_hw_validate_action_meter_mark(dev, action, false, error); - if (ret < 0) -@@ -7676,13 +7598,6 @@ flow_hw_parse_flow_actions_to_dr_actions(struct rte_eth_dev *dev, + ret = flow_hw_validate_action_meter_mark(dev, action, + error); +@@ -4321,13 +4243,6 @@ flow_hw_dr_actions_template_create(struct rte_flow_actions_template *at) @@ -150 +151 @@ -- at->dr_off[i] = curr_off; +- at->actions_off[i] = curr_off; @@ -154 +155 @@ -- action_types[curr_off++] = MLX5DR_ACTION_TYP_TBL; +- action_types[curr_off++] = MLX5DR_ACTION_TYP_FT; @@ -158 +159 @@ - at->dr_off[i] = curr_off; + at->actions_off[i] = curr_off; @@ -160 +161 @@ -index dab3c4bf77..cd6a804593 100644 +index 0ffe738ec5..4dd751f3d9 100644 @@ -163 +164 @@ -@@ -1166,49 +1166,6 @@ mlx5_flow_meter_policy_validate(struct rte_eth_dev *dev, +@@ -851,45 +851,6 @@ mlx5_flow_meter_policy_validate(struct rte_eth_dev *dev, @@ -192,4 +192,0 @@ -- if (mlx5_hws_active(dev) && !mlx5_hw_ctx_validate(dev, NULL)) -- return -rte_mtr_error_set(error, EINVAL, -- RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL, -- "non-template flow engine was not configured"); @@ -213 +210 @@ -@@ -1540,334 +1497,6 @@ mlx5_flow_meter_policy_get(struct rte_eth_dev *dev, +@@ -1215,344 +1176,6 @@ mlx5_flow_meter_policy_get(struct rte_eth_dev *dev, @@ -245 +242,9 @@ -- return mlx5_flow_meter_policy_delete(dev, policy_id, error); +- return -rte_mtr_error_set(error, ENOTSUP, +- RTE_MTR_ERROR_TYPE_UNSPECIFIED, +- NULL, "Meter policy array is not allocated"); +- /* Meter id must be valid. */ +- if (policy_id >= priv->mtr_config.nb_meter_policies) +- return -rte_mtr_error_set(error, EINVAL, +- RTE_MTR_ERROR_TYPE_METER_POLICY_ID, +- &policy_id, +- "Meter policy id not valid."); @@ -356,4 +360,0 @@ -- if (mlx5_hws_active(dev) && !mlx5_hw_ctx_validate(dev, NULL)) -- return -rte_mtr_error_set(error, EINVAL, -- RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL, -- "non-template flow engine was not configured"); @@ -361 +362,7 @@ -- return mlx5_flow_meter_policy_add(dev, policy_id, policy, error); +- return -rte_mtr_error_set(error, ENOTSUP, +- RTE_MTR_ERROR_TYPE_METER_POLICY, +- NULL, "Meter policy array is not allocated."); +- if (policy_id >= priv->mtr_config.nb_meter_policies) +- return -rte_mtr_error_set(error, ENOTSUP, +- RTE_MTR_ERROR_TYPE_METER_POLICY_ID, +- NULL, "Meter policy id not valid."); @@ -548 +555 @@ -@@ -2239,105 +1868,6 @@ error: +@@ -1922,92 +1545,6 @@ error: @@ -580 +586,0 @@ -- struct mlx5_hw_q_job *job; @@ -583,4 +588,0 @@ -- if (mlx5_hws_active(dev) && !mlx5_hw_ctx_validate(dev, NULL)) -- return -rte_mtr_error_set(error, EINVAL, -- RTE_MTR_ERROR_TYPE_UNSPECIFIED, NULL, -- "non-template flow engine was not configured"); @@ -630,10 +632,3 @@ -- job = mlx5_flow_action_job_init(priv, MLX5_HW_INV_QUEUE, NULL, NULL, -- NULL, MLX5_HW_Q_JOB_TYPE_CREATE, NULL); -- if (!job) -- return -rte_mtr_error_set(error, ENOMEM, -- RTE_MTR_ERROR_TYPE_MTR_ID, -- NULL, "No job context."); -- ret = mlx5_aso_meter_update_by_wqe(priv, MLX5_HW_INV_QUEUE, aso_mtr, -- &priv->mtr_bulk, job, true); -- if (ret) { -- flow_hw_job_put(priv, job, CTRL_QUEUE_ID(priv)); +- ret = mlx5_aso_meter_update_by_wqe(priv->sh, MLX5_HW_INV_QUEUE, aso_mtr, +- &priv->mtr_bulk, NULL, true); +- if (ret) @@ -641,3 +636,2 @@ -- RTE_MTR_ERROR_TYPE_UNSPECIFIED, -- NULL, "Failed to create devx meter."); -- } +- RTE_MTR_ERROR_TYPE_UNSPECIFIED, +- NULL, "Failed to create devx meter."); @@ -645,2 +639,2 @@ -- rte_atomic_fetch_add_explicit(&fm->profile->ref_cnt, 1, rte_memory_order_relaxed); -- rte_atomic_fetch_add_explicit(&policy->ref_cnt, 1, rte_memory_order_relaxed); +- __atomic_add_fetch(&fm->profile->ref_cnt, 1, __ATOMIC_RELAXED); +- __atomic_add_fetch(&policy->ref_cnt, 1, __ATOMIC_RELAXED); @@ -654 +648 @@ -@@ -2444,58 +1974,6 @@ mlx5_flow_meter_destroy(struct rte_eth_dev *dev, uint32_t meter_id, +@@ -2114,58 +1651,6 @@ mlx5_flow_meter_destroy(struct rte_eth_dev *dev, uint32_t meter_id, @@ -699,2 +693,2 @@ -- rte_atomic_fetch_sub_explicit(&fm->profile->ref_cnt, -- 1, rte_memory_order_relaxed); +- __atomic_sub_fetch(&fm->profile->ref_cnt, +- 1, __ATOMIC_RELAXED); @@ -704,2 +698,2 @@ -- rte_atomic_fetch_sub_explicit(&policy->ref_cnt, -- 1, rte_memory_order_relaxed); +- __atomic_sub_fetch(&policy->ref_cnt, +- 1, __ATOMIC_RELAXED); @@ -713 +707 @@ -@@ -2835,14 +2313,6 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { +@@ -2497,14 +1982,6 @@ static const struct rte_mtr_ops mlx5_flow_mtr_hws_ops = { @@ -728 +722 @@ -@@ -3286,14 +2756,6 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) +@@ -2948,14 +2425,6 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) @@ -743 +737 @@ -@@ -3319,20 +2781,6 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error) +@@ -2981,20 +2450,6 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error)