net/mlx5: fix artificial L4 limitation on switch flow rules
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>
Mon, 6 Aug 2018 14:25:42 +0000 (16:25 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 28 Aug 2018 13:27:39 +0000 (15:27 +0200)
Partial bit-masks are in fact supported on TCP/UDP source/destination
ports. Remove unnecessary check.

Fixes: 2bfc777e07 ("net/mlx5: add L2-L4 pattern items to switch flow rules")
Cc: stable@dpdk.org
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
drivers/net/mlx5/mlx5_nl_flow.c

index a1c8c34..beb03c9 100644 (file)
@@ -799,16 +799,6 @@ trans:
                        break;
                }
                spec.tcp = item->spec;
-               if ((mask.tcp->hdr.src_port &&
-                    mask.tcp->hdr.src_port != RTE_BE16(0xffff)) ||
-                   (mask.tcp->hdr.dst_port &&
-                    mask.tcp->hdr.dst_port != RTE_BE16(0xffff)))
-                       return rte_flow_error_set
-                               (error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM_MASK,
-                                mask.tcp,
-                                "no support for partial masks on"
-                                " \"hdr.src_port\" and \"hdr.dst_port\""
-                                " fields");
                if ((mask.tcp->hdr.src_port &&
                     (!mnl_attr_put_u16_check(buf, size,
                                              TCA_FLOWER_KEY_TCP_SRC,
@@ -846,16 +836,6 @@ trans:
                        break;
                }
                spec.udp = item->spec;
-               if ((mask.udp->hdr.src_port &&
-                    mask.udp->hdr.src_port != RTE_BE16(0xffff)) ||
-                   (mask.udp->hdr.dst_port &&
-                    mask.udp->hdr.dst_port != RTE_BE16(0xffff)))
-                       return rte_flow_error_set
-                               (error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM_MASK,
-                                mask.udp,
-                                "no support for partial masks on"
-                                " \"hdr.src_port\" and \"hdr.dst_port\""
-                                " fields");
                if ((mask.udp->hdr.src_port &&
                     (!mnl_attr_put_u16_check(buf, size,
                                              TCA_FLOWER_KEY_UDP_SRC,