DPDK patches and discussions
 help / color / mirror / Atom feed
From: Li Zhang <lizh@nvidia.com>
To: <orika@nvidia.com>, <viacheslavo@nvidia.com>, <matan@nvidia.com>,
	<shahafs@nvidia.com>
Cc: <dev@dpdk.org>, <thomas@monjalon.net>, <rasland@nvidia.com>,
	<roniba@nvidia.com>, <stable@dpdk.org>
Subject: [dpdk-dev] [PATCH] net/mlx5: fix meter policy with RSS action
Date: Wed, 23 Jun 2021 10:24:40 +0300	[thread overview]
Message-ID: <20210623072443.121380-1-lizh@nvidia.com> (raw)

When creating the meter sub-policy RSS rule,
the RSS descriptor was used before its update.
It also need update tunnel bit in RSS descriptor
after flow translate.

Use it only when it is updated.

Fixes: ec962bad14e ("net/mlx5: fix metering cleanup on stop")
Cc: stable@dpdk.org

Signed-off-by: Li Zhang <lizh@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index c5c767aaee..c5d4a95a8f 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -4613,7 +4613,6 @@ get_meter_sub_policy(struct rte_eth_dev *dev,
 			struct mlx5_flow dev_flow = {0};
 			struct mlx5_flow_handle dev_handle = { {0} };
 
-			rss_desc_v[i] = wks->rss_desc;
 			if (policy->is_rss) {
 				const void *rss_act =
 					policy->act_cnt[i].rss->conf;
@@ -4641,14 +4640,19 @@ get_meter_sub_policy(struct rte_eth_dev *dev,
 				if (flow_drv_translate(dev, &dev_flow, attr,
 						items, rss_actions, error))
 					goto exit;
+				rss_desc_v[i] = wks->rss_desc;
 				rss_desc_v[i].key_len = MLX5_RSS_HASH_KEY_LEN;
 				rss_desc_v[i].hash_fields =
 						dev_flow.hash_fields;
 				rss_desc_v[i].queue_num =
 						rss_desc_v[i].hash_fields ?
 						rss_desc_v[i].queue_num : 1;
+				rss_desc_v[i].tunnel =
+					!!(dev_flow.handle->layers &
+					MLX5_FLOW_LAYER_TUNNEL);
 			} else {
 				/* This is queue action. */
+				rss_desc_v[i] = wks->rss_desc;
 				rss_desc_v[i].key_len = 0;
 				rss_desc_v[i].hash_fields = 0;
 				rss_desc_v[i].queue =
-- 
2.27.0


             reply	other threads:[~2021-06-23  7:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-23  7:24 Li Zhang [this message]
2021-06-28  8:33 ` 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=20210623072443.121380-1-lizh@nvidia.com \
    --to=lizh@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=roniba@nvidia.com \
    --cc=shahafs@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@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).