patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Gregory Etelson <getelson@nvidia.com>
To: <dev@dpdk.org>, <getelson@nvidia.com>
Cc: <matan@nvidia.com>, <rasland@nvidia.com>, <stable@dpdk.org>,
	"Viacheslav Ovsiienko" <viacheslavo@nvidia.com>
Subject: [PATCH 2/5] net/mlx5: add Ethernet header to GENEVE RSS expansion
Date: Sun, 14 Nov 2021 17:36:13 +0200
Message-ID: <20211114153617.25085-2-getelson@nvidia.com> (raw)
In-Reply-To: <20211114153617.25085-1-getelson@nvidia.com>

RFC-8926 allows inner Ethernet header after GENEVE
tunnel.

Current GENEVE RSS expansion created IPv4 and IPv6 paths
only.

The patch adds Ethernet to RSS expansion scheme.

Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index f657980737..205fe19cdd 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -258,6 +258,29 @@ mlx5_flow_expand_rss_item_complete(const struct rte_flow_item *item)
 		else
 			ret = RTE_FLOW_ITEM_TYPE_END;
 		break;
+	case RTE_FLOW_ITEM_TYPE_GENEVE:
+		ether_type_m = item->mask ?
+			       ((const struct rte_flow_item_geneve *)
+			       (item->mask))->protocol :
+			       rte_flow_item_geneve_mask.protocol;
+		ether_type = ((const struct rte_flow_item_geneve *)
+			     (item->spec))->protocol;
+		ether_type_m = rte_be_to_cpu_16(ether_type_m);
+		ether_type = rte_be_to_cpu_16(ether_type);
+		switch (ether_type_m & ether_type) {
+		case RTE_ETHER_TYPE_TEB:
+			ret = RTE_FLOW_ITEM_TYPE_ETH;
+			break;
+		case RTE_ETHER_TYPE_IPV4:
+			ret = RTE_FLOW_ITEM_TYPE_IPV4;
+			break;
+		case RTE_ETHER_TYPE_IPV6:
+			ret = RTE_FLOW_ITEM_TYPE_IPV6;
+			break;
+		default:
+			ret = RTE_FLOW_ITEM_TYPE_END;
+		}
+		break;
 	default:
 		ret = RTE_FLOW_ITEM_TYPE_VOID;
 		break;
@@ -530,7 +553,8 @@ enum mlx5_expansion {
 	MLX5_EXPANSION_IPV6_UDP,
 	MLX5_EXPANSION_IPV6_TCP,
 	MLX5_EXPANSION_IPV6_FRAG_EXT,
-	MLX5_EXPANSION_GTP
+	MLX5_EXPANSION_GTP,
+	MLX5_EXPANSION_GENEVE,
 };
 
 /** Supported expansion of items. */
@@ -574,6 +598,7 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
 		.next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_VXLAN,
 						  MLX5_EXPANSION_VXLAN_GPE,
 						  MLX5_EXPANSION_MPLS,
+						  MLX5_EXPANSION_GENEVE,
 						  MLX5_EXPANSION_GTP),
 		.type = RTE_FLOW_ITEM_TYPE_UDP,
 		.rss_types = RTE_ETH_RSS_NONFRAG_IPV4_UDP,
@@ -598,6 +623,7 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
 		.next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_VXLAN,
 						  MLX5_EXPANSION_VXLAN_GPE,
 						  MLX5_EXPANSION_MPLS,
+						  MLX5_EXPANSION_GENEVE,
 						  MLX5_EXPANSION_GTP),
 		.type = RTE_FLOW_ITEM_TYPE_UDP,
 		.rss_types = RTE_ETH_RSS_NONFRAG_IPV6_UDP,
@@ -701,6 +727,12 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = {
 						  MLX5_EXPANSION_IPV6),
 		.type = RTE_FLOW_ITEM_TYPE_GTP,
 	},
+	[MLX5_EXPANSION_GENEVE] = {
+		.next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_ETH,
+						  MLX5_EXPANSION_IPV4,
+						  MLX5_EXPANSION_IPV6),
+		.type = RTE_FLOW_ITEM_TYPE_GENEVE,
+	},
 };
 
 static struct rte_flow_action_handle *
-- 
2.33.1


  reply	other threads:[~2021-11-14 15:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-14 15:36 [PATCH 1/5] net/mlx5: fix VXLAN-GPE next protocol translation Gregory Etelson
2021-11-14 15:36 ` Gregory Etelson [this message]
2021-11-15  7:47   ` [PATCH 2/5] net/mlx5: add Ethernet header to GENEVE RSS expansion Slava Ovsiienko
2021-11-14 15:36 ` [PATCH 3/5] net/mlx5: fix RSS expansion scheme for GRE header Gregory Etelson
2021-11-15  7:52   ` Slava Ovsiienko
2021-11-14 15:36 ` [PATCH 4/5] net/mlx5: fix GENEVE protocol type translation Gregory Etelson
2021-11-15  7:54   ` Slava Ovsiienko
2021-11-14 15:36 ` [PATCH 5/5] net/mlx5: fix GRE " Gregory Etelson
2021-11-15  7:53   ` Slava Ovsiienko
2021-11-15  7:46 ` [PATCH 1/5] net/mlx5: fix VXLAN-GPE next protocol translation Slava Ovsiienko
2021-11-16  7:05 ` 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=20211114153617.25085-2-getelson@nvidia.com \
    --to=getelson@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git