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

l3_egress.h (22835B)


      1 /*! \file l3_egress.h
      2  *
      3  * L3 egress header file.
      4  * This file contains L3 egress definitions internal to the BCM library.
      5  */
      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 
     13 #ifndef BCMI_LTSW_L3_EGRESS_H
     14 #define BCMI_LTSW_L3_EGRESS_H
     15 
     16 #include <shared/l3.h>
     17 #include <bcm/ifa.h>
     18 
     19 /*! Egress object start index. */
     20 #define BCMI_LTSW_L3_EGR_OBJ_BASE _SHR_L3_EGRESS_IDX_MIN
     21 
     22 /*! Egress object type. */
     23 typedef enum bcmi_ltsw_l3_egr_obj_type_e {
     24 
     25     /*! Egress object for overlay forwarding. */
     26     BCMI_LTSW_L3_EGR_OBJ_T_OL = 0,
     27 
     28     /*! Egress object for tunnel underlay forwarding. */
     29     BCMI_LTSW_L3_EGR_OBJ_T_UL = 1,
     30 
     31     /*! Egress object for overlay ECMP group. */
     32     BCMI_LTSW_L3_EGR_OBJ_T_ECMP_OL = 2,
     33 
     34     /*! Egress object for underlay ECMP group. */
     35     BCMI_LTSW_L3_EGR_OBJ_T_ECMP_UL = 3,
     36 
     37     BCMI_LTSW_L3_EGR_OBJ_T_CNT
     38 
     39 } bcmi_ltsw_l3_egr_obj_type_t;
     40 
     41 /*! ECMP Hash output selection configuration. */
     42 typedef enum bcmi_ltsw_l3_ecmp_hash_cfg_type_e {
     43 
     44     /* Enable hash concatenation for ECMP level 1 macro flow. */
     45     BCMI_LTSW_ECMP_HASH_CFG_T_OL_CONCAT_EN = 0,
     46 
     47     /* Enable hash concatenation for ECMP level 2 macro flow. */
     48     BCMI_LTSW_ECMP_HASH_CFG_T_UL_CONCAT_EN = 1,
     49 
     50     /* Set hash seed for ECMP level 1 macro flow. */
     51     BCMI_LTSW_ECMP_HASH_CFG_T_OL_SEED = 2,
     52 
     53     /* Set hash seed for ECMP level 2 macro flow. */
     54     BCMI_LTSW_ECMP_HASH_CFG_T_UL_SEED = 3,
     55 
     56     /* Set hash selection for ECMP level 0 (port-based). */
     57     BCMI_LTSW_ECMP_HASH_CFG_T_OL_OFFSET = 4,
     58 
     59     /* Set hash selection for ECMP level 1 (port-based). */
     60     BCMI_LTSW_ECMP_HASH_CFG_T_UL_OFFSET = 5,
     61 
     62     /* Set hash selection for DLB ECMP level 0 (port-based). */
     63     BCMI_LTSW_ECMP_HASH_CFG_T_DLB_OFFSET = 6,
     64 
     65     BCMI_LTSW_ECMP_HASH_CFG_T_CNT
     66 
     67 } bcmi_ltsw_l3_ecmp_hash_cfg_type_t;
     68 
     69 typedef enum bcmi_ltsw_ecmp_member_dest_user_e {
     70     /*! Explicit single pointer model for switching into L2 tunnel. */
     71     BCMI_LTSW_ECMP_MEMBER_DEST_T_L2_CASCADED = 0,
     72 
     73     /*! Explicit single pointer model for routing into L2/L3 tunnel. */
     74     BCMI_LTSW_ECMP_MEMBER_DEST_T_L3_CASCADED = 1,
     75 
     76     /*! Implicit single pointer model for ALPM routing. */
     77     BCMI_LTSW_ECMP_MEMBER_DEST_T_ALPM_NO_CASCADED = 2,
     78 
     79     /*! Always at last. */
     80     BCMI_LTSW_ECMP_MEMBER_DEST_T_CNT
     81 } bcmi_ltsw_ecmp_member_dest_user_t;
     82 
     83 /*! ECMP Member destination info. */
     84 typedef struct bcmi_ltsw_ecmp_member_dest_info_s {
     85     /*! User type. See BCMI_LTSW_ECMP_MEMBER_DEST_T_xxx. */
     86     bcmi_ltsw_ecmp_member_dest_user_t type;
     87 
     88     /*! Overlay egress object. */
     89     bcm_if_t ol_egr_obj;
     90 
     91     /*! Underlay egress object. */
     92     bcm_if_t ul_egr_obj;
     93 
     94     /*! DVP. */
     95     int dvp;
     96 
     97     /*! Profile Table index for ECMP and Protection Switching SF. */
     98     int prot_swt_prfl_idx;
     99 } bcmi_ltsw_ecmp_member_dest_info_t;
    100 
    101 #define BCMI_LTSW_L3_EGR_OBJ_INFO_F_CASCADED    0x1 /* L3 Casacded */
    102 #define BCMI_LTSW_L3_EGR_OBJ_INFO_F_FAILOVER    0x2 /* Failover protection nh */
    103 
    104 /*! L3 egress object info. */
    105 typedef struct bcmi_ltsw_l3_egr_obj_info_s {
    106     /*! Flags. See BCMI_LTSW_L3_EGR_OBJ_INFO_F_xxx. */
    107     uint32_t flags;
    108 
    109     /*! Underlay egress object. */
    110     bcm_if_t ul_egr_obj;
    111 
    112     /*! DVP. */
    113     int dvp;
    114 } bcmi_ltsw_l3_egr_obj_info_t;
    115 
    116 /*! L3 egress IFA data. */
    117 typedef struct bcmi_ltsw_l3_egr_ifa_s {
    118     /*! See <bcm/l3.h> BCM_L3_*. */
    119     uint32_t flags;
    120 
    121     /*! IP protocol to indicate IFA. */
    122     uint8_t ip_protocol;
    123 
    124     /*! The max length in the IFA base header. */
    125     uint8_t max_length;
    126 
    127     /*! The hop limit in the IFA metadata header. */
    128     uint8_t hop_limit;
    129 } bcmi_ltsw_l3_egr_ifa_t;
    130 
    131 typedef enum bcmi_ltsw_vlan_tag_present_action__e {
    132     /*! No action. */
    133     BCMI_LTSW_VLAN_TAG_PRESENT_ACTION_NONE = 0,
    134 
    135     /*! Replace VLAN and TPID. */
    136     BCMI_LTSW_VLAN_TAG_PRESENT_ACTION_REPLACE_VLAN_TPID = 1,
    137 
    138     /*! Replace VLAN only. */
    139     BCMI_LTSW_VLAN_TAG_PRESENT_ACTION_REPLACE_VLAN = 2,
    140 
    141     /*! Delete the tag. */
    142     BCMI_LTSW_VLAN_TAG_PRESENT_ACTION_DELETE = 3,
    143 
    144     /*! Replace VLAN, priority and TPID. */
    145     BCMI_LTSW_VLAN_TAG_PRESENT_ACTION_REPLACE_VLAN_PRI_TPID = 4,
    146 
    147     /*! Replace VLAN, priority. */
    148     BCMI_LTSW_VLAN_TAG_PRESENT_ACTION_REPLACE_VLAN_PRI = 5,
    149 
    150     /*! Replace priority only. */
    151     BCMI_LTSW_VLAN_TAG_PRESENT_ACTION_REPLACE_PRI = 6,
    152 
    153     /*! Replace TPID only. */
    154     BCMI_LTSW_VLAN_TAG_PRESENT_ACTION_REPLACE_TPID = 7,
    155 
    156     /*! Always at last. */
    157     BCMI_LTSW_VLAN_TAG_PRESENT_ACTION_CNT
    158 } bcmi_ltsw_vlan_tag_present_action_t;
    159 
    160 typedef enum bcmi_ltsw_vlan_tag_not_present_action__e {
    161     /*! No action. */
    162     BCMI_LTSW_VLAN_TAG_NOT_PRESENT_ACTION_NONE = 0,
    163 
    164     /*! Add VLAN and TPID. */
    165     BCMI_LTSW_VLAN_TAG_NOT_PRESENT_ACTION_ADD_VLAN_TPID = 1,
    166 
    167     /*! Always at last. */
    168     BCMI_LTSW_VLAN_TAG_NOT_PRESENT_ACTION_CNT
    169 } bcmi_ltsw_vlan_tag_not_present_action_t;
    170 
    171 typedef enum bcmi_ltsw_opaque_tag_present_action__e {
    172     /*! No action. */
    173     BCMI_LTSW_OPAQUE_TAG_PRESENT_ACTION_NONE = 0,
    174 
    175     /*! Delete the tag. */
    176     BCMI_LTSW_OPAQUE_TAG_PRESENT_ACTION_DELETE = 1,
    177 
    178     /*! Replace the tag. */
    179     BCMI_LTSW_OPAQUE_TAG_PRESENT_ACTION_REPLACE = 2,
    180 
    181     /*! Always at last. */
    182     BCMI_LTSW_OPAQUE_TAG_PRESENT_ACTION_CNT
    183 } bcmi_ltsw_opaque_tag_present_action_t;
    184 
    185 
    186 typedef enum bcmi_ltsw_opaque_tag_not_present_action__e {
    187     /*! No action. */
    188     BCMI_LTSW_OPAQUE_TAG_NOT_PRESENT_ACTION_NONE = 0,
    189 
    190     /*! Add a tag. */
    191     BCMI_LTSW_OPAQUE_TAG_NOT_PRESENT_ACTION_ADD = 1,
    192 
    193     /*! Always at last. */
    194     BCMI_LTSW_OPAQUE_TAG_NOT_PRESENT_ACTION_CNT
    195 } bcmi_ltsw_opaque_tag_not_present_action_t;
    196 
    197 
    198 /*! L3 egress l2 tag info. */
    199 typedef struct bcmi_ltsw_l3_egr_l2_tag_info_s {
    200     /*! Ethernet segment (ES) identifier. */
    201     uint32 es_id;
    202 
    203     /*! Outer VLAN priority. */
    204     uint8 pri;
    205 
    206      /*! Outer VLAN CFI. */
    207     uint8 cfi;
    208 
    209     /*! TPID ID. */
    210     uint16 tpid_id;
    211 
    212     /*! Outer LAN. */
    213     bcm_vlan_t vlan;
    214 
    215     /*! Enable remarking CFI. */
    216     uint8 remark_cfi;
    217 
    218     /*! Enable PHB map. */
    219     uint8 is_phb_map_id;
    220 
    221     /*! PHB map id. */
    222     uint16 phb_egr_l2_int_pri_to_otag_id;
    223 
    224     /*! L2 tag action if the tag is present. */
    225     bcmi_ltsw_vlan_tag_present_action_t vlan_tag_present_action;
    226 
    227     /*! L2 tag action if the tag is not present. */
    228     bcmi_ltsw_vlan_tag_not_present_action_t vlan_tag_not_present_action;
    229 
    230     /*! L2 opaque tag action if the tag is present. */
    231     bcmi_ltsw_opaque_tag_present_action_t opaque_tag_present_action;
    232 
    233     /*! L2 opaque tag action if the tag is not present. */
    234     bcmi_ltsw_opaque_tag_not_present_action_t opaque_tag_not_present_action;
    235 } bcmi_ltsw_l3_egr_l2_tag_info_t;
    236 
    237 /*! ECMP member information. */
    238 typedef struct bcmi_ltsw_l3_ecmp_member_info_s {
    239     /*! Underlay ECMP. */
    240     bool ul_ecmp;
    241 
    242     /*! NEXT_HOP_1_INDEX. */
    243     uint16_t nhop_1;
    244 
    245     /*! NEXT_HOP_2_INDEX or ECMP_GROUP_1_ID. */
    246     uint16_t nhop_2_or_ecmp_grp_1;
    247 
    248     /*! DVP. */
    249     uint16_t dvp;
    250 
    251     /*! Encoding for ecmp_and_prot_swt_sfc_profile_index. */
    252     uint16_t prot_swt_prfl_idx;
    253 
    254     /*! PORT ID. */
    255     int port_id;
    256 } bcmi_ltsw_l3_ecmp_member_info_t;
    257 
    258 /*!
    259  * \param [in] unit Unit number.
    260  * \param [in] egr_ifa L3 egress IFA data.
    261  * \param [in] header IFA header.
    262  *
    263  * \retval SHR_E_NONE No errors.
    264  */
    265 typedef int (*bcmi_ltsw_l3_egr_to_ifa_header_cb)(int unit,
    266                                                  bcmi_ltsw_l3_egr_ifa_t *egr_ifa,
    267                                                  bcm_ifa_header_t *header);
    268 
    269 /*!
    270  * \brief Initialize L3 egress entries that reserved for L2.
    271  *
    272  * \param [in] unit Unit number.
    273  *
    274  * \retval SHR_E_NONE No errors.
    275  */
    276 extern int
    277 bcmi_ltsw_l3_egress_l2_rsv(int unit);
    278 
    279 /*!
    280  * \brief Initialize L3 egress module.
    281  *
    282  * \param [in] unit Unit number.
    283  *
    284  * \retval SHR_E_NONE No errors.
    285  */
    286 extern int
    287 bcmi_ltsw_l3_egress_init(int unit);
    288 
    289 /*!
    290  * \brief De-Initialize L3 egress module.
    291  *
    292  * \param [in] unit Unit number.
    293  *
    294  * \retval SHR_E_NONE No errors.
    295  */
    296 extern int
    297 bcmi_ltsw_l3_egress_deinit(int unit);
    298 
    299 /*!
    300  * \brief Get egress object type and nhop/ecmp id from egress object ID.
    301  *
    302  * \param [in] unit Unit number.
    303  * \param [in] intf Egress object ID.
    304  * \param [out] nh_ecmp_idx Nexthop or ECMP group ID.
    305  * \param [out] type Egress object type.
    306  *
    307  * \retval SHR_E_NONE No errors.
    308  */
    309 extern int
    310 bcmi_ltsw_l3_egress_obj_id_resolve(int unit,
    311                                    bcm_if_t intf,
    312                                    int *nh_ecmp_idx,
    313                                    bcmi_ltsw_l3_egr_obj_type_t *type);
    314 
    315 /*!
    316  * \brief Construct an egress object ID from type and nhop/ecmp index.
    317  *
    318  * \param [in] unit Unit number.
    319  * \param [in] nh_ecmp_idx Nexthop or ECMP group ID.
    320  * \param [in] type Egress object type.
    321  * \param [out] intf Egress object ID.
    322  *
    323  * \retval SHR_E_NONE No errors.
    324  */
    325 extern int
    326 bcmi_ltsw_l3_egress_obj_id_construct(int unit,
    327                                      int nh_ecmp_idx,
    328                                      bcmi_ltsw_l3_egr_obj_type_t type,
    329                                      bcm_if_t *intf);
    330 
    331 /*!
    332  * \brief Get the L3 egress object info.
    333  *
    334  * \param [in] unit Unit Number.
    335  * \param [in] intf Egress object ID.
    336  * \param [out] info L3 egress object info.
    337  *
    338  * \retval SHR_E_NONE No errors.
    339  * \retval !SHR_E_NONE Failure.
    340  */
    341 extern int
    342 bcmi_ltsw_l3_egress_obj_info_get(int unit, bcm_if_t intf,
    343                                  bcmi_ltsw_l3_egr_obj_info_t *info);
    344 
    345 /*!
    346  * \brief Get the L3 egress object maximum and used number.
    347  *
    348  * \param [in] unit Unit Number.
    349  * \param [in] type Egress object type.
    350  * \param [out] max Maximum number of object.
    351  * \param [out] used Used number of object.
    352  *
    353  * \retval SHR_E_NONE No errors.
    354  * \retval !SHR_E_NONE Failure.
    355  */
    356 extern int
    357 bcmi_ltsw_l3_egress_obj_cnt_get(int unit, bcmi_ltsw_l3_egr_obj_type_t type,
    358                                 int *max, int *used);
    359 
    360 /*!
    361  * \brief Set the dvp of given egress object.
    362  *
    363  * \param [in] unit Unit number.
    364  * \param [in] intf Egress object ID.
    365  * \param [in] dvp Destination VP.
    366  *
    367  * \retval SHR_E_NONE No errors.
    368  * \retval SHR_E_PARAM Invalid egress object ID.
    369  * \retval SHR_E_NOT_FOUND The given egress object does not exist.
    370  */
    371 extern int
    372 bcmi_ltsw_l3_egress_dvp_set(int unit, bcm_if_t intf, int dvp);
    373 
    374 /*!
    375  * \brief Set the maximum ECMP paths allowed for a route.
    376  *
    377  * \param [in] unit Unit number.
    378  * \param [in] max Maximum number of paths for ECMP.
    379  *
    380  * \retval SHR_E_NONE No errors.
    381  */
    382 extern int
    383 bcmi_ltsw_l3_ecmp_max_paths_set(int unit, int max_paths);
    384 
    385 /*!
    386  * \brief Get the maximum ECMP paths allowed for a route.
    387  *
    388  * \param [in] unit Unit number.
    389  * \param [out] max Maximum number of paths for ECMP.
    390  *
    391  * \retval SHR_E_NONE No errors.
    392  */
    393 extern int
    394 bcmi_ltsw_l3_ecmp_max_paths_get(int unit, int *max_paths);
    395 
    396 /*!
    397  * \brief Set the ECMP hash output selection control info.
    398  *
    399  * \param [in] unit Unit number.
    400  * \param [in] underlay Use 1 for underlay ECMP, 0 for overlay ECMP.
    401  * \param [in] flow_based Use 1 for flow-based hash, 0 for port-based hash.
    402  *
    403  * \retval SHR_E_NONE NO errors.
    404  */
    405 extern int
    406 bcmi_ltsw_l3_ecmp_hash_ctrl_set(int unit, int underlay, int flow_based);
    407 
    408 /*!
    409  * \brief Get the ECMP hash output selection control info.
    410  *
    411  * \param [in] unit Unit number.
    412  * \param [in] underlay Use 1 for underlay ECMP, 0 for overlay ECMP.
    413  * \param [out] flow_based Use 1 for flow-based hash, 0 for port-based hash.
    414  *
    415  * \retval SHR_E_NONE NO errors.
    416  */
    417 extern int
    418 bcmi_ltsw_l3_ecmp_hash_ctrl_get(int unit, int underlay, int *flow_based);
    419 
    420 /*!
    421  * \brief Configure the ECMP flow-based hash output selection.
    422  *
    423  * \param [in] unit Unit number.
    424  * \param [in] type ECMP hash output selection configure type.
    425  * \param [in] arg Configuration value.
    426  *
    427  * \retval SHR_E_NONE NO errors.
    428  */
    429 extern int
    430 bcmi_ltsw_l3_ecmp_flow_hash_set(int unit,
    431                                 bcmi_ltsw_l3_ecmp_hash_cfg_type_t type,
    432                                 int arg);
    433 
    434 /*!
    435  * \brief Get the ECMP flow-based hash output selection info.
    436  *
    437  * \param [in] unit Unit number.
    438  * \param [in] type ECMP hash output selection configure type.
    439  * \param [out] arg Configuration value.
    440  *
    441  * \retval SHR_E_NONE NO errors.
    442  */
    443 extern int
    444 bcmi_ltsw_l3_ecmp_flow_hash_get(int unit,
    445                                 bcmi_ltsw_l3_ecmp_hash_cfg_type_t type,
    446                                 int *arg);
    447 
    448 /*!
    449  * \brief Configure the ECMP port-based hash output selection.
    450  *
    451  * \param [in] unit Unit number.
    452  * \param [in] port Port number.
    453  * \param [in] type ECMP hash output selection configure type.
    454  * \param [in] arg Configuration value.
    455  *
    456  * \retval SHR_E_NONE NO errors.
    457  */
    458 extern int
    459 bcmi_ltsw_l3_ecmp_port_hash_set(int unit,
    460                                 int port,
    461                                 bcmi_ltsw_l3_ecmp_hash_cfg_type_t type,
    462                                 int arg);
    463 
    464 /*!
    465  * \brief Get the ECMP port-based hash output selection control.
    466  *
    467  * \param [in] unit Unit number.
    468  * \param [in] port Port number.
    469  * \param [in] type ECMP hash output selection configure type.
    470  * \param [out] arg Configuration value.
    471  *
    472  * \retval SHR_E_NONE NO errors.
    473  */
    474 extern int
    475 bcmi_ltsw_l3_ecmp_port_hash_get(int unit,
    476                                 int port,
    477                                 bcmi_ltsw_l3_ecmp_hash_cfg_type_t type,
    478                                 int *arg);
    479 
    480 /*!
    481  * \brief Allocate an entry from ECMP Level 0 member table.
    482  *
    483  * \param [in] unit Unit Number.
    484  * \param [in] dest_info Destination info.
    485  * \param [out] dest_index Entry index.
    486  *
    487  * \retval SHR_E_NONE No errors.
    488  * \retval !SHR_E_NONE Failure.
    489  */
    490 extern int
    491 bcmi_ltsw_ecmp_member_dest_alloc(int unit,
    492                                  bcmi_ltsw_ecmp_member_dest_info_t *dest_info,
    493                                  int *dest_index);
    494 
    495 /*!
    496  * \brief Get ECMP MEMBER destination info.
    497  *
    498  * \param [in] unit Unit Number.
    499  * \param [in] dest_index Entry index.
    500  * \param [out] dest_info Destination info.
    501  *
    502  * \retval SHR_E_NONE No errors.
    503  * \retval !SHR_E_NONE Failure.
    504  */
    505 extern int
    506 bcmi_ltsw_ecmp_member_dest_get(int unit,
    507                                int dest_index,
    508                                bcmi_ltsw_ecmp_member_dest_info_t *dest_info);
    509 
    510 /*!
    511  * \brief Free an entry to ECMP Level 0 member table.
    512  *
    513  * \param [in] unit Unit Number.
    514  * \param [in] dest_index Destination index.
    515  *
    516  * \retval SHR_E_NONE No errors.
    517  * \retval !SHR_E_NONE Failure.
    518  */
    519 extern int
    520 bcmi_ltsw_ecmp_member_dest_free(int unit, int dest_index);
    521 
    522 /*!
    523  * \brief Update an entry in ECMP Level 0 member table.
    524  *
    525  * \param [in] unit Unit Number.
    526  * \param [in] dest_info Destination info.
    527  *
    528  * \retval SHR_E_NONE No errors.
    529  * \retval !SHR_E_NONE Failure.
    530  */
    531 extern int
    532 bcmi_ltsw_ecmp_member_dest_update(int unit,
    533                                   bcmi_ltsw_ecmp_member_dest_info_t *dest_info);
    534 
    535 /*!
    536  * \brief Public function to get L3 egress next hop table size.
    537  *
    538  * \param [in] unit Unit Number.
    539  * \param [out] size L3 egress next hop table size.
    540  *
    541  * \retval SHR_E_NONE No errors.
    542  * \retval !SHR_E_NONE Failure.
    543  */
    544 
    545 extern int
    546 bcmi_ltsw_l3_egress_size_get(
    547     int unit,
    548     int *size);
    549 
    550 /*!
    551  * \brief Public function to get current L3 egress next hop entry count.
    552  *
    553  * \param [in] unit Unit Number.
    554  * \param [out] count L3 egress next hop entry count.
    555  *
    556  * \retval SHR_E_NONE No errors.
    557  * \retval !SHR_E_NONE Failure.
    558  */
    559 extern int
    560 bcmi_ltsw_l3_egress_count_get(
    561     int unit,
    562     int *count);
    563 
    564 /*!
    565  * \brief Public function to get L3 ECMP table size.
    566  *
    567  * \param [in] unit Unit Number.
    568  * \param [out] size L3 ECMP table size.
    569  *
    570  * \retval SHR_E_NONE No errors.
    571  * \retval !SHR_E_NONE Failure.
    572  */
    573 
    574 extern int
    575 bcmi_ltsw_l3_ecmp_size_get(
    576     int unit,
    577     int *size);
    578 
    579 /*!
    580  * \brief Public function to get current L3 ECMP entry count.
    581  *
    582  * \param [in] unit Unit Number.
    583  * \param [out] count L3 ECMP entry count.
    584  *
    585  * \retval SHR_E_NONE No errors.
    586  * \retval !SHR_E_NONE Failure.
    587  */
    588 extern int
    589 bcmi_ltsw_l3_ecmp_count_get(
    590     int unit,
    591     int *count);
    592 
    593 /*!
    594  * \brief Public function to create L3 egress objects for IFA.
    595  *
    596  * \param [in] unit Unit Number.
    597  * \param [in] egr_ifa L3 egress IFA data.
    598  * \param [in/out] intf L3 egress obj ID.
    599  *
    600  * \retval SHR_E_NONE No errors.
    601  * \retval !SHR_E_NONE Failure.
    602  */
    603 extern int
    604 bcmi_ltsw_l3_egress_ifa_create(
    605     int unit,
    606     bcmi_ltsw_l3_egr_ifa_t *egr_ifa,
    607     bcm_if_t *intf);
    608 
    609 /*!
    610  * \brief Public function to destroy L3 egress objects for IFA.
    611  *
    612  * \param [in] unit Unit Number.
    613  * \param [in] intf L3 egress obj ID.
    614  *
    615  * \retval SHR_E_NONE No errors.
    616  * \retval !SHR_E_NONE Failure.
    617  */
    618 extern int
    619 bcmi_ltsw_l3_egress_ifa_destroy(
    620     int unit,
    621     bcm_if_t intf);
    622 
    623 /*!
    624  * \brief Public function to get L3 egress objects for IFA.
    625  *
    626  * \param [in] unit Unit Number.
    627  * \param [in] intf L3 egress obj ID.
    628  * \param [out] egr_ifa L3 egress IFA data.
    629  *
    630  * \retval SHR_E_NONE No errors.
    631  * \retval !SHR_E_NONE Failure.
    632  */
    633 extern int
    634 bcmi_ltsw_l3_egress_ifa_get(
    635     int unit,
    636     bcm_if_t intf,
    637     bcmi_ltsw_l3_egr_ifa_t *egr_ifa);
    638 
    639 /*!
    640  * \brief Public function to traverse L3 egress objects for IFA..
    641  *
    642  * \param [in] unit Unit Number.
    643  * \param [in] trav_fn Callback function.
    644  * \param [in] cb Callback function to contruct IFA header from L3 egress.
    645  * \param [in] user_data User data to be passed to callback function.
    646  *
    647  * \retval SHR_E_NONE No errors.
    648  * \retval !SHR_E_NONE Failure.
    649  */
    650 extern int
    651 bcmi_ltsw_l3_egress_ifa_traverse(
    652     int unit,
    653     bcm_ifa_header_traverse_cb trav_fn,
    654     bcmi_ltsw_l3_egr_to_ifa_header_cb cb,
    655     void *user_data);
    656 
    657 /*!
    658  * \brief Public function to add L2 tag for  L3 egress.
    659  *
    660  * \param [in] unit Unit Number.
    661  * \param [in] nhidx Nexthop index.
    662  * \param [in] l2_tag_info L2 tag information.
    663  *
    664  * \retval SHR_E_NONE No errors.
    665  * \retval !SHR_E_NONE Failure.
    666  */
    667 extern int
    668 bcmi_ltsw_l3_egress_add_l2tag(
    669     int unit,
    670     int nhidx,
    671     bcmi_ltsw_l3_egr_l2_tag_info_t *l2_tag_info);
    672 
    673 /*!
    674  * \brief Public function to delete L2 tag from L3 egress.
    675  *
    676  * \param [in] unit Unit Number.
    677  * \param [in] nhidx Nexthop index.
    678  *
    679  * \retval SHR_E_NONE No errors.
    680  * \retval !SHR_E_NONE Failure.
    681  */
    682 extern int
    683 bcmi_ltsw_l3_egress_delete_l2tag(
    684     int unit,
    685     int nhidx);
    686 
    687 /*!
    688  * \brief Public function to get L2 tag from L3 egress.
    689  *
    690  * \param [in] unit Unit Number.
    691  * \param [in] nhidx Nexthop index.
    692  * \param [out] l2_tag_info L2 tag information.
    693  *
    694  * \retval SHR_E_NONE No errors.
    695  * \retval !SHR_E_NONE Failure.
    696  */
    697 extern int
    698 bcmi_ltsw_l3_egress_get_l2tag(
    699     int unit,
    700     int nhidx,
    701     bcmi_ltsw_l3_egr_l2_tag_info_t *l2_tag_info);
    702 
    703 /*!
    704  * \brief Get the index range of a specified egress object type.
    705  *
    706  * \param [in] unit Unit number.
    707  * \param [in] type Egress object type.
    708  * \param [out] min Min index of the egress object type.
    709  * \param [out] max Max index of the egress object type.
    710  *
    711  * \retval SHR_E_NONE No errors.
    712  * \retval SHR_E_PARAM Invalid egress object type.
    713  */
    714 extern int
    715 bcmi_ltsw_l3_egress_id_range_get(int unit, int type, int *min, int *max);
    716 
    717 /*!
    718  * \brief Public function to add php action to L3 egress.
    719  *
    720  * \param [in] unit Unit Number.
    721  * \param [in] nhidx Nexthop index.
    722  *
    723  * \retval SHR_E_NONE No errors.
    724  * \retval !SHR_E_NONE Failure.
    725  */
    726 extern int
    727 bcmi_ltsw_l3_egress_php_action_add(
    728     int unit,
    729     bcm_if_t intf);
    730 
    731 /*!
    732  * \brief Public function to delete php action from L3 egress.
    733  *
    734  * \param [in] unit Unit Number.
    735  * \param [in] nhidx Nexthop index.
    736  *
    737  * \retval SHR_E_NONE No errors.
    738  * \retval !SHR_E_NONE Failure.
    739  */
    740 extern int
    741 bcmi_ltsw_l3_egress_php_action_delete(
    742     int unit,
    743     bcm_if_t intf);
    744 
    745 /*!
    746  * \brief clear all source ECMP table.
    747  *
    748  * \param [in] unit Unit number.
    749  *
    750  * \retval SHR_E_NONE No errors.
    751  * \retval !SHR_E_NONE Failure.
    752  */
    753 extern int
    754 bcmint_ltsw_l3_secmp_clear(int unit);
    755 
    756 /*!
    757  * \brief Set source ECMP.
    758  *
    759  * \param [in] unit Unit number.
    760  * \param [in] idx Entry index.
    761  * \param [in] ecmp_info ECMP group info.
    762  * \param [in] member Array of ECMP member info.
    763  * \param [in] count Count of ECMP member.
    764  *
    765  * \retval SHR_E_NONE No errors.
    766  * \retval !SHR_E_NONE Failure.
    767  */
    768 extern int
    769 bcmint_ltsw_l3_secmp_set(
    770     int unit,
    771     int idx,
    772     bcm_l3_egress_ecmp_t *ecmp_info,
    773     bcmi_ltsw_l3_ecmp_member_info_t *member,
    774     int count);
    775 
    776 /*!
    777  * \brief Delete source ECMP group.
    778  *
    779  * \param [in] unit Unit number.
    780  * \param [in] idx Entry index of source ECMP group.
    781  *
    782  * \retval SHR_E_NONE No errors.
    783  * \retval !SHR_E_NONE Failure.
    784  */
    785 extern int
    786 bcmint_ltsw_l3_secmp_del(
    787     int unit,
    788     int idx);
    789 
    790 /*!
    791  * \brief Add a member to a source ECMP group.
    792  *
    793  * \param [in] unit Unit number.
    794  * \param [in] idx Entry index.
    795  * \param [in] member Pointer to ECMP member info.
    796  *
    797  * \retval SHR_E_NONE No errors.
    798  * \retval !SHR_E_NONE Failure.
    799  */
    800 extern int
    801 bcmint_ltsw_l3_secmp_member_add(
    802     int unit,
    803     int idx,
    804     bcmi_ltsw_l3_ecmp_member_info_t *member);
    805 
    806 /*!
    807  * \brief Delete a member from a source ECMP group.
    808  *
    809  * \param [in] unit Unit number.
    810  * \param [in] idx Entry index.
    811  * \param [in] member Array of ECMP member info.
    812  * \param [in] count Count of ECMP member.
    813  * \param [in] del_member Information to ECMP member to be deleted.
    814  *
    815  * \retval SHR_E_NONE No errors.
    816  * \retval !SHR_E_NONE Failure.
    817  */
    818 extern int
    819 bcmint_ltsw_l3_secmp_member_del(
    820     int unit,
    821     int idx,
    822     bcmi_ltsw_l3_ecmp_member_info_t *member,
    823     int count,
    824     bcmi_ltsw_l3_ecmp_member_info_t *del_member);
    825 
    826 /*!
    827  * \brief Delete all members from a source ECMP group.
    828  *
    829  * \param [in] unit Unit number.
    830  * \param [in] idx Entry index.
    831  *
    832  * \retval SHR_E_NONE No errors.
    833  * \retval !SHR_E_NONE Failure.
    834  */
    835 extern int
    836 bcmint_ltsw_l3_secmp_member_del_all(
    837     int unit,
    838     int idx);
    839 
    840 /*!
    841  * \brief Clear trunk port membership from EGR_SYSPORT_TO_NHI
    842  *
    843  * \param [in] unit Unit number.
    844  * \param [in] tid Trunk ID.
    845  * \param [out] member_cnt Count of trunk members to be deleted.
    846  * \param [out] member_arr Trunk member gports to be deleted.
    847  *
    848  * \retval SHR_E_NONE No errors.
    849  * \retval SHR_E_PARAM Invalid egress object type.
    850  */
    851 extern int
    852 bcmi_ltsw_l3_egress_trunk_member_delete(int unit, bcm_trunk_t trunk_id,
    853                                         int member_cnt, bcm_port_t *member_arr);
    854 
    855 /*!
    856  * \brief Active trunk port membership in EGR_SYSPORT_TO_NHI
    857  *
    858  * \param [in] unit Unit number.
    859  * \param [in] tid Trunk ID.
    860  * \param [out] member_cnt Count of trunk members to be added.
    861  * \param [out] member_arr Trunk member gports to be added.
    862  *
    863  * \retval SHR_E_NONE No errors.
    864  * \retval SHR_E_PARAM Invalid egress object type.
    865  */
    866 extern int
    867 bcmi_ltsw_l3_egress_trunk_member_add(int unit, bcm_trunk_t trunk_id,
    868                                      int member_cnt, bcm_port_t *member_arr);
    869 #endif /* BCMI_LTSW_L3_EGRESS_H */