[1/4] net/mlx5/hws: allow relaxed mode in MPLS matching
Checks
Commit Message
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(-)
Comments
Hi,
> -----Original Message-----
> From: Erez Shitrit <erezsh@nvidia.com>
> Sent: Sunday, September 10, 2023 5:03 PM
> To: Alex Vesker <valex@nvidia.com>; NBU-Contact-Thomas Monjalon
> (EXTERNAL) <thomas@monjalon.net>; Suanming Mou
> <suanmingm@nvidia.com>; Matan Azrad <matan@nvidia.com>; Slava
> Ovsiienko <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>
> Cc: dev@dpdk.org
> Subject: [PATCH 1/4] net/mlx5/hws: allow relaxed mode in MPLS matching
>
>
> 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>
Series applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
@@ -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)) {