patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Xiaoyu Min <jackmin@nvidia.com>
To: <stable@dpdk.org>
Cc: <christian.ehrhardt@canonical.com>, Matan Azrad <matan@nvidia.com>
Subject: [dpdk-stable] [PATCH 19.11 3/4] net/mlx5: limit inner RSS expansion for MPLS
Date: Sat, 14 Aug 2021 15:19:35 +0800	[thread overview]
Message-ID: <591a1c75ff9a57e90f884abb13839b2bd62ad2b2.1628923046.git.jackmin@nvidia.com> (raw)
In-Reply-To: <cover.1628923046.git.jackmin@nvidia.com>

[ upstream commit a26cc30fa0463fb6707b0caea1a288dc54c09b0f ]

If user wants to do MPLS inner RSS and only provides pattern
till MPLS without inner items [1], RSS expansion will expand flows
into 13 sub-flows[2] which is too many and it impacts flow insert
rate, stack usage becomes large as well.

This expansion into 13 sub-flows seems not worthy of and it can
be significantly reduced (i.e, 7 sub-flows [3]) by user providing
at least one inner L2/L3 item [4].

[1]:
pattern eth / ipv4 / udp / mpls / end actions rss type tcp udp ip
end level 2 / end

[2]:
eth / ipv4 / udp / mpls
eth / ipv4 / udp / mpls / ipv4
eth / ipv4 / udp / mpls / ipv4 / udp
eth / ipv4 / udp / mpls / ipv4 / tcp
eth / ipv4 / udp / mpls / ipv6
eth / ipv4 / udp / mpls / ipv6 / udp
eth / ipv4 / udp / mpls / ipv6 / tcp
eth / ipv4 / udp / mpls / eth / ipv4
eth / ipv4 / udp / mpls / eth / ipv4 / udp
eth / ipv4 / udp / mpls / eth / ipv4 / tcp
eth / ipv4 / udp / mpls / eth / ipv6
eth / ipv4 / udp / mpls / eth / ipv6 / udp
eth / ipv4 / udp / mpls / eth / ipv6 / tcp

[3]:
eth / ipv4 / udp / mpls / eth
eth / ipv4 / udp / mpls / eth / ipv4 / udp
eth / ipv4 / udp / mpls / eth / ipv4 / tcp
eth / ipv4 / udp / mpls / eth / ipv6
eth / ipv4 / udp / mpls / eth / ipv6 / udp
eth / ipv4 / udp / mpls / eth / ipv6 / tcp

[4]:
pattern eth / ipv4 / udp / mpls / eth / end actions rss type tcp udp ip
level 2 / end

Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 0f0c779ca..494555b16 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1229,6 +1229,13 @@ mlx5_flow_validate_action_rss(const struct rte_flow_action *action,
 					  RTE_FLOW_ERROR_TYPE_ACTION_CONF, NULL,
 					  "inner RSS is not supported for "
 					  "non-tunnel flows");
+	if ((item_flags & MLX5_FLOW_LAYER_MPLS) &&
+	    !(item_flags &
+	      (MLX5_FLOW_LAYER_INNER_L2 | MLX5_FLOW_LAYER_INNER_L3)) &&
+	    rss->level > 1)
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ITEM, NULL,
+					  "MPLS inner RSS needs to specify inner L2/L3 items after MPLS in pattern");
 	return 0;
 }
 
-- 
2.32.0


  parent reply	other threads:[~2021-08-14  7:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-14  7:19 [dpdk-stable] [PATCH 19.11 0/4] fix MPLS & GRE key RSS expansion Xiaoyu Min
2021-08-14  7:19 ` [dpdk-stable] [PATCH 19.11 1/4] net/mlx5: fix RSS flow item expansion for GRE key Xiaoyu Min
2021-08-14  7:19 ` [dpdk-stable] [PATCH 19.11 2/4] net/mlx5: fix MPLS RSS expansion Xiaoyu Min
2021-08-14  7:19 ` Xiaoyu Min [this message]
2021-08-14  7:19 ` [dpdk-stable] [PATCH 19.11 4/4] net/mlx5: limit implicit MPLS RSS expansion over GRE Xiaoyu Min
2021-08-16  9:01 ` [dpdk-stable] [PATCH 19.11 0/4] fix MPLS & GRE key RSS expansion Christian Ehrhardt

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=591a1c75ff9a57e90f884abb13839b2bd62ad2b2.1628923046.git.jackmin@nvidia.com \
    --to=jackmin@nvidia.com \
    --cc=christian.ehrhardt@canonical.com \
    --cc=matan@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).