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 19298454E9 for ; Tue, 25 Jun 2024 02:03:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14901410DC; Tue, 25 Jun 2024 02:03:22 +0200 (CEST) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mails.dpdk.org (Postfix) with ESMTP id 707A440EDD for ; Tue, 25 Jun 2024 02:03:21 +0200 (CEST) Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-3620ee2cdf7so3136061f8f.3 for ; Mon, 24 Jun 2024 17:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719273801; x=1719878601; 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=bpCKkD9izbx8D59+WFc9WH46xIJL11iZaWpsfly8lRc=; b=blEIoZSabbd2UjB4U3vMaZ7ddaVdiOHICJ4A/JyeRbocu/GfMuTiV6Cll/yLHITYHq jKZENJT3Icos4H5mIJuYmE7vK5z50N0cLn2/nnfsf4/CYemEnjt3AgTH1ZgxUZXJl4/y 6I0UmCKbyhN7sdcSW4G3XTMDQSwax/Wwhnm5NQ0jWi1GCNkJ7jfhwIBtno8Cp7KhGQ/F RtBkJH1RAXHeWP98yrWJahaxTj0IL9kPnSPTZaBJ5as0FgEzwgEJMDzb7b3F7Qo545ux G6bGlUvyLfLUfekxii2j6Q1hFKDjD3r1E80LVIgabb/MD6Ymm6FHvzLgWGShirUjXLkc Xbwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719273801; x=1719878601; 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=bpCKkD9izbx8D59+WFc9WH46xIJL11iZaWpsfly8lRc=; b=I0I+9iYv093fi1g/YOnbQXzHUU6L1ts9fZGllmVz7C7QpHTGpPxQ15fY13te6mY5QT onvBS4hYNlENj1VOjPcZLDpMGjWdAmzOOsNNNJD7hbDBElvumw1Z8JwOiSAozLeI0kaP imTGVYLlMk+EalaQiyujawFZ/N4H/D1TVZocWQoNJxPhsPEnSeyBNpQiBBjl6Lyjte1S 1AwJXuCZiQf3hEEXchfA+Nsk8Eadfrx4FzEoWHbAxnLUAqxcLucNHEzj8EvgGfKKsYIx TT0brdn97++pgzPevljs+Ma9szOrseyAtILK8yx1bFJEnN78IjmcplnF+ehEB9Qu1qTt QwSQ== X-Forwarded-Encrypted: i=1; AJvYcCX9szu8opY19A81rEEQb4QFOEud8y2tK/r8UFuf3XKJ7Itn1yh5q03Wfrow3kaL97wVcCj+vxuEdlrYZo2sfa0= X-Gm-Message-State: AOJu0Yx2HHeU9zfcFEYHy3rYAbfkc2cXrVfRAduyROBDkgWv6jedynkx 0VdMnFBfGLuECRVk80lk9NMcB8r3v3Iwy7FQGN7TZ624oJyPwStT4o2bzSuF X-Google-Smtp-Source: AGHT+IHqNtbg9OBfBCl0MBvqkd17KSLWK+yaWw7vcX/JKIpaRGrD2NiyzPKA1/sND3R8A/ThYJjw7g== X-Received: by 2002:a5d:526d:0:b0:35e:4f42:6016 with SMTP id ffacd0b85a97d-366e7a35de0mr4619437f8f.30.1719273800888; Mon, 24 Jun 2024 17:03:20 -0700 (PDT) Received: from localhost ([137.220.120.171]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36638ab8334sm11307413f8f.48.2024.06.24.17.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jun 2024 17:03:20 -0700 (PDT) From: luca.boccassi@gmail.com To: Shun Hao Cc: Suanming Mou , dpdk stable Subject: patch 'net/mlx5: support jump in meter hierarchy' has been queued to stable release 22.11.6 Date: Tue, 25 Jun 2024 00:59:02 +0100 Message-Id: <20240624235907.885628-76-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240624235907.885628-1-luca.boccassi@gmail.com> References: <20240624235907.885628-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.6 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/27/24. 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/aadaf7fe72821e2d27cbf4f95c25b909ededc49d Thanks. Luca Boccassi --- >From aadaf7fe72821e2d27cbf4f95c25b909ededc49d Mon Sep 17 00:00:00 2001 From: Shun Hao Date: Tue, 4 Jun 2024 05:51:56 +0300 Subject: [PATCH] net/mlx5: support jump in meter hierarchy [ upstream commit dc1d92a4f547f8af6eb9b8824257ab3fd8dfbc77 ] Currently in meter hierarchy, only meter action is supported for green and yellow policy flow. This patch adds support of jump action for green or yellow policy flow. Fixes: 96ca87da4f46 ("net/mlx5: validate yellow meter action") Signed-off-by: Shun Hao Acked-by: Suanming Mou --- drivers/net/mlx5/mlx5_flow_dv.c | 36 ++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index f8431386e0..2bdca754bc 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -17173,7 +17173,7 @@ __flow_dv_create_policy_matcher(struct rte_eth_dev *dev, static int __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, struct mlx5_flow_meter_sub_policy *sub_policy, - uint8_t egress, uint8_t transfer, bool match_src_port, + uint8_t egress, uint8_t transfer, bool *match_src_port, struct mlx5_meter_policy_acts acts[RTE_COLORS]) { struct mlx5_priv *priv = dev->data->dev_private; @@ -17188,6 +17188,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, .reserved = 0, }; int i; + uint16_t priority; int ret = mlx5_flow_get_reg_id(dev, MLX5_MTR_COLOR, 0, &flow_err); struct mlx5_sub_policy_color_rule *color_rule; struct mlx5_sub_policy_color_rule *tmp_rules[RTE_COLORS] = {NULL}; @@ -17222,12 +17223,12 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, TAILQ_INSERT_TAIL(&sub_policy->color_rules[i], color_rule, next_port); color_rule->src_port = priv->representor_id; - /* No use. */ - attr.priority = i; + priority = (match_src_port[i] == match_src_port[RTE_COLOR_GREEN]) ? + MLX5_MTR_POLICY_MATCHER_PRIO : (MLX5_MTR_POLICY_MATCHER_PRIO + 1); /* Create matchers for colors. */ if (__flow_dv_create_policy_matcher(dev, color_reg_c_idx, - MLX5_MTR_POLICY_MATCHER_PRIO, sub_policy, - &attr, match_src_port, NULL, + priority, sub_policy, + &attr, match_src_port[i], NULL, &color_rule->matcher, &flow_err)) { DRV_LOG(ERR, "Failed to create color%u matcher.", i); goto err_exit; @@ -17237,7 +17238,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, color_reg_c_idx, (enum rte_color)i, color_rule->matcher, acts[i].actions_n, acts[i].dv_actions, - match_src_port, NULL, &color_rule->rule, + match_src_port[i], NULL, &color_rule->rule, &attr)) { DRV_LOG(ERR, "Failed to create color%u rule.", i); goto err_exit; @@ -17285,7 +17286,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev, uint8_t egress = (domain == MLX5_MTR_DOMAIN_EGRESS) ? 1 : 0; uint8_t transfer = (domain == MLX5_MTR_DOMAIN_TRANSFER) ? 1 : 0; bool mtr_first = egress || (transfer && priv->representor_id != UINT16_MAX); - bool match_src_port = false; + bool match_src_port[RTE_COLORS] = {false}; int i; /* If RSS or Queue, no previous actions / rules is created. */ @@ -17356,7 +17357,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev, acts[i].dv_actions[acts[i].actions_n] = port_action->action; acts[i].actions_n++; - match_src_port = true; + match_src_port[i] = true; break; case MLX5_FLOW_FATE_DROP: case MLX5_FLOW_FATE_JUMP: @@ -17408,7 +17409,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev, acts[i].dv_actions[acts[i].actions_n++] = tbl_data->jump.action; if (mtr_policy->act_cnt[i].modify_hdr) - match_src_port = !!transfer; + match_src_port[i] = !!transfer; break; default: /*Queue action do nothing*/ @@ -17422,9 +17423,9 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev, "Failed to create policy rules per domain."); goto err_exit; } - if (match_src_port) { - mtr_policy->match_port = match_src_port; - mtr_policy->hierarchy_match_port = match_src_port; + if (match_src_port[RTE_COLOR_GREEN] || match_src_port[RTE_COLOR_YELLOW]) { + mtr_policy->match_port = 1; + mtr_policy->hierarchy_match_port = 1; } return 0; err_exit: @@ -17486,6 +17487,7 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain) uint8_t egress, transfer; struct rte_flow_error error; struct mlx5_meter_policy_acts acts[RTE_COLORS]; + bool match_src_port[RTE_COLORS] = {false}; int ret; egress = (domain == MLX5_MTR_DOMAIN_EGRESS) ? 1 : 0; @@ -17561,7 +17563,7 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain) /* Create default policy rules. */ ret = __flow_dv_create_domain_policy_rules(dev, &def_policy->sub_policy, - egress, transfer, false, acts); + egress, transfer, match_src_port, acts); if (ret) { DRV_LOG(ERR, "Failed to create default policy rules."); goto def_policy_error; @@ -19142,11 +19144,13 @@ flow_dv_validate_mtr_policy_acts(struct rte_eth_dev *dev, } } if (next_mtr && *policy_mode == MLX5_MTR_POLICY_MODE_ALL) { - if (!(action_flags[RTE_COLOR_GREEN] & action_flags[RTE_COLOR_YELLOW] & - MLX5_FLOW_ACTION_METER_WITH_TERMINATED_POLICY)) + uint64_t hierarchy_type_flag = + MLX5_FLOW_ACTION_METER_WITH_TERMINATED_POLICY | MLX5_FLOW_ACTION_JUMP; + if (!(action_flags[RTE_COLOR_GREEN] & hierarchy_type_flag) || + !(action_flags[RTE_COLOR_YELLOW] & hierarchy_type_flag)) return -rte_mtr_error_set(error, EINVAL, RTE_MTR_ERROR_TYPE_METER_POLICY, NULL, - "Meter hierarchy supports meter action only."); + "Unsupported action in meter hierarchy."); } /* If both colors have RSS, the attributes should be the same. */ if (flow_dv_mtr_policy_rss_compare(rss_color[RTE_COLOR_GREEN], -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-06-25 00:22:17.447954111 +0100 +++ 0076-net-mlx5-support-jump-in-meter-hierarchy.patch 2024-06-25 00:22:13.297187932 +0100 @@ -1 +1 @@ -From dc1d92a4f547f8af6eb9b8824257ab3fd8dfbc77 Mon Sep 17 00:00:00 2001 +From aadaf7fe72821e2d27cbf4f95c25b909ededc49d Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit dc1d92a4f547f8af6eb9b8824257ab3fd8dfbc77 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index 99abb2f2fb..220d92b1a7 100644 +index f8431386e0..2bdca754bc 100644 @@ -23 +24 @@ -@@ -17963,7 +17963,7 @@ __flow_dv_create_policy_matcher(struct rte_eth_dev *dev, +@@ -17173,7 +17173,7 @@ __flow_dv_create_policy_matcher(struct rte_eth_dev *dev, @@ -32 +33 @@ -@@ -17978,6 +17978,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, +@@ -17188,6 +17188,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, @@ -40 +41 @@ -@@ -18012,12 +18013,12 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, +@@ -17222,12 +17223,12 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, @@ -57 +58 @@ -@@ -18027,7 +18028,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, +@@ -17237,7 +17238,7 @@ __flow_dv_create_domain_policy_rules(struct rte_eth_dev *dev, @@ -66 +67 @@ -@@ -18075,7 +18076,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev, +@@ -17285,7 +17286,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev, @@ -75 +76 @@ -@@ -18146,7 +18147,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev, +@@ -17356,7 +17357,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev, @@ -84 +85 @@ -@@ -18198,7 +18199,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev, +@@ -17408,7 +17409,7 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev, @@ -93 +94 @@ -@@ -18212,9 +18213,9 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev, +@@ -17422,9 +17423,9 @@ __flow_dv_create_policy_acts_rules(struct rte_eth_dev *dev, @@ -106 +107 @@ -@@ -18276,6 +18277,7 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain) +@@ -17486,6 +17487,7 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain) @@ -114 +115 @@ -@@ -18351,7 +18353,7 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain) +@@ -17561,7 +17563,7 @@ __flow_dv_create_domain_def_policy(struct rte_eth_dev *dev, uint32_t domain) @@ -123 +124 @@ -@@ -19934,11 +19936,13 @@ flow_dv_validate_mtr_policy_acts(struct rte_eth_dev *dev, +@@ -19142,11 +19144,13 @@ flow_dv_validate_mtr_policy_acts(struct rte_eth_dev *dev,