esb.h (3735B)
1 /* 2 * \file esb.h 3 * 4 * Created on: March 26, 2019 5 * Author: vg889851 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 _ESB_H_INCLUDED_ 13 #define _ESB_H_INCLUDED_ 14 15 #ifndef BCM_DNX_SUPPORT 16 #error "This file is for use by DNX (JR2) family only!" 17 #endif 18 19 #include <shared/shrextend/shrextend_error.h> 20 21 #define ESB_QUEUE_ID_INVALID -1 22 23 /** 24 * \brief - Initiallize the Egress Shared Buffers 25 * 26 * \param [in] unit - Unit-ID 27 * 28 * \return 29 * shr_error_e 30 * \remark 31 * * None 32 * \see 33 * * None 34 */ 35 shr_error_e dnx_esb_init( 36 uint32 unit); 37 38 /** 39 * \brief - Configure the Egress Shared Buffers for a given logical port 40 * 41 * \param [in] unit - Unit-ID 42 * \param [in] logical_port - Logical port 43 * 44 * \return 45 * shr_error_e 46 * \remark 47 * * None 48 * \see 49 * * None 50 */ 51 shr_error_e dnx_esb_port_add( 52 uint32 unit, 53 bcm_port_t logical_port); 54 55 /** 56 * \brief - Configure port speed dependent settings of the Egress Shared Buffers for a given logical port 57 * 58 * \param [in] unit - Unit-ID 59 * \param [in] logical_port - Logical port 60 * 61 * \return 62 * shr_error_e 63 * \remark 64 * * None 65 * \see 66 * * None 67 */ 68 shr_error_e dnx_esb_port_speed_config_add( 69 uint32 unit, 70 bcm_port_t logical_port); 71 72 /** 73 * \brief - Configure TXI logic and IRDY threshold for a given logical port 74 * 75 * \param [in] unit - Unit-ID 76 * \param [in] logical_port - Logical port 77 * \param [in] is_add - indication whether port is added (otherwise it's removed) 78 * 79 * \return 80 * shr_error_e 81 * \remark 82 * * None 83 * \see 84 * * None 85 */ 86 shr_error_e dnx_esb_port_txi_config_set( 87 uint32 unit, 88 bcm_port_t logical_port, 89 int is_add); 90 91 /** 92 * \brief - Clear the configuration of the Egress Shared Buffers for a given logical port 93 * 94 * \param [in] unit - Unit-ID 95 * \param [in] logical_port - Logical port 96 * 97 * \return 98 * shr_error_e 99 * \remark 100 * * None 101 * \see 102 * * None 103 */ 104 shr_error_e dnx_esb_port_remove( 105 uint32 unit, 106 bcm_port_t logical_port); 107 108 /** 109 * \brief - 110 * Given rate, in Mega Bits Per Second, calculate the 111 * weight for the ESB calendar configuration 112 * 113 * \param [in] unit - HW Unit-ID 114 * \param [in] rate - Rate in Mega Bits Per Second 115 * \param [out] weight_p - Holds the weight 116 * \param [in] is_l1 - Indicate if the calculation is fone for L1 queue 117 * 118 * \return 119 * shr_error_e 120 * If zero (_SHR_E_NONE), then no error was encountered. 121 * Otherwise, see shr_error_e 122 * \remark 123 * * None 124 * \see 125 * * dnx_esb_nif_calendar_set 126 */ 127 shr_error_e dnx_esb_nif_rate_to_weight( 128 int unit, 129 uint32 rate, 130 uint32 *weight_p, 131 uint8 is_l1); 132 133 /** 134 * \brief - 135 * Based on setup of rate of master ports, load interface calendar fot ESB 136 * 137 * \param [in] unit - Unit-ID 138 * \param [in] core - Core-ID 139 * \return 140 * If zero (_SHR_E_NONE), then no error was encountered. 141 * Otherwise, see shr_error_e 142 * \remark 143 * * Indirect input is the 'rate' setup for all master ports (assigned per interface). 144 * See dnx_algo_port_interface_rate_get() 145 * \see 146 * * None 147 */ 148 shr_error_e dnx_esb_nif_calendar_set( 149 int unit, 150 bcm_core_t core); 151 152 /** 153 * \brief - 154 * configure the initiate credit size for ilkn port. 155 * \param [in] unit - HW Unit-ID 156 * \param [in] port - logical port 157 * \param [in] max_credits - maximum credits allowed to configure 158 * \return 159 * If zero (_SHR_E_NONE), then no error was encountered. 160 * Otherwise, see shr_error_e 161 * \remark 162 * None 163 * \see 164 * None 165 */ 166 shr_error_e dnx_esb_ilkn_credits_set( 167 int unit, 168 bcm_port_t port, 169 int max_credits); 170 171 #endif /* _ESB_H_INCLUDED_ */