DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bing Zhao <bingz@nvidia.com>
To: <viacheslavo@nvidia.com>, <matan@nvidia.com>
Cc: <dev@dpdk.org>, <orika@nvidia.com>, <rasland@nvidia.com>,
	<thomas@monjalon.net>
Subject: [dpdk-dev] [PATCH] net/mlx5: fix the green color policy RSS queues overwritten
Date: Thu, 29 Jul 2021 19:04:04 +0300	[thread overview]
Message-ID: <20210729160405.161982-3-bingz@nvidia.com> (raw)
In-Reply-To: <20210729160405.161982-1-bingz@nvidia.com>

Both green policy and yellow policy could support RSS actions
simultaneous, the Rx queues configuration may be different between
them while the other fields should be the same.

When the only green color policy was supported in the past, the
queues copied and saved in the temporary workspace were used. Since
the yellow support was added, the queues stored in the thread
workspace would be overwritten by the yellow color policy. The flow
rule created using a meter with such a policy would have the same
RSS distribution for both green and yellow packets.

By using the meter action containers RSS information instead of the
workspace RSS, this overwritten can be prevented.

Fixes: b38a12272b3a ("net/mlx5: split meter color policy handling")

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

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index f7f16883cd..0689e6d45d 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -4710,7 +4710,7 @@ get_meter_sub_policy(struct rte_eth_dev *dev,
 			uint8_t fate = final_policy->act_cnt[i].fate_action;
 
 			if (fate == MLX5_FLOW_FATE_SHARED_RSS) {
-				const void *rss_act =
+				const struct rte_flow_action_rss *rss_act =
 					final_policy->act_cnt[i].rss->conf;
 				struct rte_flow_action rss_actions[2] = {
 					[0] = {
@@ -4746,6 +4746,9 @@ get_meter_sub_policy(struct rte_eth_dev *dev,
 				rss_desc_v[i].tunnel =
 						!!(dev_flow.handle->layers &
 						   MLX5_FLOW_LAYER_TUNNEL);
+				/* Use the RSS queues in the containers. */
+				rss_desc_v[i].queue =
+					(uint16_t *)(uintptr_t)rss_act->queue;
 				rss_desc[i] = &rss_desc_v[i];
 			} else if (fate == MLX5_FLOW_FATE_QUEUE) {
 				/* This is queue action. */
-- 
2.27.0


  parent reply	other threads:[~2021-07-29 16:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 16:04 [dpdk-dev] [PATCH] net/mlx5: fix meter profile validation Bing Zhao
2021-07-29 16:04 ` [dpdk-dev] [PATCH] net/mlx5: fix the EIR calculation Bing Zhao
2021-07-29 20:06   ` Raslan Darawsheh
2021-07-29 16:04 ` Bing Zhao [this message]
2021-07-29 20:07   ` [dpdk-dev] [PATCH] net/mlx5: fix the green color policy RSS queues overwritten Raslan Darawsheh
2021-07-29 16:04 ` [dpdk-dev] [PATCH] net/mlx5: fix the meter hierarchy validation with yellow Bing Zhao
2021-07-29 20:07   ` Raslan Darawsheh
2021-07-29 20:04 ` [dpdk-dev] [PATCH] net/mlx5: fix meter profile validation 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=20210729160405.161982-3-bingz@nvidia.com \
    --to=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --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).