From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ori Kam Subject: [PATCH] net/mlx5: fix counter set destroy order Date: Mon, 30 Oct 2017 14:46:54 +0200 Message-ID: <1509367614-1626-1-git-send-email-orika@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain Cc: dev@dpdk.org, orika@mellanox.com To: adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com, yskoh@mellanox.com Return-path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40064.outbound.protection.outlook.com [40.107.4.64]) by dpdk.org (Postfix) with ESMTP id 0E5811B2C5 for ; Mon, 30 Oct 2017 13:47:26 +0100 (CET) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The counter set should be destroyed only after the flow was destroyed. Fixes: 9a761de ("net/mlx5: flow counter support") Cc: orika@mellanox.com Signed-off-by: Ori Kam --- drivers/net/mlx5/mlx5_flow.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 3999b84..e810a3a 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2001,10 +2001,6 @@ struct rte_flow * { 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) { @@ -2053,6 +2049,10 @@ struct rte_flow * 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); -- 1.7.1