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

iqs_api.h (5847B)


      1 /** \file bcm_int/dnx/cosq/ingress/iqs_api.h
      2  * 
      3  *
      4  * APIs and High Level functions of IQS
      5  * Module IQS - Ingress Queue Scheduling 
      6  *  
      7  * Configuration of Ingress TM queue scheduling, includes:
      8  *  * Credit request profiles
      9  *  * Credit worth
     10  *  * FSM reorder mechanism
     11  *  
     12  *  Not including:
     13  *  * FMQ Credit generation(legacy implementation)
     14  */
     15 
     16 /*
     17  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
     18  * 
     19  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
     20  */
     21 
     22 #ifndef _DNX_IQS_API_INCLUDED__
     23 #define _DNX_IQS_API_INCLUDED__
     24 
     25 #ifndef BCM_DNX_SUPPORT
     26 #error "This file is for use by DNX family only!"
     27 #endif
     28 
     29 #include <shared/shrextend/shrextend_error.h>
     30 #include <bcm/cosq.h>
     31 /*
     32  * Defines:
     33  * {
     34  */
     35 
     36 /*
     37  * } 
     38  */
     39 /*
     40  * Typedefs:
     41  * {
     42  */
     43 
     44  /*
     45   * } 
     46   */
     47 /*
     48  * Functions
     49  * {
     50  */
     51 /**
     52  * \brief - 
     53  * Map delay tolerance level to actual credit request profile-id
     54  
     55  * \param [in] unit -  Unit-ID 
     56  * \param [in] delay_tolerance_level - delay tolerance level defines or the actual profile id
     57  * \param [in] profile_id - credit request profile id
     58  *             
     59  * \return
     60  *   See shr_error_e 
     61  * \remark
     62  *   * None
     63  * \see
     64  *   * None
     65  */
     66 int dnx_iqs_api_delay_tolerance_level_to_profile_id_get(
     67     int unit,
     68     int delay_tolerance_level,
     69     int *profile_id);
     70 /**
     71  * \brief -
     72  * Range of queues supporting credit watchdog mechanism.
     73  *
     74  * \param [in] unit -  Unit-ID
     75  * \param [in] range - is_enabled - enable / disable watchdog mechanism
     76  *                     range_min - min queue id.
     77  *                     range_max - max queue id.
     78  *
     79  * \return
     80  *   See shr_error_e
     81  * \remark
     82  *   * None
     83  * \see
     84  *   * None
     85  */
     86 shr_error_e dnx_iqs_api_wd_range_set(
     87     int unit,
     88     bcm_cosq_range_t * range);
     89 
     90 /**
     91  * \brief -
     92  * Range of queues supporting credit watchdog mechanism.
     93  *
     94  * \param [in] unit -  Unit-ID
     95  * \param [in] range - is_enabled - enable / disable watchdog mechanism
     96  *                     range_min - min queue id.
     97  *                     range_max - max queue id.
     98  *
     99  * \return
    100  *   See shr_error_e
    101  * \remark
    102  *   * None
    103  * \see
    104  *   * None
    105  */
    106 shr_error_e dnx_iqs_api_wd_range_get(
    107     int unit,
    108     bcm_cosq_range_t * range);
    109 
    110 /**
    111  * \brief -
    112  *  Assign ingress queue to credit request profile.
    113  *  When creating a ingress queue using API bcm_cosq_ingress_queue_bundle_gport_add() the queue assigned to credit request profile according to user input.
    114  *  This API will allow modifying the credit request profile.
    115  *
    116  *
    117  * \param [in] unit -  Unit-ID
    118  * \param [in] gport - Queue bundle gport. Created by API bcm_cosq_ingress_queue_bundle_gport_add().
    119  * \param [in] cosq - queue offset in the bundle
    120  * \param [in] delay_tolerance_id - credit request profile (defined by API bcm_cosq_delay_tolerance_level_set())
    121  * \return
    122  *   See shr_error_e
    123  * \remark
    124  *   * None
    125  * \see
    126  *   * None
    127  */
    128 shr_error_e dnx_iqs_api_queue_to_request_profile_set(
    129     int unit,
    130     bcm_gport_t gport,
    131     bcm_cos_queue_t cosq,
    132     int delay_tolerance_id);
    133 
    134 /**
    135  * \brief -
    136  *  Get mapping of ingress queue to credit request profile.
    137  *  When creating a ingress queue using API bcm_cosq_ingress_queue_bundle_gport_add() the queue assigned to credit request profile according to user input.
    138  *  This API will allow modifying the credit request profile.
    139  *
    140  *
    141  * \param [in] unit -  Unit-ID
    142  * \param [in] gport - Queue bundle gport. Created by API bcm_cosq_ingress_queue_bundle_gport_add().
    143  * \param [in] cosq - queue offset in the bundle
    144  * \param [in] delay_tolerance_id - credit request profile (defined by API bcm_cosq_delay_tolerance_level_set())
    145  * \return
    146  *   See shr_error_e
    147  * \remark
    148  *   * None
    149  * \see
    150  *   * None
    151  */
    152 shr_error_e dnx_iqs_api_queue_to_request_profile_get(
    153     int unit,
    154     bcm_gport_t gport,
    155     bcm_cos_queue_t cosq,
    156     int *delay_tolerance_id);
    157 
    158 /**
    159  * \brief -
    160  *  Set mapping from ingress queue to dqcq prioity.
    161  *
    162  * \param [in] unit -  Unit-ID
    163  * \param [in] voq_gport - Base queue Gport (UCAST/MCAST).
    164  * \param [in] cosq - queue offset from base queue
    165  * \param [in] priority - DQCQ priority to set
    166  * \return
    167  *   See shr_error_e
    168  * \remark
    169  *   This mapping is only valid when the feature for 8 DQCQ priorities is supported.
    170  *   when the feature is not supported, the mapping to DQCQ priority is done per credit-request-profile, not per VOQ
    171  * \see
    172  *   * None
    173  */
    174 shr_error_e dnx_iqs_queue_priority_set(
    175     int unit,
    176     bcm_gport_t voq_gport,
    177     bcm_cos_queue_t cosq,
    178     int priority);
    179 
    180 /**
    181  * \brief -
    182  *  Get mapping from ingress queue to dqcq prioity.
    183  *
    184  * \param [in] unit -  Unit-ID
    185  * \param [in] voq_gport - Base queue Gport (UCAST/MCAST).
    186  * \param [in] cosq - queue offset from base queue
    187  * \param [out] priority - DQCQ priority
    188  * \return
    189  *   See shr_error_e
    190  * \remark
    191  *   This mapping is only valid when the feature for 8 DQCQ priorities is supported.
    192  *   when the feature is not supported, the mapping to DQCQ priority is done per credit-request-profile, not per VOQ
    193  * \see
    194  *   * None
    195  */
    196 shr_error_e dnx_iqs_queue_priority_get(
    197     int unit,
    198     bcm_gport_t voq_gport,
    199     bcm_cos_queue_t cosq,
    200     int *priority);
    201 
    202 /**
    203  * \brief -
    204  *  Trigger a flush on the specified queue.
    205  *  if after the given timeout the flush is not finished, an error will be returned.
    206  *  if timeout is 0, the API will return without checking if the flush is finished
    207  *
    208  * \param [in] unit -  Unit-ID
    209  * \param [in] voq_gport - Base queue Gport (UCAST/MCAST).
    210  * \param [in] cosq - queue offset from base queue
    211  * \param [in] timeout - timeout for the flush operation [usecs]
    212  * \return
    213  *   See shr_error_e
    214  * \see
    215  *   * None
    216  */
    217 shr_error_e dnx_iqs_queue_flush_set(
    218     int unit,
    219     bcm_gport_t voq_gport,
    220     bcm_cos_queue_t cosq,
    221     int timeout);
    222 /*
    223  * }
    224  */
    225 
    226 #endif/*_DNX_COSQ_INCLUDED__*/