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_l3.h (21832B)


      1 /**
      2  * \file algo_l3.h Internal DNX L3 Managment APIs
      3  *
      4  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      5  * 
      6  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
      7  */
      8 
      9 #ifndef ALGO_L3_H_INCLUDED
     10 /*
     11  * {
     12  */
     13 #define ALGO_L3_H_INCLUDED
     14 
     15 #include <shared/shrextend/shrextend_debug.h>
     16 #include <soc/dnx/mdb.h>
     17 #include <bcm_int/dnx/algo/template_mngr/template_manager_types.h>
     18 
     19 #ifndef BCM_DNX_SUPPORT
     20 #error "This file is for use by DNX (JR2) family only!"
     21 #endif
     22 /**
     23  * Defines
     24  * {
     25  */
     26 
     27 /**
     28  * Resource name defines for algo l3.
     29  * \see
     30  * dnx_algo_l3_ingress_mymac_prefix_entry_template_create
     31  * dnx_algo_l3_source_address_table_init
     32  */
     33 #define DNX_ALGO_L3_INGRESS_MYMAC_PREFIX_TABLE_RESOURCE     "Ingress MyMac prefix table"
     34 
     35 #define DNX_ALGO_L3_EGRESS_SOURCE_ADDRESS_TABLE_RESOURCE    "Egress source address table"
     36 
     37 #define DNX_ALGO_L3_ECMP_PROFILE_HIER_1_TABLE_RESOURCE      "ECMP first hierarchy profile table"
     38 
     39 #define DNX_ALGO_L3_ECMP_PROFILE_HIER_2_TABLE_RESOURCE      "ECMP second hierarchy profile table"
     40 
     41 #define DNX_ALGO_L3_ECMP_PROFILE_HIER_3_TABLE_RESOURCE      "ECMP third hierarchy profile table"
     42 
     43 #define DNX_ALGO_L3_ECMP_TUNNEL_PRIORITY_RESOURCE_MANAGER   "ECMP tunnel priority resource manager."
     44 
     45 #define DNX_ALGO_L3_ECMP_CONSISTENT_MANAGER_HANDLE          "ECMP consistent hashing manager handle"
     46 
     47 #define DNX_ALGO_L3_VRRP_VSI_TCAM_TABLE_RESOURCE            "VRRP MyMac TCAM VSI table"
     48 
     49 #define DNX_ALGO_L3_VRRP_EXEM_TCAM_TABLE_RESOURCE           "VRRP MyMac TCAM EXEM table"
     50 
     51 #define DNX_ALGO_L3_VRRP_EXEM_STATION_ID_RESOURCE           "VRRP MyMac EXEM station ID"
     52 
     53 #define DNX_ALGO_L3_LIF_LOCAL_OUTLIF                        "LIF local outlif"
     54 
     55 #define DNX_ALGO_L3_VIP_ECMP_TABLE_RESOURCE                 "VIP ECMP VIP ID resource manager"
     56 
     57 /**
     58  * Resource name defines for algo l3 ECMP
     59  */
     60 #define DNX_ALGO_L3_RES_ECMP_GROUP "DNX_ALGO_L3_RES_ECMP_GROUP"
     61 #define DNX_ALGO_L3_RES_ECMP_EXTENDED_GROUP "DNX_ALGO_L3_RES_ECMP_EXTENDED_GROUP"
     62 /*
     63  * represent a FEC invalid logical address.
     64  */
     65 #define ALGO_L3_INVALID_LOGICAL_ADDRESS -1
     66 /**
     67  * Resource cb defines for algo l3 ECMP
     68  */
     69 #define DNX_ALGO_L3_RES_ECMP_GROUP_CB ecmp_db_info.ecmp_res_manager
     70 #define DNX_ALGO_L3_RES_ECMP_EXTENDED_GROUP_CB ecmp_db_info.ecmp_extended_res_manager
     71 
     72 /**
     73  * Resource name defines for algo L3 FEC in the resource manager
     74  */
     75 #define DNX_ALGO_L3_RES_FEC "DNX_ALGO_L3_FEC"
     76 
     77 /** Define flags for the FEC allocation */
     78 /** Flag which is used to indicate with-id allocation */
     79 #define DNX_ALGO_L3_FEC_WITH_ID         (0x00000001)
     80 
     81 /** Translate fec_id (20bits) to super fec_id (19 bits) by taking bits [1:19] */
     82 #define DNX_ALGO_L3_FEC_ID_TO_SUPER_FEC_ID(_fec_id_) (_fec_id_ >> 1)
     83 
     84 /** Retrieve the physical FEC from the FEC ID ((super_FEC * fec_size) / row_size)*/
     85 #define DNX_ALGO_L3_PHYSICAL_FEC_GET(unit,fec_id) (DNX_ALGO_L3_FEC_ID_TO_SUPER_FEC_ID(fec_id) * dnx_data_l3.fec.super_fec_size_get(unit) /  dnx_data_mdb.pdbs.pdb_info_get(unit,DBAL_ENUM_FVAL_MDB_PHYSICAL_TABLE_FEC_1)->row_width)
     86 
     87 /**
     88  * }
     89  */
     90 
     91 /**
     92  * emums
     93  * {
     94  */
     95 /*
     96  * List of the the FEC banks groups types that are used during the FEC bank allocation.
     97  */
     98 typedef enum
     99 {
    100     /*
    101      * Information of the cluster and banks that are to be updated for the requested resource.
    102      */
    103     ALGOL_L3_FEC_BANKS_GROUP_TO_UPDATE = 0,
    104     /*
    105      * Information of the clusters that need to be moved in order to allocate the requested resource.
    106      */
    107     ALGOL_L3_FEC_BANKS_GROUP_TO_MOVE = 1,
    108     /*
    109      * Number of bank allocation information types.
    110      */
    111     ALGOL_L3_NOF_FEC_BANKS_GROUP_TYPES = 2
    112 } algo_l3_fec_banks_group_type_e;
    113 
    114 /*
    115  * List of the the FEC banks groups types that are used during the FEC bank allocation.
    116  */
    117 typedef enum
    118 {
    119     /*
    120      * The requested bank resource
    121      */
    122     ALGOL_L3_FEC_BANK_REQUESTED_TYPE = 0,
    123     /*
    124      * The pair of the requested bank resource (a pair of resources is two consecutive number with a leading even number)
    125      */
    126     ALGOL_L3_FEC_BANK_REQUESTED_PAIR_TYPE = 1,
    127     /*
    128      * NOF of bank types
    129      */
    130     ALGOL_L3_NOF_FEC_BANK_TYPES = 2
    131 } algo_l3_fec_banks_types_in_group_e;
    132 
    133 /**
    134  * }
    135  */
    136 
    137 /**
    138  * Structures
    139  * {
    140  */
    141 /**
    142  * \brief - VRRP tcam key fields
    143  */
    144 typedef struct
    145 {
    146     /**
    147      * Destination MAC address
    148      */
    149     bcm_mac_t mac_da;
    150 
    151     /**
    152      * Destination MAC address mask
    153      */
    154     bcm_mac_t mac_da_mask;
    155 
    156     /**
    157      * Protocol group ID
    158      */
    159     uint32 protocol_group;
    160 
    161     /**
    162      * Protocol group ID mask
    163      */
    164     uint32 protocol_group_mask;
    165 } algo_dnx_l3_vrrp_tcam_key_t;
    166 
    167 /**
    168  * }
    169  */
    170 
    171 /**
    172 * \brief
    173 *   gets the NOF of FEC allocation banks.
    174 *
    175 *  \par DIRECT INPUT:
    176 *    \param [in] unit -
    177 *     Identifier of the device to access.
    178 *    \param [out] fec_banks -
    179 *      NOF of FEC allocation banks.
    180 *  \remark
    181 *    None
    182 *  \see
    183 *    shr_error_e
    184  */
    185 shr_error_e dnx_algo_l3_nof_fec_banks_get(
    186     int unit,
    187     uint32 *fec_banks);
    188 
    189 /**
    190 * \brief
    191 *   Intialize l3 algorithms.
    192 *
    193 *  \par DIRECT INPUT:
    194 *    \param [in] unit -
    195 *      Relevant unit.
    196 *  \par INDIRECT INPUT:
    197 *    - DBAL table sizes, used to initialize source address table template.
    198 *  \par DIRECT OUTPUT:
    199 *    shr_error_e -
    200 *      Error return value
    201 *  \par INDIRECT OUTPUT:
    202 *      None
    203 *  \remark
    204 *    None
    205 *  \see
    206 *    shr_error_e
    207  */
    208 shr_error_e dnx_algo_l3_init(
    209     int unit);
    210 
    211 /**
    212 * \brief
    213 *   Deintialize l3 algorithms.
    214 *
    215 *  \par DIRECT INPUT:
    216 *    \param [in] unit -
    217 *      Relevant unit.
    218 *  \par INDIRECT INPUT:
    219 *    - DBAL table sizes, used to initialize source address table template.
    220 *  \par DIRECT OUTPUT:
    221 *    shr_error_e -
    222 *      Error return value
    223 *  \par INDIRECT OUTPUT:
    224 *      None
    225 *  \remark
    226 *    None
    227 *  \see
    228 *    shr_error_e
    229  */
    230 shr_error_e dnx_algo_l3_deinit(
    231     int unit);
    232 
    233 /**
    234 * \brief
    235 *   Print an entry of the ingress mymac prefix template. See
    236 *       \ref dnx_algo_template_print_data_cb for more details.
    237 *
    238 *  \par DIRECT INPUT:
    239 *    \param [in] unit -
    240 *     Identifier of the device to access.
    241 *    \param [in] data -
    242 *      Pointer of the struct to be printed.
    243 *      \b As \b input - \n
    244 *       The pointer is expected to hold a struct of type bcm_mac_t. \n
    245 *       It's the user's responsibility to verify it beforehand.
    246 *  \par INDIRECT INPUT:
    247 *    \b *data \n
    248 *     See DIRECT INPUT above
    249 *  \par DIRECT OUTPUT:
    250 *    None.
    251 *  \par INDIRECT OUTPUT:
    252 *      The default output stream.
    253 *  \remark
    254 *    None
    255 *  \see
    256 *    dnx_algo_template_print_data_cb
    257 *    shr_error_e
    258  */
    259 void dnx_algo_l3_print_ingress_mymac_prefix_entry_cb(
    260     int unit,
    261     const void *data);
    262 
    263 /**
    264  * \brief
    265  *  prints a VRRP multiple MyMac TCAM profile.  See \ref dnx_algo_template_print_data_cb for more details.
    266  * \param [in] unit -
    267  *   The unit number.
    268  * \param [in] data -
    269  *  pointer to an VRRP TCAM profile structure.
    270  * \return
    271  *   None
    272  */
    273 void dnx_algo_l3_print_vrrp_entry_cb(
    274     int unit,
    275     const void *data);
    276 
    277 /**
    278  * \brief
    279  *  prints an ECMP profile.  See \ref dnx_algo_template_print_data_cb for more details.
    280  * \param [in] unit -
    281  *   The unit number.
    282  * \param [in] data -
    283  *  pointer to an ECMP profile structure.
    284  * \return
    285  *   None
    286  */
    287 void dnx_algo_l3_print_ecmp_profiles_cb(
    288     int unit,
    289     const void *data);
    290 
    291 /**
    292  * \brief
    293  *   Receive the hierarchy of the ECMP group based on its ID.
    294  *   The data is taken from the SW state parameter where the
    295  *   information for the hierarchy of each 2k stage is kept.
    296  * \param [in] unit - The unit number.
    297  * \param [in] ecmp_index - The ECMP ID of the wanted element.
    298  * \param [out] hierarchy -
    299  *   The hierarchy value of the ECMP group
    300  * \return
    301  *   \retval Zero if no error was detected
    302  *   \retval Negative if error was detected. See \ref shr_error_e
    303  * \see
    304  *  * bcm_dnx_l3_egress_ecmp_add
    305  *  * bcm_dnx_l3_egress_ecmp_delete
    306  *  * bcm_dnx_l3_egress_ecmp_destroy
    307  */
    308 shr_error_e dnx_algo_l3_ecmp_hierarchy_get(
    309     int unit,
    310     int ecmp_index,
    311     uint32 *hierarchy);
    312 
    313 /**
    314  * \brief
    315  *   Finds out if the given ECMP group is the only one added in its range of 2k values.
    316  * \param [in] unit - The unit number.
    317  * \param [in] ecmp_id - The ECMP group id.
    318  * \param [out] bank_id - The bank to which the ECMP belongs.
    319  * \param [out] is_alone_in_bank -
    320  *   Boolean value indicating whether the ECMP ID is first in the range or not
    321  * \return
    322  *   \retval Zero if no error was detected
    323  *   \retval Negative if error was detected. See \ref shr_error_e
    324  * \see
    325  *  * bcm_dnx_l3_egress_ecmp_create
    326  */
    327 shr_error_e dnx_algo_l3_ecmp_group_is_alone_in_bank(
    328     int unit,
    329     int ecmp_id,
    330     int *bank_id,
    331     int *is_alone_in_bank);
    332 
    333 /**
    334  * \brief
    335  *   Finds out if the given ECMP group is allocated in the resource.
    336  * \param [in] unit - The unit number.
    337  * \param [in] ecmp_index - The ECMP group id.
    338  * \param [out] is_allocated - Indication whether the group exists.
    339  * \return
    340  *   \retval Zero if no error was detected
    341  *   \retval Negative if error was detected. See \ref shr_error_e
    342  * \see
    343  *  * dnx_l3_ecmp_group_verify
    344  */
    345 shr_error_e dnx_algo_l3_ecmp_is_allocated(
    346     int unit,
    347     int ecmp_index,
    348     uint8 *is_allocated);
    349 
    350 /**
    351  * \brief
    352  *   Allocates an ECMP group in the resource with a given hierarchy.
    353  * \param [in] unit - The unit number.
    354  * \param [in,out] ecmp_index - The ECMP group id.
    355  *          As input:
    356  *              * when flag BCM_L3_WITH_ID is provided to ecmp_flags.
    357  *          As output:
    358  *              * when flag BCM_L3_WITH_ID is missing.
    359  * \param [in] ecmp_flags - Control flags for the allocation in the resource
    360  * \param [in] ecmp_group_flags - Control flags for ECMP group
    361  * \param [in] hierarchy -
    362  *   Hierarchy value of the ECMP group.
    363  * \return
    364  *   \retval Zero if no error was detected
    365  *   \retval Negative if error was detected. See \ref shr_error_e
    366  * \see
    367  *  * dnx_l3_egress_ecmp_entry_alloc
    368  */
    369 shr_error_e dnx_algo_l3_ecmp_allocate(
    370     int unit,
    371     int *ecmp_index,
    372     uint32 ecmp_flags,
    373     uint32 ecmp_group_flags,
    374     uint32 hierarchy);
    375 
    376 /**
    377  * \brief
    378  *   Deallocates an ECMP from the resource using its ID.
    379  * \param [in] unit - The unit number.
    380  * \param [in] ecmp_index - The ECMP group id.
    381  * \return
    382  *   \retval Zero if no error was detected
    383  *   \retval Negative if error was detected. See \ref shr_error_e
    384  * \see
    385  *  * dnx_l3_egress_ecmp_entry_dealloc
    386  */
    387 shr_error_e dnx_algo_l3_ecmp_deallocate(
    388     int unit,
    389     int ecmp_index);
    390 
    391 /**
    392  * \brief
    393  *   Reserves a bank of memory for the use of the FEC protection
    394  * \param [in] unit - The unit number.
    395  * \param [in] bank_id - The bank ID that is going to be reserved.
    396  *             Valid bank IDs are 0 to 3.
    397  * \return
    398  *   \retval Zero if no error was detected
    399  *   \retval Negative if error was detected. See \ref shr_error_e
    400  */
    401 shr_error_e dnx_algo_l3_ecmp_extended_bank_for_failover_allocate(
    402     int unit,
    403     int bank_id);
    404 
    405 /**
    406  * \brief
    407  *   Free a bank of memory from the use of FEC protection.
    408  *   It can be used by FEC protection and ECMP extended mode.
    409  * \param [in] unit - The unit number.
    410  * \param [in] bank_id - The bank ID that is going to be freed.
    411  *             Valid bank IDs are 0 to 3.
    412  * \return
    413  *   \retval Zero if no error was detected
    414  *   \retval Negative if error was detected. See \ref shr_error_e
    415  */
    416 shr_error_e dnx_algo_l3_ecmp_extended_bank_for_failover_destroy(
    417     int unit,
    418     int bank_id);
    419 /**
    420  * \brief
    421  *   returns the FEC IDs ranges.
    422  * \param [in] unit - The unit number.
    423  * \param [in] hierarchy - The requested hierarchy to return the FEC range for.
    424  * \param [out] range_start - the first FEC ID in the allocation range.
    425  * \param [out] range_size - the FEC IDs range size.
    426  * \return
    427  *   \retval Zero if no error was detected
    428  *   \retval Negative if error was detected. See \ref shr_error_e
    429  */
    430 shr_error_e dnx_algo_l3_fec_allocation_info_get(
    431     int unit,
    432     int hierarchy,
    433     uint32 *range_start,
    434     uint32 *range_size);
    435 
    436 /**
    437  * \brief
    438  *   Allocates a FEC entry in the resource.
    439  * \param [in] unit - The unit number.
    440  * \param [in,out] fec_index - The FEC id.
    441  *          As input:
    442  *              * when flag BCM_L3_WITH_ID is provided to fec_flags.
    443  *          As output:
    444  *              * when flag BCM_L3_WITH_ID is missing.
    445  * \param [in] flags - DNX_ALGO_L3_ Control flags for the allocation in the resource
    446  * \param [in] hierarchy - Hierarchy value:
    447  *          * DBAL_ENUM_FVAL_HIERARCHY_LEVEL_HIERARCHY_LEVEL_1
    448  *          * DBAL_ENUM_FVAL_HIERARCHY_LEVEL_HIERARCHY_LEVEL_2
    449  *          * DBAL_ENUM_FVAL_HIERARCHY_LEVEL_HIERARCHY_LEVEL_3
    450  * \param [in] fec_resource_type - Super FEC resource type:
    451  *          * DBAL_ENUM_FVAL_FEC_RESOURCE_TYPE_NO_PROT_NO_STAT
    452  *          * DBAL_ENUM_FVAL_FEC_RESOURCE_TYPE_W_PROT_NO_STAT
    453  *          * DBAL_ENUM_FVAL_FEC_RESOURCE_TYPE_NO_PROT_W_STAT
    454  *          * DBAL_ENUM_FVAL_FEC_RESOURCE_TYPE_W_PROT_W_STAT
    455  * \return
    456  *   \retval Zero if no error was detected
    457  *   \retval Negative if error was detected. See \ref shr_error_e
    458  * \see
    459  *  * dnx_l3_egress_create_fec_allocate
    460  */
    461 shr_error_e dnx_algo_l3_fec_allocate(
    462     int unit,
    463     int *fec_index,
    464     uint32 flags,
    465     dbal_enum_value_field_hierarchy_level_e hierarchy,
    466     dbal_enum_value_field_fec_resource_type_e fec_resource_type);
    467 
    468 /**
    469  * \brief
    470  *   Deallocates a FEC ID from the resource.
    471  * \param [in] unit - The unit number.
    472  * \param [in] fec_index - The FEC id.
    473  * \return
    474  *   \retval Zero if no error was detected
    475  *   \retval Negative if error was detected. See \ref shr_error_e
    476  * \see
    477  *  * dnx_l3_egress_destroy_fec_deallocate
    478  */
    479 shr_error_e dnx_algo_l3_fec_deallocate(
    480     int unit,
    481     int fec_index);
    482 
    483 /**
    484  * \brief
    485  *   Receive the hierarchy of the FEC based on its ID.
    486  * \param [in] unit - The unit number.
    487  * \param [in] fec_index - The FEC ID of the wanted element.
    488  * \param [out] hierarchy_p -
    489  *   The hierarchy value of the FEC
    490  * \return
    491  *   \retval Zero if no error was detected
    492  *   \retval Negative if error was detected. See \ref shr_error_e
    493  * \see
    494  *  * dnx_algo_l3_fec_bitmap_allocate
    495  *  * dnx_l3_egress_fec_entry_add
    496  *  * dnx_l3_egress_fec_entry_get
    497  */
    498 shr_error_e algo_l3_fec_hierarchy_stage_map_get(
    499     int unit,
    500     uint32 fec_index,
    501     uint32 *hierarchy_p);
    502 
    503 /**
    504  * \brief
    505  *   Set the hierarchy for a given FEC bank ID.
    506  *   The data is set in the DBAL table.
    507  * \param [in] unit - The unit number.
    508  * \param [in] bank_id - The bank ID
    509  * \param [out] hierarchy -
    510  *   The hierarchy value of the FEC
    511  * \return
    512  *   \retval Zero if no error was detected
    513  *   \retval Negative if error was detected. See \ref shr_error_e
    514  * \see
    515  *  * dnx_algo_l3_fec_deallocate
    516  *  * dnx_algo_l3_fec_allocate
    517  */
    518 shr_error_e algo_l3_fec_hierarchy_stage_map_set(
    519     int unit,
    520     uint32 bank_id,
    521     uint32 hierarchy);
    522 
    523 /**
    524  * \brief
    525  *   Finds out if the given FEC ID is allocated in the resource.
    526  * \param [in] unit - The unit number.
    527  * \param [in] fec_index - The FEC id.
    528  * \param [out] is_allocated - Indication whether the ID exists.
    529  * \return
    530  *   \retval Zero if no error was detected
    531  *   \retval Negative if error was detected. See \ref shr_error_e
    532  * \see
    533  *  * dnx_l3_egress_create_fec_verify
    534  *  * dnx_l3_egress_fec_info_get
    535  *  * dnx_l3_egress_fec_info_delete
    536  */
    537 shr_error_e dnx_algo_l3_fec_is_allocated(
    538     int unit,
    539     int fec_index,
    540     uint8 *is_allocated);
    541 
    542 /**
    543  * \brief
    544  *   Receive the type of the Super FEC - it indicates whether
    545  *   the FEC has protection or not and whether it has statistics or not.
    546  * \param [in] unit - The unit number.
    547  * \param [in] fec_index - The FEC id.
    548  * \param [out] super_fec_type - Type of the super FEC.
    549  *      The type can be:
    550  *          * No protection, no statistics
    551  *          * With protection, no statistics
    552  *          * No protection, with statistics
    553  *          * With protection and with statistics
    554  * \return
    555  *   \retval Zero if no error was detected
    556  *   \retval Negative if error was detected. See \ref shr_error_e
    557  * \see
    558  *  * dnx_l3_egress_fec_entry_add
    559  */
    560 shr_error_e dnx_algo_l3_fec_super_fec_type_get(
    561     int unit,
    562     int fec_index,
    563     dbal_enum_value_field_fec_resource_type_e * super_fec_type);
    564 
    565 /**
    566  * \brief
    567  *   return the FEC protection state
    568  * \param [in] unit - The unit number.
    569  * \param [in] fec_index - The FEC id.
    570  * \param [out] is_protected - the protection state of the FEC 0/1.
    571  * \return
    572  *   \retval Zero if no error was detected
    573  *   \retval Negative if error was detected. See \ref shr_error_e
    574  */
    575 shr_error_e dnx_algo_l3_fec_protection_state_get(
    576     int unit,
    577     int fec_index,
    578     uint8 *is_protected);
    579 
    580 /**
    581  * \brief
    582  *   Find a start FEC for a given range of free IDs.
    583  * \param [in] unit - The unit number.
    584  * \param [in] nof_members - The number of members
    585  * \param [in] hierarchy - The required hierarchy level
    586  * \param [in] fec_resource_type - super FEC resourse type
    587  * \param [out] start_if_id - The start FEC ID which was found
    588  * \return
    589  *   \retval Zero if no error was detected
    590  *   \retval Negative if error was detected. See \ref shr_error_e
    591  */
    592 shr_error_e dnx_algo_l3_fec_allocation_get(
    593     int unit,
    594     int nof_members,
    595     dbal_enum_value_field_hierarchy_level_e hierarchy,
    596     dbal_enum_value_field_fec_resource_type_e fec_resource_type,
    597     int *start_if_id);
    598 
    599 /**
    600  * \brief
    601  *   Receive the MDB clusters which are currently allocated
    602  *   for the use of a particular FEC table.
    603  * \param [in] unit - The unit number.
    604  * \param [in] hierarchy - The FEC index hierarchy
    605  * \param [out] nof_clusters - number of clusters allocated for the FEC table.
    606  * \param [out] clusters - An array of clusters in use by the given FEC table.
    607  * \return
    608  *   \retval Zero if no error was detected
    609  *   \retval Negative if error was detected. See \ref shr_error_e
    610  * \see
    611  *  * algo_l3_fec_mdb_table_resources_set
    612  *  * algo_l3_fec_mdb_table_resources_check
    613  */
    614 shr_error_e algo_l3_fec_mdb_table_resources_get(
    615     int unit,
    616     uint32 hierarchy,
    617     int *nof_clusters,
    618     mdb_cluster_alloc_info_t * clusters);
    619 
    620 /**
    621  * \brief
    622  *   Verify whether the ECMP profile ID is allocated by checking if there are any references to it.
    623  * \param [in] unit - The unit number.
    624  * \param [in] index - The ECMP group profile index.
    625  * \param [out] is_allocated - Indication whether the profile exists.
    626  * \return
    627  *   \retval Zero if no error was detected
    628  *   \retval Negative if error was detected. See \ref shr_error_e
    629  * \see
    630  *  * dnx_algo_res_dbal_is_allocated
    631  */
    632 shr_error_e dnx_algo_l3_res_dbal_ecmp_group_profile_is_allocated(
    633     int unit,
    634     int index,
    635     uint8 *is_allocated);
    636 
    637 /**
    638  * \brief
    639  *   Allocate an ECMP profile ID in the template manager
    640  *   with unique data result and a particular ID
    641  * \param [in] unit - The unit number.
    642  * \param [in] profile_index - The ECMP group profile index.
    643  * \return
    644  *   \retval Zero if no error was detected
    645  *   \retval Negative if error was detected. See \ref shr_error_e
    646  * \see
    647  *  * dnx_algo_res_dbal_alloc
    648  */
    649 shr_error_e dnx_algo_l3_res_dbal_ecmp_group_profile_allocate(
    650     int unit,
    651     int *profile_index);
    652 
    653 /**
    654  * \brief
    655  *   Free an ECMP profile ID from the template manager.
    656  * \param [in] unit - The unit number.
    657  * \param [in] profile_index - The ECMP group profile index.
    658  * \return
    659  *   \retval Zero if no error was detected
    660  *   \retval Negative if error was detected. See \ref shr_error_e
    661  * \see
    662  *  * dnx_algo_res_dbal_free
    663  */
    664 shr_error_e dnx_algo_l3_res_dbal_ecmp_group_profile_free(
    665     int unit,
    666     int profile_index);
    667 
    668 /**
    669  * \brief
    670  *   Receive the following ECMP profile ID after the current one
    671  * \param [in] unit - The unit number.
    672  * \param [in] hierarchy - The unit number.
    673  * \param [in,out] profile_index - The ECMP group profile index.
    674  * \return
    675  *   \retval Zero if no error was detected
    676  *   \retval Negative if error was detected. See \ref shr_error_e
    677  * \see
    678  *  * dnx_algo_res_dbal_get_next
    679  */
    680 shr_error_e dnx_algo_l3_res_dbal_ecmp_group_profile_get_next(
    681     int unit,
    682     uint32 hierarchy,
    683     int *profile_index);
    684 
    685 /**
    686  * \brief
    687  *  Allocate a rif, and save its information in the sw state.
    688  *
    689  * \param [in] unit  -  The unit number.
    690  * \param [in] rif_id  -  The l3 interface structure.
    691  * \param [in] rif_result_type  -  The result type of RIF EEDB table.
    692  * \param [in] table_id  -  The dbal table id of the of RIF EEDB table.
    693  *
    694  * \return
    695  *   shr_error_e
    696  */
    697 shr_error_e dnx_algo_l3_rif_allocate_generic(
    698     int unit,
    699     int rif_id,
    700     dbal_enum_value_result_type_eedb_rif_basic_e rif_result_type,
    701     dbal_tables_e table_id);
    702 
    703 /**
    704  * \brief
    705  *  Allocate a rif, and save its information in the sw state.
    706  *
    707  * \param [in] unit  -  The unit number.
    708  * \param [in] rif_id  -  The l3 interface structure.
    709  * \param [in] rif_result_type  -  The result type of RIF EEDB table.
    710  * \param [in] fixed_entry_size  -  Minimal entry size to allocate.
    711  *
    712  * \return
    713  *   shr_error_e
    714  */
    715 shr_error_e dnx_algo_l3_rif_allocate(
    716     int unit,
    717     int rif_id,
    718     dbal_enum_value_result_type_eedb_rif_basic_e rif_result_type,
    719     uint32 fixed_entry_size);
    720 
    721 /**
    722  * \brief
    723  *  Free a rif, and remove its information from the sw state.
    724  *
    725  * \param [in] unit  -  The unit number.
    726  * \param [in] rif_id  -  The l3 interface structure.
    727  *
    728  * \return
    729  *   shr_error_e
    730  */
    731 shr_error_e dnx_algo_l3_rif_free(
    732     int unit,
    733     int rif_id);
    734 
    735 /* ALGO CINT exported API - START */
    736 shr_error_e dnx_cint_algo_l3_rif_allocate_generic(
    737     int unit,
    738     int rif_id,
    739     char *rif_result_type_name,
    740     char *table_name);
    741 
    742 shr_error_e dnx_cint_algo_l3_fec_allocate(
    743     int unit,
    744     int *fec_index,
    745     uint32 flags,
    746     char *hierarchy_name,
    747     char *fec_resource_type_name);
    748 
    749 /* ALGO CINT exported API - END */
    750 
    751 /*
    752  * Info related to EGR_POINTED
    753  * {
    754  */
    755 /**
    756  * Resource name defines for algo egr_pointed
    757  */
    758 #define DNX_ALGO_EGR_POINTED_RESOURCE "EGR_POINTED"
    759 /*
    760  * }
    761  */
    762 /*
    763  * }
    764  */
    765 #endif/*_ALGO_L3_API_INCLUDED__*/