trunk.h (27983B)
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 TRUNK definitions internal to the BCM library. 8 */ 9 10 #ifndef _BCM_INT_TRUNK_H 11 #define _BCM_INT_TRUNK_H 12 13 #include <bcm/trunk.h> 14 #include <bcm/switch.h> 15 16 /* 6-bit field, MSB indicates trunk */ 17 #define BCM_TGID_TRUNK_INDICATOR(unit) (1 << SOC_TRUNK_BIT_POS(unit)) 18 #define BCM_TGID_PORT_TRUNK_MASK(unit) ((1 << SOC_TRUNK_BIT_POS(unit)) - 1) 19 #define BCM_TGID_PORT_TRUNK_MASK_HI(unit) (0x3 << SOC_TRUNK_BIT_POS(unit)) 20 #define BCM_TGID_PORT_TRUNK_MASK_HI_SHIFT(unit) (SOC_TRUNK_BIT_POS(unit)) 21 22 #define BCM_TRUNK_TO_MODIDf(unit, tid) \ 23 (((tid) & BCM_TGID_PORT_TRUNK_MASK_HI(unit)) >> BCM_TGID_PORT_TRUNK_MASK_HI_SHIFT(unit)) 24 #define BCM_TRUNK_TO_TGIDf(unit, tid) \ 25 (((tid) & BCM_TGID_PORT_TRUNK_MASK(unit)) | BCM_TGID_TRUNK_INDICATOR(unit)) 26 #define BCM_MODIDf_TGIDf_TO_TRUNK(unit,mod,tgid) \ 27 ((((mod)<<BCM_TGID_PORT_TRUNK_MASK_HI_SHIFT(unit))&BCM_TGID_PORT_TRUNK_MASK_HI(unit)) | \ 28 ((tgid) & BCM_TGID_PORT_TRUNK_MASK(unit))) 29 30 /* 31 * Define: 32 * TRUNK_CHK_TGID32 33 * Purpose: 34 * Causes a routine to return BCM_E_PARAM if the specified 35 * trunk group ID is out of range 0-31. 36 */ 37 38 #define TRUNK_CHK_TGID32(unit, tgid) do { \ 39 if (tgid < 0 || tgid > 31) return BCM_E_PARAM; \ 40 } while (0); 41 42 /* 43 * Define: 44 * TRUNK_CHK_TGID128 45 * Purpose: 46 * Causes a routine to return BCM_E_PARAM if the specified 47 * trunk group ID is out of range 0-127. 48 */ 49 50 #define TRUNK_CHK_TGID128(unit, tgid) do { \ 51 if (tgid < 0 || tgid > 127) return BCM_E_PARAM; \ 52 } while (0); 53 54 extern soc_mem_t _bcm_esw_trunk_tgid_extended_mem_get(int unit); 55 56 /* 57 * Define: 58 * TRUNK_CHK_TGID_EXTENDED 59 * Purpose: 60 * Causes a routine to return BCM_E_PARAM if the specified 61 * trunk group ID is out of range on this unit. 62 */ 63 #define TRUNK_CHK_TGID_EXTENDED(unit, tgid) \ 64 do { \ 65 soc_mem_t trunk_mem = _bcm_esw_trunk_tgid_extended_mem_get(unit); \ 66 if (tgid < 0 || tgid > (soc_mem_index_max(unit, trunk_mem))) { \ 67 return (BCM_E_PARAM); \ 68 } \ 69 } while (0); 70 71 /* 72 * Accesses to the trunk hardware tables and software state 73 * are made atomic using the TTR memory table lock. The TTR lock 74 * protects ALL related hardware tables, even if the particular chip 75 * doesn't have a TTR table. 76 */ 77 #define TRUNK_LOCK(unit) _bcm_esw_trunk_lock(unit) 78 #define TRUNK_UNLOCK(unit) _bcm_esw_trunk_unlock(unit) 79 80 #define VPLAG_LOCK(unit) _bcm_esw_vplag_lock(unit) 81 #define VPLAG_UNLOCK(unit) _bcm_esw_vplag_unlock(unit) 82 83 typedef struct trunk_private_s { 84 int tid; /* trunk group ID */ 85 int in_use; 86 int psc; /* port spec criterion */ 87 #ifdef BCM_APACHE_SUPPORT 88 int rr_lag_select; /* Round Robin Counter select */ 89 #endif /* BCM_APACHE_SUPPORT */ 90 int ipmc_psc; /* IPMC port spec criterion */ 91 int rtag; /* hardware rtag value */ 92 uint32 flags; /* BCM_TRUNK_FLAG_FAILOVER_xxx */ 93 int dlf_index_spec; /* requested by user */ 94 int dlf_index_used; /* actually used */ 95 int dlf_port_used; /* actually used or -1 */ 96 int mc_index_spec; /* requested by user */ 97 int mc_index_used; /* actually used */ 98 int mc_port_used; /* actually used or -1 */ 99 int ipmc_index_spec; /* requested by user */ 100 int ipmc_index_used; /* actually used */ 101 int ipmc_port_used; /* actually used or -1 */ 102 uint32 dynamic_size; /* number of flows for 103 dynamic load balancing */ 104 uint32 dynamic_age; /* Inactivity duration, in usec */ 105 uint32 dynamic_load_exponent; /* The exponent used in the 106 exponentially weighted moving 107 average calculation of historical 108 member load. */ 109 uint32 dynamic_expected_load_exponent; /* The exponent used in the 110 exponentially weighted moving 111 average calculation of historical 112 expected member load. */ 113 int vlan_vp_count; /* number of VLAN virtual ports using 114 this trunk */ 115 } trunk_private_t; 116 117 /* The following structure is very similar to bcm_trunk_add_info_t, 118 * except that member_flags, tp, and tm are pointers to dynamically 119 * allocated arrays instead of fixed size arrays. 120 */ 121 typedef struct _esw_trunk_add_info_s { 122 uint32 flags; /* BCM_TRUNK_FLAG_xxx. */ 123 int num_ports; /* Number of ports in the trunk group. */ 124 int psc; /* Port selection criteria. */ 125 int ipmc_psc; /* Port selection criteria for software 126 IPMC trunk resolution. */ 127 int dlf_index; /* DLF/broadcast port for trunk group. */ 128 int mc_index; /* Multicast port for trunk group. */ 129 int ipmc_index; /* IPMC port for trunk group. */ 130 uint32 *member_flags; /* BCM_TRUNK_MEMBER_xxx */ 131 bcm_port_t *tp; /* Ports in trunk. */ 132 bcm_module_t *tm; /* Modules per port. */ 133 int *dynamic_scaling_factor; /* Per member DLB threshold scaling 134 factor */ 135 int *dynamic_load_weight; /* Weight of load in determining DLB 136 member quality */ 137 int *dynamic_queue_size_weight; /* Weight of Queue size in determining DLB 138 member quality */ 139 uint32 dynamic_size; /* Number of flows for dynamic load 140 balancing */ 141 uint32 dynamic_age; /* Inactivity duration, in usec */ 142 uint32 dynamic_load_exponent; /* The exponent used in the 143 exponentially weighted moving average 144 calculation of historical member 145 load. */ 146 uint32 dynamic_expected_load_exponent; /* The exponent used in the 147 exponentially weighted moving average 148 calculation of historical expected 149 member load. */ 150 } _esw_trunk_add_info_t; 151 152 #define BCM_XGS3_TRUNK_MAX_PORTCNT 16 153 /* Max # of ports in a front-panel or fabric trunk group on devices before Trident. */ 154 #define BCM_SWITCH_TRUNK_MAX_PORTCNT 8 155 /* Max # of ports in a front-panel trunk group on devices before Trident */ 156 157 #define TRUNK_MEMBER_OP_SET 0 158 #define TRUNK_MEMBER_OP_ADD 1 159 #define TRUNK_MEMBER_OP_DELETE 2 160 161 #define TRUNK_BLOCK_MASK_TYPE_IPMC 0 162 #define TRUNK_BLOCK_MASK_TYPE_L2MC 1 163 #define TRUNK_BLOCK_MASK_TYPE_BCAST 2 164 #define TRUNK_BLOCK_MASK_TYPE_DLF 3 165 166 extern int _bcm_esw_trunk_gport_array_resolve(int unit, int fabric_trunk, 167 int count, 168 bcm_gport_t *port_array, 169 bcm_port_t *port_list, 170 bcm_module_t *modid_list); 171 172 extern int _bcm_esw_trunk_gport_construct(int unit, int fabric_trunk, 173 int count, 174 bcm_port_t *port_list, 175 bcm_module_t *modid_list, 176 bcm_gport_t *port_array); 177 178 extern int _bcm_esw_trunk_port_property_get(int unit, 179 bcm_module_t modid, 180 bcm_port_t port, 181 bcm_trunk_t *tid); 182 183 extern int _bcm_esw_trunk_rtag_get(int unit, bcm_trunk_t tid, int *rtag); 184 185 extern int _bcm_esw_trunk_active_member_get(int unit, bcm_trunk_t tid, 186 bcm_trunk_info_t *trunk_info, 187 int member_max, 188 bcm_trunk_member_t *active_member_array, 189 int *active_member_count); 190 extern int _bcm_nuc_tpbm_get(int unit, 191 int num_ports, 192 bcm_module_t tm[BCM_TRUNK_MAX_PORTCNT], 193 uint32 *nuc_tpbm); 194 195 #if defined (BCM_XGS3_SWITCH_SUPPORT) 196 #define _BCM_XGS3_TRUNK_MOD_PORT_MAP_IDX_COUNT(_unit_) \ 197 (SOC_MAX_NUM_PORTS * ((SOC_MODID_MAX(_unit_) > 0) ? \ 198 (1 + SOC_MODID_MAX(_unit_)) : 1)) 199 extern int _bcm_xgs3_trunk_mod_port_map_init(int unit); 200 extern int _bcm_xgs3_trunk_mod_port_map_deinit(int unit); 201 #ifdef BCM_HURRICANE3_SUPPORT 202 extern int _bcm_xgs3_trunk_mod_port_map_reinit(int unit, 203 bcm_module_t mod, int base_index,int num_ports); 204 #endif 205 extern int _bcm_xgs3_trunk_swfailover_init(int unit); 206 extern void _bcm_xgs3_trunk_swfailover_detach(int unit); 207 208 extern int _bcm_xgs3_trunk_member_init(int unit); 209 extern void _bcm_xgs3_trunk_member_detach(int unit); 210 211 extern int bcm_xgs3_trunk_modify(int, bcm_trunk_t, 212 bcm_trunk_info_t *, int, bcm_trunk_member_t *, 213 trunk_private_t *, int, bcm_trunk_member_t *); 214 extern int bcm_xgs3_trunk_get(int, bcm_trunk_t, 215 bcm_trunk_info_t *, int, bcm_trunk_member_t *, 216 int *, trunk_private_t *); 217 extern int bcm_xgs3_trunk_destroy(int, bcm_trunk_t, trunk_private_t *); 218 extern int bcm_xgs3_trunk_mcast_join(int, bcm_trunk_t, bcm_vlan_t, 219 bcm_mac_t, trunk_private_t *); 220 extern int _bcm_xgs3_trunk_fabric_find(int unit, 221 bcm_port_t port, 222 bcm_trunk_t *tid); 223 extern int _bcm_xgs3_trunk_get_port_property(int unit, 224 bcm_module_t mod, 225 bcm_port_t port, 226 bcm_trunk_t *tid); 227 228 extern int _bcm_xgs3_trunk_hwfailover_init(int unit); 229 extern void _bcm_xgs3_trunk_hwfailover_detach(int unit); 230 231 extern int _bcm_xgs3_trunk_hwfailover_set(int unit, bcm_trunk_t tid, 232 int hg_trunk, 233 bcm_port_t port, 234 bcm_module_t modid, 235 int psc, 236 uint32 flags, int count, 237 bcm_port_t *ftp, 238 bcm_module_t *ftm); 239 extern int _bcm_xgs3_trunk_hwfailover_get(int unit, bcm_trunk_t tid, 240 int hg_trunk, 241 bcm_port_t port, 242 bcm_module_t modid, 243 int *psc, 244 uint32 *flags, int array_size, 245 bcm_port_t *ftp, 246 bcm_module_t *ftm, 247 int *array_count); 248 extern int _bcm_xgs3_trunk_property_migrate(int unit, 249 int num_leaving, bcm_gport_t *leaving_arr, 250 int num_staying, bcm_gport_t *staying_arr, 251 int num_joining, bcm_gport_t *joining_arr); 252 253 #ifdef BCM_TRIDENT_SUPPORT 254 extern int bcm_trident_trunk_mbr_zero_rsvd[BCM_MAX_NUM_UNITS]; 255 extern int _bcm_trident_trunk_init(int unit); 256 void _bcm_trident_trunk_deinit(int unit); 257 extern int _bcm_trident_trunk_override_mcast_set(int unit, 258 bcm_trunk_t hgtid, 259 int idx, 260 int enable); 261 extern int _bcm_trident_trunk_override_mcast_get(int unit, 262 bcm_trunk_t hgtid, 263 int idx, 264 int *enable); 265 extern int _bcm_trident_trunk_override_ipmc_set(int unit, 266 bcm_trunk_t hgtid, 267 int idx, 268 int enable); 269 extern int _bcm_trident_trunk_override_ipmc_get(int unit, 270 bcm_trunk_t hgtid, 271 int idx, 272 int *enable); 273 extern int _bcm_trident_trunk_override_vlan_set(int unit, 274 bcm_trunk_t hgtid, 275 int idx, 276 int enable); 277 extern int _bcm_trident_trunk_override_vlan_get(int unit, 278 bcm_trunk_t hgtid, 279 int idx, 280 int *enable); 281 extern int _bcm_trident_trunk_fabric_find(int unit, 282 bcm_port_t port, 283 bcm_trunk_t *tid); 284 extern int _bcm_trident_trunk_get_port_property(int unit, bcm_module_t mod, 285 bcm_port_t port, int *tid); 286 extern int _bcm_trident_trunk_hwfailover_set(int unit, 287 bcm_trunk_t tid, int hg_trunk, 288 bcm_port_t port, bcm_module_t modid, 289 int psc, uint32 flags, int count, 290 bcm_port_t *ftp, bcm_module_t *ftm); 291 extern int _bcm_trident_trunk_hwfailover_get(int unit, 292 bcm_trunk_t tid, int hg_trunk, 293 bcm_port_t port, bcm_module_t modid, 294 int *psc, uint32 *flags, int array_size, 295 bcm_port_t *ftp, bcm_module_t *ftm, 296 int *array_count); 297 extern int _bcm_trident_hg_dlb_config_set(int unit, 298 bcm_switch_control_t type, 299 int arg); 300 extern int _bcm_trident_hg_dlb_config_get(int unit, 301 bcm_switch_control_t type, 302 int *arg); 303 extern int bcm_trident_hg_dlb_member_status_set(int unit, bcm_port_t port, 304 int status); 305 extern int bcm_trident_hg_dlb_member_status_get(int unit, bcm_port_t port, 306 int *status); 307 #endif /* BCM_TRIDENT_SUPPORT */ 308 309 #ifdef BCM_TRIUMPH3_SUPPORT 310 extern void bcm_tr3_lag_dlb_deinit(int unit); 311 extern int bcm_tr3_lag_dlb_init(int unit); 312 extern int bcm_tr3_lag_dlb_free_resource(int unit, int tid); 313 extern int bcm_tr3_lag_dlb_set(int unit, int tid, 314 _esw_trunk_add_info_t *add_info, 315 int num_dlb_ports, int *mod_array, int *port_array, 316 int *scaling_factor_array, int *load_weight_array); 317 extern int bcm_tr3_lag_dlb_member_attr_get(int unit, 318 bcm_module_t mod, bcm_port_t port, 319 int *scaling_factor, int *load_weight); 320 extern int bcm_tr3_lag_dlb_member_status_set(int unit, bcm_module_t mod, 321 bcm_port_t port, int status); 322 extern int bcm_tr3_lag_dlb_member_status_get(int unit, bcm_module_t mod, 323 bcm_port_t port, int *status); 324 extern int bcm_tr3_lag_dlb_ethertype_set(int unit, uint32 flags, 325 int ethertype_count, int *ethertype_array); 326 extern int bcm_tr3_lag_dlb_ethertype_get(int unit, uint32 *flags, 327 int ethertype_max, int *ethertype_array, int *ethertype_count); 328 extern int bcm_tr3_lag_dlb_config_set(int unit, bcm_switch_control_t type, 329 int arg); 330 extern int bcm_tr3_lag_dlb_config_get(int unit, bcm_switch_control_t type, 331 int *arg); 332 extern int bcm_tr3_lag_dlb_dynamic_size_encode(int dynamic_size, 333 int *encoded_value); 334 335 extern int bcm_tr3_hg_dlb_ethertype_set(int unit, uint32 flags, 336 int ethertype_count, int *ethertype_array); 337 extern int bcm_tr3_hg_dlb_ethertype_get(int unit, uint32 *flags, 338 int ethertype_max, int *ethertype_array, int *ethertype_count); 339 #endif /* BCM_TRIUMPH3_SUPPORT */ 340 341 #if defined(BCM_TOMAHAWK2_SUPPORT) || defined(BCM_TRIDENT3_SUPPORT) 342 extern void bcm_th2_hgt_lag_dlb_deinit(int unit); 343 extern int bcm_th2_hgt_lag_dlb_init(int unit); 344 extern int bcm_th2_hgt_lag_dlb_free_resource(int unit, int tid, int hgt); 345 extern int bcm_th2_hgt_lag_dlb_set(int unit, int tid, int hgt, 346 _esw_trunk_add_info_t *add_info, 347 int num_dlb_ports, 348 int *mod_array, 349 int *port_array, 350 int *scaling_factor_array, 351 int *load_weight_array, 352 int *qsize_weight_array); 353 extern int bcm_th2_hgt_lag_dlb_member_attr_get(int unit, 354 bcm_port_t port, 355 int *scaling_factor, 356 int *load_weight, 357 int *qsize_weight); 358 extern int bcm_th2_hgt_lag_dlb_member_status_set(int unit, 359 bcm_port_t port, 360 int status); 361 extern int bcm_th2_hgt_lag_dlb_member_status_get(int unit, 362 bcm_port_t port, 363 int *status); 364 extern int bcm_th2_hgt_lag_dlb_ethertype_set(int unit, 365 uint32 flags, 366 int ethertype_count, 367 int *ethertype_array); 368 extern int bcm_th2_hgt_lag_dlb_ethertype_get(int unit, 369 uint32 *flags, 370 int ethertype_max, 371 int *ethertype_array, 372 int *ethertype_count); 373 extern int bcm_th2_hgt_lag_dlb_config_set(int unit, 374 bcm_switch_control_t type, 375 int arg); 376 extern int bcm_th2_hgt_lag_dlb_config_get(int unit, 377 bcm_switch_control_t type, 378 int *arg); 379 extern int bcm_th2_hgt_lag_dlb_dynamic_size_encode(int dynamic_size, 380 int *encoded_value); 381 382 #endif /* BCM_TOMAHAWK2_SUPPORT || BCM_TRIDENT3_SUPPORT*/ 383 384 #endif /* BCM_XGS3_SWITCH_SUPPORT */ 385 386 #ifdef BCM_WARM_BOOT_SUPPORT 387 extern int _bcm_trunk_reinit(int unit); 388 #if defined (BCM_XGS3_SWITCH_SUPPORT) 389 extern int _xgs3_trunk_reinit(int unit, int ngroups_fp, trunk_private_t *); 390 extern int _xgs3_trunk_fabric_reinit(int unit, int min_tid, int max_tid, 391 trunk_private_t *); 392 393 #if defined(BCM_TRX_SUPPORT) || defined(BCM_BRADLEY_SUPPORT) 394 extern void _bcm_xgs3_hw_failover_flags_set(int unit, bcm_trunk_t tid, 395 int port_index, int hg_trunk, 396 uint8 flags); 397 extern uint8 _bcm_xgs3_hw_failover_flags_get(int unit, bcm_trunk_t tid, 398 int port_index, int hg_trunk); 399 #endif /* BCM_TRX_SUPPORT || BCM_BRADLEY_SUPPORT */ 400 401 extern void _bcm_xgs3_trunk_member_info_set(int unit, bcm_trunk_t tid, 402 uint8 num_ports, 403 uint16 modport[BCM_TRUNK_MAX_PORTCNT], 404 uint32 member_flags[BCM_TRUNK_MAX_PORTCNT]); 405 extern void _bcm_xgs3_trunk_member_info_get(int unit, bcm_trunk_t tid, 406 uint8 *num_ports, 407 uint16 modport[BCM_TRUNK_MAX_PORTCNT], 408 uint32 member_flags[BCM_TRUNK_MAX_PORTCNT]); 409 410 #ifdef BCM_TRIDENT_SUPPORT 411 extern int _bcm_trident_trunk_mod_port_map_reinit(int unit, bcm_module_t mod, 412 int base_index, int num_ports); 413 extern int _bcm_trident_trunk_lag_reinit(int unit, int ngroups_fp, 414 trunk_private_t *); 415 extern int _bcm_trident_trunk_fabric_reinit(int unit, int min_tid, int max_tid, 416 trunk_private_t *); 417 extern void _bcm_trident_hw_failover_num_ports_set(int unit, bcm_trunk_t tid, 418 int hg_trunk, uint16 num_ports); 419 extern uint16 _bcm_trident_hw_failover_num_ports_get(int unit, bcm_trunk_t tid, 420 int hg_trunk); 421 extern int _bcm_trident_hw_failover_flags_set(int unit, bcm_trunk_t tid, 422 int port_index, int hg_trunk, 423 uint8 flags); 424 extern uint8 _bcm_trident_hw_failover_flags_get(int unit, bcm_trunk_t tid, 425 int port_index, int hg_trunk); 426 extern int _bcm_trident_trunk_member_info_set(int unit, bcm_trunk_t tid, 427 uint16 num_ports, 428 uint16 *modport, 429 uint32 *member_flags); 430 extern int _bcm_trident_trunk_member_info_get(int unit, bcm_trunk_t tid, 431 uint16 array_size, 432 uint16 *modport, 433 uint32 *member_flags, 434 uint16 *num_ports); 435 extern int bcm_trident_hg_dlb_wb_alloc_size_get(int unit, int *size); 436 extern int bcm_trident_hg_dlb_sync(int unit, uint8 **scache_ptr); 437 extern int bcm_trident_hg_dlb_scache_recover(int unit, uint8 **scache_ptr); 438 #endif /* BCM_TRIDENT_SUPPORT */ 439 440 #ifdef BCM_TRIUMPH3_SUPPORT 441 extern int bcm_tr3_lag_dlb_wb_alloc_size_get(int unit, int *size); 442 extern int bcm_tr3_lag_dlb_sync(int unit, uint8 **scache_ptr); 443 extern int bcm_tr3_lag_dlb_scache_recover(int unit, uint8 **scache_ptr); 444 extern int bcm_tr3_lag_dlb_member_recover(int unit); 445 extern int bcm_tr3_lag_dlb_group_recover(int unit, bcm_trunk_t tid, 446 trunk_private_t *trunk_info); 447 extern int bcm_tr3_lag_dlb_quality_parameters_recover(int unit); 448 #endif /* BCM_TRIUMPH3_SUPPORT */ 449 450 #if defined(BCM_TOMAHAWK2_SUPPORT) || defined (BCM_TRIDENT3_SUPPORT) 451 extern int bcm_th2_hgt_lag_dlb_wb_alloc_size_get(int unit, int *size); 452 extern int bcm_th2_hgt_lag_dlb_sync(int unit, uint8 **scache_ptr); 453 extern int bcm_th2_hgt_lag_dlb_scache_recover(int unit, uint8 **scache_ptr); 454 extern int bcm_th2_hgt_lag_dlb_group_recover(int unit, bcm_trunk_t tid, int hgt, 455 trunk_private_t *trunk_info); 456 extern int bcm_th2_hgt_lag_dlb_quality_parameters_recover(int unit); 457 #endif /* BCM_TOMAHAWK2_SUPPORT */ 458 #if defined(BCM_TOMAHAWK3_SUPPORT) 459 extern uint16 _bcm_th3_trunk_hwfailover_num_ports_get(int unit, bcm_trunk_t tid); 460 extern void _bcm_th3_trunk_hwfailover_num_ports_set(int unit, bcm_trunk_t tid, uint16 num_ports); 461 extern uint8 _bcm_th3_trunk_hwfailover_flags_get(int unit, bcm_trunk_t tid, int port); 462 extern void _bcm_th3_trunk_hwfailover_flags_set(int unit, bcm_trunk_t tid, int port, uint8 flags); 463 extern int _bcm_th3_trunk_member_info_get(int unit, bcm_trunk_t tid, 464 _esw_trunk_add_info_t *t_data, trunk_private_t *t_info); 465 extern int _bcm_th3_trunk_member_info_set(int unit, bcm_trunk_t tid, 466 uint16 num_ports, uint8 *member_port, uint32 *member_flags); 467 extern int _bcm_th3_trunk_lag_reinit(int unit, int ngroups_fp, trunk_private_t *t_info); 468 #endif /* BCM_TOMAHAWK3_SUPPORT */ 469 #endif /* BCM_XGS3_SWITCH_SUPPORT */ 470 #else 471 #define _bcm_trunk_reinit(unit) (BCM_E_NONE) 472 #if defined (BCM_XGS3_SWITCH_SUPPORT) 473 #define _xgs3_trunk_reinit(unit, ng_fp, tp) (BCM_E_UNAVAIL) 474 #define _xgs3_trunk_fabric_reinit(unit, min, max, tp) (BCM_E_UNAVAIL) 475 #endif /* BCM_XGS3_SWITCH_SUPPORT */ 476 #endif /* BCM_WARM_BOOT_SUPPORT */ 477 478 extern int _bcm_esw_trunk_lock(int unit); 479 extern int _bcm_esw_trunk_unlock(int unit); 480 extern int _bcm_esw_trunk_group_num(int unit); 481 482 extern int _bcm_esw_vplag_lock(int unit); 483 extern int _bcm_esw_vplag_unlock(int unit); 484 485 #ifdef BCM_WARM_BOOT_SUPPORT 486 extern int _bcm_esw_trunk_sync(int unit); 487 #endif /* BCM_WARM_BOOT_SUPPORT */ 488 489 #ifndef BCM_SW_STATE_DUMP_DISABLE 490 extern void _bcm_trunk_sw_dump(int unit); 491 #if defined(BCM_XGS3_SWITCH_SUPPORT) 492 extern void _bcm_xgs3_trunk_sw_dump(int unit); 493 494 #ifdef BCM_TRIDENT_SUPPORT 495 extern void _bcm_trident_trunk_sw_dump(int unit); 496 #endif /* BCM_TRIDENT_SUPPORT */ 497 498 #ifdef BCM_TRIUMPH3_SUPPORT 499 extern void bcm_tr3_lag_dlb_sw_dump(int unit); 500 #endif /* BCM_TRIUMPH3_SUPPORT */ 501 502 #if defined(BCM_TOMAHAWK2_SUPPORT) || defined(BCM_TRIDENT3_SUPPORT) 503 extern void bcm_th2_hgt_lag_dlb_sw_dump(int unit); 504 #endif /* BCM_TOMAHAWK2_SUPPORT */ 505 506 #endif /* BCM_XGS3_SWITCH_SUPPORT */ 507 508 #endif /* BCM_SW_STATE_DUMP_DISABLE */ 509 510 extern int _bcm_trunk_id_validate(int unit, bcm_trunk_t tid); 511 extern int _bcm_esw_trunk_local_members_get(int unit, bcm_trunk_t trunk_id, 512 int local_member_max, 513 bcm_port_t *local_member_array, 514 int *local_member_count); 515 extern int _bcm_esw_trunk_chip_info_vp_resource_get(int unit, int *vp_id_min, 516 int *vp_id_max, 517 int *vp_ports_max); 518 extern int _bcm_esw_trunk_id_is_vp_lag(int unit, bcm_trunk_t tid, 519 int *tid_is_vp_lag); 520 extern int _bcm_esw_trunk_tid_to_vp_lag_vp(int unit, bcm_trunk_t tid, 521 int *vp_lag_vp); 522 extern int _bcm_esw_trunk_vp_lag_vp_to_tid(int unit, int vp_lag_vp, 523 bcm_trunk_t *tid); 524 extern int _bcm_esw_trunk_match_multi_get( 525 int unit, bcm_trunk_t tid, int size, 526 bcm_port_match_info_t *match_array, int *count); 527 extern trunk_private_t* _bcm_esw_trunk_info_get(int unit, int tid); 528 529 #ifdef BCM_TOMAHAWK3_SUPPORT 530 extern int _bcm_th3_trunk_init(int unit); 531 extern void _bcm_th3_trunk_deinit(int unit); 532 extern int _bcm_th3_trunk_port_map_init(int unit); 533 extern int _bcm_th3_trunk_port_map_deinit(int unit); 534 extern int bcm_th3_trunk_destroy(int unit, bcm_trunk_t tid, 535 trunk_private_t *t_info); 536 extern int _bcm_th3_trunk_hwfailover_set(int unit, 537 bcm_trunk_t tid, bcm_port_t port, 538 int psc, uint32 flags, int count, 539 bcm_port_t *ftp); 540 extern int _bcm_th3_trunk_hwfailover_get(int unit, bcm_trunk_t tid, 541 bcm_port_t port, int *psc, uint32 *flags, 542 int array_size, bcm_port_t *ftp, int *array_count); 543 extern int _bcm_th3_trunk_get_port_property(int unit, 544 bcm_port_t port, int *tid); 545 #endif 546 547 #if defined(BCM_CHANNELIZED_SWITCHING_SUPPORT) 548 extern int _bcm_esw_trunk_local_member_subport_get(int unit, bcm_trunk_t trunk_id, 549 int local_member_max, 550 bcm_port_t *local_member_array, 551 int *local_member_count); 552 #endif 553 554 #endif /* !_BCM_INT_TRUNK_H */