From: Ori Kam Date: Mon, 30 Oct 2017 12:46:54 +0000 (+0200) Subject: net/mlx5: fix counter set destroy order X-Git-Tag: spdx-start~970 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=25a987433bd16d18086e7875162641374b9a47cf;p=dpdk.git net/mlx5: fix counter set destroy order The counter set should be destroyed only after the flow was destroyed. Fixes: 9a761de8ea14 ("net/mlx5: flow counter support") Signed-off-by: Ori Kam Acked-by: Yongseok Koh --- diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 29c8e89ac8..c9e6c52100 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2011,10 +2011,6 @@ priv_flow_destroy(struct priv *priv, { unsigned int i; - if (flow->cs) { - claim_zero(ibv_destroy_counter_set(flow->cs)); - flow->cs = NULL; - } if (flow->drop || !flow->mark) goto free; for (i = 0; i != flow->queues_n; ++i) { @@ -2063,6 +2059,10 @@ free: rte_free(frxq->ibv_attr); } } + if (flow->cs) { + claim_zero(ibv_destroy_counter_set(flow->cs)); + flow->cs = NULL; + } TAILQ_REMOVE(list, flow, next); DEBUG("Flow destroyed %p", (void *)flow); rte_free(flow);