trunk.h (27431B)
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-2019 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 } trunk_private_t; 114 115 /* The following structure is very similar to bcm_trunk_add_info_t, 116 * except that member_flags, tp, and tm are pointers to dynamically 117 * allocated arrays instead of fixed size arrays. 118 */ 119 typedef struct _esw_trunk_add_info_s { 120 uint32 flags; /* BCM_TRUNK_FLAG_xxx. */ 121 int num_ports; /* Number of ports in the trunk group. */ 122 int psc; /* Port selection criteria. */ 123 int ipmc_psc; /* Port selection criteria for software 124 IPMC trunk resolution. */ 125 int dlf_index; /* DLF/broadcast port for trunk group. */ 126 int mc_index; /* Multicast port for trunk group. */ 127 int ipmc_index; /* IPMC port for trunk group. */ 128 uint32 *member_flags; /* BCM_TRUNK_MEMBER_xxx */ 129 bcm_port_t *tp; /* Ports in trunk. */ 130 bcm_module_t *tm; /* Modules per port. */ 131 int *dynamic_scaling_factor; /* Per member DLB threshold scaling 132 factor */ 133 int *dynamic_load_weight; /* Weight of load in determining DLB 134 member quality */ 135 int *dynamic_queue_size_weight; /* Weight of Queue size in determining DLB 136 member quality */ 137 uint32 dynamic_size; /* Number of flows for dynamic load 138 balancing */ 139 uint32 dynamic_age; /* Inactivity duration, in usec */ 140 uint32 dynamic_load_exponent; /* The exponent used in the 141 exponentially weighted moving average 142 calculation of historical member 143 load. */ 144 uint32 dynamic_expected_load_exponent; /* The exponent used in the 145 exponentially weighted moving average 146 calculation of historical expected 147 member load. */ 148 } _esw_trunk_add_info_t; 149 150 #define BCM_XGS3_TRUNK_MAX_PORTCNT 16 151 /* Max # of ports in a front-panel or fabric trunk group on devices before Trident. */ 152 #define BCM_SWITCH_TRUNK_MAX_PORTCNT 8 153 /* Max # of ports in a front-panel trunk group on devices before Trident */ 154 155 #define TRUNK_MEMBER_OP_SET 0 156 #define TRUNK_MEMBER_OP_ADD 1 157 #define TRUNK_MEMBER_OP_DELETE 2 158 159 #define TRUNK_BLOCK_MASK_TYPE_IPMC 0 160 #define TRUNK_BLOCK_MASK_TYPE_L2MC 1 161 #define TRUNK_BLOCK_MASK_TYPE_BCAST 2 162 #define TRUNK_BLOCK_MASK_TYPE_DLF 3 163 164 extern int _bcm_esw_trunk_gport_array_resolve(int unit, int fabric_trunk, 165 int count, 166 bcm_gport_t *port_array, 167 bcm_port_t *port_list, 168 bcm_module_t *modid_list); 169 170 extern int _bcm_esw_trunk_gport_construct(int unit, int fabric_trunk, 171 int count, 172 bcm_port_t *port_list, 173 bcm_module_t *modid_list, 174 bcm_gport_t *port_array); 175 176 extern int _bcm_esw_trunk_port_property_get(int unit, 177 bcm_module_t modid, 178 bcm_port_t port, 179 bcm_trunk_t *tid); 180 181 extern int _bcm_esw_trunk_rtag_get(int unit, bcm_trunk_t tid, int *rtag); 182 183 extern int _bcm_esw_trunk_active_member_get(int unit, bcm_trunk_t tid, 184 bcm_trunk_info_t *trunk_info, 185 int member_max, 186 bcm_trunk_member_t *active_member_array, 187 int *active_member_count); 188 extern int _bcm_nuc_tpbm_get(int unit, 189 int num_ports, 190 bcm_module_t tm[BCM_TRUNK_MAX_PORTCNT], 191 uint32 *nuc_tpbm); 192 193 #if defined (BCM_XGS3_SWITCH_SUPPORT) 194 #define _BCM_XGS3_TRUNK_MOD_PORT_MAP_IDX_COUNT(_unit_) \ 195 (SOC_MAX_NUM_PORTS * ((SOC_MODID_MAX(_unit_) > 0) ? \ 196 (1 + SOC_MODID_MAX(_unit_)) : 1)) 197 extern int _bcm_xgs3_trunk_mod_port_map_init(int unit); 198 extern int _bcm_xgs3_trunk_mod_port_map_deinit(int unit); 199 #ifdef BCM_HURRICANE3_SUPPORT 200 extern int _bcm_xgs3_trunk_mod_port_map_reinit(int unit, 201 bcm_module_t mod, int base_index,int num_ports); 202 #endif 203 extern int _bcm_xgs3_trunk_swfailover_init(int unit); 204 extern void _bcm_xgs3_trunk_swfailover_detach(int unit); 205 206 extern int _bcm_xgs3_trunk_member_init(int unit); 207 extern void _bcm_xgs3_trunk_member_detach(int unit); 208 209 extern int bcm_xgs3_trunk_modify(int, bcm_trunk_t, 210 bcm_trunk_info_t *, int, bcm_trunk_member_t *, 211 trunk_private_t *, int, bcm_trunk_member_t *); 212 extern int bcm_xgs3_trunk_get(int, bcm_trunk_t, 213 bcm_trunk_info_t *, int, bcm_trunk_member_t *, 214 int *, trunk_private_t *); 215 extern int bcm_xgs3_trunk_destroy(int, bcm_trunk_t, trunk_private_t *); 216 extern int bcm_xgs3_trunk_mcast_join(int, bcm_trunk_t, bcm_vlan_t, 217 bcm_mac_t, trunk_private_t *); 218 extern int _bcm_xgs3_trunk_fabric_find(int unit, 219 bcm_port_t port, 220 bcm_trunk_t *tid); 221 extern int _bcm_xgs3_trunk_get_port_property(int unit, 222 bcm_module_t mod, 223 bcm_port_t port, 224 bcm_trunk_t *tid); 225 226 extern int _bcm_xgs3_trunk_hwfailover_init(int unit); 227 extern void _bcm_xgs3_trunk_hwfailover_detach(int unit); 228 229 extern int _bcm_xgs3_trunk_hwfailover_set(int unit, bcm_trunk_t tid, 230 int hg_trunk, 231 bcm_port_t port, 232 bcm_module_t modid, 233 int psc, 234 uint32 flags, int count, 235 bcm_port_t *ftp, 236 bcm_module_t *ftm); 237 extern int _bcm_xgs3_trunk_hwfailover_get(int unit, bcm_trunk_t tid, 238 int hg_trunk, 239 bcm_port_t port, 240 bcm_module_t modid, 241 int *psc, 242 uint32 *flags, int array_size, 243 bcm_port_t *ftp, 244 bcm_module_t *ftm, 245 int *array_count); 246 extern int _bcm_xgs3_trunk_property_migrate(int unit, 247 int num_leaving, bcm_gport_t *leaving_arr, 248 int num_staying, bcm_gport_t *staying_arr, 249 int num_joining, bcm_gport_t *joining_arr); 250 251 #ifdef BCM_TRIDENT_SUPPORT 252 extern int bcm_trident_trunk_mbr_zero_rsvd[BCM_MAX_NUM_UNITS]; 253 extern int _bcm_trident_trunk_init(int unit); 254 void _bcm_trident_trunk_deinit(int unit); 255 extern int _bcm_trident_trunk_override_mcast_set(int unit, 256 bcm_trunk_t hgtid, 257 int idx, 258 int enable); 259 extern int _bcm_trident_trunk_override_mcast_get(int unit, 260 bcm_trunk_t hgtid, 261 int idx, 262 int *enable); 263 extern int _bcm_trident_trunk_override_ipmc_set(int unit, 264 bcm_trunk_t hgtid, 265 int idx, 266 int enable); 267 extern int _bcm_trident_trunk_override_ipmc_get(int unit, 268 bcm_trunk_t hgtid, 269 int idx, 270 int *enable); 271 extern int _bcm_trident_trunk_override_vlan_set(int unit, 272 bcm_trunk_t hgtid, 273 int idx, 274 int enable); 275 extern int _bcm_trident_trunk_override_vlan_get(int unit, 276 bcm_trunk_t hgtid, 277 int idx, 278 int *enable); 279 extern int _bcm_trident_trunk_fabric_find(int unit, 280 bcm_port_t port, 281 bcm_trunk_t *tid); 282 extern int _bcm_trident_trunk_get_port_property(int unit, bcm_module_t mod, 283 bcm_port_t port, int *tid); 284 extern int _bcm_trident_trunk_hwfailover_set(int unit, 285 bcm_trunk_t tid, int hg_trunk, 286 bcm_port_t port, bcm_module_t modid, 287 int psc, uint32 flags, int count, 288 bcm_port_t *ftp, bcm_module_t *ftm); 289 extern int _bcm_trident_trunk_hwfailover_get(int unit, 290 bcm_trunk_t tid, int hg_trunk, 291 bcm_port_t port, bcm_module_t modid, 292 int *psc, uint32 *flags, int array_size, 293 bcm_port_t *ftp, bcm_module_t *ftm, 294 int *array_count); 295 extern int _bcm_trident_hg_dlb_config_set(int unit, 296 bcm_switch_control_t type, 297 int arg); 298 extern int _bcm_trident_hg_dlb_config_get(int unit, 299 bcm_switch_control_t type, 300 int *arg); 301 extern int bcm_trident_hg_dlb_member_status_set(int unit, bcm_port_t port, 302 int status); 303 extern int bcm_trident_hg_dlb_member_status_get(int unit, bcm_port_t port, 304 int *status); 305 #endif /* BCM_TRIDENT_SUPPORT */ 306 307 #ifdef BCM_TRIUMPH3_SUPPORT 308 extern void bcm_tr3_lag_dlb_deinit(int unit); 309 extern int bcm_tr3_lag_dlb_init(int unit); 310 extern int bcm_tr3_lag_dlb_free_resource(int unit, int tid); 311 extern int bcm_tr3_lag_dlb_set(int unit, int tid, 312 _esw_trunk_add_info_t *add_info, 313 int num_dlb_ports, int *mod_array, int *port_array, 314 int *scaling_factor_array, int *load_weight_array); 315 extern int bcm_tr3_lag_dlb_member_attr_get(int unit, 316 bcm_module_t mod, bcm_port_t port, 317 int *scaling_factor, int *load_weight); 318 extern int bcm_tr3_lag_dlb_member_status_set(int unit, bcm_module_t mod, 319 bcm_port_t port, int status); 320 extern int bcm_tr3_lag_dlb_member_status_get(int unit, bcm_module_t mod, 321 bcm_port_t port, int *status); 322 extern int bcm_tr3_lag_dlb_ethertype_set(int unit, uint32 flags, 323 int ethertype_count, int *ethertype_array); 324 extern int bcm_tr3_lag_dlb_ethertype_get(int unit, uint32 *flags, 325 int ethertype_max, int *ethertype_array, int *ethertype_count); 326 extern int bcm_tr3_lag_dlb_config_set(int unit, bcm_switch_control_t type, 327 int arg); 328 extern int bcm_tr3_lag_dlb_config_get(int unit, bcm_switch_control_t type, 329 int *arg); 330 extern int bcm_tr3_lag_dlb_dynamic_size_encode(int dynamic_size, 331 int *encoded_value); 332 333 extern int bcm_tr3_hg_dlb_ethertype_set(int unit, uint32 flags, 334 int ethertype_count, int *ethertype_array); 335 extern int bcm_tr3_hg_dlb_ethertype_get(int unit, uint32 *flags, 336 int ethertype_max, int *ethertype_array, int *ethertype_count); 337 #endif /* BCM_TRIUMPH3_SUPPORT */ 338 339 #if defined(BCM_TOMAHAWK2_SUPPORT) || defined(BCM_TRIDENT3_SUPPORT) 340 extern void bcm_th2_hgt_lag_dlb_deinit(int unit); 341 extern int bcm_th2_hgt_lag_dlb_init(int unit); 342 extern int bcm_th2_hgt_lag_dlb_free_resource(int unit, int tid, int hgt); 343 extern int bcm_th2_hgt_lag_dlb_set(int unit, int tid, int hgt, 344 _esw_trunk_add_info_t *add_info, 345 int num_dlb_ports, 346 int *mod_array, 347 int *port_array, 348 int *scaling_factor_array, 349 int *load_weight_array, 350 int *qsize_weight_array); 351 extern int bcm_th2_hgt_lag_dlb_member_attr_get(int unit, 352 bcm_port_t port, 353 int *scaling_factor, 354 int *load_weight, 355 int *qsize_weight); 356 extern int bcm_th2_hgt_lag_dlb_member_status_set(int unit, 357 bcm_port_t port, 358 int status); 359 extern int bcm_th2_hgt_lag_dlb_member_status_get(int unit, 360 bcm_port_t port, 361 int *status); 362 extern int bcm_th2_hgt_lag_dlb_ethertype_set(int unit, 363 uint32 flags, 364 int ethertype_count, 365 int *ethertype_array); 366 extern int bcm_th2_hgt_lag_dlb_ethertype_get(int unit, 367 uint32 *flags, 368 int ethertype_max, 369 int *ethertype_array, 370 int *ethertype_count); 371 extern int bcm_th2_hgt_lag_dlb_config_set(int unit, 372 bcm_switch_control_t type, 373 int arg); 374 extern int bcm_th2_hgt_lag_dlb_config_get(int unit, 375 bcm_switch_control_t type, 376 int *arg); 377 extern int bcm_th2_hgt_lag_dlb_dynamic_size_encode(int dynamic_size, 378 int *encoded_value); 379 380 #endif /* BCM_TOMAHAWK2_SUPPORT || BCM_TRIDENT3_SUPPORT*/ 381 382 #endif /* BCM_XGS3_SWITCH_SUPPORT */ 383 384 #ifdef BCM_WARM_BOOT_SUPPORT 385 extern int _bcm_trunk_reinit(int unit); 386 #if defined (BCM_XGS3_SWITCH_SUPPORT) 387 extern int _xgs3_trunk_reinit(int unit, int ngroups_fp, trunk_private_t *); 388 extern int _xgs3_trunk_fabric_reinit(int unit, int min_tid, int max_tid, 389 trunk_private_t *); 390 391 #if defined(BCM_TRX_SUPPORT) || defined(BCM_BRADLEY_SUPPORT) 392 extern void _bcm_xgs3_hw_failover_flags_set(int unit, bcm_trunk_t tid, 393 int port_index, int hg_trunk, 394 uint8 flags); 395 extern uint8 _bcm_xgs3_hw_failover_flags_get(int unit, bcm_trunk_t tid, 396 int port_index, int hg_trunk); 397 #endif /* BCM_TRX_SUPPORT || BCM_BRADLEY_SUPPORT */ 398 399 extern void _bcm_xgs3_trunk_member_info_set(int unit, bcm_trunk_t tid, 400 uint8 num_ports, 401 uint16 modport[BCM_TRUNK_MAX_PORTCNT], 402 uint32 member_flags[BCM_TRUNK_MAX_PORTCNT]); 403 extern void _bcm_xgs3_trunk_member_info_get(int unit, bcm_trunk_t tid, 404 uint8 *num_ports, 405 uint16 modport[BCM_TRUNK_MAX_PORTCNT], 406 uint32 member_flags[BCM_TRUNK_MAX_PORTCNT]); 407 408 #ifdef BCM_TRIDENT_SUPPORT 409 extern int _bcm_trident_trunk_mod_port_map_reinit(int unit, bcm_module_t mod, 410 int base_index, int num_ports); 411 extern int _bcm_trident_trunk_lag_reinit(int unit, int ngroups_fp, 412 trunk_private_t *); 413 extern int _bcm_trident_trunk_fabric_reinit(int unit, int min_tid, int max_tid, 414 trunk_private_t *); 415 extern void _bcm_trident_hw_failover_num_ports_set(int unit, bcm_trunk_t tid, 416 int hg_trunk, uint16 num_ports); 417 extern uint16 _bcm_trident_hw_failover_num_ports_get(int unit, bcm_trunk_t tid, 418 int hg_trunk); 419 extern int _bcm_trident_hw_failover_flags_set(int unit, bcm_trunk_t tid, 420 int port_index, int hg_trunk, 421 uint8 flags); 422 extern uint8 _bcm_trident_hw_failover_flags_get(int unit, bcm_trunk_t tid, 423 int port_index, int hg_trunk); 424 extern int _bcm_trident_trunk_member_info_set(int unit, bcm_trunk_t tid, 425 uint16 num_ports, 426 uint16 *modport, 427 uint32 *member_flags); 428 extern int _bcm_trident_trunk_member_info_get(int unit, bcm_trunk_t tid, 429 uint16 array_size, 430 uint16 *modport, 431 uint32 *member_flags, 432 uint16 *num_ports); 433 extern int bcm_trident_hg_dlb_wb_alloc_size_get(int unit, int *size); 434 extern int bcm_trident_hg_dlb_sync(int unit, uint8 **scache_ptr); 435 extern int bcm_trident_hg_dlb_scache_recover(int unit, uint8 **scache_ptr); 436 #endif /* BCM_TRIDENT_SUPPORT */ 437 438 #ifdef BCM_TRIUMPH3_SUPPORT 439 extern int bcm_tr3_lag_dlb_wb_alloc_size_get(int unit, int *size); 440 extern int bcm_tr3_lag_dlb_sync(int unit, uint8 **scache_ptr); 441 extern int bcm_tr3_lag_dlb_scache_recover(int unit, uint8 **scache_ptr); 442 extern int bcm_tr3_lag_dlb_member_recover(int unit); 443 extern int bcm_tr3_lag_dlb_group_recover(int unit, bcm_trunk_t tid, 444 trunk_private_t *trunk_info); 445 extern int bcm_tr3_lag_dlb_quality_parameters_recover(int unit); 446 #endif /* BCM_TRIUMPH3_SUPPORT */ 447 448 #if defined(BCM_TOMAHAWK2_SUPPORT) || defined (BCM_TRIDENT3_SUPPORT) 449 extern int bcm_th2_hgt_lag_dlb_wb_alloc_size_get(int unit, int *size); 450 extern int bcm_th2_hgt_lag_dlb_sync(int unit, uint8 **scache_ptr); 451 extern int bcm_th2_hgt_lag_dlb_scache_recover(int unit, uint8 **scache_ptr); 452 extern int bcm_th2_hgt_lag_dlb_group_recover(int unit, bcm_trunk_t tid, int hgt, 453 trunk_private_t *trunk_info); 454 extern int bcm_th2_hgt_lag_dlb_quality_parameters_recover(int unit); 455 #endif /* BCM_TOMAHAWK2_SUPPORT */ 456 #if defined(BCM_TOMAHAWK3_SUPPORT) 457 extern uint16 _bcm_th3_trunk_hwfailover_num_ports_get(int unit, bcm_trunk_t tid); 458 extern void _bcm_th3_trunk_hwfailover_num_ports_set(int unit, bcm_trunk_t tid, uint16 num_ports); 459 extern uint8 _bcm_th3_trunk_hwfailover_flags_get(int unit, bcm_trunk_t tid, int port); 460 extern void _bcm_th3_trunk_hwfailover_flags_set(int unit, bcm_trunk_t tid, int port, uint8 flags); 461 extern int _bcm_th3_trunk_member_info_get(int unit, bcm_trunk_t tid, 462 _esw_trunk_add_info_t *t_data, trunk_private_t *t_info); 463 extern int _bcm_th3_trunk_member_info_set(int unit, bcm_trunk_t tid, 464 uint16 num_ports, uint8 *member_port, uint32 *member_flags); 465 extern int _bcm_th3_trunk_lag_reinit(int unit, int ngroups_fp, trunk_private_t *t_info); 466 #endif /* BCM_TOMAHAWK3_SUPPORT */ 467 #endif /* BCM_XGS3_SWITCH_SUPPORT */ 468 #else 469 #define _bcm_trunk_reinit(unit) (BCM_E_NONE) 470 #if defined (BCM_XGS3_SWITCH_SUPPORT) 471 #define _xgs3_trunk_reinit(unit, ng_fp, tp) (BCM_E_UNAVAIL) 472 #define _xgs3_trunk_fabric_reinit(unit, min, max, tp) (BCM_E_UNAVAIL) 473 #endif /* BCM_XGS3_SWITCH_SUPPORT */ 474 #endif /* BCM_WARM_BOOT_SUPPORT */ 475 476 extern int _bcm_esw_trunk_lock(int unit); 477 extern int _bcm_esw_trunk_unlock(int unit); 478 extern int _bcm_esw_trunk_group_num(int unit); 479 480 extern int _bcm_esw_vplag_lock(int unit); 481 extern int _bcm_esw_vplag_unlock(int unit); 482 483 #ifdef BCM_WARM_BOOT_SUPPORT 484 extern int _bcm_esw_trunk_sync(int unit); 485 #endif /* BCM_WARM_BOOT_SUPPORT */ 486 487 #ifndef BCM_SW_STATE_DUMP_DISABLE 488 extern void _bcm_trunk_sw_dump(int unit); 489 #if defined(BCM_XGS3_SWITCH_SUPPORT) 490 extern void _bcm_xgs3_trunk_sw_dump(int unit); 491 492 #ifdef BCM_TRIDENT_SUPPORT 493 extern void _bcm_trident_trunk_sw_dump(int unit); 494 #endif /* BCM_TRIDENT_SUPPORT */ 495 496 #ifdef BCM_TRIUMPH3_SUPPORT 497 extern void bcm_tr3_lag_dlb_sw_dump(int unit); 498 #endif /* BCM_TRIUMPH3_SUPPORT */ 499 500 #if defined(BCM_TOMAHAWK2_SUPPORT) || defined(BCM_TRIDENT3_SUPPORT) 501 extern void bcm_th2_hgt_lag_dlb_sw_dump(int unit); 502 #endif /* BCM_TOMAHAWK2_SUPPORT */ 503 504 #endif /* BCM_XGS3_SWITCH_SUPPORT */ 505 506 #endif /* BCM_SW_STATE_DUMP_DISABLE */ 507 508 extern int _bcm_trunk_id_validate(int unit, bcm_trunk_t tid); 509 extern int _bcm_esw_trunk_local_members_get(int unit, bcm_trunk_t trunk_id, 510 int local_member_max, 511 bcm_port_t *local_member_array, 512 int *local_member_count); 513 extern int _bcm_esw_trunk_chip_info_vp_resource_get(int unit, int *vp_id_min, 514 int *vp_id_max, 515 int *vp_ports_max); 516 extern int _bcm_esw_trunk_id_is_vp_lag(int unit, bcm_trunk_t tid, 517 int *tid_is_vp_lag); 518 extern int _bcm_esw_trunk_tid_to_vp_lag_vp(int unit, bcm_trunk_t tid, 519 int *vp_lag_vp); 520 extern int _bcm_esw_trunk_vp_lag_vp_to_tid(int unit, int vp_lag_vp, 521 bcm_trunk_t *tid); 522 extern int _bcm_esw_trunk_match_multi_get( 523 int unit, bcm_trunk_t tid, int size, 524 bcm_port_match_info_t *match_array, int *count); 525 526 #ifdef BCM_TOMAHAWK3_SUPPORT 527 extern int _bcm_th3_trunk_init(int unit); 528 extern void _bcm_th3_trunk_deinit(int unit); 529 extern int _bcm_th3_trunk_port_map_init(int unit); 530 extern int _bcm_th3_trunk_port_map_deinit(int unit); 531 extern int bcm_th3_trunk_destroy(int unit, bcm_trunk_t tid, 532 trunk_private_t *t_info); 533 extern int _bcm_th3_trunk_hwfailover_set(int unit, 534 bcm_trunk_t tid, bcm_port_t port, 535 int psc, uint32 flags, int count, 536 bcm_port_t *ftp); 537 extern int _bcm_th3_trunk_hwfailover_get(int unit, bcm_trunk_t tid, 538 bcm_port_t port, int *psc, uint32 *flags, 539 int array_size, bcm_port_t *ftp, int *array_count); 540 extern int _bcm_th3_trunk_get_port_property(int unit, 541 bcm_port_t port, int *tid); 542 #endif 543 544 545 #endif /* !_BCM_INT_TRUNK_H */