Lines Matching refs:sub_pool

47 	const struct mlxsw_sp_counter_sub_pool *sub_pool = priv;  in mlxsw_sp_counter_sub_pool_occ_get()  local
49 return atomic_read(&sub_pool->active_entries_count); in mlxsw_sp_counter_sub_pool_occ_get()
56 struct mlxsw_sp_counter_sub_pool *sub_pool; in mlxsw_sp_counter_sub_pools_init() local
63 sub_pool = &pool->sub_pools[i]; in mlxsw_sp_counter_sub_pools_init()
64 res_id = sub_pool->entry_size_res_id; in mlxsw_sp_counter_sub_pools_init()
68 sub_pool->entry_size = mlxsw_core_res_get(mlxsw_sp->core, in mlxsw_sp_counter_sub_pools_init()
71 sub_pool->resource_id, in mlxsw_sp_counter_sub_pools_init()
72 &sub_pool->size); in mlxsw_sp_counter_sub_pools_init()
77 sub_pool->resource_id, in mlxsw_sp_counter_sub_pools_init()
79 sub_pool); in mlxsw_sp_counter_sub_pools_init()
81 sub_pool->base_index = base_index; in mlxsw_sp_counter_sub_pools_init()
82 base_index += sub_pool->size; in mlxsw_sp_counter_sub_pools_init()
83 atomic_set(&sub_pool->active_entries_count, 0); in mlxsw_sp_counter_sub_pools_init()
89 sub_pool = &pool->sub_pools[i]; in mlxsw_sp_counter_sub_pools_init()
92 sub_pool->resource_id); in mlxsw_sp_counter_sub_pools_init()
101 struct mlxsw_sp_counter_sub_pool *sub_pool; in mlxsw_sp_counter_sub_pools_fini() local
105 sub_pool = &pool->sub_pools[i]; in mlxsw_sp_counter_sub_pools_fini()
107 WARN_ON(atomic_read(&sub_pool->active_entries_count)); in mlxsw_sp_counter_sub_pools_fini()
109 sub_pool->resource_id); in mlxsw_sp_counter_sub_pools_fini()
187 struct mlxsw_sp_counter_sub_pool *sub_pool; in mlxsw_sp_counter_alloc() local
192 sub_pool = &pool->sub_pools[sub_pool_id]; in mlxsw_sp_counter_alloc()
193 stop_index = sub_pool->base_index + sub_pool->size; in mlxsw_sp_counter_alloc()
194 entry_index = sub_pool->base_index; in mlxsw_sp_counter_alloc()
205 if (entry_index + sub_pool->entry_size > stop_index) { in mlxsw_sp_counter_alloc()
209 for (i = 0; i < sub_pool->entry_size; i++) in mlxsw_sp_counter_alloc()
214 atomic_add(sub_pool->entry_size, &sub_pool->active_entries_count); in mlxsw_sp_counter_alloc()
215 atomic_add(sub_pool->entry_size, &pool->active_entries_count); in mlxsw_sp_counter_alloc()
228 struct mlxsw_sp_counter_sub_pool *sub_pool; in mlxsw_sp_counter_free() local
233 sub_pool = &pool->sub_pools[sub_pool_id]; in mlxsw_sp_counter_free()
235 for (i = 0; i < sub_pool->entry_size; i++) in mlxsw_sp_counter_free()
238 atomic_sub(sub_pool->entry_size, &sub_pool->active_entries_count); in mlxsw_sp_counter_free()
239 atomic_sub(sub_pool->entry_size, &pool->active_entries_count); in mlxsw_sp_counter_free()
246 const struct mlxsw_sp_counter_sub_pool *sub_pool; in mlxsw_sp_counter_resources_register() local
280 sub_pool = &mlxsw_sp_counter_sub_pools[i]; in mlxsw_sp_counter_resources_register()
281 sub_pool_size = sub_pool->bank_count * bank_size; in mlxsw_sp_counter_resources_register()
291 sub_pool->resource_name, in mlxsw_sp_counter_resources_register()
293 sub_pool->resource_id, in mlxsw_sp_counter_resources_register()
298 total_bank_config += sub_pool->bank_count; in mlxsw_sp_counter_resources_register()