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

algo_bfd.h (14787B)


      1 /**
      2  * \file algo_bfd.h Internal DNX L3 Managment APIs
      3 PIs This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      4 PIs 
      5 PIs Copyright 2007-2020 Broadcom Inc. All rights reserved.
      6  */
      7 
      8 #ifndef ALGO_BFD_H_INCLUDED
      9 /*
     10  * { 
     11  */
     12 #define ALGO_BFD_H_INCLUDED
     13 
     14 #include <shared/shrextend/shrextend_debug.h>
     15 
     16 #ifndef BCM_DNX_SUPPORT
     17 #error "This file is for use by DNX (JR2) family only!"
     18 #endif
     19 
     20 #include <bcm_int/dnx/algo/template_mngr/template_manager_types.h>
     21 
     22 /**
     23  * Resource name defines for algo bfd 
     24  * \see
     25  * dnx_bfd_init_templates 
     26  * {
     27  */
     28 #define DNX_BFD_TEMPLATE_OAMA_ACTION               "BFD MEP OAMA Action"
     29 
     30 #define DNX_BFD_TEMPLATE_OAMB_ACTION               "BFD MEP OAMB Action"
     31 
     32 #define DNX_BFD_TEMPLATE_DIP                       "BFD DIP"
     33 
     34 #define DNX_BFD_SERVER_TRAP_CODES                  "BFD SERVER Trap Codes"
     35 
     36 #define DNX_BFD_TEMPLATE_YOUR_DISCR_RANGE          "BFD Your-Discr Range"
     37 
     38 #define DNX_BFD_OAMP_TEMPLATE_TX_RATE              "BFD OAMP TX Rate"
     39 
     40 #define DNX_BFD_OAMP_TEMPLATE_REQ_INTERVAL         "BFD OAMP Required Interval"
     41 
     42 #define DNX_BFD_OAMP_TEMPLATE_MY_DISCR_RANGE_START "BFD OAMP My-Discr Range Start"
     43 
     44 #define DNX_BFD_OAMP_TEMPLATE_TOS_TTL              "BFD OAMP TOS-TTL"
     45 
     46 #define DNX_BFD_OAMP_TEMPLATE_IPV4_SRC_ADDR        "BFD OAMP IPv4 Source Addr"
     47 
     48 #define DNX_BFD_OAMP_TEMPLATE_UDP_SPORT            "BFD OAMP UDP SPORT"
     49 
     50 #define DNX_BFD_OAMP_TEMPLATE_MPLS_SPORT           "BFD OAMP MPLS SPORT"
     51 
     52 #define DNX_BFD_TEMPLATE_OAMP_SINGLE_HOP_TOS       "BFD OAMP SINGLE-HOP TOS"
     53 
     54 #define DNX_BFD_TEMPLATE_LOCAL_MIN_ECHO            "BFD OAMP LOCAL MIN ECHO"
     55 
     56 #define DNX_BFD_TEMPLATE_TX_PERIOD_CLUSTER         "BFD OAMP TX PERIOD CLUSTER"
     57 
     58 #define DNX_BFD_OAMP_TEMPLATE_SEAMLESS_UDP_SPORT   "BFD OAMP SEAMLESS UDP SPORT"
     59 
     60 #define DNX_BFD_TEMPLATE_SEAMLESS_UDP_SPORT        "BFD SEAMLESS UDP SPORT"
     61 
     62 /**
     63  * }
     64  */
     65 
     66 /** Structure used to store BFD MEP profiles as templates */
     67 typedef struct
     68 {
     69     /** 
     70      *  The trap code points to a defined trap - a possible
     71      *  destination for a received packet.  In each stage of the
     72      *  pipeline different traps with different forwarding
     73      *  strengths are encountered.  The trap with the highest
     74      *  forwrarding strength wins.
     75      */
     76     uint16 trap_code;
     77 
     78     /** The forwarding strength for the above trap code.   */
     79     uint8 forwarding_stregth;
     80 
     81     /** 
     82      *  Similarly to trap strength, snoop strength is used to
     83      *  to decide the destination of a copy of the original
     84      *  packet.  While trap strength and snoop strength can be
     85      *  different, trap code is also used for snoop code, so at
     86      *  the end of the pipeline it is possible for the resulting
     87      *  trap code and snoop code to be different (because one
     88      *  stage of the pipeline had the highest trap strength,
     89      *  while a different stage had the highest snoop strength.)
     90      */
     91     uint8 snoop_strength;
     92 } dnx_bfd_mep_profile_t;
     93 
     94 /** 
     95  *  Structure used to store BFD discriminator range as
     96  *  template.  In BFD packets, the discriminator is used to
     97  *  establish a sequence of packets between two endpoints, where
     98  *  each packet contains a "my discriminator" and a "your
     99  *  discriminator" field.  If device X sends BFD packets to
    100  *  device Y with my discriminator=A and your-discriminator=B,
    101  *  device Y should send BFD packet to device X with the values
    102  *  inverted: my discriminator=B and your-discriminator=A.  This
    103  *  setting limits the values allowed for my-discriminator.
    104  *  These limits are applied to the most significant 18 bits in
    105  *  a 32 bit word.  Therefore, even if range_min=range_max
    106  *  (which is currently the case for dune devices) there are
    107  *  2^14 possible values for my-discriminator.
    108  */
    109 typedef struct
    110 {
    111     uint32 range_min;
    112     uint32 range_max;
    113 } dnx_bfd_discr_range_t;
    114 
    115 /** 
    116  *  Structure used to store profiles that contain "type of
    117  *  service/time to live" profiles as template.  These
    118  *  values are used by the OAMP to construct BFD packets for
    119  *  transmission.
    120  */
    121 typedef struct
    122 {
    123     uint8 tos;
    124     uint8 ttl;
    125 } dnx_bfd_tos_ttl_t;
    126 
    127 /**
    128  *  Structure used to store profiles that contain "(clustered)
    129  *  Tx period" profiles as template.  These values are used by
    130  *  the OAMP for transmission rate, and if cluster ID is not 0,
    131  *  allow the modification of transmission rate for multiple
    132  *  endpoints simultaneously.
    133  */
    134 typedef struct
    135 {
    136     uint32 tx_period;
    137     uint32 cluster_profile;
    138 } dnx_bfd_tx_period_t;
    139 
    140 /**
    141  * }
    142  */
    143 
    144 /**
    145  * \brief - initialize templates for all BFD profile types. 
    146  *        Current BFD Templates:\n
    147  *  BFD MEP OAMA Action - action profiles for non-accelerated
    148  *  BFD endpoints (stored in OAMA table.)\n
    149  *  BFD MEP OAMB Action - action profiles for accelerated BFD
    150  *  endpoints (either to local or remote OAMP, stored in OAMB
    151  *  table.)\n
    152  *  BFD DIP - Destination IPs.  In non-accelerated BFD
    153  *  endpoints, these are only relevant for multi-hop.
    154  *  BFD Your-Discr Range - The upper and lower values of the
    155  *  most significant 18 bits of the my-discriminator field.
    156  * 
    157  * \param [in] unit - Number of hardware unit used.
    158  *   
    159  * \return
    160  *   shr_error_e 
    161  *   
    162  * \remark
    163  *   * None
    164  * \see
    165  *   * None
    166  */
    167 shr_error_e dnx_algo_bfd_init(
    168     int unit);
    169 
    170 /**
    171  * \brief - Printing callback for the BFD MEP action templates, 
    172  *        which are used to track the references to BFD profile
    173  *        entries in the OAMA and OAMB tables.
    174  * 
    175  * \param [in] unit - Number of hardware unit used.
    176  * \param [in] data - Pointer to template profile data.  The BFD 
    177  *        action profile structure dnx_bfd_mep_profile_t is
    178  *        defined and described above.
    179  * \return
    180  * \remark
    181  *   * A print callback function is required to create a
    182  *     template.  It is later used for BCM shell diagnostics.
    183  * \see
    184  *   * None
    185  */
    186 
    187 void dnx_bfd_mep_action_profile_print_cb(
    188     int unit,
    189     const void *data);
    190 
    191 /**
    192  * \brief - Printing callback for the BFD DIP template, which is 
    193  *        use to track the refernces to entries in the BFD DIP
    194  *        hardware table by multihop BFD endpoints.
    195  * 
    196  * \param [in] unit - Number of hardware unit used.
    197  * \param [in] data - Pointer to template profile data.  This 
    198  *        data is in the format of an IPv6 address, and is
    199  *        displayed as such.
    200  * \return
    201  * \remark
    202  *   * A print callback function is required to create a
    203  *     template.  It is later used for BCM shell diagnostics.
    204  * \see
    205  *   * None
    206  */
    207 void dnx_bfd_dip_profile_print_cb(
    208     int unit,
    209     const void *data);
    210 
    211 /**
    212  * \brief - Printing callback for the BFD SERVER trap codes template, which is 
    213  *        use to track the references to BFD SERVER trap codes in the virtual
    214  *        registers CFG_BFDv6_TRAP_TO_REMOTE_OAMP_TRAP_CODE_0/1/2
    215  * 
    216  * \param [in] unit - Number of hardware unit used.
    217  * \param [in] data - Pointer to BFD SERVER trap codes data.  This 
    218  *        data is in the format of uint16, and is
    219  *        displayed as such.
    220  * \return
    221  * \remark
    222  *   * A print callback function is required to create a
    223  *     template.  It is later used for BCM shell diagnostics.
    224  * \see
    225  *   * None
    226  */
    227 void dnx_bfd_server_trap_codes_print_cb(
    228     int unit,
    229     const void *data);
    230 
    231 /**
    232  * \brief - Printing callback for the BFD Discriminator Range 
    233  *        template, which is used to track the references to the
    234  *        discriminator range registers by BFD endpoints that
    235  *        receive packets classified by discriminator.
    236  * 
    237  * \param [in] unit - Number of hardware unit used.
    238  * \param [in] data - Pointer to template profile data.  The BFD
    239  *        discriminator range structure dnx_bfd_discr_range_t is
    240  *        defined and described above.
    241  * \return
    242  * \remark
    243  *   * A print callback function is required to create a
    244  *     template.  It is later used for BCM shell diagnostics.
    245  * \see
    246  *   * None
    247  */
    248 void dnx_bfd_your_discr_range_profile_print_cb(
    249     int unit,
    250     const void *data);
    251 
    252 /**
    253  * \brief - Printing callback for the BFD Tx rate 
    254  *        template, which is used to configure packet
    255  *        transmissions for BFD accelerated endpoints.
    256  * 
    257  * \param [in] unit - Number of hardware unit used.
    258  * \param [in] data - Pointer to template profile data.  The Tx 
    259  *        rate is a 10-bit integer.
    260  * \return
    261  * \remark
    262  *   * A print callback function is required to create a
    263  *     template.  It is later used for BCM shell diagnostics.
    264  * \see
    265  *   * None
    266  */
    267 void dnx_bfd_tx_rate_profile_print_cb(
    268     int unit,
    269     const void *data);
    270 
    271 /**
    272  * \brief - Printing callback for the BFD required interval 
    273  *        template, which is used to negotiate the rate that
    274  *        remote endpoints transmit to BFD accelerated
    275  *        endpoints.
    276  * 
    277  * \param [in] unit - Number of hardware unit used.
    278  * \param [in] data - Pointer to template profile data. 
    279  *        Intervals are 32-bit integers.
    280  * \return
    281  * \remark
    282  *   * A print callback function is required to create a
    283  *     template.  It is later used for BCM shell diagnostics.
    284  * \see
    285  *   * None
    286  */
    287 void dnx_bfd_req_int_profile_print_cb(
    288     int unit,
    289     const void *data);
    290 
    291 /**
    292  * \brief - Printing callback for the BFD My Discriminator Range
    293  *        Start template, which is used to track the references
    294  *        to the discriminator range start registers by
    295  *        accekerated BFD endpoints that have IPv4 or MPLS
    296  *        tunneling.
    297  * 
    298  * \param [in] unit - Number of hardware unit used.
    299  * \param [in] data - Pointer to template profile data. This 
    300  *        offset is a 32-bit integer.
    301  * \return
    302  * \remark
    303  *   * None
    304  * \see
    305  *   * None
    306  */
    307 void dnx_bfd_discr_range_start_profile_print_cb(
    308     int unit,
    309     const void *data);
    310 
    311 /**
    312  * \brief - Printing callback for the BFD ToS TTL template. 
    313  *        These two values are used by the OAMP to construct BFD
    314  *        packet to transmit for accelerated endpoint.
    315  * 
    316  * \param [in] unit - Number of hardware unit used.
    317  * \param [in] data - Pointer to template profile data. These
    318  *        values are one byte each.
    319  * \return
    320  * \remark
    321  *   * A print callback function is required to create a
    322  *     template.  It is later used for BCM shell diagnostics.
    323  * \see
    324  *   * None
    325  */
    326 void dnx_bfd_tos_ttl_profile_print_cb(
    327     int unit,
    328     const void *data);
    329 
    330 /**
    331  * \brief - Printing callback for the BFD source address 
    332  *        template. This IPv4 address is used by the OAMP to
    333  *        construct the BFD packet to transmit for an
    334  *        accelerated endpoint.
    335  * 
    336  * \param [in] unit - Number of hardware unit used.
    337  * \param [in] data - Pointer to template profile data. The data
    338  *        is an IPv4 address - 4 bytes.
    339  * \return
    340  * \remark
    341  *   * A print callback function is required to create a
    342  *     template.  It is later used for BCM shell diagnostics.
    343  * \see
    344  *   * None
    345  */
    346 void dnx_bfd_ipv4_src_addr_profile_print_cb(
    347     int unit,
    348     const void *data);
    349 
    350 /**
    351  * \brief - Printing callback for the BFD UDP source port
    352  *        template. This IPv4 address is used by the OAMP to
    353  *        construct the BFD packet to transmit for an
    354  *        accelerated endpoint.
    355  *
    356  * \param [in] unit - Number of hardware unit used.
    357  * \param [in] data - Pointer to template profile data. The data
    358  *        is a port - 2 bytes.
    359  * \return
    360  * \remark
    361  *   * A print callback function is required to create a
    362  *     template.  It is later used for BCM sdnx_bfd_udp_src_port_profile_print_cbhell diagnostics.
    363  * \see
    364  *   * None
    365  */
    366 void dnx_bfd_udp_src_port_profile_print_cb(
    367     int unit,
    368     const void *data);
    369 
    370 /**
    371  * \brief - Printing callback for the BFD MPLS source port
    372  *        template. This IPv4 address is used by the OAMP to
    373  *        construct the BFD packet to transmit for an
    374  *        accelerated endpoint.
    375  *
    376  * \param [in] unit - Number of hardware unit used.
    377  * \param [in] data - Pointer to template profile data. The data
    378  *        is a port - 2 bytes.
    379  * \return
    380  * \remark
    381  *   * A print callback function is required to create a
    382  *     template.  It is later used for BCM shell diagnostics.
    383  * \see
    384  *   * None
    385  */
    386 void dnx_bfd_mpls_src_port_profile_print_cb(
    387     int unit,
    388     const void *data);
    389 
    390 /**
    391  * \brief - Printing callback for the BFD MPLS single hop TOS
    392  *        template. This TOS value is used by the OAMP to
    393  *        construct the BFD packet to transmit for a single-hop
    394  *        IPv4 accelerated endpoint.
    395  *
    396  * \param [in] unit - Number of hardware unit used.
    397  * \param [in] data - Pointer to template profile data. The data
    398  *        is a TOS - 1 byte.
    399  * \return
    400  * \remark
    401  *   * A print callback function is required to create a
    402  *     template.  It is later used for BCM shell diagnostics.
    403  * \see
    404  *   * None
    405  */
    406 void dnx_bfd_oamp_single_hop_tos_profile_print_cb(
    407     int unit,
    408     const void *data);
    409 
    410 /**
    411  * \brief - Printing callback for the BFD local min echo
    412  *        template. The local min echo is used in Tx packets
    413  *        to notify remote devices what is the minimum echo
    414  *        interval this device can support.
    415  *
    416  * \param [in] unit - Number of hardware unit used.
    417  * \param [in] data - Pointer to template profile data. The data
    418  *        is the interval - 4 bytes..
    419  * \return
    420  * \remark
    421  *   * A print callback function is required to create a
    422  *     template.  It is later used for BCM shell diagnostics.
    423  * \see
    424  *   * None
    425  */
    426 void dnx_bfd_oamp_bfd_local_min_echo_print_cb(
    427     int unit,
    428     const void *data);
    429 
    430 /**
    431  * \brief - Printing callback for the BFD Tx Period Cluster
    432  *        template. The Tx Period Cluster parameter allows
    433  *        the user to modify the Tx Period for any number
    434  *        of accelerated BFD endpoints simultaneously.
    435  *
    436  * \param [in] unit - Number of hardware unit used.
    437  * \param [in] data - Pointer to template profile data. The data
    438  *        is the Tx period cluster (1-8)
    439  * \return
    440  * \remark
    441  *   * A print callback function is required to create a
    442  *     template.  It is later used for BCM shell diagnostics.
    443  * \see
    444  *   * None
    445  */
    446 void dnx_bfd_oamp_bfd_tx_period_cluster_print_cb(
    447     int unit,
    448     const void *data);
    449 
    450 /**
    451  * \brief - Printing callback for the seamless BFD UDP source
    452  *        port template. This IPv4 address is used by the OAMP
    453  *        to construct the seamless BFD packet to transmit for
    454  *        an accelerated endpoint.
    455  *
    456  * \param [in] unit - Number of hardware unit used.
    457  * \param [in] data - Pointer to template profile data. The data
    458  *        is an port - 2 bytes.
    459  * \return
    460  * \remark
    461  *   * A print callback function is required to create a
    462  *     template.  It is later used for BCM sdnx_bfd_udp_src_port_profile_print_cbhell diagnostics.
    463  * \see
    464  *   * None
    465  */
    466 void dnx_bfd_seamless_udp_src_port_profile_print_cb(
    467     int unit,
    468     const void *data);
    469 
    470 /*
    471  * } 
    472  */
    473 #endif/*_ALGO_QOS_API_INCLUDED__*/