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 1/2] net/mlx5/hws: recognize IPIP in definer layer
Date: Fri, 20 Jun 2025 13:42:02 +0300 [thread overview]
Message-ID: <20250620104203.261435-2-junfengg@nvidia.com> (raw)
In-Reply-To: <20250620104203.261435-1-junfengg@nvidia.com>
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
next prev 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 ` Junfeng Guo [this message]
2025-06-20 10:42 ` [PATCH 2/2] net/mlx5: support IPIP flow for all combinations Junfeng Guo
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-2-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).