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_int.h (5306B)


      1 /*! \file l3_egress_int.h
      2  *
      3  * L3 egress internal header file.
      4  * This file contains L3 egress definitions internal to the L3 egress module
      5  * itself.
      6  */
      7 /*
      8  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      9  * 
     10  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
     11  */
     12 
     13 
     14 #ifndef BCMI_LTSW_L3_EGRESS_INT_H
     15 #define BCMI_LTSW_L3_EGRESS_INT_H
     16 #include <bcm_int/ltsw/l3_fib_int.h>
     17 
     18 #include <bcm_int/ltsw/types.h>
     19 
     20 /* HA Sub component id for ECMP flags. */
     21 #define BCMINT_LTSW_L3_EGR_HA_ECMP_INFO     0
     22 #define BCMINT_LTSW_L3_EGR_HA_OL_ECMP_FLAGS 1
     23 #define BCMINT_LTSW_L3_EGR_HA_UL_ECMP_FLAGS 2
     24 #define BCMINT_LTSW_L3_EGR_HA_ECMP_WEIGHTED_FLAGS 3
     25 /* HA Sub component id for ECMP lb mode. */
     26 #define BCMINT_LTSW_L3_EGR_HA_OL_ECMP_LB_MODE 4
     27 #define BCMINT_LTSW_L3_EGR_HA_UL_ECMP_LB_MODE 5
     28 #define BCMINT_LTSW_L3_EGR_HA_ECMP_MEMBER_DEST 6
     29 #define BCMINT_LTSW_L3_EGR_HA_OL_RH_ECMP_MAX_PATHS 7
     30 #define BCMINT_LTSW_L3_EGR_HA_UL_RH_ECMP_MAX_PATHS 8
     31 #define BCMINT_LTSW_L3_EGR_HA_OL_NHOP_FLAGS 9
     32 
     33 /* ECMP Group attributes. */
     34 #define BCMI_LTSW_ECMP_ATTR_WGT         0x1 /* Weighted ECMP group. */
     35 #define BCMI_LTSW_ECMP_ATTR_DLB         0x2 /* DLB ECMP group */
     36 #define BCMI_LTSW_ECMP_ATTR_DGM         0x4 /* DGM ECMP group */
     37 #define BCMI_LTSW_ECMP_ATTR_RH          0x8 /* Resilient Hash ECMP group */
     38 #define BCMI_LTSW_ECMP_ATTR_OL          0x10 /* Overlay ECMP group */
     39 
     40 /* Field description. */
     41 typedef struct bcmint_ltsw_l3_egress_fld_s {
     42     /* Field name. */
     43     const char *fld_name;
     44 
     45     /* Key field. */
     46     bool key;
     47 
     48     /* Symbol field. */
     49     bool symbol;
     50 
     51     /* Callback to get scalar value from symbol. */
     52     bcmi_ltsw_symbol_to_scalar_f symbol_to_scalar;
     53 
     54     /* Callback to get symbol from scalar value. */
     55     bcmi_ltsw_scalar_to_symbol_f scalar_to_symbol;
     56 
     57 } bcmint_ltsw_l3_egress_fld_t;
     58 
     59 /* L3 egress tables. */
     60 typedef enum bcmint_ltsw_l3_egress_tbl_id_e {
     61     BCMINT_LTSW_L3_EGRESS_TBL_UC,
     62     BCMINT_LTSW_L3_EGRESS_TBL_MC,
     63     BCMINT_LTSW_L3_EGRESS_TBL_MPLS_TRNSIT,
     64     BCMINT_LTSW_L3_EGRESS_TBL_MPLS_ENCAP,
     65     BCMINT_LTSW_L3_EGRESS_TBL_IFP_ACTION,
     66     BCMINT_LTSW_L3_EGRESS_TBL_L2_TAG,
     67     BCMINT_LTSW_L3_EGRESS_TBL_CNT
     68 } bcmint_ltsw_l3_egress_tbl_id_t;
     69 
     70 typedef enum bcmint_ltsw_l3_ecmp_tbl_id_e {
     71     BCMINT_LTSW_L3_ECMP_TBL_UL,
     72     BCMINT_LTSW_L3_ECMP_TBL_OL,
     73     BCMINT_LTSW_L3_ECMP_TBL_WEIGHTED_UL,
     74     BCMINT_LTSW_L3_ECMP_TBL_WEIGHTED_OL,
     75     BCMINT_LTSW_L3_ECMP_TBL_CNT
     76 } bcmint_ltsw_l3_ecmp_tbl_id_t;
     77 
     78 typedef enum bcmint_ltsw_l3_ecmp_flexctr_act_tbl_id_e {
     79     BCMINT_LTSW_L3_ECMP_FLEXCTR_ACT_TBL_UL,
     80     BCMINT_LTSW_L3_ECMP_FLEXCTR_ACT_TBL_OL,
     81     BCMINT_LTSW_L3_ECMP_FLEXCTR_ACT_TBL_CNT
     82 } bcmint_ltsw_l3_ecmp_flexctr_act_tbl_id_t;
     83 
     84 typedef enum bcmint_ltsw_l3_control_tbl_id_e {
     85     BCMINT_LTSW_L3_CTR_TBL_LIMIT,
     86     BCMINT_LTSW_L3_CTR_TBL_TBL_CNT
     87 } bcmint_ltsw_l3_control_tbl_id_t;
     88 
     89 /* The structure of L3 egress table. */
     90 typedef struct bcmint_ltsw_l3_egress_tbl_s {
     91     /* Table name. */
     92     const char *name;
     93 
     94     /* Field count. */
     95     uint32_t fld_cnt;
     96 
     97     /* Bitmap of valid fields. */
     98     uint64_t fld_bmp;
     99 
    100     /* The fields of table. */
    101     const bcmint_ltsw_l3_egress_fld_t *flds;
    102 
    103 } bcmint_ltsw_l3_egress_tbl_t;
    104 
    105 /* L3 egress table database. */
    106 typedef struct bcmint_ltsw_l3_egress_tbl_db_s {
    107     /* The table bitmap. */
    108     uint32_t tbl_bmp;
    109 
    110     /* The table array. */
    111     const bcmint_ltsw_l3_egress_tbl_t *tbls;
    112 } bcmint_ltsw_l3_egress_tbl_db_t;
    113 
    114 /* L3 overlay table Information. */
    115 typedef struct bcmint_ltsw_l3_ol_tbl_info_s {
    116     /* Overlay egress object number. */
    117     int ol_egr_obj_num;
    118 
    119     /* Overlay ecmp member number. */
    120     int ol_ecmp_member_num;
    121 
    122     /* Overlay L3 interface number. */
    123     int ol_eif_num;
    124 
    125 } bcmint_ltsw_l3_ol_tbl_info_t;
    126 
    127 /*!
    128  * \brief Get the L3 egress table database.
    129  *
    130  * \param [in] unit Unit number.
    131  * \param [in] tbl_id L3 egress logical table description ID.
    132  * \param [out] tbl_info L3 egress table databse.
    133  *
    134  * \retval SHR_E_NONE No errors.
    135  */
    136 extern int
    137 bcmint_ltsw_l3_egress_tbl_get(
    138     int unit,
    139     bcmint_ltsw_l3_egress_tbl_id_t tbl_id,
    140     const bcmint_ltsw_l3_egress_tbl_t **tbl_info);
    141 
    142 /*!
    143  * \brief Get the L3 ECMP table database.
    144  *
    145  * \param [in] unit Unit number.
    146  * \param [in] tbl_id L3 ecmp logical table description ID.
    147  * \param [out] tbl_info L3 ECMP table databse.
    148  *
    149  * \retval SHR_E_NONE No errors.
    150  */
    151 extern int
    152 bcmint_ltsw_l3_ecmp_tbl_get(
    153     int unit,
    154     bcmint_ltsw_l3_ecmp_tbl_id_t tbl_id,
    155     const bcmint_ltsw_l3_egress_tbl_t **tbl_info);
    156 
    157 /*!
    158  * \brief Get the L3 ECMP flex ctr action table database.
    159  *
    160  * \param [in] unit Unit number.
    161  * \param [in] tbl_id L3 ecmp flexctr action logical table description ID.
    162  * \param [out] tbl_info L3 ECMP flex ctr action table databse.
    163  *
    164  * \retval SHR_E_NONE No errors.
    165  */
    166 extern int
    167 bcmint_ltsw_l3_ecmp_flexctr_action_tbl_get(
    168     int unit,
    169     bcmint_ltsw_l3_ecmp_flexctr_act_tbl_id_t tbl_id,
    170     const bcmint_ltsw_l3_egress_tbl_t **tbl_info);
    171 
    172 /*!
    173  * \brief Init L3 overlay information.
    174  *
    175  * \param [in] unit Unit number.
    176  * \param [in] info L3 overlay table info.
    177  *
    178  * \retval SHR_E_NONE No errors.
    179  */
    180 extern int
    181 bcmint_ltsw_l3_overlay_table_init(
    182     int unit,
    183     bcmint_ltsw_l3_ol_tbl_info_t *info);
    184 #endif /* BCMI_LTSW_L3_EGRESS_INT_H */
    185