fabric_cgm.h (2718B)
1 2 /** \file fabric_cgm.h 3 * 4 * 5 * Fabric CGM APIs 6 * 7 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 8 * 9 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 10 */ 11 12 #ifndef __FABRIC_CGM_H_INCLUDED__ 13 #define __FABRIC_CGM_H_INCLUDED__ 14 15 #ifndef BCM_DNX_SUPPORT 16 #error "This file is for use by DNX (JR2) family only!" 17 #endif 18 19 /* 20 * Index types of fabric cgm DBAL tables. 21 */ 22 typedef enum 23 { 24 /** Access to dbal table doesn't requires index */ 25 DNX_FABRIC_CGM_CONTROL_INDEX_TYPE_NONE = 0, 26 /** Access to dbal table with 'leaky bucket' index */ 27 DNX_FABRIC_CGM_CONTROL_INDEX_TYPE_LEAKY_BUCKET, 28 /** Access to dbal table with 'pipe' index */ 29 DNX_FABRIC_CGM_CONTROL_INDEX_TYPE_PIPE, 30 /** Access to dbal table with 'level' index */ 31 DNX_FABRIC_CGM_CONTROL_INDEX_TYPE_LEVEL, 32 /** Access to dbal table with 'level separate' index */ 33 DNX_FABRIC_CGM_CONTROL_INDEX_TYPE_LEVEL_SEPARATE, 34 /** Access to dbal table with 'FMC shaper' index */ 35 DNX_FABRIC_CGM_CONTROL_INDEX_TYPE_FMC_SHAPER, 36 /** Access to dbal table with 'priority' index */ 37 DNX_FABRIC_CGM_CONTROL_INDEX_TYPE_PRIORITY, 38 /** Access to dbal table with 'level' and 'pipe' indexes */ 39 DNX_FABRIC_CGM_CONTROL_INDEX_TYPE_PIPE_LEVEL, 40 /** Access to dbal table with 'fmc_shaper' and 'slow_start_phase' indexes */ 41 DNX_FABRIC_CGM_CONTROL_INDEX_TYPE_FMC_SLOW_START_PHASE, 42 /** Access to dbal table with 'cast' and 'priority' indexes */ 43 DNX_FABRIC_CGM_CONTROL_INDEX_TYPE_CAST_PRIORITY 44 } dnx_fabric_cgm_control_index_type_e; 45 46 /** 47 * \brief 48 * Initialize Fabric CGM module. 49 * 50 * \param [in] unit - 51 * The unit number. 52 * \return 53 * \retval See \ref shr_error_e 54 * \remark 55 * * None 56 * \see 57 * * None 58 */ 59 shr_error_e dnx_fabric_cgm_init( 60 int unit); 61 62 /** 63 * \brief 64 * Enable/Disable link's LLFC. 65 * 66 * \param [in] unit - 67 * The unit number. 68 * \param [in] link - 69 * The fabric link number. 70 * \param [in] enable - 71 * 1 - enable LLFC. 72 * 0 - disable LLFC. 73 * \return 74 * \retval See \ref shr_error_e 75 * \remark 76 * * None 77 * \see 78 * * None 79 */ 80 shr_error_e dnx_fabric_cgm_llfc_enable_hw_set( 81 int unit, 82 bcm_port_t link, 83 int enable); 84 85 /** 86 * \brief 87 * Get whether link's LLFC is enabled. 88 * 89 * \param [in] unit - 90 * The unit number. 91 * \param [in] link - 92 * The fabric link number. 93 * \param [in] enable - 94 * 1 - enable LLFC. 95 * 0 - disable LLFC. 96 * \return 97 * \retval See \ref shr_error_e 98 * \remark 99 * * None 100 * \see 101 * * None 102 */ 103 shr_error_e dnx_fabric_cgm_llfc_enable_hw_get( 104 int unit, 105 bcm_port_t link, 106 int *enable); 107 108 #endif /** __FABRIC_CGM_H_INCLUDED__ */