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

Function mlx5_trunk_idx_get

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

Source from the content-addressed store, hash-verified

25}
26
27static inline uint32_t
28mlx5_trunk_idx_get(struct mlx5_indexed_pool *pool, uint32_t entry_idx)
29{
30 struct mlx5_indexed_pool_config *cfg = &pool->cfg;
31 uint32_t trunk_idx = 0;
32 uint32_t i;
33
34 if (!cfg->grow_trunk)
35 return entry_idx / cfg->trunk_size;
36 if (entry_idx >= pool->grow_tbl[cfg->grow_trunk - 1]) {
37 trunk_idx = (entry_idx - pool->grow_tbl[cfg->grow_trunk - 1]) /
38 (cfg->trunk_size << (cfg->grow_shift *
39 cfg->grow_trunk)) + cfg->grow_trunk;
40 } else {
41 for (i = 0; i < cfg->grow_trunk; i++) {
42 if (entry_idx < pool->grow_tbl[i])
43 break;
44 }
45 trunk_idx = i;
46 }
47 return trunk_idx;
48}
49
50static inline uint32_t
51mlx5_trunk_size_get(struct mlx5_indexed_pool *pool, uint32_t trunk_idx)

Callers 3

_mlx5_ipool_get_cacheFunction · 0.85
mlx5_ipool_freeFunction · 0.85
mlx5_ipool_getFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected