From d564eea7ce7fe66f6b4210956b8907f663d30734 Mon Sep 17 00:00:00 2001 From: Xiaoyu Min Date: Mon, 22 Nov 2021 21:53:29 +0800 Subject: [PATCH] net/mlx4: fix empty Ethernet spec with VLAN When the ETH spec is empty MLX4 PMD doesn't allow match other criteria, which means the flow should be promisc one. Currently, PMD validates this by setting flow->promisc bit when ETH spec is empty and checking whether there is other rte_flow_item followed when flow->promisc is on. However, commit [1] adds support to match traffic only on VLAN id, the above validation logic should be changed accordingly. This patch changes the above validate logic by skipping flow->promisc check if this item is VLAN. [1]: Fixes: c0d239263156 ("net/mlx4: support flow w/o ETH spec and with VLAN") Cc: stable@dpdk.org Signed-off-by: Xiaoyu Min Acked-by: Matan Azrad --- drivers/net/mlx4/mlx4_flow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index 2e1b6c87e9..9d7247cf81 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -713,7 +713,8 @@ fill: flow->internal = 1; continue; } - if (flow->promisc || flow->allmulti) { + if ((item->type != RTE_FLOW_ITEM_TYPE_VLAN && flow->promisc) || + flow->allmulti) { msg = "mlx4 does not support additional matching" " criteria combined with indiscriminate" " matching on Ethernet headers"; -- 2.20.1