The counter set should be destroyed only after the flow was destroyed.
Fixes:
9a761de8ea14 ("net/mlx5: flow counter support")
Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
{
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) {
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);