port.h (17017B)
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: port.h 8 * Purpose: PORT internal definitions to the BCM library. 9 */ 10 11 #ifndef _BCM_INT_DPP_PORT_H_ 12 #define _BCM_INT_DPP_PORT_H_ 13 14 #include <soc/dpp/PPD/ppd_api_general.h> 15 #include <soc/dpp/PPD/ppd_api_llp_trap.h> 16 #include <soc/dpp/PPD/ppd_api_trap_mgmt.h> 17 #include <soc/dpp/PPC/ppc_api_trap_mgmt.h> 18 #include <soc/dpp/ARAD/ARAD_PP/arad_pp_occupation_mgmt.h> 19 20 #include <soc/dpp/TMC/tmc_api_action_cmd.h> 21 #include <bcm/port.h> 22 #include <soc/types.h> 23 24 /* 25 * port definition 26 */ 27 28 /* color mapping (DP value)*/ 29 #define _BCM_DPP_COLOR_GREEN 0 30 #define _BCM_DPP_COLOR_YELLOW 1 31 #define _BCM_DPP_COLOR_RED 2 32 #define _BCM_DPP_COLOR_BLACK 3 33 #define _BCM_DPP_COLOR_PRESERVE 4 34 35 /* number of FAP ports */ 36 #define _BCM_PETRA_NOF_LOCAL_PORTS(unit) (SOC_DPP_DEFS_GET(unit, nof_local_ports)) 37 #define _BCM_PETRA_NOF_TM_PORTS(unit) (SOC_DPP_DEFS_GET(unit, nof_logical_ports)) 38 #define _BCM_PETRA_NOF_MAX_PP_PORTS (SOC_PPC_MAX_NOF_LOCAL_PORTS_ARAD) 39 /* number of traps used for learning mode per port*/ 40 #define _BCM_PETRA_PORT_LEARN_NOF_TRAPS 4 41 42 #define _BCM_DPP_PORT_TRAP_CODE_SA_DROP_NOF_PROFILES 4 43 #define _BCM_DPP_PORT_TRAP_CODE_DA_UNKNOWN_NOF_PROFILES 4 44 45 #define _BCM_DPP_PORT_DISCARD_MODE_MIM_BIT (0x40) 46 #define _BCM_DPP_PORT_DISCARD_MODE_OUTER_PRIO (0x80) 47 #define _BCM_DPP_PORT_DISCARD_MODE_MAX ((BCM_PORT_DISCARD_COUNT - 1) | _BCM_DPP_PORT_DISCARD_MODE_MIM_BIT | _BCM_DPP_PORT_DISCARD_MODE_OUTER_PRIO) 48 #define _BCM_DPP_PORT_DISCARD_MODE_IS_MIM(_mode_) (_mode_ & _BCM_DPP_PORT_DISCARD_MODE_MIM_BIT) 49 #define _BCM_DPP_PORT_DISCARD_MODE_MIM_REMOVE(_mode_) (_mode_ &= ~_BCM_DPP_PORT_DISCARD_MODE_MIM_BIT) 50 #define _BCM_DPP_PORT_DISCARD_MODE_MIM_SET(_mode_) (_mode_ |= _BCM_DPP_PORT_DISCARD_MODE_MIM_BIT) 51 #define _BCM_DPP_PORT_DISCARD_MODE_IS_OUTER_PRIO(_mode_) (_mode_ & _BCM_DPP_PORT_DISCARD_MODE_OUTER_PRIO) 52 #define _BCM_DPP_PORT_DISCARD_MODE_OUTER_PRIO_REMOVE(_mode_) (_mode_ &= ~_BCM_DPP_PORT_DISCARD_MODE_OUTER_PRIO) 53 #define _BCM_DPP_PORT_DISCARD_MODE_OUTER_PRIO_SET(_mode_) (_mode_ |= _BCM_DPP_PORT_DISCARD_MODE_OUTER_PRIO) 54 55 #define _BCM_DPP_PORT_PRD_ETH_MAP_INDICATION _SHR_PORT_PRD_ETH_MAP_INDICATION 56 #define _BCM_DPP_PORT_PRD_TM_MAP_INDICATION _SHR_PORT_PRD_TM_MAP_INDICATION 57 #define _BCM_DPP_PORT_PRD_IP_MAP_INDICATION _SHR_PORT_PRD_IP_MAP_INDICATION 58 #define _BCM_DPP_PORT_PRD_MPLS_MAP_INDICATION _SHR_PORT_PRD_MPLS_MAP_INDICATION 59 60 #define _BCM_COSQ_INGRESS_PORT_DROP_ETH_MAP_KEY_SET(key) ( key |= _BCM_DPP_PORT_PRD_ETH_MAP_INDICATION ) 61 #define _BCM_COSQ_INGRESS_PORT_DROP_TM_MAP_KEY_SET(key) ( key |= _BCM_DPP_PORT_PRD_TM_MAP_INDICATION ) 62 #define _BCM_COSQ_INGRESS_PORT_DROP_IP_MAP_KEY_SET(key) ( key |= _BCM_DPP_PORT_PRD_IP_MAP_INDICATION ) 63 #define _BCM_COSQ_INGRESS_PORT_DROP_MPLS_MAP_KEY_SET(key) ( key |= _BCM_DPP_PORT_PRD_MPLS_MAP_INDICATION ) 64 65 #define _BCM_COSQ_INGRESS_PORT_DROP_ETH_MAP_KEY_GET(key) ( key & _BCM_DPP_PORT_PRD_ETH_MAP_INDICATION ) 66 #define _BCM_COSQ_INGRESS_PORT_DROP_TM_MAP_KEY_GET(key) ( key & _BCM_DPP_PORT_PRD_TM_MAP_INDICATION ) 67 #define _BCM_COSQ_INGRESS_PORT_DROP_IP_MAP_KEY_GET(key) ( key & _BCM_DPP_PORT_PRD_IP_MAP_INDICATION ) 68 #define _BCM_COSQ_INGRESS_PORT_DROP_MPLS_MAP_KEY_GET(key) ( key & _BCM_DPP_PORT_PRD_MPLS_MAP_INDICATION ) 69 70 #define _BCM_COSQ_INGRESS_PORT_DROP_ETH_MAP_KEY_CLEAR(key) ( key &= ~_BCM_DPP_PORT_PRD_ETH_MAP_INDICATION ) 71 #define _BCM_COSQ_INGRESS_PORT_DROP_TM_MAP_KEY_CLEAR(key) ( key &= ~_BCM_DPP_PORT_PRD_TM_MAP_INDICATION ) 72 #define _BCM_COSQ_INGRESS_PORT_DROP_IP_MAP_KEY_CLEAR(key) ( key &= ~_BCM_DPP_PORT_PRD_IP_MAP_INDICATION ) 73 #define _BCM_COSQ_INGRESS_PORT_DROP_MPLS_MAP_KEY_CLEAR(key) ( key &= ~_BCM_DPP_PORT_PRD_MPLS_MAP_INDICATION ) 74 75 /* user define trap used for drop */ 76 #define _BCM_PETRA_UD_DROP_TRAP (SOC_PPC_TRAP_CODE_USER_DEFINED_DROP_TRAP) 77 #define _BCM_PETRA_UD_DFLT_TRAP (SOC_PPC_TRAP_CODE_USER_DEFINED_DFLT_TRAP) 78 79 typedef struct bcm_dpp_mal_assoc_s { 80 uint8 mal; 81 uint8 lanes; 82 uint16 nif_type; 83 } bcm_dpp_mal_assoc_t; 84 85 typedef struct bcm_dpp_user_defined_traps_s { 86 SOC_PPC_TRAP_FRWRD_ACTION_PROFILE_INFO trap; 87 uint32 snoop_cmd; 88 uint32 gport_trap_id; /*Added for support: bcmRxTrapL2Cache (virtual traps) */ 89 uint32 ud_unique; /*Added for support: sync user define traps in rx.c with port.c */ 90 } bcm_dpp_user_defined_traps_t; 91 92 93 typedef struct bcm_dpp_snoop_s { 94 SOC_TMC_ACTION_CMD_SNOOP_MIRROR_INFO snoop_action_info; /*snoop profile data */ 95 uint32 snoop_unique; /*Added for support: sync snoop between diffrent modules */ 96 } bcm_dpp_snoop_t; 97 98 99 /* number of bits per tag-structure 100 0:0 PcpDeiProfile This is the port-based PCP-DEI mapping profile. 101 6:1 Ivec This is the port-based ingress VLAN edit command. 19:16 102 10:7 IncomingTagStructure Used together with the VLAN-Edit-Profile 103 11:11 discard 104 12:12: outer-cep 105 13:13 inner-cep 106 19:14 reserved 107 */ 108 #define _BCM_DPP_PORT_TPID_CLASS_BITS_PER_TAG_STRCT (20) 109 110 /* number of U32 need, for all tag structures 2^5 = 32 ==> 20 U32 */ 111 #define _BCM_DPP_PORT_TPID_CLASS_INFO_BUF_NOF_U32 (20) 112 113 typedef struct _bcm_dpp_port_tpid_class_info_s { 114 uint32 buff[_BCM_DPP_PORT_TPID_CLASS_INFO_BUF_NOF_U32]; 115 } _bcm_dpp_port_tpid_class_info_t; 116 117 118 119 typedef enum _bcm_petra_tpid_profile_e{ 120 _bcm_petra_tpid_profile_none = 0, 121 _bcm_petra_tpid_profile_outer, 122 _bcm_petra_tpid_profile_outer_inner, 123 _bcm_petra_tpid_profile_outer_inner2, 124 _bcm_petra_tpid_profile_outer_outer, 125 _bcm_petra_tpid_profile_inner_outer, 126 _bcm_petra_tpid_profile_inner_outer2, /* TPID1: outer + inner TPID2:outer */ 127 _bcm_petra_tpid_profile_outer_inner_same, /* TPID1: outer TPID1: inner */ 128 _bcm_petra_tpid_profile_outer_inner_same2, /* TPID2: outer TPID2: inner */ 129 _bcm_petra_tpid_profile_outer_c_tag, /* TPID1: C-tag*/ 130 _bcm_petra_tpid_profile_outer_outer_c_tag, /* TPID1: C-tag TPID2: C-tag*/ 131 _bcm_petra_tpid_profile_outer_inner_c_tag, /* TPID1: S-tag, TPID2: C-tag */ 132 _bcm_petra_tpid_profile_outer_trill_fgl, /* TPID1: S-tag, TPID2: C-tag */ 133 _bcm_petra_tpid_profile_count 134 } _bcm_petra_tpid_profile_t; 135 136 typedef enum _bcm_petra_dtag_mode_e{ 137 _bcm_petra_dtag_mode_accept = 0, /* Accept double tag */ 138 _bcm_petra_dtag_mode_ignore, /* Ignore double tag. Parse as one tag */ 139 _bcm_petra_dtag_mode_count 140 } _bcm_petra_dtag_mode_t; 141 142 typedef enum _bcm_petra_ac_key_map_type_e{ 143 _bcm_petra_ac_key_map_type_normal = 0, 144 _bcm_petra_ac_key_map_type_compressional, 145 _bcm_petra_ac_key_map_type_count 146 } _bcm_petra_ac_key_map_type_t; 147 148 typedef enum _bcm_petra_port_mact_mgmt_action_profile_e{ 149 _bcm_petra_port_mact_mgmt_action_profile_none = 0, 150 _bcm_petra_port_mact_mgmt_action_profile_drop, 151 _bcm_petra_port_mact_mgmt_action_profile_trap, 152 _bcm_petra_port_mact_mgmt_action_profile_trap_and_drop 153 } _bcm_petra_port_mact_mgmt_action_profile_t; 154 155 156 157 typedef enum _bcm_dpp_port_map_type_e { 158 _bcm_dpp_port_map_type_up_to_dp=0,/* mapping UP to DP */ 159 _bcm_dpp_port_map_type_in_up_to_tc_and_de, 160 _bcm_dpp_port_map_type_count 161 } _bcm_dpp_port_map_type_t; 162 163 164 int _bcm_petra_outlif_profile_set( 165 const int unit, 166 const uint32 local_outlif_id, 167 const uint32 arg, 168 const SOC_OCC_MGMT_OUTLIF_APP kind); 169 170 171 int _bcm_petra_port_outlif_profile_set( 172 const int unit, 173 const bcm_port_t port, 174 const uint32 arg, 175 const SOC_OCC_MGMT_OUTLIF_APP kind); 176 177 #define _BCM_DPP_PORT_MAP_MAX_NOF_TBLS (8) 178 179 180 181 /* number of different tpid values */ 182 #define _BCM_PORT_NOF_TPID_VALS (4) 183 /* number of TPID profiles pair of TPIDs */ 184 #define _BCM_PORT_NOF_TPID_PROFILES (4) 185 186 #define _BCM_PETRA_NOF_TPIDS_PER_PORT (2) 187 188 /* The NOF of usable TPIDs per port include the number of TPIDs per Port-Profile 189 and possibly the MIM TPID */ 190 #define _BCM_DPP_MAX_NOF_USABLE_TPIDS_PER_PORT (_BCM_PETRA_NOF_TPIDS_PER_PORT + 1) 191 192 193 typedef struct { 194 195 uint16 tpid[_BCM_PETRA_NOF_TPIDS_PER_PORT][_BCM_PORT_NOF_TPID_PROFILES]; /* tpid 1/2 index <value> */ 196 int tpid_count[_BCM_PETRA_NOF_TPIDS_PER_PORT][_BCM_PORT_NOF_TPID_PROFILES]; /* number of users of this tpid in the profile */ 197 198 } bcm_petra_port_tpid_info; 199 200 201 202 203 204 typedef struct bcm_dpp_port_config_s { 205 206 int bcm_petra_port_init_arrays_done; 207 208 int port_pp_initialized; 209 210 int map_tbl_use[_bcm_dpp_port_map_type_count][_BCM_DPP_PORT_MAP_MAX_NOF_TBLS]; 211 212 /* for each learn trap what is the usage */ 213 int trap_to_flag[_BCM_PETRA_PORT_LEARN_NOF_TRAPS]; 214 215 bcm_petra_port_tpid_info *bcm_port_tpid_info; 216 217 uint32 in_port_key_gen_var_32_msb[MAX_NUM_OF_CORES][SOC_TMC_NOF_FAP_PORTS_MAX]; 218 } bcm_dpp_port_config_t; 219 220 221 typedef struct _bcm_dpp_port_tpid_class_acceptable_frame_type_info_s { 222 uint32 buffer; 223 } _bcm_dpp_port_tpid_class_acceptable_frame_type_info_t; 224 225 226 extern pbmp_t _bcm_dpp_port_prbs_mac_mode[BCM_MAX_NUM_UNITS]; 227 extern bcm_dpp_port_config_t _dpp_port_config[BCM_MAX_NUM_UNITS]; 228 229 typedef struct { 230 uint8 tpids_count[MAX_NUM_OF_CORES][SOC_TMC_NOF_FAP_PORTS_MAX]; 231 bcm_dpp_port_config_t dpp_port_config; 232 pbmp_t prbs_mac_mode; 233 } bcm_dpp_port_info_t; 234 /* 235 * External functions 236 */ 237 extern int bcm_petra_port_advert_remote_get(int unit, bcm_port_t port, bcm_port_abil_t *ability_mask); 238 239 int 240 _bcm_petra_port_class_nof_vlan_domains_count( 241 int unit, 242 uint32 class_id, 243 int *nof_pp_ports); 244 245 extern uint32 246 soc_petra_ihp_prog_n00_load_unsafe(int unit); 247 248 extern int 249 _bcm_petra_port_link_get(int unit, bcm_port_t port, int hw, int *up); 250 251 extern int 252 _bcm_petra_port_link_get_and_hook_placeholder (int unit, bcm_port_t port, int hw, int *up); 253 254 extern int 255 _bcm_petra_port_find_free_port_and_allocate(int unit, bcm_core_t core, bcm_port_if_t interface, int with_id, bcm_port_t *port); 256 257 /* These functions below are required for cosq TM */ 258 259 extern int 260 bcm_petra_port_vlan_priority_map_set(int unit, bcm_port_t port, int pkt_pri, int cfi, int internal_pri, bcm_color_t color); 261 262 extern int 263 bcm_petra_port_vlan_priority_map_get(int unit, bcm_port_t port, int pkt_pri, int cfi, int *internal_pri, bcm_color_t *color); 264 265 extern int 266 bcm_petra_port_vlan_priority_unmap_set(int unit, bcm_port_t port, int internal_pri, bcm_color_t color, int pkt_pri, int cfi); 267 268 extern int 269 bcm_petra_port_vlan_priority_unmap_get(int unit, bcm_port_t port, int internal_pri, bcm_color_t color, int *pkt_pri, int *cfi); 270 271 extern int 272 bcm_petra_port_vlan_pri_map_get(int unit, bcm_port_t port, bcm_vlan_t vid, int pkt_pri, int cfi, int *internal_pri, bcm_color_t *color); 273 274 extern int 275 bcm_petra_port_vlan_pri_map_set(int unit, bcm_port_t port, bcm_vlan_t vid, int pkt_pri, int cfi, int internal_pri, int color); 276 277 extern int 278 _bcm_petra_port_color_encode(int, bcm_color_t, int *); 279 280 extern int 281 _bcm_petra_port_color_decode(int unit, int dp, bcm_color_t *color); 282 283 284 #ifdef BCM_WARM_BOOT_SUPPORT_SW_DUMP 285 extern int 286 _bcm_dpp_port_sw_dump(int unit); 287 #endif /* BCM_WARM_BOOT_SUPPORT_SW_DUMP */ 288 289 int 290 _bcm_petra_port_discard_extend_dtag_mode_set(int unit,bcm_port_t port,_bcm_petra_dtag_mode_t dtag_mode); 291 292 int 293 _bcm_petra_port_discard_extend_get(int unit, bcm_port_t port, int *mode); 294 295 int 296 _bcm_petra_port_discard_extend_dtag_mode_get(int unit,bcm_port_t port,_bcm_petra_dtag_mode_t *dtag_mode); 297 298 int 299 _bcm_petra_port_discard_extend_mode_set(int unit, bcm_port_t port, int mode); 300 301 int 302 bcm_petra_port_tpid_profile_exact_match_search(int unit, int index, uint16 tpids[_BCM_PETRA_NOF_TPIDS_PER_PORT], int nof_tpids, int inner_only, int* is_exact_match); 303 304 int 305 bcm_petra_port_tpid_profile_first_match_search(int unit, int index, uint16 tpids[_BCM_PETRA_NOF_TPIDS_PER_PORT], int nof_tpids, int inner_only, int* is_exact_match); 306 307 int 308 bcm_petra_port_tpid_profile_opposite_match_search(int unit, int indx, uint16 tpids[_BCM_PETRA_NOF_TPIDS_PER_PORT], int nof_tpids, int inner_only, int* is_exact_match); 309 310 int 311 bcm_petra_port_tpid_profile_similar_match_search(int unit, int tpid_profile_idx, uint16 tpids[_BCM_PETRA_NOF_TPIDS_PER_PORT], int nof_tpids, int inner_only, int* is_match); 312 313 314 /* given a lif, update its tpid profile index (to match given tpid) */ 315 int 316 _bcm_petra_mim_tpid_profile_update(int unit, int lif, uint16 tpid); 317 318 319 extern int 320 bcm_petra_port_deinit(int unit); 321 322 /* Attributes taht can be controlled on BCM88650*/ 323 #define _BCM_DPP_PORT_ATTRS \ 324 (BCM_PORT_ATTR_ENABLE_MASK | \ 325 BCM_PORT_ATTR_SPEED_MASK | \ 326 BCM_PORT_ATTR_DUPLEX_MASK | \ 327 BCM_PORT_ATTR_LINKSCAN_MASK | \ 328 BCM_PORT_ATTR_VLANFILTER_MASK | \ 329 BCM_PORT_ATTR_INTERFACE_MASK | \ 330 BCM_PORT_ATTR_LOOPBACK_MASK | \ 331 BCM_PORT_ATTR_STP_STATE_MASK | \ 332 BCM_PORT_ATTR_PAUSE_TX_MASK | \ 333 BCM_PORT_ATTR_PAUSE_RX_MASK) 334 335 int 336 bcm_petra_tpid_profile_info_set(int unit, int port_profile,int port_profile_eg, _bcm_petra_tpid_profile_t profile_type, int accept_mode, _bcm_petra_dtag_mode_t dtag_mode, _bcm_petra_ac_key_map_type_t ac_key_map_type, uint8 cep_port, uint8 evb_port); 337 338 int _bcm_dpp_port_tpid_class_acceptable_frame_type_info_t_clear(int unit, _bcm_dpp_port_tpid_class_acceptable_frame_type_info_t *tpid_class_acceptable_frame_info); 339 340 void _bcm_dpp_port_tpid_class_info_t_to_bcm_dpp_port_tpid_class_acceptable_frame_type_info_t(int unit, _bcm_dpp_port_tpid_class_info_t *tpid_class_info, _bcm_dpp_port_tpid_class_acceptable_frame_type_info_t *tpid_class_acceptable_frame_info); 341 342 int bcm_petra_port_tpid_profile_alloc(int unit, uint16 tpids[_BCM_PETRA_NOF_TPIDS_PER_PORT], int nof_tpids, int inner_only, int *tpid_profile); 343 344 int _bcm_petra_port_nrdy_thresh_allocate(int unit, soc_port_t port); 345 346 int _bcm_petra_port_nrdy_thresh_free(int unit, soc_port_t port); 347 348 int _bcm_petra_port_traps_init(int unit); 349 350 int _bcm_dpp_port_reassembly_context_get(int unit, bcm_port_t port, uint32 *port_termination_context, uint32 *reassembly_context); 351 352 /* 353 * Function: 354 * _bcm_dpp_mod_port_to_sys_port 355 * Description: 356 * map module-ID + mod-port to system port 357 * Parameters: 358 * unit - [IN] DPP device unit number (driver internal). 359 * modid - [IN] module id 360 * mode_port - [IN] module user port 361 * sys_port - [OUT] unique System port, or SOC_TMC_SYS_PHYS_PORT_INVALID if 362 * given module or port on module not exist 363 * Returns: 364 * BCM_E_XXX 365 */ 366 367 int 368 _bcm_dpp_port_mod_port_to_sys_port(int unit, bcm_module_t modid, bcm_port_t mode_port, unsigned int *sys_port); 369 370 /* 371 * Function: 372 * _bcm_dpp_mod_port_from_sys_port 373 * Description: 374 * map module-ID + mod-port to system port 375 * Parameters: 376 * unit - [IN] DPP device unit number (driver internal). 377 * modid - [IN] module id 378 * mode_port - [IN] module user port 379 * sys_port - [OUT] unique System port, or SOC_TMC_SYS_PHYS_PORT_INVALID if 380 * given module or port on module not exist 381 * Returns: 382 * BCM_E_XXX 383 */ 384 int 385 _bcm_dpp_port_mod_port_from_sys_port(int unit, bcm_module_t *modid, bcm_port_t *mode_port, uint32 sys_port); 386 387 388 /* 389 * Function: 390 * _bcm_dpp_port_pbmp_arm_get 391 * Purpose: 392 * Get port pbmp for ARM core 393 * Parameters: 394 * unit - (IN) Device Number 395 * bcm_pbmp_t - (OUT) arm pbmp 396 * Returns: 397 * BCM_E_XXX 398 */ 399 int 400 _bcm_dpp_port_pbmp_arm_get(int unit, bcm_pbmp_t *arm_pbmp); 401 402 /* 403 * Function: 404 * _bcm_petra_port_nif_priority_set 405 * Purpose: 406 * Set nif priority 407 * Parameters: 408 * unit - (IN) Device Number 409 * local_port - (IN) port for which to set priority 410 * flags - (IN) 411 * allow_tdm - (IN) allow set with tdm priority 412 * priority - (IN) priority to set 413 * affected_ports - (OUT other ports that were affected by this configuration 414 * Returns: 415 * BCM_E_XXX 416 */ 417 int _bcm_petra_port_nif_priority_set(int unit, bcm_gport_t local_port, uint32 flags, uint32 allow_tdm, bcm_port_nif_prio_t* priority, bcm_pbmp_t* affected_ports ); 418 419 420 int 421 _bcm_petra_port_fabric_detach(int unit, 422 bcm_pbmp_t pbmp, 423 bcm_pbmp_t *detached); 424 425 426 int _bcm_petra_port_outlif_profile_set_pwe_port( 427 const int unit, 428 const bcm_port_t port, 429 const uint32 arg, 430 const SOC_OCC_MGMT_OUTLIF_APP kind); 431 432 433 434 #define _BCM_DPP_PORT_DISCARD_MODE_BOTH (0) 435 #define _BCM_DPP_PORT_DISCARD_MODE_EGRESS_ONLY (1) /* Discard state should be set for Out-LIF only */ 436 #define _BCM_DPP_PORT_DISCARD_MODE_INGRESS_ONLY (2) /* Discard state should be set for In-LIF only */ 437 438 439 #define _BCM_DPP_PORT_DISCARD_MODE_SHIFT (14) 440 #define _BCM_DPP_PORT_DISCARD_VAL_SHIFT (0) 441 #define _BCM_DPP_PORT_DISCARD_MODE_MASK (0x3) 442 #define _BCM_DPP_PORT_DISCARD_VAL_MASK (0x3FFF) 443 444 #define DPP_PORT_DISCARD_VAL_GET(_mode) ((_mode >> _BCM_DPP_PORT_DISCARD_VAL_SHIFT ) & _BCM_DPP_PORT_DISCARD_VAL_MASK) 445 #define DPP_PORT_DISCARD_MODE_GET(_mode) ((_mode >> _BCM_DPP_PORT_DISCARD_MODE_SHIFT) & _BCM_DPP_PORT_DISCARD_MODE_MASK) 446 447 #endif /* _BCM_INT_PETRA_PORT_H_ */