patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Shun Hao <shunh@nvidia.com>
Cc: Matan Azrad <matan@nvidia.com>, dpdk stable <stable@dpdk.org>
Subject: patch 'net/mlx5: fix counter in non-termination meter' has been queued to stable release 21.11.2
Date: Tue, 10 May 2022 13:29:51 +0100	[thread overview]
Message-ID: <20220510123010.159523-14-ktraynor@redhat.com> (raw)
In-Reply-To: <20220510123010.159523-1-ktraynor@redhat.com>

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@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@nvidia.com>
Acked-by: Matan Azrad <matan@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@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,


  parent reply	other threads:[~2022-05-10 12:30 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 12:29 patch 'eal/windows: add missing C++ include guards' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/dpaa2: fix dpdmux default interface' " Kevin Traynor
2022-05-10 12:29 ` patch 'examples/bond: fix invalid use of trylock' " Kevin Traynor
2022-05-10 12:29 ` patch 'test/bpf: skip test if libpcap is unavailable' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/ice: improve performance of Rx timestamp offload' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/i40e: populate error in flow director parser' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/ice: add missing Tx burst mode name' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/ice: refactor parser usage' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/ice: fix raw flow input pattern parsing' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/netvsc: fix calculation of checksums based on mbuf flag' " Kevin Traynor
2022-05-10 12:29 ` patch 'common/mlx5: fix memory region range calculation' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/mlx5: fix Tx when inlining is impossible' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/mlx5: fix probing with secondary bonding member' " Kevin Traynor
2022-05-10 12:29 ` Kevin Traynor [this message]
2022-05-10 12:29 ` patch 'net/mlx5: restrict Rx queue array access to boundary' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/mlx5: fix GTP handling in header modify action' " Kevin Traynor
2022-05-10 12:29 ` patch 'net/mlx5: fix Rx/Tx stats concurrency' " Kevin Traynor
2022-05-10 12:29 ` patch 'test/table: fix buffer overflow on lpm entry' " Kevin Traynor
2022-05-10 12:29 ` patch 'mem: skip attaching external memory in secondary process' " Kevin Traynor
2022-05-10 12:29 ` patch 'malloc: fix ASan handling for unmapped memory' " Kevin Traynor
2022-05-10 12:29 ` patch 'eal: fix C++ include for device event and DMA' " Kevin Traynor
2022-05-10 12:29 ` patch 'crypto/dpaa_sec: fix digest size' " Kevin Traynor
2022-05-10 12:30 ` patch 'security: fix SA lifetime comments' " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/mlx5: fix login cleanup' " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/dpaa2_sec: fix fle buffer leak' " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/dpaa2_sec: fix buffer pool ID check' " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/dpaa_sec: fix chained FD length in raw datapath' " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/dpaa2_sec: " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/dpaa_sec: fix secondary process probing' " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/dpaa2_sec: fix crypto operation pointer' " Kevin Traynor
2022-05-10 12:30 ` patch 'crypto/dpaa2_sec: fix operation status for simple FD' " Kevin Traynor
2022-05-10 12:30 ` patch 'common/dpaax: fix short MAC-I IV calculation for ZUC' " Kevin Traynor
2022-05-10 12:30 ` patch 'examples/l2fwd-crypto: fix stats refresh rate' " Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220510123010.159523-14-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=matan@nvidia.com \
    --cc=shunh@nvidia.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).