DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shun Hao <shunh@nvidia.com>
To: <viacheslavo@nvidia.com>, <matan@nvidia.com>, <orika@nvidia.com>,
	"Sean Zhang" <xiazhang@nvidia.com>
Cc: <dev@dpdk.org>, <rasland@nvidia.com>, <stable@dpdk.org>
Subject: [PATCH v1 3/3] net/mlx5: fix meter ID tag for meter hierarchy
Date: Sat, 17 Sep 2022 09:02:10 +0300	[thread overview]
Message-ID: <20220917060210.3332529-4-shunh@nvidia.com> (raw)
In-Reply-To: <20220917060210.3332529-1-shunh@nvidia.com>

Currently, when flow usese meter hierarchy, a tag action is always applied
to set the first meter's meter id, so as to update the first meter's drop
count. But it's not considered if first meter doesn't have drop count.

This patch fixes it, that in hierarchy, if the first meter doesn't have
drop count, no need to add the meter id tag action. No change for
non-hierarchy meter.

Fixes: e8146c63 ("net/mlx5: support represented port item in flow rules")
Cc: stable@dpdk.org

Signed-off-by: Shun Hao <shunh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 2038c4a6c0..e4744b0a67 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -6438,14 +6438,12 @@ flow_create_split_meter(struct rte_eth_dev *dev,
 		}
 		/*
 		 * If it isn't default-policy Meter, and
-		 * 1. There's no action in flow to change
+		 * 1. Not meter hierarchy and there's no action in flow to change
 		 *    packet (modify/encap/decap etc.), OR
 		 * 2. No drop count needed for this meter.
-		 * 3. It's not meter hierarchy.
 		 * Then no need to use regC to save meter id anymore.
 		 */
-		if (!fm->def_policy && !is_mtr_hierarchy &&
-		    (!has_modify || !fm->drop_cnt))
+		if (!fm->def_policy && ((!has_modify && !is_mtr_hierarchy) || !fm->drop_cnt))
 			set_mtr_reg = false;
 		/* Prefix actions: meter, decap, encap, tag, jump, end, cnt. */
 #define METER_PREFIX_ACTION 7
-- 
2.20.0


  parent reply	other threads:[~2022-09-17  6:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17  6:02 [PATCH v1 0/3] Fix meter hierarchy issue for represented port Shun Hao
2022-09-17  6:02 ` [PATCH v1 1/3] net/mlx5: fix meter hierarchy with represented port item Shun Hao
2022-09-17  6:02 ` [PATCH v1 2/3] net/mlx5: add meter flow limitation when matching all ports Shun Hao
2022-09-17  6:02 ` Shun Hao [this message]
2022-09-21 11:30 ` [PATCH v1 0/3] Fix meter hierarchy issue for represented port Raslan Darawsheh

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=20220917060210.3332529-4-shunh@nvidia.com \
    --to=shunh@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@nvidia.com \
    --cc=xiazhang@nvidia.com \
    /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).