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

Function mlx5_ipool_update_global_cache

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

Source from the content-addressed store, hash-verified

198}
199
200static inline struct mlx5_indexed_cache *
201mlx5_ipool_update_global_cache(struct mlx5_indexed_pool *pool, int cidx)
202{
203 struct mlx5_indexed_cache *gc, *lc, *olc = NULL;
204
205 lc = pool->cache[cidx]->lc;
206 gc = __atomic_load_n(&pool->gc, __ATOMIC_RELAXED);
207 if (gc && lc != gc) {
208 mlx5_ipool_lock(pool);
209 if (lc && !(--lc->ref_cnt))
210 olc = lc;
211 lc = pool->gc;
212 lc->ref_cnt++;
213 pool->cache[cidx]->lc = lc;
214 mlx5_ipool_unlock(pool);
215 if (olc)
216 pool->cfg.free(olc);
217 }
218 return lc;
219}
220
221static uint32_t
222mlx5_ipool_allocate_from_global(struct mlx5_indexed_pool *pool, int cidx)

Callers 1

_mlx5_ipool_get_cacheFunction · 0.85

Calls 2

mlx5_ipool_lockFunction · 0.85
mlx5_ipool_unlockFunction · 0.85

Tested by

no test coverage detected