All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Support IPIP Tunnel in NT2HWS and HWS
@ 2025-06-20 10:42 Junfeng Guo
  2025-06-20 10:42 ` [PATCH 1/2] net/mlx5/hws: recognize IPIP in definer layer Junfeng Guo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Junfeng Guo @ 2025-06-20 10:42 UTC (permalink / raw)
  To: dev; +Cc: dsosnowski, viacheslavo, bingz, orika, suanmingm, matan

This patchset support IPIP Tunnel in NT2HWS and HWS, including the
following {IPv4 x IPv6} combinations:
 - IPv4 over IPv4
 - IPv4 over IPv6
 - IPv6 over IPv4
 - IPv6 over IPv6

This feature cover both basic IPIP and IPIP over VXLAN Tunnel types.

Junfeng Guo (2):
  net/mlx5/hws: recognize IPIP in definer layer
  net/mlx5: support IPIP flow for all combinations

 drivers/net/mlx5/hws/mlx5dr_definer.c | 10 ++++++++++
 drivers/net/mlx5/mlx5_flow.c          |  5 -----
 drivers/net/mlx5/mlx5_flow_hw.c       |  3 ++-
 3 files changed, 12 insertions(+), 6 deletions(-)

-- 
2.45.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] net/mlx5/hws: recognize IPIP in definer layer
  2025-06-20 10:42 [PATCH 0/2] Support IPIP Tunnel in NT2HWS and HWS Junfeng Guo
@ 2025-06-20 10:42 ` Junfeng Guo
  2025-06-20 10:42 ` [PATCH 2/2] net/mlx5: support IPIP flow for all combinations Junfeng Guo
  2025-06-27  9:23 ` [PATCH 0/2] Support IPIP Tunnel in NT2HWS and HWS Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Junfeng Guo @ 2025-06-20 10:42 UTC (permalink / raw)
  To: dev; +Cc: dsosnowski, viacheslavo, bingz, orika, suanmingm, matan

Definers are HW objects that are used for matching, rte items are
translated to definers, each definer holds the fields and bit-masks
used for HW flow matching.

This patch recognize IP-in-IP tunnel type in definer layer, including
the following combinations:
 - IPv4 over IPv4
 - IPv4 over IPv6
 - IPv6 over IPv4
 - IPv6 over IPv6

Signed-off-by: Junfeng Guo <junfengg@nvidia.com>
Acked-by: Bing Zhao <bingz@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 9c11d6c2cb..7464d95373 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -3322,11 +3322,21 @@ mlx5dr_definer_conv_items_to_hl(struct mlx5dr_context *ctx,
 				(MLX5_FLOW_LAYER_OUTER_VLAN | MLX5_FLOW_LAYER_OUTER_L2);
 			break;
 		case RTE_FLOW_ITEM_TYPE_IPV4:
+			if (cd.last_item == RTE_FLOW_ITEM_TYPE_IPV4 ||
+			    cd.last_item == RTE_FLOW_ITEM_TYPE_IPV6) {
+				cd.tunnel = true;
+				item_flags |= MLX5_FLOW_LAYER_IPIP;
+			}
 			ret = mlx5dr_definer_conv_item_ipv4(&cd, items, i);
 			item_flags |= cd.tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV4 :
 						  MLX5_FLOW_LAYER_OUTER_L3_IPV4;
 			break;
 		case RTE_FLOW_ITEM_TYPE_IPV6:
+			if (cd.last_item == RTE_FLOW_ITEM_TYPE_IPV4 ||
+			    cd.last_item == RTE_FLOW_ITEM_TYPE_IPV6) {
+				cd.tunnel = true;
+				item_flags |= MLX5_FLOW_LAYER_IPIP;
+			}
 			ret = mlx5dr_definer_conv_item_ipv6(&cd, items, i);
 			item_flags |= cd.tunnel ? MLX5_FLOW_LAYER_INNER_L3_IPV6 :
 						  MLX5_FLOW_LAYER_OUTER_L3_IPV6;
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] net/mlx5: support IPIP flow for all combinations
  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
  2025-06-27  9:23 ` [PATCH 0/2] Support IPIP Tunnel in NT2HWS and HWS Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Junfeng Guo @ 2025-06-20 10:42 UTC (permalink / raw)
  To: dev; +Cc: dsosnowski, viacheslavo, bingz, orika, suanmingm, matan

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] Support IPIP Tunnel in NT2HWS and HWS
  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 ` [PATCH 2/2] net/mlx5: support IPIP flow for all combinations Junfeng Guo
@ 2025-06-27  9:23 ` Thomas Monjalon
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2025-06-27  9:23 UTC (permalink / raw)
  To: Junfeng Guo; +Cc: dev, dsosnowski, viacheslavo, bingz, orika, suanmingm, matan

20/06/2025 12:42, Junfeng Guo:
> This patchset support IPIP Tunnel in NT2HWS and HWS, including the
> following {IPv4 x IPv6} combinations:
>  - IPv4 over IPv4
>  - IPv4 over IPv6
>  - IPv6 over IPv4
>  - IPv6 over IPv6
> 
> This feature cover both basic IPIP and IPIP over VXLAN Tunnel types.
> 
> Junfeng Guo (2):
>   net/mlx5/hws: recognize IPIP in definer layer
>   net/mlx5: support IPIP flow for all combinations

Applied, thanks.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-06-27  9:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/2] net/mlx5: support IPIP flow for all combinations Junfeng Guo
2025-06-27  9:23 ` [PATCH 0/2] Support IPIP Tunnel in NT2HWS and HWS Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.