patch 'net/mlx5/hws: fix tunnel protocol checks' has been queued to stable release 22.11.5
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Mar 7 02:31:55 CET 2024
Hi,
FYI, your patch has been queued to stable release 22.11.5
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/09/24. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/02373cf8c20b4e9a52808a3e9ca8b28b3ccaa04c
Thanks.
Luca Boccassi
---
>From 02373cf8c20b4e9a52808a3e9ca8b28b3ccaa04c Mon Sep 17 00:00:00 2001
From: Alex Vesker <valex at nvidia.com>
Date: Thu, 25 Jan 2024 15:30:23 +0200
Subject: [PATCH] net/mlx5/hws: fix tunnel protocol checks
[ upstream commit 28e69588f4170f29b73a04fc3bffba2596305782 ]
Align GRE, GTPU and VXLAN tunnel protocols to fail
in case the packet is already tunneled. Also use local
defines for protocol UDP ports for better layering of
mlx5dr API.
Fixes: c55c2bf35333 ("net/mlx5/hws: add definer layer")
Fixes: 5bf14a4beb1a ("net/mlx5/hws: support matching on MPLSoUDP")
Signed-off-by: Alex Vesker <valex at nvidia.com>
Acked-by: Suanming Mou <suanmingm at nvidia.com>
---
drivers/net/mlx5/hws/mlx5dr_definer.c | 32 +++++++++++++--------------
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 6fc5d70f67..af63cdd343 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -8,7 +8,7 @@
#define BAD_PORT 0xBAD
#define ETH_TYPE_IPV4_VXLAN 0x0800
#define ETH_TYPE_IPV6_VXLAN 0x86DD
-#define ETH_VXLAN_DEFAULT_PORT 4789
+#define UDP_VXLAN_PORT 4789
#define STE_NO_VLAN 0x0
#define STE_SVLAN 0x1
@@ -153,7 +153,7 @@ struct mlx5dr_definer_conv_data {
X(SET, gtp_ext_hdr_pdu, v->hdr.type, rte_flow_item_gtp_psc) \
X(SET, gtp_ext_hdr_qfi, v->hdr.qfi, rte_flow_item_gtp_psc) \
X(SET, vxlan_flags, v->flags, rte_flow_item_vxlan) \
- X(SET, vxlan_udp_port, ETH_VXLAN_DEFAULT_PORT, rte_flow_item_vxlan) \
+ X(SET, vxlan_udp_port, UDP_VXLAN_PORT, rte_flow_item_vxlan) \
X(SET, source_qp, v->queue, mlx5_rte_flow_item_sq) \
X(SET, tag, v->data, rte_flow_item_tag) \
X(SET, metadata, v->data, rte_flow_item_meta) \
@@ -824,6 +824,12 @@ mlx5dr_definer_conv_item_gtp(struct mlx5dr_definer_conv_data *cd,
const struct rte_flow_item_gtp *m = item->mask;
struct mlx5dr_definer_fc *fc;
+ if (cd->tunnel) {
+ DR_LOG(ERR, "Inner GTPU item not supported");
+ rte_errno = ENOTSUP;
+ return rte_errno;
+ }
+
/* Overwrite GTPU dest port if not present */
fc = &cd->fc[DR_CALC_FNAME(L4_DPORT, false)];
if (!fc->tag_set && !cd->relaxed) {
@@ -996,9 +1002,13 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd,
struct mlx5dr_definer_fc *fc;
bool inner = cd->tunnel;
- /* In order to match on VXLAN we must match on ether_type, ip_protocol
- * and l4_dport.
- */
+ if (inner) {
+ DR_LOG(ERR, "Inner VXLAN item not supported");
+ rte_errno = ENOTSUP;
+ return rte_errno;
+ }
+
+ /* In order to match on VXLAN we must match on ip_protocol and l4_dport */
if (!cd->relaxed) {
fc = &cd->fc[DR_CALC_FNAME(IP_PROTOCOL, inner)];
if (!fc->tag_set) {
@@ -1021,12 +1031,6 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd,
return 0;
if (m->flags) {
- if (inner) {
- DR_LOG(ERR, "Inner VXLAN flags item not supported");
- rte_errno = ENOTSUP;
- return rte_errno;
- }
-
fc = &cd->fc[MLX5DR_DEFINER_FNAME_VXLAN_FLAGS];
fc->item_idx = item_idx;
fc->tag_set = &mlx5dr_definer_vxlan_flags_set;
@@ -1036,12 +1040,6 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd,
}
if (!is_mem_zero(m->vni, 3)) {
- if (inner) {
- DR_LOG(ERR, "Inner VXLAN vni item not supported");
- rte_errno = ENOTSUP;
- return rte_errno;
- }
-
fc = &cd->fc[MLX5DR_DEFINER_FNAME_VXLAN_VNI];
fc->item_idx = item_idx;
fc->tag_set = &mlx5dr_definer_vxlan_vni_set;
--
2.39.2
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2024-03-07 01:05:43.056483875 +0000
+++ 0098-net-mlx5-hws-fix-tunnel-protocol-checks.patch 2024-03-07 01:05:35.070945790 +0000
@@ -1 +1 @@
-From 28e69588f4170f29b73a04fc3bffba2596305782 Mon Sep 17 00:00:00 2001
+From 02373cf8c20b4e9a52808a3e9ca8b28b3ccaa04c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 28e69588f4170f29b73a04fc3bffba2596305782 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -18,2 +19,2 @@
- drivers/net/mlx5/hws/mlx5dr_definer.c | 43 +++++++++++++--------------
- 1 file changed, 21 insertions(+), 22 deletions(-)
+ drivers/net/mlx5/hws/mlx5dr_definer.c | 32 +++++++++++++--------------
+ 1 file changed, 15 insertions(+), 17 deletions(-)
@@ -22 +23 @@
-index 750eb9c7c6..219bffd3b5 100644
+index 6fc5d70f67..af63cdd343 100644
@@ -25 +26 @@
-@@ -8,9 +8,10 @@
+@@ -8,7 +8,7 @@
@@ -30,2 +30,0 @@
--#define ETH_VXLAN_GPE_DEFAULT_PORT 4790
--#define IP_UDP_PORT_MPLS 6635
@@ -33,5 +31,0 @@
-+#define UDP_VXLAN_GPE_PORT 4790
-+#define UDP_GTPU_PORT 2152
-+#define UDP_PORT_MPLS 6635
- #define UDP_ROCEV2_PORT 4791
- #define DR_FLOW_LAYER_TUNNEL_NO_MPLS (MLX5_FLOW_LAYER_TUNNEL & ~MLX5_FLOW_LAYER_MPLS)
@@ -39,10 +33,3 @@
-@@ -159,7 +160,7 @@ struct mlx5dr_definer_conv_data {
- X(SET, tcp_protocol, STE_TCP, rte_flow_item_tcp) \
- X(SET_BE16, tcp_src_port, v->hdr.src_port, rte_flow_item_tcp) \
- X(SET_BE16, tcp_dst_port, v->hdr.dst_port, rte_flow_item_tcp) \
-- X(SET, gtp_udp_port, RTE_GTPU_UDP_PORT, rte_flow_item_gtp) \
-+ X(SET, gtp_udp_port, UDP_GTPU_PORT, rte_flow_item_gtp) \
- X(SET_BE32, gtp_teid, v->hdr.teid, rte_flow_item_gtp) \
- X(SET, gtp_msg_type, v->hdr.msg_type, rte_flow_item_gtp) \
- X(SET, gtp_ext_flag, !!v->hdr.gtp_hdr_info, rte_flow_item_gtp) \
-@@ -167,12 +168,12 @@ struct mlx5dr_definer_conv_data {
+ #define STE_NO_VLAN 0x0
+ #define STE_SVLAN 0x1
+@@ -153,7 +153,7 @@ struct mlx5dr_definer_conv_data {
@@ -53 +39,0 @@
-- X(SET, vxlan_gpe_udp_port, ETH_VXLAN_GPE_DEFAULT_PORT, rte_flow_item_vxlan_gpe) \
@@ -55,6 +40,0 @@
-+ X(SET, vxlan_gpe_udp_port, UDP_VXLAN_GPE_PORT, rte_flow_item_vxlan_gpe) \
- X(SET, vxlan_gpe_flags, v->flags, rte_flow_item_vxlan_gpe) \
- X(SET, vxlan_gpe_protocol, v->protocol, rte_flow_item_vxlan_gpe) \
- X(SET, vxlan_gpe_rsvd1, v->rsvd1, rte_flow_item_vxlan_gpe) \
-- X(SET, mpls_udp_port, IP_UDP_PORT_MPLS, rte_flow_item_mpls) \
-+ X(SET, mpls_udp_port, UDP_PORT_MPLS, rte_flow_item_mpls) \
@@ -64 +44 @@
-@@ -1198,6 +1199,12 @@ mlx5dr_definer_conv_item_gtp(struct mlx5dr_definer_conv_data *cd,
+@@ -824,6 +824,12 @@ mlx5dr_definer_conv_item_gtp(struct mlx5dr_definer_conv_data *cd,
@@ -77 +57 @@
-@@ -1372,9 +1379,13 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd,
+@@ -996,9 +1002,13 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd,
@@ -94 +74 @@
-@@ -1397,12 +1408,6 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd,
+@@ -1021,12 +1031,6 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd,
@@ -107 +87 @@
-@@ -1412,12 +1417,6 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd,
+@@ -1036,12 +1040,6 @@ mlx5dr_definer_conv_item_vxlan(struct mlx5dr_definer_conv_data *cd,
More information about the stable
mailing list