doc: fix MPLS limitations under HWS
PATCH 1/2 doc: fix MPLS limitations under HWS
Update missing limitations.
Fixes 1e2a51f545b6 ("net/mlx5: support MPLS tunnel with HWS")
Signed-off-by Maayan Kashani <[email protected]>
--- doc/guides/nics/mlx5.rst | 8 ++++++++ 1 file changed, 8 insertions(+)
doc/guides/nics/mlx5.rst +8 -0
@@ -279,6 +279,14 @@ Limitations which results in L3 encap. d. Only in transfer (switchdev) mode. + - MPLS: + + - RTE_FLOW_ITEM_TYPE_MPLS matching is not supported for mlxcfg ``FLEX_PARSER_PROFILE_ENABLE`` = 1. + - RTE_FLOW_ITEM_TYPE_MPLS matching is not supported on group 0. + - Testpmd commands "set mplsoudp_encap" and "set mplsoudp_decap" support only one MPLS. + - For non relaxed pattern template, MPLSoUDP match is assumed when trying to match MPLS w/o former + protocol match. + - When using Verbs flow engine (``dv_flow_en`` = 0), flow pattern without any specific VLAN will match for VLAN packets as well:
Signature · 1 line
2.21.0
PATCH 2/2 net/mlx5: add MPLSoGRE matching in HWS
Remove limitations in validation and MPLS match translation.
For non relaxed mode, assume MPLSoUDP if no protocol is mentioned. Set UDP dest port to MPLS type only for UDP protocol.
Signed-off-by Maayan Kashani <[email protected]>
--- doc/guides/nics/mlx5.rst | 2 -- drivers/net/mlx5/hws/mlx5dr_definer.c | 28 +++++++++++++-------------- drivers/net/mlx5/mlx5_flow.c | 7 ------- 3 files changed, 13 insertions(+), 24 deletions(-)
doc/guides/nics/mlx5.rst +0 -2
@@ -356,8 +356,6 @@ Limitations - L3 VXLAN and VXLAN-GPE tunnels cannot be supported together with MPLSoGRE and MPLSoUDP. -- MPLSoGRE is not supported in HW steering (``dv_flow_en`` = 2). - - MPLSoUDP with multiple MPLS headers is only supported in HW steering (``dv_flow_en`` = 2). - Match on Geneve header supports the following fields only:
drivers/net/mlx5/hws/mlx5dr_definer.c +13 -15
@@ -1644,14 +1644,9 @@ mlx5dr_definer_conv_item_mpls(struct mlx5dr_definer_conv_data *cd, {const struct rte_flow_item_mpls *m = item->mask;struct mlx5dr_definer_fc *fc; -bool inner = cd->tunnel; - -if (inner) { -DR_LOG (ERR ,"Inner MPLS item not supported" ); - rte_errno =ENOTSUP ; -return rte_errno; - } +bool is_udp; +/* If no protocol is set - assume MPLSoUDP */ if (!cd->relaxed) {/* In order to match on MPLS we must match on ip_protocol and l4_dport. */ fc = &cd->fc[DR_CALC_FNAME (IP_PROTOCOL , false)];
@@ -1661,14 +1656,17 @@ mlx5dr_definer_conv_item_mpls(struct mlx5dr_definer_conv_data *cd, fc->tag_set = &mlx5dr_definer_udp_protocol_set;DR_CALC_SET (fc, eth_l2, l4_type_bwc, false); } - -/* Currently support only MPLSoUDP */ - fc = &cd->fc[DR_CALC_FNAME (L4_DPORT , false)]; -if (!fc->tag_set) { - fc->item_idx = item_idx; - fc->tag_mask_set = &mlx5dr_definer_ones_set; - fc->tag_set = &mlx5dr_definer_mpls_udp_port_set; -DR_CALC_SET (fc, eth_l4, destination_port, false); + is_udp = (fc->tag_set == &mlx5dr_definer_udp_protocol_set); + +if (is_udp) { +/* Set UDP dest port to MPLS. */ + fc = &cd->fc[DR_CALC_FNAME (L4_DPORT , false)]; +if (!fc->tag_set) { + fc->item_idx = item_idx; + fc->tag_mask_set = &mlx5dr_definer_ones_set; + fc->tag_set = &mlx5dr_definer_mpls_udp_port_set; +DR_CALC_SET (fc, eth_l4, destination_port, false); + } } }
drivers/net/mlx5/mlx5_flow.c +0 -7
@@ -3812,13 +3812,6 @@ mlx5_flow_validate_item_mpls(struct rte_eth_dev *dev __rte_unused,return rte_flow_error_set (error,ENOTSUP ,RTE_FLOW_ERROR_TYPE_ITEM , item,"multiple tunnel layers not supported" ); - }else { -/* Multi-tunnel isn't allowed but MPLS over GRE is an exception. */ -if ((item_flags &MLX5_FLOW_LAYER_TUNNEL ) && - !(item_flags &MLX5_FLOW_LAYER_MPLS )) -return rte_flow_error_set (error,ENOTSUP , -RTE_FLOW_ERROR_TYPE_ITEM , item, -"multiple tunnel layers not supported" ); }if (!mask) mask = nic_mask;
Signature · 1 line
2.21.0
Hi,
From: Maayan Kashani <[email protected]>
Sent: Wednesday, February 26, 2025 10:02 AM
To: [email protected]
Cc: Maayan Kashani; Dariusz Sosnowski; Raslan Darawsheh; [email protected]; Slava Ovsiienko; Bing Zhao; Ori Kam; Suanming Mou; Matan Azrad; Michael Baum
Subject: [PATCH 1/2] doc: fix MPLS limitations under HWS
Update missing limitations.
Fixes 1e2a51f545b6 ("net/mlx5: support MPLS tunnel with HWS")
Signed-off-by Maayan Kashani <[email protected]>
series squashed and applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh