+ if (pool->cfg.release_mem_en && trunk->free == mlx5_trunk_size_get
+ (pool, trunk->idx)) {
+ if (pool->free_list == trunk->idx)
+ pool->free_list = trunk->next;
+ if (trunk->next != TRUNK_INVALID)
+ pool->trunks[trunk->next]->prev = trunk->prev;
+ if (trunk->prev != TRUNK_INVALID)
+ pool->trunks[trunk->prev]->next = trunk->next;
+ pool->cfg.free(trunk);
+ pool->trunks[trunk_idx] = NULL;
+ pool->n_trunk_valid--;
+#ifdef POOL_DEBUG
+ pool->trunk_avail--;
+ pool->trunk_free++;
+#endif
+ if (pool->n_trunk_valid == 0) {
+ pool->cfg.free(pool->trunks);
+ pool->trunks = NULL;
+ pool->n_trunk = 0;
+ }
+ } else if (trunk->free == 1) {