DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching
@ 2023-09-10 14:03 Erez Shitrit
  2023-09-10 14:03 ` [PATCH 2/4] net/mlx5/hws: allow attaching action template to matcher Erez Shitrit
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Erez Shitrit @ 2023-09-10 14:03 UTC (permalink / raw)
  To: valex, thomas, suanmingm, Matan Azrad, Viacheslav Ovsiienko, Ori Kam; +Cc: dev


Remove the previous constrain on relaxed mode, that way it will be like
all other matching items, can be used in relaxed or non-relaxed mode.

The previous constrain was due to HW limitation that supports MPLS over
specific UDP port, now we give the ability to the user to make sure it
is with the right needs for MPLS matching.

Signed-off-by: Erez Shitrit <erezsh@nvidia.com>
Reviewed-by: Alex Vesker <valex@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 45 ++++++++++-----------------
 1 file changed, 17 insertions(+), 28 deletions(-)

diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 33d0f2d18e..88f22e7f70 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -1320,35 +1320,24 @@ mlx5dr_definer_conv_item_mpls(struct mlx5dr_definer_conv_data *cd,
 		return rte_errno;
 	}
 
-	if (cd->relaxed) {
-		DR_LOG(ERR, "Relaxed mode is not supported");
-		rte_errno = ENOTSUP;
-		return rte_errno;
-	}
-
-	/* Currently support only MPLSoUDP */
-	if (cd->last_item != RTE_FLOW_ITEM_TYPE_UDP &&
-	    cd->last_item != RTE_FLOW_ITEM_TYPE_MPLS) {
-		DR_LOG(ERR, "MPLS supported only after UDP");
-		rte_errno = ENOTSUP;
-		return rte_errno;
-	}
-
-	/* In order to match on MPLS we must match on ip_protocol and l4_dport. */
-	fc = &cd->fc[DR_CALC_FNAME(IP_PROTOCOL, false)];
-	if (!fc->tag_set) {
-		fc->item_idx = item_idx;
-		fc->tag_mask_set = &mlx5dr_definer_ones_set;
-		fc->tag_set = &mlx5dr_definer_udp_protocol_set;
-		DR_CALC_SET(fc, eth_l2, l4_type_bwc, false);
-	}
+	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)];
+		if (!fc->tag_set) {
+			fc->item_idx = item_idx;
+			fc->tag_mask_set = &mlx5dr_definer_ones_set;
+			fc->tag_set = &mlx5dr_definer_udp_protocol_set;
+			DR_CALC_SET(fc, eth_l2, l4_type_bwc, false);
+		}
 
-	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);
+		/* 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);
+		}
 	}
 
 	if (m && (!is_mem_zero(m->label_tc_s, 3) || m->ttl)) {
-- 
2.18.2


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

end of thread, other threads:[~2023-09-19 12:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-10 14:03 [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching Erez Shitrit
2023-09-10 14:03 ` [PATCH 2/4] net/mlx5/hws: allow attaching action template to matcher Erez Shitrit
2023-09-10 14:03 ` [PATCH 3/4] net/mlx5/hws: print syndrome value on error Erez Shitrit
2023-09-10 14:03 ` [PATCH 4/4] net/mlx5/hws: skip process action-template on coll matcher Erez Shitrit
2023-09-19 12:02 ` [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching Raslan Darawsheh

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).