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

appl_ref_e2e_scheme.h (6426B)


      1 /** \file appl_ref_e2e_scheme.h
      2  */
      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 
     10 #ifndef APPL_DNX_E2E_SCHEME_H_INCLUDED
     11 /*
     12  * {
     13  */
     14 #define APPL_DNX_E2E_SCHEME_H_INCLUDED
     15 
     16 /*
     17  * }
     18  */
     19 
     20 /*
     21 * Include files.
     22 * {
     23 */
     24 
     25 #include <bcm/types.h>
     26 #include <bcm/error.h>
     27 #include <shared/error.h>
     28 #include <shared/shrextend/shrextend_debug.h>
     29 #include <appl/reference/dnx/appl_ref_sys_ports.h>
     30 
     31 /*
     32  * }
     33  */
     34 
     35 /*
     36  * Typedefs
     37  * {
     38  */
     39 
     40 
     41 /*
     42  * }
     43  */
     44 
     45 /*
     46  * DEFINEs
     47  * {
     48  */
     49 
     50 
     51 /*
     52  * }
     53  */
     54 
     55 /**
     56  * \brief - Cosq applicaion. Create default scheduling scheme: 
     57  * 1. Create multicast scheduling scheme 
     58  * 2. Create unicast scheduling scheme for each port 
     59  * 
     60  * \param [in] unit - Unit ID
     61  *   
     62  * \return
     63  *   shr_error_e 
     64  *   
     65  * \remark
     66  *   * None
     67  * \see
     68  *   * appl_dnx_cosq_port_scheme_create()
     69  */
     70 shr_error_e
     71 appl_dnx_e2e_scheme_init(
     72     int unit);
     73 
     74 /**
     75  * \brief - Cosq applicaion. Create default profiles:
     76  * 1. Create credit request profiles
     77  * 2. Create rate class profiles
     78  *
     79  * \param [in] unit - Unit ID
     80  *
     81  * \return
     82  *   shr_error_e
     83  *
     84  * \remark
     85  *   * None
     86  * \see
     87  *   * appl_dnx_cosq_port_scheme_create()
     88  */
     89 shr_error_e
     90 appl_dnx_e2e_profiles_create(
     91     int unit);
     92 
     93 /**
     94  * \brief - Create scheduling scheme for a given port:
     95  * 1. [Egress] Configure HR mode for the port.
     96  * 2. [Egress] Create Connectors for all VoQs pointing to the port on remote devices.
     97  * 4. [Egress] Connect the created connectors to the VoQs of the remote devices.
     98  * 
     99  * \param [in] unit - Unit ID
    100  * \param [in] system_port_id - system port id
    101  * \param [in] sys_port_map - system port mapping info
    102  *   
    103  * \return
    104  *   shr_error_e 
    105  *   
    106  * \remark
    107  *   * None
    108  * \see
    109  */
    110 shr_error_e
    111 appl_dnx_e2e_scheme_port_create(
    112     int unit,
    113     int system_port_id,
    114     const system_port_mapping_t* sys_port_map);
    115 
    116 /**
    117  * \brief - connect VOQ to VOQ connector on Ingress side!.
    118  *
    119  * \param [in] unit - Unit ID
    120  * \param [in] systen_port_id - System Port ID
    121  * \param [in] sys_port_map - system port mapping in the system (see system_port_mapping_t)
    122  * \param [in] is_disconnect - Indication if need to disconnect instead of connect
    123  *
    124  * \return
    125  *   shr_error_e
    126  *
    127  * \remark
    128  *   * None
    129  * \see
    130  *   * system_port_mapping_t
    131  */
    132 shr_error_e
    133 appl_dnx_e2e_scheme_voq_connect(
    134     int unit,
    135     int system_port_id,
    136     const system_port_mapping_t * sys_port_map,
    137     int is_disconnect);
    138 
    139 /**
    140  * \brief - Destroy scheduling scheme for a given port. 
    141  * Meaning, disconnect VOQ and VOQ connectors and destroy both.
    142  * 
    143  * \param [in] unit - Unit ID
    144  * \param [in] system_port_id - system port id to be added
    145  * \param [in] port - Port
    146  *
    147  * \return
    148  *   shr_error_e 
    149  *
    150  * \remark
    151  *   This function is suitable only for symmetric ports configuration cross multiple devices.
    152  *   when working in such configuration need to call this function on each FAP in the system.
    153  */
    154 shr_error_e
    155 appl_dnx_e2e_scheme_port_destroy(
    156     int unit,
    157     int system_port_id,
    158     int port);
    159 
    160 
    161 /**
    162  * \brief - Convert modid index and logical port to base voq connector
    163  *
    164  * \param [in] unit - Unit ID
    165  * \param [in] local_port - Logical port
    166  * \param [in] remote_core_id - Core of remote voq
    167  * \param [in] ingress_modid - Ingress (remote device) modid
    168  * \param [in] nof_devices - nof devices in the system
    169  * \param [out] base_voq_connector -   Returned base voq connector
    170  *
    171  * \return
    172  *   shr_error_e
    173  *
    174  * \remark
    175  *   * None
    176  * \see
    177  *   * None
    178  */
    179 shr_error_e
    180 appl_dnx_logical_port_to_base_voq_connector_id_get(
    181     int unit,
    182     bcm_port_t port,
    183     bcm_module_t remote_modid,
    184     int *base_voq_connector);
    185 
    186 
    187 /**
    188  * \brief - Convert modid and logical port to base voq id
    189  * 
    190  * \param [in] unit - Unit ID 
    191  * \param [in] modid - module id 
    192  * \param [in] logical_port - Logical port
    193  * \param [out] base_voq - Returned base voq
    194  *   
    195  * \return
    196  *   shr_error_e 
    197  *   
    198  * \remark
    199  *   * None
    200  * \see
    201  *   * None
    202  */
    203 int
    204 appl_dnx_e2e_scheme_logical_port_to_base_voq_get(int unit, bcm_module_t modid, bcm_port_t logical_port, int *base_voq);
    205 
    206 /**
    207  * \brief - Get delay tolerance profile from port speed
    208  *
    209  * \param [in] unit - Unit ID
    210  * \param [in] speed - speed
    211  * \param [out] delay_tolerance_level - delay_tolerance_level
    212  * \param [out] rate_class - rate class profile
    213  *
    214  * \return
    215  *   shr_error_e
    216  *
    217  * \remark
    218  *   * None
    219  * \see
    220  *   * None
    221  */
    222 shr_error_e appl_dnx_e2e_voq_profiles_get(
    223     int unit,
    224     int speed,
    225     int *delay_tolerance_level,
    226     int *rate_class);
    227 
    228 /**
    229  * \brief - Get delay tolerance level for TDM ports
    230  *
    231  * \param [in] unit - Unit ID
    232  * \param [out] delay_tolerance_level - delay_tolerance_level
    233  *
    234  * \return
    235  *   shr_error_e
    236  *
    237  * \remark
    238  *   * None
    239  * \see
    240  *   * None
    241  */
    242 shr_error_e
    243 appl_dnx_e2e_tdm_delay_tolerance_get(
    244     int unit,
    245     int* delay_tolerance_level);
    246 
    247 /**
    248  * \brief - Create and set recommended thresholds of credit request profiles.
    249  *          It is recommended to create profiles according to the approximated port end to end rate
    250  *          and attributes: is low latency, is high bandwidth.
    251  *
    252  * \param [in] unit - Unit ID
    253  *
    254  * \return
    255  *   shr_error_e
    256  *
    257  * \remark
    258  *   * None
    259  * \see
    260  *   * None
    261  */
    262 shr_error_e
    263 appl_dnx_e2e_credit_request_profiles_create(int unit);
    264 
    265 /**
    266  * \brief - Create and set recommended thresholds of rate class profiles.
    267  *          It is recommended to create profiles according to the approximated port end to end rate.
    268  *
    269  * \param [in] unit - Unit ID
    270  *
    271  * \return
    272  *   shr_error_e
    273  *
    274  * \remark
    275  *   * None
    276  * \see
    277  *   * None
    278  */
    279 shr_error_e
    280 appl_dnx_e2e_rate_class_profiles_create(int unit);
    281 
    282 /**
    283  * \brief - Create multicast scheduling scheme
    284  *
    285  * \param [in] unit - Unit ID
    286  *
    287  * \return
    288  *   shr_error_e
    289  *
    290  * \remark
    291  *   Before creating VOQs, User must specify the range of the FMQs in the device.
    292  *   In most cases, where fabric multicast is only defined by packet tc, range should set between 0-3.
    293  *   Set range that is different than 0-3, need to change fabric scheduler mode.
    294  *   Please see more details in the UM, Cint example:
    295  *   cint_enhance_application.c
    296  *   and API:
    297  *   bcm_fabric_control_set type: bcmFabricMulticastSchedulerMode.
    298  * \see
    299  *   * None
    300  */
    301 shr_error_e
    302 appl_dnx_e2e_scheme_mcast_create(
    303     int unit);
    304 
    305 /*
    306  * }
    307  */
    308 #endif /* APPL_DNX_E2E_SCHEME_H_INCLUDED */