From 4daae08e7f5894cfa4cc729b21c1ac9750c2084c Mon Sep 17 00:00:00 2001 From: =?utf8?q?N=C3=A9lio=20Laranjeiro?= Date: Thu, 9 Nov 2017 13:43:06 +0100 Subject: [PATCH] net/mlx5: fix flow director rules comparison When deleting/replacing a flow director rule the first rule of the list was always the one replaced instead of the corresponding one. Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director") Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_flow.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index cd99cb0759..3df8fba4e0 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2914,13 +2914,16 @@ priv_fdir_filter_delete(struct priv *priv, flow_h = flow_spec; if (memcmp(spec, flow_spec, RTE_MIN(attr_h->size, flow_h->size))) - continue; + goto wrong_flow; spec = (void *)((uintptr_t)attr + attr_h->size); flow_spec = (void *)((uintptr_t)flow_attr + flow_h->size); } /* At this point, the flow match. */ break; +wrong_flow: + /* The flow does not match. */ + continue; } if (flow) priv_flow_destroy(priv, &priv->flows, flow); -- 2.20.1