openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

algo_rx.h (14545B)


      1 /** \file algo_rx.h
      2  * 
      3  * Internal DNX resource manager APIs for Rx module:
      4  *  Traps - ingress, engress
      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 #ifndef ALGO_RX_H_INCLUDED
     11 /*
     12  * { 
     13  */
     14 #define ALGO_RX_H_INCLUDED
     15 
     16 #ifndef BCM_DNX_SUPPORT
     17 #error "This file is for use by DNX (JR2) family only!"
     18 #endif
     19 
     20 /*
     21  * INCLUDE FILES:
     22  * {
     23  */
     24 
     25 #include <shared/shrextend/shrextend_error.h>
     26 #include <bcm/rx.h>
     27 #include <bcm_int/dnx/algo/template_mngr/template_manager_types.h>
     28 
     29 /*
     30  * }
     31  */
     32 
     33 /**
     34  * \brief
     35  *   Print a recycle command template entry.
     36  * \par DIRECT INPUT
     37  *   \param [in] unit -the unit number
     38  *   \param [in] data -Pointer to data \n
     39  *       \b As \b input - \n
     40  *       pointer to data of type dnx_rx_trap_recycle_cmd_config_t which
     41  *       includes properties of recycle command
     42  * \par INDIRECT INPUT
     43  *   None
     44  * \par DIRECT OUTPUT
     45  *   None
     46  * \par INDIRECT OUTPUT
     47  *    the printout
     48  * \see
     49  *   * None
     50  */
     51 void dnx_algo_rx_trap_recycle_cmd_print_entry_cb(
     52     int unit,
     53     const void *data);
     54 
     55 /**
     56  * \brief
     57  *   Print the trap gport (encoding trap_id, fwd_strength, snp_strength) template entry.
     58  * \par DIRECT INPUT
     59  *   \param [in] unit -the unit number
     60  *   \param [in] data -Pointer to data \n
     61  *       \b As \b input - \n
     62  *       pointer to data of type dnx_rx_trap_erpp_config_t which
     63  *       includes properties of erpp action profile
     64  * \par INDIRECT INPUT
     65  *   None
     66  * \par DIRECT OUTPUT
     67  *   None
     68  * \par INDIRECT OUTPUT
     69  *    the printout
     70  * \see
     71  *   * None
     72  */
     73 void dnx_algo_rx_trap_gport_print_entry_cb(
     74     int unit,
     75     const void *data);
     76 
     77 /**
     78 * \brief  
     79 *   Allocate trap id in DNX_ALGO_RX_TRAP_RES_MNGR_INGRESS_PREDEFINED pool
     80 * \par DIRECT INPUT: 
     81 *   \param [in] unit     -  Unit id
     82 *   \param [in] trap_id_p  -  Pointer to a memory type of int. \n
     83 *           \b As \b output - \n
     84 *           This pocedure loads pointed memory by ingress predefined trap_id newly allocated
     85 * \par INDIRECT INPUT: 
     86 *   * None
     87 * \par DIRECT OUTPUT: 
     88 *   shr_error_e - Error type
     89 * \par INDIRECT OUTPUT: 
     90 *   * None
     91 * \remark 
     92 *   * None
     93 * \see
     94 *   * None
     95 */
     96 shr_error_e dnx_algo_rx_trap_id_ingress_predefined_allocate(
     97     int unit,
     98     int *trap_id_p);
     99 
    100 /**
    101 * \brief  
    102 *   Allocate trap id in DNX_ALGO_RX_TRAP_RES_MNGR_INGRESS_USER_DEFINED pool
    103 * \par DIRECT INPUT: 
    104 *   \param [in] unit     -  Unit id
    105 *   \param [in] alloc_flags  -  User define trap can be allocated BCM_RX_TRAP_WITH_ID
    106 *   \param [in] alloc_id_p  -  Pointer to a memory type of int. \n
    107 *           \b As \b output - \n
    108 *           This pocedure loads pointed memory by ingress user_defined trap_id newly allocated
    109 * \par INDIRECT INPUT: 
    110 *   * None
    111 * \par DIRECT OUTPUT: 
    112 *   shr_error_e - Error type
    113 * \par INDIRECT OUTPUT: 
    114 *   * None
    115 * \remark 
    116 *   * None
    117 * \see
    118 *   * None
    119 */
    120 shr_error_e dnx_algo_rx_trap_id_ingress_user_define_allocate(
    121     int unit,
    122     int alloc_flags,
    123     int *alloc_id_p);
    124 
    125 /**
    126 * \brief  
    127 *   Allocate trap id in DNX_ALGO_RX_TRAP_RES_MNGR_ERPP pool
    128 * \par DIRECT INPUT: 
    129 *   \param [in] unit     - Unit id
    130 *   \param [in] flags    - Flags
    131 *   \param [in] trap_id_p  - Pointer to a memory type of int. \n
    132 *           \b As \b output - \n
    133 *           This pocedure loads pointed memory by ERPP trap_id
    134 *           newly allocaed
    135 * \par INDIRECT INPUT: 
    136 *   * None
    137 * \par DIRECT OUTPUT: 
    138 *   shr_error_e - Error type
    139 * \par INDIRECT OUTPUT: 
    140 *   * None
    141 * \remark 
    142 *   * None
    143 * \see
    144 *   * None
    145 */
    146 shr_error_e dnx_algo_rx_trap_id_erpp_allocate(
    147     int unit,
    148     int flags,
    149     int *trap_id_p);
    150 
    151 /**
    152 * \brief  
    153 *   Allocate trap id in DNX_ALGO_RX_TRAP_RES_MNGR_ETPP_ pool
    154 * \par DIRECT INPUT: 
    155 *   \param [in] unit      -  Unit id
    156 *   \param [in] flags     - Flags(WITH_ID)
    157 *   \param [in] type     -  bcmRxTrapTypeEgTx.. to allocate
    158 *   \param [out] trap_id_p  -  Pointer to a memory type of int. \n
    159 *           \b As \b output - \n
    160 *           This pocedure loads pointed memory by ETPP trap_id newly allocaed
    161 * \par INDIRECT INPUT: 
    162 *   * None
    163 * \par DIRECT OUTPUT: 
    164 *   shr_error_e - Error type
    165 * \par INDIRECT OUTPUT: 
    166 *   * None
    167 * \remark 
    168 *   * None
    169 * \see
    170 *   * None
    171 */
    172 shr_error_e dnx_algo_rx_trap_id_etpp_allocate(
    173     int unit,
    174     int flags,
    175     bcm_rx_trap_t type,
    176     int *trap_id_p);
    177 
    178 /**
    179 * \brief  
    180 *   Allocate trap id in DNX_ALGO_RX_TRAP_RES_MNGR_ETPP_OAM pool
    181 * \par DIRECT INPUT: 
    182 *   \param [in] unit     -  Unit id
    183 *   \param [in] trap_id_p  -  Pointer to a memory type of int. \n
    184 *           \b As \b output - \n
    185 *           This pocedure loads pointed memory by ETPP OAM trap_id newly allocated
    186 * \par INDIRECT INPUT: 
    187 *   * None
    188 * \par DIRECT OUTPUT: 
    189 *   shr_error_e - Error type
    190 * \par INDIRECT OUTPUT: 
    191 *   * None
    192 * \remark 
    193 *   * None
    194 * \see
    195 *   * None
    196 */
    197 shr_error_e dnx_algo_rx_trap_id_etpp_oam_allocate(
    198     int unit,
    199     int *trap_id_p);
    200 
    201 /**
    202 * \brief
    203 *   Deallocate trap id in DNX_ALGO_RX_TRAP_RES_MNGR_INGRESS_PREDEFINED pool
    204 * \par DIRECT INPUT: 
    205 *   \param [in] unit     -  Unit id
    206 *   \param [in] trap_id  -  Trap id to deallocate
    207 * \par INDIRECT INPUT: 
    208 *   * None
    209 * \par DIRECT OUTPUT: 
    210 *   shr_error_e - Error type
    211 * \par INDIRECT OUTPUT: 
    212 *   * None
    213 * \remark 
    214 *   * None
    215 * \see
    216 *   * None
    217 */
    218 shr_error_e dnx_algo_rx_trap_id_ingress_predefined_deallocate(
    219     int unit,
    220     int trap_id);
    221 
    222 /**
    223 * \brief  
    224 *   Deallocate trap id in DNX_ALGO_RX_TRAP_RES_MNGR_INGRESS_USER_DEFINED pool
    225 * \par DIRECT INPUT: 
    226 *   \param [in] unit     -  Unit id
    227 *   \param [in] trap_id  -  Trap id to deallocate
    228 * \par INDIRECT INPUT: 
    229 *   * None
    230 * \par DIRECT OUTPUT: 
    231 *   shr_error_e - Error type
    232 * \par INDIRECT OUTPUT: 
    233 *   * None
    234 * \remark 
    235 *   * None
    236 * \see
    237 *   * None
    238 */
    239 shr_error_e dnx_algo_rx_trap_id_ingress_user_define_deallocate(
    240     int unit,
    241     int trap_id);
    242 
    243 /**
    244 * \brief  
    245 *   Deallocate trap id in DNX_ALGO_RX_TRAP_RES_MNGR_ERPP pool
    246 * \par DIRECT INPUT: 
    247 *   \param [in] unit     -  Unit id
    248 *   \param [in] trap_id  -  Trap id to deallocate
    249 * \par INDIRECT INPUT: 
    250 *   * None
    251 * \par DIRECT OUTPUT: 
    252 *   shr_error_e - Error type
    253 * \par INDIRECT OUTPUT: 
    254 *   * None
    255 * \remark 
    256 *   * None
    257 * \see
    258 *   * None
    259 */
    260 shr_error_e dnx_algo_rx_trap_id_erpp_deallocate(
    261     int unit,
    262     int trap_id);
    263 
    264 /**
    265 * \brief  
    266 *   Deallocate trap id in DNX_ALGO_RX_TRAP_RES_MNGR_ETPP_PREDEFINED pool
    267 * \par DIRECT INPUT: 
    268 *   \param [in] unit     -  Unit id
    269 *   \param [in] trap_id  -  Trap id to deallocate
    270 * \par INDIRECT INPUT: 
    271 *   * None
    272 * \par DIRECT OUTPUT: 
    273 *   shr_error_e - Error type
    274 * \par INDIRECT OUTPUT: 
    275 *   * None
    276 * \remark 
    277 *   * None
    278 * \see
    279 *   * None
    280 */
    281 shr_error_e dnx_algo_rx_trap_id_etpp_deallocate(
    282     int unit,
    283     int trap_id);
    284 
    285 /**
    286 * \brief  
    287 *   Deallocate trap id in DNX_ALGO_RX_TRAP_RES_MNGR_ETPP_OAM pool
    288 * \par DIRECT INPUT: 
    289 *   \param [in] unit     -  Unit id
    290 *   \param [in] trap_id  -  Trap id to deallocate
    291 * \par INDIRECT INPUT: 
    292 *   * None
    293 * \par DIRECT OUTPUT: 
    294 *   shr_error_e - Error type
    295 * \par INDIRECT OUTPUT: 
    296 *   * None
    297 * \remark 
    298 *   * None
    299 * \see
    300 *   * None
    301 */
    302 shr_error_e dnx_algo_rx_trap_id_etpp_oam_deallocate(
    303     int unit,
    304     int trap_id);
    305 
    306 /**
    307 * \brief
    308 *   Check whether specific ingress pre-defined trap was already allocated 
    309 *   in DNX_ALGO_RX_TRAP_RES_MNGR_INGRESS_PREDEFINED
    310 * \par DIRECT INPUT: 
    311 *   \param [in] unit            -  Unit ID
    312 *   \param [in] trap_id         -  Pre-defined trap id to check
    313 *   \param [in] is_allocated_p  -  Pointer to a memory type of int. \n
    314 *           \b As \b output - \n
    315 *           This pocedure loads pointed memory by TRUE if the ingress predefined trap_id was allocated, otherwise FALSE.
    316 * \par INDIRECT INPUT: 
    317 *   * None
    318 * \par DIRECT OUTPUT: 
    319 *   shr_error_e - Error type
    320 * \par INDIRECT OUTPUT: 
    321 *   * None
    322 * \remark 
    323 *   * None
    324 * \see
    325 *   * None
    326 */
    327 shr_error_e dnx_algo_rx_trap_id_ingress_predefined_is_allocated(
    328     int unit,
    329     int trap_id,
    330     uint8 *is_allocated_p);
    331 
    332 /**
    333 * \brief  
    334 *   Check whether specific ingress user define trap was already allocated
    335 *   in DNX_ALGO_RX_TRAP_RES_MNGR_INGRESS_USER_DEFINED
    336 * \par DIRECT INPUT: 
    337 *   \param [in] unit            -  Unit Id
    338 *   \param [in] trap_id         -  User define trap id to check
    339 *   \param [in] is_allocated_p  -  Pointer to a memory type of int. \n
    340 *           \b As \b output - \n
    341 *           This pocedure loads pointed memory by TRUE if ingress user_define trap_id was allocated, otherwise FALSE.
    342 * \par INDIRECT INPUT: 
    343 *   * None
    344 * \par DIRECT OUTPUT: 
    345 *   shr_error_e - Error type
    346 * \par INDIRECT OUTPUT: 
    347 *   * None
    348 * \remark 
    349 *   * None
    350 * \see
    351 *   * None
    352 */
    353 shr_error_e dnx_algo_rx_trap_id_ingress_user_define_is_allocated(
    354     int unit,
    355     int trap_id,
    356     uint8 *is_allocated_p);
    357 
    358 /**
    359 * \brief  
    360 *   Check whether specific erpp trap was already allocated
    361 *   in DNX_ALGO_RX_TRAP_RES_MNGR_ERPP
    362 * \par DIRECT INPUT: 
    363 *   \param [in] unit            -  Unit id
    364 *   \param [in] trap_id         -  Id of erpp trap
    365 *   \param [in] is_allocated_p  -  Pointer to a memory type of int. \n
    366 *           \b As \b output - \n
    367 *           This pocedure loads pointed memory by TRUE if the erpp trap_id was allocated, otherwise FALSE.
    368 * \par INDIRECT INPUT: 
    369 *   * None
    370 * \par DIRECT OUTPUT: 
    371 *   shr_error_e - Error type
    372 * \par INDIRECT OUTPUT: 
    373 *   * None
    374 * \remark 
    375 *   * None
    376 * \see
    377 *   * None
    378 */
    379 shr_error_e dnx_algo_rx_trap_id_erpp_is_allocated(
    380     int unit,
    381     int trap_id,
    382     uint8 *is_allocated_p);
    383 
    384 /**
    385 * \brief  
    386 *   Check whether specific erpp trap was already allocated
    387 *   in DNX_ALGO_RX_TRAP_RES_MNGR_ETPP_PREDEFINED
    388 * \par DIRECT INPUT: 
    389 *   \param [in] unit            -  Unit id
    390 *   \param [in] trap_id         -  Id of etpp trap
    391 *   \param [in] is_allocated_p  -  Pointer to a memory type of int. \n
    392 *           \b As \b output - \n
    393 *           This pocedure loads pointed memory by TRUE if the etpp trap_id was allocated, otherwise FALSE.
    394 * \par INDIRECT INPUT: 
    395 *   * None
    396 * \par DIRECT OUTPUT: 
    397 *   shr_error_e - Error type
    398 * \par INDIRECT OUTPUT: 
    399 *   * None
    400 * \remark 
    401 *   * None
    402 * \see
    403 *   * None
    404 */
    405 shr_error_e dnx_algo_rx_trap_id_etpp_is_allocated(
    406     int unit,
    407     int trap_id,
    408     uint8 *is_allocated_p);
    409 
    410 /**
    411 * \brief  
    412 *   Check whether specific etpp trap was already allocated
    413 *   in DNX_ALGO_RX_TRAP_RES_MNGR_ETPP_OAM
    414 * \par DIRECT INPUT: 
    415 *   \param [in] unit            -  Unit id
    416 *   \param [in] trap_id         -  Id of etpp oam trap
    417 *   \param [in] is_allocated_p  -  Pointer to a memory type of int. \n
    418 *           \b As \b output - \n
    419 *           This pocedure loads pointed memory by TRUE if the etpp oam trap_id was allocated, otherwise FALSE.
    420 * \par INDIRECT INPUT: 
    421 *   * None
    422 * \par DIRECT OUTPUT: 
    423 *   shr_error_e - Error type
    424 * \par INDIRECT OUTPUT: 
    425 *   * None
    426 * \remark 
    427 *   * None
    428 * \see
    429 *   * None
    430 */
    431 shr_error_e dnx_algo_rx_trap_id_etpp_oam_is_allocated(
    432     int unit,
    433     int trap_id,
    434     uint8 *is_allocated_p);
    435 
    436 /**
    437 * \brief
    438 *   Check if the ICMP compression type is allocated.
    439 * \par DIRECT INPUT:
    440 *   \param [in] unit            -  Unit id
    441 *   \param [in] compressed_type -  ICMP compressed type
    442 *   \param [out] is_allocated_p -  Is allocated
    443 * \par INDIRECT INPUT:
    444 *   * None
    445 * \par DIRECT OUTPUT:
    446 *   shr_error_e - Error type
    447 * \par INDIRECT OUTPUT:
    448 *   * None
    449 * \remark
    450 *   * None
    451 * \see
    452 *   * None
    453 */
    454 shr_error_e dnx_algo_rx_trap_icmp_compressed_type_is_allocated(
    455     int unit,
    456     int compressed_type,
    457     uint8 *is_allocated_p);
    458 
    459 /**
    460 * \brief
    461 *   Allocate trap id in DNX_ALGO_RX_TRAP_RES_MNGR_PROTOCOL_ICMP_TYPE_MAP pool
    462 * \par DIRECT INPUT:
    463 *   \param [in] unit                - Unit id
    464 *   \param [in] alloc_flags         - Allocation flags
    465 *   \param [out] compressed_type_p  - Compressed ICMP Type
    466 * \par INDIRECT INPUT:
    467 *   * None
    468 * \par DIRECT OUTPUT:
    469 *   shr_error_e - Error type
    470 * \par INDIRECT OUTPUT:
    471 *   * None
    472 * \remark
    473 *   * None
    474 * \see
    475 *   * None
    476 */
    477 shr_error_e dnx_algo_rx_trap_icmp_compressed_type_allocate(
    478     int unit,
    479     int alloc_flags,
    480     int *compressed_type_p);
    481 
    482 /**
    483 * \brief
    484 *   Deallocate ICMP compression type
    485 * \par DIRECT INPUT:
    486 *   \param [in] unit            -  Unit id
    487 *   \param [in] compressed_type -  ICMP compressed type
    488 * \par INDIRECT INPUT:
    489 *   * None
    490 * \par DIRECT OUTPUT:
    491 *   shr_error_e - Error type
    492 * \par INDIRECT OUTPUT:
    493 *   * None
    494 * \remark
    495 *   * None
    496 * \see
    497 *   * None
    498 */
    499 shr_error_e dnx_algo_rx_trap_icmp_compressed_type_deallocate(
    500     int unit,
    501     int compressed_type);
    502 
    503 /**
    504  * \brief - Initialize rx algorithms
    505  *  Resource managers for traps - ingress
    506  * \par DIRECT_INPUT:
    507  *   \param [in] unit - Unit ID
    508  *   
    509  * \par INDIRECT INPUT:
    510  *   * None
    511  * \par DIRECT OUTPUT:
    512  *   shr_error_e 
    513  * \par INDIRECT OUTPUT
    514  *   * rx resource manager
    515  * \remark
    516  *   * None
    517  * \see
    518  *   * None
    519  */
    520 shr_error_e dnx_algo_rx_init(
    521     int unit);
    522 
    523 /*
    524  * MACROs
    525  * {
    526  */
    527 
    528 /**
    529  * \brief - res mngr for ingress traps - predefined traps
    530  */
    531 #define DNX_ALGO_RX_TRAP_RES_MNGR_INGRESS_PREDEFINED            "TRAP_INGRESS_PREDEFINED"
    532 /**
    533  * \brief - res mngr for ingress traps - user_define traps 
    534  */
    535 #define DNX_ALGO_RX_TRAP_RES_MNGR_INGRESS_USER_DEFINED          "TRAP_INGRESS_USER_DEFINED"
    536 /**
    537  * \brief - res mngr for ERPP traps
    538  */
    539 #define DNX_ALGO_RX_TRAP_RES_MNGR_ERPP                          "TRAP_ERPP"
    540 /**
    541  * \brief - res mngr for ETPP traps - predefined traps
    542  */
    543 #define DNX_ALGO_RX_TRAP_RES_MNGR_ETPP                          "TRAP_ETPP"
    544 /**
    545  * \brief - res mngr for ETPP traps - OAM traps
    546  */
    547 #define DNX_ALGO_RX_TRAP_RES_MNGR_ETPP_OAM                      "TRAP_ETPP_OAM"
    548 /**
    549  * \brief - template manager for Protocol(ICMP) type map
    550  */
    551 #define DNX_ALGO_RX_TRAP_RES_MNGR_PROTOCOL_ICMP_TYPE_MAP        "TRAP_PROTOCOL_ICMP_MAP"
    552 /**
    553  * \brief - template manager for recycle command
    554  */
    555 #define DNX_ALGO_RX_TRAP_TEMPLATE_MNGR_RECYCLE_CMD              "TRAP_RECYCLE_CMD"
    556 /**
    557  * \brief - template mngr for action profile of ERPP traps                  
    558  */
    559 #define DNX_ALGO_RX_TRAP_TEMPLATE_MNGR_ERPP_ACTION_PROFILE      "TRAP_ERPP_ACTION_PROFILE"
    560 
    561 /**
    562  * \brief - template mngr for action profile of ETPP traps                  
    563  */
    564 #define DNX_ALGO_RX_TRAP_TEMPLATE_MNGR_ETPP_ACTION_PROFILE      "TRAP_ETPP_ACTION_PROFILE"
    565 
    566 /**
    567  * \brief - template manager for ingress lif traps
    568  */
    569 #define DNX_ALGO_RX_TRAP_TEMPLATE_MNGR_INGRESS_LIF              "TRAP_INGRESS_LIF"
    570 /**
    571  * \brief - template manager for ETPP lif traps
    572  */
    573 #define DNX_ALGO_RX_TRAP_TEMPLATE_MNGR_ETPP_LIF                 "TRAP_ETPP_LIF"
    574 
    575 /*
    576  * }
    577  */
    578 
    579 /*
    580  * } 
    581  */
    582 #endif/*_ALGO_MIRROR_INCLUDED__*/