patch 'net/mlx5: fix counter in non-termination meter' has been queued to stable release 21.11.2
Kevin Traynor
ktraynor at redhat.com
Tue May 10 14:29:51 CEST 2022
Hi,
FYI, your patch has been queued to stable release 21.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/15/22. 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/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/c08c6247f23e2147c8191741c42c2d3c6d240b83
Thanks.
Kevin
---
>From c08c6247f23e2147c8191741c42c2d3c6d240b83 Mon Sep 17 00:00:00 2001
From: Shun Hao <shunh at nvidia.com>
Date: Wed, 6 Apr 2022 11:54:01 +0300
Subject: [PATCH] net/mlx5: fix counter in non-termination meter
[ upstream commit 4fa1452bcaa452f7fa0214b78a2e0e2032deed40 ]
In rte_flow, if a counter action is before a meter which has
non-termination policy, the counter value only includes packets not
being dropped.
This patch fixes this issue by differentiating the order of counter and
non-termination meter:
1. counter + meter, counts all packets hitting this flow.
2. meter + counter, only counts packets not being dropped.
Fixes: 51ec04dc7bcf ("net/mlx5: connect meter policy to created flows")
Signed-off-by: Shun Hao <shunh at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
drivers/net/mlx5/mlx5_flow.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 1ea6d030f3..3574358c72 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -5044,4 +5044,5 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
uint32_t flow_id_reversed = 0;
uint8_t flow_id_bits = 0;
+ bool after_meter = false;
int shift;
@@ -5110,4 +5111,5 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
action_cur = actions_pre++;
}
+ after_meter = true;
break;
case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP:
@@ -5138,4 +5140,9 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
}
break;
+ case RTE_FLOW_ACTION_TYPE_COUNT:
+ if (fm->def_policy)
+ action_cur = after_meter ?
+ actions_sfx++ : actions_pre++;
+ break;
default:
break;
@@ -6168,6 +6175,8 @@ flow_create_split_meter(struct rte_eth_dev *dev,
(!has_modify || !fm->drop_cnt))
set_mtr_reg = false;
- /* Prefix actions: meter, decap, encap, tag, jump, end. */
- act_size = sizeof(struct rte_flow_action) * (actions_n + 6) +
+ /* Prefix actions: meter, decap, encap, tag, jump, end, cnt. */
+#define METER_PREFIX_ACTION 7
+ act_size = (sizeof(struct rte_flow_action) *
+ (actions_n + METER_PREFIX_ACTION)) +
sizeof(struct mlx5_rte_flow_action_set_tag);
/* Suffix items: tag, vlan, port id, end. */
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2022-05-10 13:24:21.994006492 +0100
+++ 0014-net-mlx5-fix-counter-in-non-termination-meter.patch 2022-05-10 13:24:21.587646339 +0100
@@ -1 +1 @@
-From 4fa1452bcaa452f7fa0214b78a2e0e2032deed40 Mon Sep 17 00:00:00 2001
+From c08c6247f23e2147c8191741c42c2d3c6d240b83 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4fa1452bcaa452f7fa0214b78a2e0e2032deed40 ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index 78cb38d42b..28afdfe011 100644
+index 1ea6d030f3..3574358c72 100644
@@ -28 +29 @@
-@@ -5272,4 +5272,5 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
+@@ -5044,4 +5044,5 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
@@ -34 +35 @@
-@@ -5338,4 +5339,5 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
+@@ -5110,4 +5111,5 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
@@ -40 +41 @@
-@@ -5366,4 +5368,9 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
+@@ -5138,4 +5140,9 @@ flow_meter_split_prep(struct rte_eth_dev *dev,
@@ -50 +51 @@
-@@ -6394,6 +6401,8 @@ flow_create_split_meter(struct rte_eth_dev *dev,
+@@ -6168,6 +6175,8 @@ flow_create_split_meter(struct rte_eth_dev *dev,
More information about the stable
mailing list