DPDK patches and discussions
 help / color / mirror / Atom feed
From: Junfeng Guo <junfengg@nvidia.com>
To: <dev@dpdk.org>
Cc: <dsosnowski@nvidia.com>, <viacheslavo@nvidia.com>,
	<bingz@nvidia.com>, <orika@nvidia.com>, <suanmingm@nvidia.com>,
	<matan@nvidia.com>
Subject: [PATCH 2/2] net/mlx5: support IPIP flow for all combinations
Date: Fri, 20 Jun 2025 13:42:03 +0300	[thread overview]
Message-ID: <20250620104203.261435-3-junfengg@nvidia.com> (raw)
In-Reply-To: <20250620104203.261435-1-junfengg@nvidia.com>

IP-in-IP tunnel type includes the following combination:
 - IPv4 over IPv4
 - IPv4 over IPv6
 - IPv6 over IPv4
 - IPv6 over IPv6

It's okay to have MLX5_FLOW_LAYER_IPIP flag when validate IPv6 item.
And it's okay to have outer L3 layer as either IPv4 or IPv6 when
setting the IP-in-IP tunnel item flag.

Signed-off-by: Junfeng Guo <junfengg@nvidia.com>
Acked-by: Bing Zhao <bingz@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c    | 5 -----
 drivers/net/mlx5/mlx5_flow_hw.c | 3 ++-
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 3d49a2d833..8db372123c 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2973,11 +2973,6 @@ mlx5_flow_validate_item_ipv6(const struct rte_eth_dev *dev,
 					  RTE_FLOW_ERROR_TYPE_ITEM, item,
 					  "IPv6 proto (next header) should "
 					  "not be set as extension header");
-	if (item_flags & MLX5_FLOW_LAYER_IPIP)
-		return rte_flow_error_set(error, EINVAL,
-					  RTE_FLOW_ERROR_TYPE_ITEM, item,
-					  "wrong tunnel type - IPv4 specified "
-					  "but IPv6 item provided");
 	if (item_flags & l3m)
 		return rte_flow_error_set(error, ENOTSUP,
 					  RTE_FLOW_ERROR_TYPE_ITEM, item,
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index af2e7a84a5..0aaa8fe2a6 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -8325,7 +8325,8 @@ mlx5_hw_flow_tunnel_ip_check(uint64_t last_item, uint64_t *item_flags)
 {
 	bool tunnel;
 
-	if (last_item == MLX5_FLOW_LAYER_OUTER_L3_IPV4) {
+	if (last_item == MLX5_FLOW_LAYER_OUTER_L3_IPV4 ||
+	    last_item == MLX5_FLOW_LAYER_OUTER_L3_IPV6) {
 		tunnel = true;
 		*item_flags |= MLX5_FLOW_LAYER_IPIP;
 	} else if (last_item == MLX5_FLOW_LAYER_OUTER_L3_IPV6 ||
-- 
2.45.0


      parent reply	other threads:[~2025-06-20 10:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20 10:42 [PATCH 0/2] Support IPIP Tunnel in NT2HWS and HWS Junfeng Guo
2025-06-20 10:42 ` [PATCH 1/2] net/mlx5/hws: recognize IPIP in definer layer Junfeng Guo
2025-06-20 10:42 ` Junfeng Guo [this message]

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=20250620104203.261435-3-junfengg@nvidia.com \
    --to=junfengg@nvidia.com \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=suanmingm@nvidia.com \
    --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).