mim.h (4610B)
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 * This file contains mim definitions internal to the BCM library. 8 */ 9 10 #ifndef _BCM_INT_MIM_H 11 #define _BCM_INT_MIM_H 12 13 #include <bcm/mim.h> 14 #include <bcm_int/esw/vpn.h> 15 16 #define _BCM_MIM_VPN_TYPE_MIM _BCM_VPN_TYPE_VFI 17 18 #define _BCM_IS_MIM_VPN(_vpn_) _BCM_VPN_IS_MIM(_vpn_) 19 20 #define _BCM_MIM_VPN_IS_SET(_vpn_) _BCM_VPN_IS_MIM(_vpn_) 21 22 #define _BCM_MIM_VPN_SET(_vpn_, _type_, _id_) \ 23 _BCM_VPN_SET(_vpn_, _type_, _id_) 24 25 #define _BCM_MIM_VPN_GET(_id_, _type_, _vpn_) \ 26 _BCM_VPN_GET(_id_, _type_, _vpn_) 27 28 #define _BCM_MIM_VPN_INVALID 0xffff 29 30 #define _BCM_MIM_PORT_TYPE_NETWORK (1 << 0) 31 #define _BCM_MIM_PORT_TYPE_ACCESS_PORT (1 << 1) 32 #define _BCM_MIM_PORT_TYPE_ACCESS_PORT_VLAN (1 << 2) 33 #define _BCM_MIM_PORT_TYPE_ACCESS_PORT_VLAN_STACKED (1 << 3) 34 #define _BCM_MIM_PORT_TYPE_ACCESS_LABEL (1 << 4) 35 #define _BCM_MIM_PORT_TYPE_PEER (1 << 5) 36 #define _BCM_MIM_PORT_TYPE_ACCESS_PORT_TRUNK (1 << 6) 37 #define _BCM_MIM_PORT_TYPE_ACCESS_SHARED (1 << 7) 38 #define _BCM_MIM_PORT_TYPE_SHARE (1 << 8) 39 40 /* on TR2 B0, default port for mim is 1 */ 41 #define _BCM_MIM_DEFAULT_PORT (1) 42 43 /* 44 * MIM VPN state - need to remember the ISID 45 */ 46 typedef struct _bcm_tr2_vpn_info_s { 47 int isid; /* The ISID value */ 48 } _bcm_tr2_vpn_info_t; 49 50 /* 51 * MIM port state - need to remember where to find the port. 52 * Flags indicate the type of the port and hence the tables where the data is. 53 * The index is used for the SOURCE_TRUNK_MAP table or for the 54 * MPLS_STATION_TCAM. 55 * The match attributes are the keys for the various hash tables. 56 */ 57 typedef struct _bcm_tr2_mim_port_info_s { 58 uint32 flags; 59 uint32 index; /* Index of memory where port info is programmed */ 60 bcm_trunk_t tgid; /* Trunk group ID */ 61 bcm_module_t modid; /* Module id */ 62 bcm_port_t port; /* Port */ 63 bcm_vlan_t match_vlan; /* S-Tag */ 64 bcm_vlan_t match_inner_vlan; /* C-Tag */ 65 bcm_mpls_label_t match_label; /* MPLS label */ 66 bcm_mac_t match_tunnel_srcmac; /* NVP src BMAC */ 67 bcm_vlan_t match_tunnel_vlan; /* NVP BVID */ 68 int match_count; /* Number of matches from VLAN_XLATE configured */ 69 int vfi_count; /* Number of VFI sharing the same peer vp */ 70 } _bcm_tr2_mim_port_info_t; 71 72 /* 73 * Software book keeping for MIM related information 74 */ 75 typedef struct _bcm_tr2_mim_bookkeeping_s { 76 _bcm_tr2_vpn_info_t *vpn_info; /* VPN state */ 77 _bcm_tr2_mim_port_info_t *port_info; /* VP state */ 78 SHR_BITDCL *intf_bitmap; /* L3 interfaces used */ 79 } _bcm_tr2_mim_bookkeeping_t; 80 81 extern _bcm_tr2_mim_bookkeeping_t _bcm_tr2_mim_bk_info[BCM_MAX_NUM_UNITS]; 82 83 #ifdef BCM_WARM_BOOT_SUPPORT_SW_DUMP 84 extern void _bcm_mim_sw_dump(int unit); 85 #endif /* BCM_WARM_BOOT_SUPPORT_SW_DUMP */ 86 87 88 #if defined(BCM_TRIUMPH3_SUPPORT) && defined(INCLUDE_L3) 89 extern int _bcm_tr2_mim_egr_vxlt_sd_tag_actions(int unit, 90 bcm_mim_port_t *mim_port, 91 bcm_mim_vpn_config_t *vpn_info, 92 uint32 *evxlt_entry); 93 extern int _bcm_tr2_mim_match_trunk_add(int unit, bcm_trunk_t tgid, int vp); 94 extern int _bcm_tr2_mim_egr_vxlt_sd_tag_actions_delete( 95 int unit, uint32 *egr_vlan_xlate_entry); 96 97 extern int _bcm_tr3_mim_peer_port_config_add(int unit, 98 bcm_mim_port_t *mim_port, int vp, bcm_mim_vpn_t vpn); 99 extern int _bcm_tr_mim_match_trunk_delete(int unit, bcm_trunk_t tgid, int vp); 100 101 extern int _bcm_tr3_mim_peer_port_config_delete(int unit, int vp, 102 bcm_mim_vpn_t vpn); 103 extern int _bcm_tr3_mim_match_add(int unit, bcm_mim_port_t *mim_port, int vp); 104 extern int _bcm_tr3_mim_match_delete(int unit, int vp); 105 106 #endif /* BCM_TRIUMPH3_SUPPORT */ 107 108 #if defined(INCLUDE_L3) 109 extern int _bcm_esw_mim_port_source_vp_lag_set( 110 int unit, bcm_gport_t gport, int vp_lag_vp); 111 extern int _bcm_esw_mim_port_source_vp_lag_clear( 112 int unit, bcm_gport_t gport, int vp_lag_vp); 113 extern int _bcm_esw_mim_port_source_vp_lag_get( 114 int unit, bcm_gport_t gport, int *vp_lag_vp); 115 #ifdef BCM_WARM_BOOT_SUPPORT 116 extern int _bcm_esw_mim_sync(int unit); 117 #endif /* BCM_WARM_BOOT_SUPPORT */ 118 119 #endif /* INCLUDE_L3 */ 120 121 #endif /* !_BCM_INT_MIM_H */