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