alloc_mngr_lif.h (6361B)
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 * File: alloc_mngr_lif.h 8 * Purpose: Resource allocation for lif. 9 */ 10 11 #ifndef INCLUDE_ALLOC_MNGR_LIF_H 12 #define INCLUDE_ALLOC_MNGR_LIF_H 13 14 #include <bcm_int/dpp/alloc_mngr_shr.h> 15 16 /* Sync LIF start definiations { */ 17 #define _BCM_DPP_AM_SYNC_LIF_INGRESS (1 << 0) 18 #define _BCM_DPP_AM_SYNC_LIF_EGRESS (1 << 1) 19 20 #define _BCM_DPP_AM_INGRESS_LIF_NOF_ENTRIES_PER_BANK (SOC_IS_JERICHO(unit) ? (8*1024) : (4*1024)) 21 #define _BCM_DPP_AM_INGRESS_LIF_BANK_LOW_ID(bank_id) (bank_id*_BCM_DPP_AM_INGRESS_LIF_NOF_ENTRIES_PER_BANK) 22 23 #define _BCM_DPP_AM_EGRESS_MAP_ENCAP_INTPRI_COLOR_NOF_ENTRIES (SOC_IS_JERICHO(unit) ? (16) : (0)) /* Num of entries of the COS profile table */ 24 25 #define _BCM_DPP_AM_EGRESS_ENCAP_NOF_ENTRIES_PER_BANK (SOC_IS_JERICHO(unit) ? (8*1024) : (4*1024)) 26 #define _BCM_DPP_AM_EGRESS_ENCAP_BANK_LOW_ID(bank_id) (bank_id*_BCM_DPP_AM_EGRESS_ENCAP_NOF_ENTRIES_PER_BANK) 27 28 #define _BCM_DPP_AM_INGRESS_LIF_BITMAP_PHASE_SET(bitmap_phase,phase_id) \ 29 (SHR_BITSET(bitmap_phase,phase_id)) 30 31 typedef enum _dpp_am_ingress_lif_phase_e{ 32 _dpp_am_ingress_lif_phase_vt_lookup_res_0 = 0, 33 _dpp_am_ingress_lif_phase_vt_lookup_res_1, 34 _dpp_am_ingress_lif_phase_tt_lookup_res_0, 35 _dpp_am_ingress_lif_phase_tt_lookup_res_1, 36 _dpp_am_ingress_lif_nof_phases 37 } _dpp_am_ingress_lif_phase_t; 38 39 40 typedef enum bcm_dpp_am_egress_encap_app_e{ 41 bcm_dpp_am_egress_encap_app_pwe=0, 42 bcm_dpp_am_egress_encap_app_mpls_tunnel, 43 bcm_dpp_am_egress_encap_app_second_mpls_tunnel, 44 bcm_dpp_am_egress_encap_app_out_ac, 45 bcm_dpp_am_egress_encap_app_3_tags_data, 46 bcm_dpp_am_egress_encap_app_3_tags_out_ac, 47 bcm_dpp_am_egress_encap_app_linker_layer, /* ROO Linker-layer */ 48 bcm_dpp_am_egress_encap_app_ip_tunnel_roo, /* ROO ip tunnel */ 49 bcm_dpp_am_egress_encap_app_trill_roo , /* ROO Trill */ 50 bcm_dpp_am_egress_encap_app_l2_encap , /* l2 encap for external CPU */ 51 bcm_dpp_am_egress_encap_app_out_big_ac, 52 bcm_dpp_am_egress_encap_app_evpn, 53 bcm_dpp_am_egress_encap_app_native_arp, 54 bcm_dpp_am_egress_encap_app_native_ac, 55 bcm_dpp_am_egress_encap_app_third_mpls_tunnel,/*on QAX, mpls tunnel using access stage 2*/ 56 bcm_dpp_am_egress_encap_app_phase_3_out_ac, /* Store out ac at phase 3 intead of 4 */ 57 bcm_dpp_am_egress_encap_app_ip_tunnel_l2tp, /* L2TP ip tunnel */ 58 bcm_dpp_am_egress_encap_nof_app_types 59 } bcm_dpp_am_egress_encap_app_t; 60 61 typedef struct bcm_dpp_am_egress_encap_alloc_info_s { 62 _dpp_am_res_t pool_id; /* Indication on pool id */ 63 /* Indication needed on application in case pool id refers to more than one application */ 64 bcm_dpp_am_egress_encap_app_t application_type; 65 } bcm_dpp_am_egress_encap_alloc_info_t; 66 67 typedef enum bcm_dpp_am_ingress_lif_app_e{ 68 bcm_dpp_am_ingress_lif_app_ingress_ac=0, 69 bcm_dpp_am_ingress_lif_app_ingress_isid, 70 bcm_dpp_am_ingress_lif_app_mpls_term, 71 bcm_dpp_am_ingress_lif_app_mpls_term_indexed_1, 72 bcm_dpp_am_ingress_lif_app_mpls_term_indexed_2, 73 bcm_dpp_am_ingress_lif_app_mpls_term_indexed_3, 74 bcm_dpp_am_ingress_lif_app_mpls_term_indexed_1_2, 75 bcm_dpp_am_ingress_lif_app_mpls_term_indexed_1_3, 76 bcm_dpp_am_ingress_lif_app_mpls_frr_inrif_port_term_indexed_1, 77 bcm_dpp_am_ingress_lif_app_mpls_frr_inrif_port_term_indexed_3, 78 bcm_dpp_am_ingress_lif_app_mpls_frr_term, 79 bcm_dpp_am_ingress_lif_app_mpls_term_explicit_null, 80 bcm_dpp_am_ingress_lif_app_mpls_term_mldp, 81 bcm_dpp_am_ingress_lif_app_ip_term, 82 bcm_dpp_am_ingress_lif_app_trill_nick, 83 bcm_dpp_am_ingress_lif_app_vpn_ac, 84 bcm_dpp_am_ingress_lif_app_l2tp, 85 bcm_dpp_am_ingress_lif_nof_app_types 86 } bcm_dpp_am_ingress_lif_app_t; 87 88 typedef struct bcm_dpp_am_ingress_lif_alloc_info_s { 89 _dpp_am_res_t pool_id; /* Indication on pool id */ 90 /* Indication needed on application in case pool id refers to more than one application */ 91 bcm_dpp_am_ingress_lif_app_t application_type; 92 } bcm_dpp_am_ingress_lif_alloc_info_t; 93 94 typedef struct bcm_dpp_am_sync_lif_alloc_info_s { 95 uint32 sync_flags; 96 bcm_dpp_am_ingress_lif_alloc_info_t ingress_lif; 97 bcm_dpp_am_egress_encap_alloc_info_t egress_lif; 98 } bcm_dpp_am_sync_lif_alloc_info_t; 99 100 101 102 uint32 103 _bcm_dpp_am_egress_encap_alloc(int unit, bcm_dpp_am_egress_encap_alloc_info_t* allocation_info, uint32 flags, int count, int* object); 104 105 uint32 106 _bcm_dpp_am_egress_encap_alloc_align(int unit, bcm_dpp_am_egress_encap_alloc_info_t* allocation_info, uint32 flags, int align, int offset, int count, int* object); 107 108 uint32 109 _bcm_dpp_am_egress_encap_dealloc(int unit, bcm_dpp_am_egress_encap_alloc_info_t* allocation_info, int count, int object); 110 111 int 112 _bcm_dpp_am_egress_encap_is_allocated(int unit, bcm_dpp_am_egress_encap_alloc_info_t* allocation_info, int count, int object); 113 114 uint32 115 _bcm_dpp_am_ingress_lif_alloc(int unit, bcm_dpp_am_ingress_lif_alloc_info_t* allocation_info, uint32 flags, int count, int* object); 116 117 uint32 118 _bcm_dpp_am_ingress_lif_dealloc(int unit, bcm_dpp_am_ingress_lif_alloc_info_t* allocation_info, int count, int object); 119 120 int 121 _bcm_dpp_am_ingress_lif_is_allocated(int unit, bcm_dpp_am_ingress_lif_alloc_info_t* allocation_info, int count, int object); 122 123 uint32 124 _bcm_dpp_am_sync_lif_alloc(int unit, bcm_dpp_am_sync_lif_alloc_info_t* allocation_info, uint32 flags, int count, int* object); 125 126 uint32 127 _bcm_dpp_am_sync_lif_alloc_align(int unit, bcm_dpp_am_sync_lif_alloc_info_t* allocation_info, uint32 flags, int align, int offset, int count, int* object); 128 129 uint32 130 _bcm_dpp_am_sync_lif_dealloc(int unit, bcm_dpp_am_sync_lif_alloc_info_t* allocation_info, int count, int object); 131 132 uint32 133 _bcm_dpp_am_ingress_lif_init(int unit); 134 135 uint32 136 _bcm_dpp_am_ingress_lif_deinit(int unit); 137 138 uint32 139 _bcm_dpp_am_egress_encap_sw_state_init(int unit); 140 141 uint32 142 _bcm_dpp_am_egress_encap_init(int unit); 143 144 uint32 145 _bcm_dpp_am_egress_encap_deinit(int unit); 146 147 uint32 148 _bcm_dpp_am_egress_encap_alloc_mngr_pool_id_to_access_phase(int unit, bcm_dpp_am_egress_encap_alloc_info_t* allocation_info, SOC_PPC_EG_ENCAP_ACCESS_PHASE *phase_number); 149 150 uint32 151 _bcm_dpp_am_sync_lif_init(int unit); 152 153 uint32 154 _bcm_dpp_am_sync_lif_deinit(int unit); 155 156 157 #endif /*INCLUDE_ALLOC_MNGR_LIF_H*/ 158