From ab95b7e7b20c8a98cc1cfdc11844ea904fb1feb5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?N=C3=A9lio=20Laranjeiro?= Date: Mon, 6 Nov 2017 11:41:41 +0100 Subject: [PATCH] net/mlx5: fix flow director delete with drop action Removing a flow director rule with a drop action ends by not removing it due to a missing verbs drop specification in the conversion process between the flow director and generic flow API. Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director") Signed-off-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_flow.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index bcb06f84aa..cd99cb0759 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2866,6 +2866,22 @@ priv_fdir_filter_delete(struct priv *priv, attributes.actions, &error, &parser); if (ret) goto exit; + /* + * Special case for drop action which is only set in the + * specifications when the flow is created. In this situation the + * drop specification is missing. + */ + if (parser.drop) { + struct ibv_flow_spec_action_drop *drop; + + drop = (void *)((uintptr_t)parser.drop_q.ibv_attr + + parser.drop_q.offset); + *drop = (struct ibv_flow_spec_action_drop){ + .type = IBV_FLOW_SPEC_ACTION_DROP, + .size = sizeof(struct ibv_flow_spec_action_drop), + }; + parser.drop_q.ibv_attr->num_of_specs++; + } TAILQ_FOREACH(flow, &priv->flows, next) { struct ibv_flow_attr *attr; struct ibv_spec_header *attr_h; -- 2.20.1