cosq_stat.h (7217B)
1 /* 2 * DO NOT EDIT THIS FILE! 3 * This file is auto-generated. 4 * Edits to this file will be lost when it is regenerated. 5 * 6 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 7 * 8 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 9 */ 10 11 #ifndef BCMINT_LTSW_MBCM_COSQ_STAT_H 12 #define BCMINT_LTSW_MBCM_COSQ_STAT_H 13 14 #include <bcm/types.h> 15 #include <bcm/cosq.h> 16 17 #include <sal/sal_types.h> 18 19 /*! 20 * \brief Get MMU statistics on a per port per cosq basis 21 * 22 * \param [in] unit Unit Number. 23 * \param [in] gport Gport Number. 24 * \param [in] cosq COS queue. 25 * \param [in] stat Statistic to be retrieved. 26 * \param [in] sync_mode Sync mode. 27 * \param [out] value Returned statistic value. 28 * 29 * \retval SHR_E_NONE No errors. 30 * \retval !SHR_E_NONE Failure. 31 */ 32 typedef int (*cosq_stat_get_f)( 33 int unit, 34 bcm_gport_t gport, 35 bcm_cos_queue_t cosq, 36 bcm_cosq_stat_t stat, 37 int sync_mode, 38 uint64_t *value); 39 40 /*! 41 * \brief Set MMU statistics on a per port per cosq basis 42 * 43 * \param [in] unit Unit Number. 44 * \param [in] gport Gport Number. 45 * \param [in] cosq COS queue. 46 * \param [in] stat Statistic to be set. 47 * \param [in] value Statistic value to be set. 48 * 49 * \retval SHR_E_NONE No errors. 50 * \retval !SHR_E_NONE Failure. 51 */ 52 typedef int (*cosq_stat_set_f)( 53 int unit, 54 bcm_gport_t gport, 55 bcm_cos_queue_t cosq, 56 bcm_cosq_stat_t stat, 57 uint64_t value); 58 59 /*! 60 * \brief Clear the cosq stat per port. 61 * 62 * \param [in] unit Unit Number. 63 * \param [in] port Logic port id. 64 * 65 * \retval SHR_E_NONE No errors. 66 * \retval !SHR_E_NONE Failure. 67 */ 68 typedef int (*cosq_stat_clear_f)( 69 int unit, 70 int port); 71 72 /*! 73 * \brief Get MMU debug counter match configuration for a certain MMU debug counter 74 * 75 * \param [in] unit Unit Number. 76 * \param [in] port Port number, used to deduce buffer ID. 77 * \param [in] stat MMU debug counter whose match configuration to be retrieved. 78 * \param [out] match Returned MMU debug counter match configuration. 79 * 80 * \retval SHR_E_NONE No errors. 81 * \retval !SHR_E_NONE Failure. 82 */ 83 typedef int (*cosq_stat_debug_stat_match_get_f)( 84 int unit, 85 bcm_port_t port, 86 bcm_cosq_stat_t stat, 87 bcm_cosq_debug_stat_match_t *match); 88 89 /*! 90 * \brief Set MMU debug counter match configuration for a certain MMU debug counter 91 * 92 * \param [in] unit Unit Number. 93 * \param [in] port Port number, used to deduce buffer ID. 94 * \param [in] stat MMU debug counter whose match configuration to be set. 95 * \param [in] match MMU debug counter match configuration to be set. 96 * 97 * \retval SHR_E_NONE No errors. 98 * \retval !SHR_E_NONE Failure. 99 */ 100 typedef int (*cosq_stat_debug_stat_match_set_f)( 101 int unit, 102 bcm_port_t port, 103 bcm_cosq_stat_t stat, 104 bcm_cosq_debug_stat_match_t *match); 105 106 /*! 107 * \brief Initialize the cosq_stat module. 108 * 109 * \param [in] unit Unit Number. 110 * 111 * \retval SHR_E_NONE No errors. 112 * \retval !SHR_E_NONE Failure. 113 */ 114 typedef int (*cosq_stat_init_f)(int unit); 115 116 /*! 117 * \brief Detach the cosq_stat module. 118 * 119 * \param [in] unit Unit Number. 120 * 121 * \retval SHR_E_NONE No errors. 122 * \retval !SHR_E_NONE Failure. 123 */ 124 typedef int (*cosq_stat_detach_f)(int unit); 125 126 /*! 127 * \brief Cosq_stat driver structure. 128 */ 129 typedef struct mbcm_ltsw_cosq_stat_drv_s { 130 131 /*! Get MMU statistics on a per port per cosq basis */ 132 cosq_stat_get_f cosq_stat_get; 133 134 /*! Set MMU statistics on a per port per cosq basis */ 135 cosq_stat_set_f cosq_stat_set; 136 137 /*! Clear the cosq stat per port. */ 138 cosq_stat_clear_f cosq_stat_clear; 139 140 /*! Get MMU debug counter match configuration for a certain MMU debug counter */ 141 cosq_stat_debug_stat_match_get_f cosq_stat_debug_stat_match_get; 142 143 /*! Set MMU debug counter match configuration for a certain MMU debug counter */ 144 cosq_stat_debug_stat_match_set_f cosq_stat_debug_stat_match_set; 145 146 /*! Initialize the cosq_stat module. */ 147 cosq_stat_init_f cosq_stat_init; 148 149 /*! Detach the cosq_stat module. */ 150 cosq_stat_detach_f cosq_stat_detach; 151 152 } mbcm_ltsw_cosq_stat_drv_t; 153 154 /*! 155 * \brief Set the COSQ_STAT driver of the device. 156 * 157 * \param [in] unit Unit Number. 158 * \param [in] drv Cosq_stat driver to set. 159 * 160 * \retval SHR_E_NONE No errors. 161 * \retval !SHR_E_NONE Failure. 162 */ 163 extern int 164 mbcm_ltsw_cosq_stat_drv_set( 165 int unit, 166 mbcm_ltsw_cosq_stat_drv_t *drv); 167 168 /*! 169 * \brief Get MMU statistics on a per port per cosq basis 170 * 171 * \param [in] unit Unit Number. 172 * \param [in] gport Gport Number. 173 * \param [in] cosq COS queue. 174 * \param [in] stat Statistic to be retrieved. 175 * \param [in] sync_mode Sync mode. 176 * \param [out] value Returned statistic value. 177 * 178 * \retval SHR_E_NONE No errors. 179 * \retval !SHR_E_NONE Failure. 180 */ 181 extern int 182 mbcm_ltsw_cosq_stat_get( 183 int unit, 184 bcm_gport_t gport, 185 bcm_cos_queue_t cosq, 186 bcm_cosq_stat_t stat, 187 int sync_mode, 188 uint64_t *value); 189 190 /*! 191 * \brief Set MMU statistics on a per port per cosq basis 192 * 193 * \param [in] unit Unit Number. 194 * \param [in] gport Gport Number. 195 * \param [in] cosq COS queue. 196 * \param [in] stat Statistic to be set. 197 * \param [in] value Statistic value to be set. 198 * 199 * \retval SHR_E_NONE No errors. 200 * \retval !SHR_E_NONE Failure. 201 */ 202 extern int 203 mbcm_ltsw_cosq_stat_set( 204 int unit, 205 bcm_gport_t gport, 206 bcm_cos_queue_t cosq, 207 bcm_cosq_stat_t stat, 208 uint64_t value); 209 210 /*! 211 * \brief Clear the cosq stat per port. 212 * 213 * \param [in] unit Unit Number. 214 * \param [in] port Logic port id. 215 * 216 * \retval SHR_E_NONE No errors. 217 * \retval !SHR_E_NONE Failure. 218 */ 219 extern int 220 mbcm_ltsw_cosq_stat_clear( 221 int unit, 222 int port); 223 224 /*! 225 * \brief Get MMU debug counter match configuration for a certain MMU debug counter 226 * 227 * \param [in] unit Unit Number. 228 * \param [in] port Port number, used to deduce buffer ID. 229 * \param [in] stat MMU debug counter whose match configuration to be retrieved. 230 * \param [out] match Returned MMU debug counter match configuration. 231 * 232 * \retval SHR_E_NONE No errors. 233 * \retval !SHR_E_NONE Failure. 234 */ 235 extern int 236 mbcm_ltsw_cosq_stat_debug_stat_match_get( 237 int unit, 238 bcm_port_t port, 239 bcm_cosq_stat_t stat, 240 bcm_cosq_debug_stat_match_t *match); 241 242 /*! 243 * \brief Set MMU debug counter match configuration for a certain MMU debug counter 244 * 245 * \param [in] unit Unit Number. 246 * \param [in] port Port number, used to deduce buffer ID. 247 * \param [in] stat MMU debug counter whose match configuration to be set. 248 * \param [in] match MMU debug counter match configuration to be set. 249 * 250 * \retval SHR_E_NONE No errors. 251 * \retval !SHR_E_NONE Failure. 252 */ 253 extern int 254 mbcm_ltsw_cosq_stat_debug_stat_match_set( 255 int unit, 256 bcm_port_t port, 257 bcm_cosq_stat_t stat, 258 bcm_cosq_debug_stat_match_t *match); 259 260 /*! 261 * \brief Initialize the cosq_stat module. 262 * 263 * \param [in] unit Unit Number. 264 * 265 * \retval SHR_E_NONE No errors. 266 * \retval !SHR_E_NONE Failure. 267 */ 268 extern int 269 mbcm_ltsw_cosq_stat_init(int unit); 270 271 /*! 272 * \brief Detach the cosq_stat module. 273 * 274 * \param [in] unit Unit Number. 275 * 276 * \retval SHR_E_NONE No errors. 277 * \retval !SHR_E_NONE Failure. 278 */ 279 extern int 280 mbcm_ltsw_cosq_stat_detach(int unit); 281 282 #endif /* BCMINT_LTSW_MBCM_COSQ_STAT_H */