net/mlx4: fix empty ETH spec with VLAN support

Message ID 3672e46dd1181429c73952a93cc211ad11769b99.1637589050.git.jackmin@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx4: fix empty ETH spec with VLAN support |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS

Commit Message

Jack Min Nov. 22, 2021, 1:53 p.m. UTC
  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.

Fixes: c0d239263156 ("net/mlx4: support flow w/o ETH spec and with VLAN")
Cc: stable@dpdk.org

[1]:
commit c0d239263156 ("net/mlx4: support flow w/o ETH spec and with VLAN")

Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx4/mlx4_flow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Raslan Darawsheh Nov. 23, 2021, 1:26 p.m. UTC | #1
Hi,
> -----Original Message-----
> From: Xiaoyu Min <jackmin@nvidia.com>
> Sent: Monday, November 22, 2021 3:53 PM
> To: Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Dekel Peled <dekelp@mellanox.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: [PATCH] net/mlx4: fix empty ETH spec with VLAN support
> 
> 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.
> 
> Fixes: c0d239263156 ("net/mlx4: support flow w/o ETH spec and with VLAN")
> Cc: stable@dpdk.org
> 
> [1]:
> commit c0d239263156 ("net/mlx4: support flow w/o ETH spec and with
> VLAN")
> 
> Signed-off-by: Xiaoyu Min <jackmin@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

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 @@  mlx4_flow_prepare(struct mlx4_priv *priv,
 			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";