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

ecn.h (5321B)


      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 BCMI_LTSW_ECN_H
     12 #define BCMI_LTSW_ECN_H
     13 
     14 #include <bcm/switch.h>
     15 #include <bcm/types.h>
     16 
     17 #include <sal/sal_types.h>
     18 
     19 /*! Encoding ID for ING_MPLS_EXP_TO_ECN type. */
     20 #define BCMI_LTSW_ECN_MPLS_ECN_MAP_TYPE_EXP2ECN (0x4000)
     21 
     22 /*! Encoding ID for ECN_IP_TO_MPLS_EXP type. */
     23 #define BCMI_LTSW_ECN_MPLS_ECN_MAP_TYPE_ECN2EXP (0x8000)
     24 
     25 /*! Encoding ID for ECN_CNG_TO_MPLS_EXP type. */
     26 #define BCMI_LTSW_ECN_MPLS_ECN_MAP_TYPE_INTCN2EXP (0xC000)
     27 
     28 /*! Encoding ID for ECN_TNL_DECAP_IP_PAYLOAD type. */
     29 #define BCMI_LTSW_ECN_TUNNEL_ECN_MAP_TYPE_TERM (0x10000)
     30 
     31 /*! Encoding ID for ECN_TNL_ENCAP_IP_PAYLOAD type. */
     32 #define BCMI_LTSW_ECN_TUNNEL_ECN_MAP_TYPE_INIT_IP_PAYLOAD (0x20000)
     33 
     34 /*! Encoding ID for ECN_TNL_ENCAP_NON_IP_PAYLOAD type. */
     35 #define BCMI_LTSW_ECN_TUNNEL_ECN_MAP_TYPE_INIT_NON_IP_PAYLOAD (0x40000)
     36 
     37 /*! Encoding ID for ECN_LATENCY_PROFILE type. */
     38 #define BCMI_LTSW_ECN_LATENCY_ECN_MAP_TYPE (0x80000)
     39 
     40 /*!
     41  * \brief Resolve ECN map ID.
     42  *
     43  * \param [in] unit Unit Number.
     44  * \param [in] ecn_map_id ECN map ID.
     45  * \param [out] ecn_map_type ECN map type.
     46  * \param [out] prof_id ECN map profile ID.
     47  */
     48 extern int
     49 bcmi_ltsw_ecn_map_id_resolve(
     50     int unit,
     51     int ecn_map_id,
     52     int *ecn_map_type,
     53     uint32_t *prof_id);
     54 
     55 /*!
     56  * \brief Construct ECN map ID.
     57  *
     58  * \param [in] unit Unit Number.
     59  * \param [in] ecn_map_type ECN map type.
     60  * \param [in] prof_id ECN map profile ID.
     61  * \param [out] ecn_map_id ECN map ID.
     62  */
     63 extern int
     64 bcmi_ltsw_ecn_map_id_construct(
     65     int unit,
     66     int ecn_map_type,
     67     uint32_t prof_id,
     68     int *ecn_map_id);
     69 
     70 /*!
     71  * \brief Deinit ECN module.
     72  *
     73  * \param [in] unit Unit Number.
     74  *
     75  * \retval SHR_E_NONE No errors.
     76  * \retval !SHR_E_NONE Failure.
     77  */
     78 extern int
     79 bcmi_ltsw_ecn_deinit(int unit);
     80 
     81 /*!
     82  * \brief Init ECN module.
     83  *
     84  * \param [in] unit Unit Number.
     85  *
     86  * \retval SHR_E_NONE No errors.
     87  * \retval !SHR_E_NONE Failure.
     88  */
     89 extern int
     90 bcmi_ltsw_ecn_init(int unit);
     91 
     92 /*!
     93  * \brief Set latency-based ECN mode.
     94  *
     95  * \param [in] unit Unit Number.
     96  * \param [in] mode mode.
     97  *
     98  * \retval SHR_E_NONE No errors.
     99  * \retval !SHR_E_NONE Failure.
    100  */
    101 extern int
    102 bcmi_ltsw_ecn_latency_based_mode_set(
    103     int unit,
    104     bcm_switch_latency_ecn_mark_mode_t mode);
    105 
    106 /*!
    107  * \brief Get latency-based ECN mode.
    108  *
    109  * \param [in] unit Unit Number.
    110  * \param [out] mode mode.
    111  *
    112  * \retval SHR_E_NONE No errors.
    113  * \retval !SHR_E_NONE Failure.
    114  */
    115 extern int
    116 bcmi_ltsw_ecn_latency_based_mode_get(
    117     int unit,
    118     bcm_switch_latency_ecn_mark_mode_t *mode);
    119 
    120 /*!
    121  * \brief Set latency-based ECN threshold.
    122  *
    123  * \param [in] unit Unit Number.
    124  * \param [in] gport Port number or GPORT identifier.
    125  * \param [in] cosq COS queue number.
    126  * \param [in] mode mode.
    127  * \param [in] threshold threshold.
    128  *
    129  * \retval SHR_E_NONE No errors.
    130  * \retval !SHR_E_NONE Failure.
    131  */
    132 extern int
    133 bcmi_ltsw_ecn_latency_based_threshold_set(
    134     int unit,
    135     bcm_gport_t gport,
    136     bcm_cos_queue_t cosq,
    137     bcm_switch_latency_ecn_mark_mode_t mode,
    138     uint32_t threshold);
    139 
    140 /*!
    141  * \brief Get latency-based ECN threshold.
    142  *
    143  * \param [in] unit Unit Number.
    144  * \param [in] gport Port number or GPORT identifier.
    145  * \param [in] cosq COS queue number.
    146  * \param [in] mode mode.
    147  * \param [out] threshold threshold.
    148  *
    149  * \retval SHR_E_NONE No errors.
    150  * \retval !SHR_E_NONE Failure.
    151  */
    152 extern int
    153 bcmi_ltsw_ecn_latency_based_threshold_get(
    154     int unit,
    155     bcm_gport_t gport,
    156     bcm_cos_queue_t cosq,
    157     bcm_switch_latency_ecn_mark_mode_t mode,
    158     uint32_t *threshold);
    159 
    160 /*!
    161  * \brief To set the default responsive value for Non-TCP packets.
    162  *
    163  * \param [in] unit Unit Number.
    164  * \param [in] value Default responsive value.
    165  *
    166  * \retval SHR_E_NONE No errors.
    167  * \retval !SHR_E_NONE Failure.
    168  */
    169 extern int
    170 bcmi_ltsw_ecn_responsive_default_set(
    171     int unit,
    172     int value);
    173 
    174 /*!
    175  * \brief To get the default responsive value for Non-TCP packets.
    176  *
    177  * \param [in] unit Unit Number.
    178  * \param [out] value Returned default responsive value.
    179  *
    180  * \retval SHR_E_NONE No errors.
    181  * \retval !SHR_E_NONE Failure.
    182  */
    183 extern int
    184 bcmi_ltsw_ecn_responsive_default_get(
    185     int unit,
    186     int *value);
    187 
    188 /*!
    189  * \brief Enable or disable one field ECN control table.
    190  *
    191  * \param [in] unit Unit Number.
    192  * \param [in] lt_name ecn_ctrl_name LT name.
    193  * \param [in] lt_fld_name ecn_ctrl_fld LT field name.
    194  * \param [in] val value set in the field.
    195  *
    196  * \retval SHR_E_NONE No errors.
    197  * \retval !SHR_E_NONE Failure.
    198  */
    199 extern int
    200 bcmi_ltsw_ecn_ctrl_set(
    201     int unit,
    202     const char *lt_name,
    203     const char *lt_fld_name,
    204     int val);
    205 
    206 /*!
    207  * \brief Get status ECN control table.
    208  *
    209  * \param [in] unit Unit Number.
    210  * \param [in] lt_name ecn_ctrl_name LT name.
    211  * \param [in] lt_fld_name ecn_ctrl_fld LT field name.
    212  * \param [in] val value get in the field.
    213  *
    214  * \retval SHR_E_NONE No errors.
    215  * \retval !SHR_E_NONE Failure.
    216  */
    217 extern int
    218 bcmi_ltsw_ecn_ctrl_get(
    219     int unit,
    220     const char *lt_name,
    221     const char *lt_fld_name,
    222     int *val);
    223 
    224 #endif /* BCMI_LTSW_ECN_H */