1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */ 2 /* Copyright (c) 2017-2018 Mellanox Technologies. All rights reserved */ 3 4 #ifndef _MLXSW_SPECTRUM_CNT_H 5 #define _MLXSW_SPECTRUM_CNT_H 6 7 #include "spectrum.h" 8 9 enum mlxsw_sp_counter_sub_pool_id { 10 MLXSW_SP_COUNTER_SUB_POOL_FLOW, 11 MLXSW_SP_COUNTER_SUB_POOL_RIF, 12 }; 13 14 int mlxsw_sp_counter_alloc(struct mlxsw_sp *mlxsw_sp, 15 enum mlxsw_sp_counter_sub_pool_id sub_pool_id, 16 unsigned int *p_counter_index); 17 void mlxsw_sp_counter_free(struct mlxsw_sp *mlxsw_sp, 18 enum mlxsw_sp_counter_sub_pool_id sub_pool_id, 19 unsigned int counter_index); 20 int mlxsw_sp_counter_pool_init(struct mlxsw_sp *mlxsw_sp); 21 void mlxsw_sp_counter_pool_fini(struct mlxsw_sp *mlxsw_sp); 22 23 #endif 24