MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mlx5_ipool_destroy

Function mlx5_ipool_destroy

dpdk/drivers/net/mlx5/mlx5_utils.c:682–725  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

680}
681
682int
683mlx5_ipool_destroy(struct mlx5_indexed_pool *pool)
684{
685 struct mlx5_indexed_trunk **trunks = NULL;
686 struct mlx5_indexed_cache *gc = pool->gc;
687 uint32_t i, n_trunk_valid = 0;
688
689 MLX5_ASSERT(pool);
690 mlx5_ipool_lock(pool);
691 if (pool->cfg.per_core_cache) {
692 for (i = 0; i <= RTE_MAX_LCORE; i++) {
693 /*
694 * Free only old global cache. Pool gc will be
695 * freed at last.
696 */
697 if (pool->cache[i]) {
698 if (pool->cache[i]->lc &&
699 pool->cache[i]->lc != pool->gc &&
700 (!(--pool->cache[i]->lc->ref_cnt)))
701 pool->cfg.free(pool->cache[i]->lc);
702 pool->cfg.free(pool->cache[i]);
703 }
704 }
705 if (gc) {
706 trunks = gc->trunks;
707 n_trunk_valid = gc->n_trunk_valid;
708 }
709 } else {
710 gc = NULL;
711 trunks = pool->trunks;
712 n_trunk_valid = pool->n_trunk_valid;
713 }
714 for (i = 0; i < n_trunk_valid; i++) {
715 if (trunks[i])
716 pool->cfg.free(trunks[i]);
717 }
718 if (!gc && trunks)
719 pool->cfg.free(trunks);
720 if (gc)
721 pool->cfg.free(gc);
722 mlx5_ipool_unlock(pool);
723 mlx5_free(pool);
724 return 0;
725}
726
727void
728mlx5_ipool_flush_cache(struct mlx5_indexed_pool *pool)

Callers 12

mlx5_flow_quota_destroyFunction · 0.85
flow_dv_modify_ipool_getFunction · 0.85
mlx5_flow_ipool_destroyFunction · 0.85
flow_hw_table_createFunction · 0.85
flow_hw_table_destroyFunction · 0.85
flow_hw_ct_pool_destroyFunction · 0.85
flow_hw_configureFunction · 0.85
flow_hw_resource_releaseFunction · 0.85
mlx5_flow_meter_uninitFunction · 0.85
mlx5_l3t_destroyFunction · 0.85

Calls 3

mlx5_ipool_lockFunction · 0.85
mlx5_ipool_unlockFunction · 0.85
mlx5_freeFunction · 0.85

Tested by

no test coverage detected