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

trunk.h (2583B)


      1 /*
      2  * 
      3  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      4  * 
      5  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
      6  *
      7  * IPMC Internal header
      8  */
      9 
     10 #ifndef _BCM_INT_DPP_TRUNK_H_
     11 #define _BCM_INT_DPP_TRUNK_H_
     12 
     13 #include <sal/types.h>
     14 #include <sal/core/sync.h>
     15 #include <bcm/types.h>
     16 
     17 #include <soc/dpp/PPD/ppd_api_lag.h>
     18 
     19 #include <bcm_int/dpp/stack.h>
     20 #include <shared/swstate/sw_state.h>
     21 
     22 /* Max Trunk ID */
     23 #define BCM_DPP_MAX_TRUNKS      (SOC_PPC_LAG_MAX_ID)
     24 #define BCM_DPP_MAX_STK_TRUNKS      (SOC_TMC_NOF_TM_DOMAIN_IN_SYSTEM)
     25 
     26 /* Check valid Trunk ID */
     27 #define BCM_DPP_TRUNK_VALID(tid) (((tid) >= 0) && ((tid) < BCM_DPP_MAX_TRUNKS))
     28 
     29 
     30 typedef struct bcm_dpp_trunk_private_s {
     31     bcm_trunk_t     trunk_id;       /* trunk group ID */
     32     int             in_use;         /* whether particular trunk is in use */
     33     int             nof_members;    /* number of members in trunk */
     34     int             is_stateful;    /* indicates if member is stateful - relevant for arad+ and higher - relevant for network trunk */
     35     int             psc;            /* indicates the port selection criteria - relevant for network trunk */
     36 } bcm_dpp_trunk_private_t;
     37 
     38 typedef enum trunk_init_state_e {
     39     ts_none,
     40     ts_recovering, /* phase 1 recovered, second phase recovery required to
     41                     * complete init sequence */
     42     ts_init        /* completely initialized */
     43 } trunk_init_state_t;
     44 
     45 typedef struct bcm_dpp_trunk_member_s {
     46     bcm_gport_t         system_port;    /* destination */
     47     uint32              flags;          /* member flags */
     48     uint32              member_id;      /* member id in trunk */
     49     uint32              trunk_id;       /* trunk id */
     50 } bcm_dpp_trunk_member_t;
     51 
     52 typedef struct trunk_state_s {
     53     trunk_init_state_t                          init_state;     /* Initialized, recovering, or none */
     54     int                                         ngroups;        /* max number of trunk groups */
     55     int                                         stk_ngroups;    /* max number of trunk groups */
     56     int                                         nports;         /* max port count per trunk group */
     57     PARSER_HINT_ARR bcm_dpp_trunk_private_t     *t_info;
     58     PARSER_HINT_ARR bcm_dpp_trunk_member_t      *trunk_members; /* should contain max amount of members possible (16K) */
     59 } trunk_state_t;
     60 
     61 #ifdef BCM_WARM_BOOT_SUPPORT_SW_DUMP
     62 extern int
     63 _bcm_dpp_trunk_sw_dump(int unit);
     64 #endif /* BCM_WARM_BOOT_SUPPORT_SW_DUMP */
     65  	 
     66 
     67 #endif /* _BCM_INT_DPP_TRUNK_H_ */
     68