summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_flow.c
diff options
context:
space:
mode:
authorYongseok Koh <yskoh@mellanox.com>2018-11-06 08:14:18 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2018-11-14 00:35:53 +0100
commit3193c2494eea5e87f578dc1f5b778053aae30f13 (patch)
treea71704773b5b1386cd22f1f559037c357b2561a4 /drivers/net/mlx5/mlx5_flow.c
parent636a71dedc7eb4493661a20e13ec98bb8152a1cb (diff)
downloaddpdk-next-eventdev-3193c2494eea5e87f578dc1f5b778053aae30f13.zip
dpdk-next-eventdev-3193c2494eea5e87f578dc1f5b778053aae30f13.tar.gz
dpdk-next-eventdev-3193c2494eea5e87f578dc1f5b778053aae30f13.tar.xz
net/mlx5: fix L4 protocol validation
- Currently, no device supports partial mask for protocol in IP header. - As there could be multiple IP items, next_protocol variable in flow validation has to be reset for inner layer. Otherwise, inner TCP/UDP will see protocol number of outer IP header. - Remove redundant protocol checking for MPLS, which is done in mlx5_flow_validate_item_mpls(). Fixes: 3d69434113d1 ("net/mlx5: add Direct Verbs validation function") Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function") Signed-off-by: Yongseok Koh <yskoh@mellanox.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_flow.c')
-rw-r--r--drivers/net/mlx5/mlx5_flow.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 3c2ac4b..8039664 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1178,6 +1178,12 @@ mlx5_flow_validate_item_ipv4(const struct rte_flow_item *item,
"L3 cannot follow an L4 layer.");
if (!mask)
mask = &rte_flow_item_ipv4_mask;
+ else if (mask->hdr.next_proto_id != 0 &&
+ mask->hdr.next_proto_id != 0xff)
+ return rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM_MASK, mask,
+ "partial mask is not supported"
+ " for protocol");
ret = mlx5_flow_item_acceptable(item, (const uint8_t *)mask,
(const uint8_t *)&nic_mask,
sizeof(struct rte_flow_item_ipv4),