compat_6517.h (82236B)
1 /* 2 * $Id: compat_6517.h,v 1.0 2019/11/10 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 * RPC Compatibility with sdk-6.5.17 routines 8 */ 9 10 #ifndef _COMPAT_6517_H_ 11 #define _COMPAT_6517_H_ 12 13 #ifdef BCM_RPC_SUPPORT 14 #include <bcm_int/compat/compat_6519.h> 15 #include <bcm/types.h> 16 #include <bcm/vlan.h> 17 #if defined(INCLUDE_L3) 18 #include <bcm/l2gre.h> 19 #include <bcm/wlan.h> 20 #include <bcm/vxlan.h> 21 #endif /* defined(INCLUDE_L3) */ 22 #include <bcm/srv6.h> 23 #include <bcm/oam.h> 24 #if defined(INCLUDE_L3) 25 #include <bcm/tunnel.h> 26 #include <bcm/l3.h> 27 #endif /* defined(INCLUDE_L3) */ 28 #include <bcm/port.h> 29 #include <bcm/ppp.h> 30 #include <bcm/tunnel.h> 31 #include <bcm/mirror.h> 32 #include <bcm/field.h> 33 #include <bcm/switch.h> 34 #if defined(INCLUDE_BFD) 35 #include <bcm/bfd.h> 36 #endif /* defined(INCLUDE_BFD) */ 37 #include <bcm/mpls.h> 38 #include <bcm/qos.h> 39 #include <bcm/pkt.h> 40 #include <bcm/cosq.h> 41 #include <bcm/flowtracker.h> 42 #include <bcm/cpri.h> 43 44 /* egress QoS model structure */ 45 typedef struct bcm_compat6517_qos_egress_model_s { 46 bcm_qos_egress_model_type_t egress_qos; /* egress qos variable */ 47 bcm_qos_egress_model_type_t egress_ttl; /* egress ttl */ 48 uint8 ecn_eligible; /* layer ecn is eligible */ 49 } bcm_compat6517_qos_egress_model_t; 50 51 /* bcm_mpls_egress_label_s */ 52 typedef struct bcm_compat6517_mpls_egress_label_s { 53 uint32 flags; /* BCM_MPLS_EGRESS_LABEL_xxx. */ 54 bcm_mpls_label_t label; /* */ 55 int qos_map_id; /* EXP map ID. */ 56 uint8 exp; /* */ 57 uint8 ttl; /* */ 58 uint8 pkt_pri; /* */ 59 uint8 pkt_cfi; /* */ 60 bcm_if_t tunnel_id; /* Tunnel Interface. */ 61 bcm_if_t l3_intf_id; /* l3 Interface ID. */ 62 bcm_mpls_egress_action_t action; /* MPLS label action, relevant when BCM_MPLS_EGRESS_LABEL_ACTION_VALID is set. */ 63 int ecn_map_id; /* Ecn map id for IP ECN to EXP mapping. */ 64 int int_cn_map_id; /* Ecn map id for INT_CN to EXP mapping. */ 65 bcm_failover_t egress_failover_id; /* Failover object index for Egress Protection. */ 66 bcm_if_t egress_failover_if_id; /* Failover MPLS Tunnel identifier for Egress Protection. */ 67 int outlif_counting_profile; /* Out LIF counting profile */ 68 bcm_mpls_special_label_push_type_t spl_label_push_type; /* Special label push type */ 69 bcm_encap_access_t encap_access; /* Encapsulation Access stage */ 70 bcm_compat6517_qos_egress_model_t egress_qos_model; /* egress qos and ttl model */ 71 } bcm_compat6517_mpls_egress_label_t; 72 73 #if defined(INCLUDE_L3) 74 /* Set the MPLS tunnel initiator parameters for an L3 interface. */ 75 extern int bcm_compat6517_mpls_tunnel_initiator_set( 76 int unit, 77 bcm_if_t intf, 78 int num_labels, 79 bcm_compat6517_mpls_egress_label_t *label_array); 80 81 /* bcm_mpls_tunnel_initiator_create */ 82 extern int bcm_compat6517_mpls_tunnel_initiator_create( 83 int unit, 84 bcm_if_t intf, 85 int num_labels, 86 bcm_compat6517_mpls_egress_label_t *label_array); 87 88 /* Get the MPLS tunnel initiator parameters from an L3 interface. */ 89 extern int bcm_compat6517_mpls_tunnel_initiator_get( 90 int unit, 91 bcm_if_t intf, 92 int label_max, 93 bcm_compat6517_mpls_egress_label_t *label_array, 94 int *label_count); 95 96 /* MPLS port type. */ 97 typedef struct bcm_compat6517_mpls_port_s { 98 bcm_gport_t mpls_port_id; /* GPORT identifier. */ 99 uint32 flags; /* BCM_MPLS_PORT_xxx. */ 100 uint32 flags2; /* BCM_MPLS_PORT2_xxx. */ 101 int if_class; /* Interface class ID. */ 102 int exp_map; /* Incoming EXP map ID. */ 103 int int_pri; /* Internal priority. */ 104 uint8 pkt_pri; /* Packet priority. */ 105 uint8 pkt_cfi; /* Packet CFI. */ 106 uint16 service_tpid; /* Service VLAN TPID value. */ 107 bcm_gport_t port; /* Match port and/or egress port. */ 108 bcm_mpls_port_match_t criteria; /* Match criteria. */ 109 bcm_vlan_t match_vlan; /* Outer VLAN ID to match. */ 110 bcm_vlan_t match_inner_vlan; /* Inner VLAN ID to match. */ 111 bcm_mpls_label_t match_label; /* VC label to match. */ 112 bcm_if_t egress_tunnel_if; /* MPLS tunnel egress object. */ 113 bcm_compat6517_mpls_egress_label_t egress_label; /* Outgoing VC label. */ 114 int mtu; /* MPLS port MTU. */ 115 bcm_vlan_t egress_service_vlan; /* Service VLAN to Add/Replace. */ 116 uint32 pw_seq_number; /* Initial-value of Pseudo-wire Sequence number */ 117 bcm_if_t encap_id; /* Encap Identifier. */ 118 bcm_failover_t ingress_failover_id; /* Ingress Failover Object Identifier. */ 119 bcm_gport_t ingress_failover_port_id; /* Ingress Failover MPLS Port Identifier. */ 120 bcm_failover_t failover_id; /* Failover Object Identifier. */ 121 bcm_gport_t failover_port_id; /* Failover MPLS Port Identifier. */ 122 bcm_policer_t policer_id; /* Policer ID to be associated with the MPLS gport */ 123 bcm_multicast_t failover_mc_group; /* MC group used for bi-cast. */ 124 bcm_failover_t pw_failover_id; /* Failover Object Identifier for Redundant PW. */ 125 bcm_gport_t pw_failover_port_id; /* Redundant PW port Identifier. */ 126 bcm_mpls_port_control_channel_type_t vccv_type; /* Indicate VCCV Control Channel */ 127 bcm_switch_network_group_t network_group_id; /* Split Horizon network group identifier */ 128 bcm_vlan_t match_subport_pkt_vid; /* LLTAG VLAN ID to match. */ 129 bcm_gport_t tunnel_id; /* Tunnel Id pointing to ingress LSP. */ 130 bcm_gport_t per_flow_queue_base; /* Base queue of the per flow queue set. Actual queue is decided based on internal priority and qos map. */ 131 int qos_map_id; /* QOS map identifier. */ 132 bcm_failover_t egress_failover_id; /* Failover object index for Egress Protection */ 133 bcm_gport_t egress_failover_port_id; /* Failover MPLS Port identifier for Egress Protection */ 134 int ecn_map_id; /* ECN map identifier. */ 135 uint32 class_id; /* Class ID */ 136 uint32 egress_class_id; /* Egress Class ID */ 137 int inlif_counting_profile; /* In LIF counting profile */ 138 bcm_compat6517_mpls_egress_label_t egress_tunnel_label; /* A mpls tunnel to be binded with the pwe */ 139 int nof_service_tags; /* Number of Service-Tags expected on Native-ETH header */ 140 bcm_qos_ingress_model_t ingress_qos_model; /* ingress qos&ttl model */ 141 bcm_mpls_label_t context_label; /* Ingress match - context label. */ 142 bcm_if_t ingress_if; /* Ingress match - context interface. */ 143 } bcm_compat6517_mpls_port_t; 144 145 /* Add an MPLS port to an L2 VPN. */ 146 extern int bcm_compat6517_mpls_port_add( 147 int unit, 148 bcm_vpn_t vpn, 149 bcm_compat6517_mpls_port_t *mpls_port); 150 151 /* Get an MPLS port from an L2 VPN. */ 152 extern int bcm_compat6517_mpls_port_get( 153 int unit, 154 bcm_vpn_t vpn, 155 bcm_compat6517_mpls_port_t *mpls_port); 156 157 /* Get all MPLS ports from an L2 VPN. */ 158 extern int bcm_compat6517_mpls_port_get_all( 159 int unit, 160 bcm_vpn_t vpn, 161 int port_max, 162 bcm_compat6517_mpls_port_t *port_array, 163 int *port_count); 164 165 /* MPLS tunnel initiator type. */ 166 typedef enum bcm_mpls_tunnel_encap_type_e { 167 bcmMplsTunnelEncapTypeInvalid = 0, /* Illegal. */ 168 bcmMplsTunnelEncapTypeL2 = 1, /* L2 MPLS tunnel. */ 169 bcmMplsTunnelEncapTypeL3 = 2, /* L3 MPLS tunnel. */ 170 bcmMplsTunnelEncapTypeCount = 3 /* Must be last. */ 171 } bcm_mpls_tunnel_encap_type_t; 172 173 /* MPLS tunnel initiator structure. */ 174 typedef struct bcm_compat6517_mpls_tunnel_encap_s { 175 bcm_gport_t tunnel_id; /* Tunnel ID. */ 176 bcm_mpls_tunnel_encap_type_t tunnel_type; /* Tunnel initiator type. */ 177 int num_labels; /* Number of labels to be added. */ 178 bcm_compat6517_mpls_egress_label_t label_array[BCM_MPLS_EGRESS_LABEL_MAX]; /* Label info. */ 179 } bcm_compat6517_mpls_tunnel_encap_t; 180 181 /* Create the MPLS tunnel initiator. */ 182 extern int bcm_compat6517_mpls_tunnel_encap_create( 183 int unit, 184 uint32 options, 185 bcm_compat6517_mpls_tunnel_encap_t *tunnel_encap); 186 187 /* Get the MPLS tunnel initiator. */ 188 extern int bcm_compat6517_mpls_tunnel_encap_get( 189 int unit, 190 bcm_compat6517_mpls_tunnel_encap_t *tunnel_encap); 191 192 /* MPLS tunnel switch structure. */ 193 typedef struct bcm_compat6517_mpls_tunnel_switch_s { 194 uint32 flags; /* BCM_MPLS_SWITCH_xxx. */ 195 uint32 flags2; /* BCM_MPLS_SWITCH2_xxx. */ 196 bcm_mpls_label_t label; /* Incoming label value. */ 197 bcm_mpls_label_t second_label; /* Incoming second label. */ 198 bcm_gport_t port; /* Incoming port. */ 199 bcm_mpls_switch_action_t action; /* MPLS label action. */ 200 bcm_mpls_switch_action_t action_if_bos; /* MPLS label action if BOS. */ 201 bcm_mpls_switch_action_t action_if_not_bos; /* MPLS label action if not BOS. */ 202 bcm_multicast_t mc_group; /* P2MP Multicast group. */ 203 int exp_map; /* EXP-map ID. */ 204 int int_pri; /* Internal priority. */ 205 bcm_policer_t policer_id; /* Policer ID to be associated with the incoming label. */ 206 bcm_vpn_t vpn; /* L3 VPN used if action is POP. */ 207 bcm_compat6517_mpls_egress_label_t egress_label; /* Outgoing label information. */ 208 bcm_if_t egress_if; /* Outgoing egress object. */ 209 bcm_if_t ingress_if; /* Ingress Interface object. */ 210 int mtu; /* MTU. */ 211 int qos_map_id; /* QOS map identifier. */ 212 bcm_failover_t failover_id; /* Failover Object Identifier for protected tunnel. Used for 1+1 protection also */ 213 bcm_gport_t tunnel_id; /* Tunnel ID. */ 214 bcm_gport_t failover_tunnel_id; /* Failover Tunnel ID. */ 215 bcm_if_t tunnel_if; /* hierarchical interface, relevant for when action is BCM_MPLS_SWITCH_ACTION_POP. */ 216 bcm_gport_t egress_port; /* Outgoing egress port. */ 217 uint16 oam_global_context_id; /* OAM global context id passed from ingress to egress XGS chip. */ 218 uint32 class_id; /* Class ID */ 219 int inlif_counting_profile; /* In LIF counting profile */ 220 int ecn_map_id; /* ECN map identifier */ 221 int tunnel_term_ecn_map_id; /* Tunnel termination ecn map identifier */ 222 uint32 stat_id; /* Object statistics id */ 223 int stat_pp_profile; /* Statistics id and profile */ 224 bcm_qos_ingress_model_t ingress_qos_model; /* ingress qos & ttl model */ 225 uint8 pkt_pri; /* New vlan pri */ 226 uint8 pkt_cfi; /* New vlan cfi */ 227 } bcm_compat6517_mpls_tunnel_switch_t; 228 229 /* Add an MPLS label entry. */ 230 extern int bcm_compat6517_mpls_tunnel_switch_add( 231 int unit, 232 bcm_compat6517_mpls_tunnel_switch_t *info); 233 234 /* Add an MPLS label entry. */ 235 extern int bcm_compat6517_mpls_tunnel_switch_create( 236 int unit, 237 bcm_compat6517_mpls_tunnel_switch_t *info); 238 239 /* Delete an MPLS label entry. */ 240 extern int bcm_compat6517_mpls_tunnel_switch_delete( 241 int unit, 242 bcm_compat6517_mpls_tunnel_switch_t *info); 243 244 /* Get an MPLS label entry. */ 245 extern int bcm_compat6517_mpls_tunnel_switch_get( 246 int unit, 247 bcm_compat6517_mpls_tunnel_switch_t *info); 248 #endif /* INCLUDE_L3 */ 249 250 /* OAM endpoint object. This is equivalent to an 802.1ag Maintenance Endpoint (MEP). */ 251 typedef struct bcm_compat6517_oam_endpoint_info_s { 252 uint32 flags; /* */ 253 uint32 flags2; /* */ 254 uint32 opcode_flags; /* OAM opcode flags */ 255 uint32 lm_flags; /* OAM loss measurment flags */ 256 bcm_oam_endpoint_t id; /* */ 257 bcm_oam_endpoint_type_t type; /* */ 258 bcm_oam_group_t group; /* The ID of the group to which this endpoint belongs */ 259 uint16 name; /* A unique identifier of the endpoint within the group. This is equivalent to the MEPID in 802.1ag. */ 260 bcm_oam_endpoint_t local_id; /* Used by remote endpoints only. */ 261 int level; /* This is equivalent to the Maintenance Domain Level (MDL) in 802.1ag. */ 262 int ccm_period; /* For local endpoints, this is the CCM transmission period in ms. For remote endpoints, this is the period on which CCM timeout is based. */ 263 bcm_vlan_t vlan; /* The VLAN associated with this endpoint */ 264 bcm_vlan_t inner_vlan; /* Configure with CVID for two-tag operation or set to 0 for one-tag */ 265 bcm_gport_t gport; /* The gport associated with this endpoint */ 266 bcm_gport_t tx_gport; /* TX gport associated with this endpoint */ 267 int trunk_index; /* The trunk port index for this endpoint */ 268 bcm_if_t intf_id; /* Interface Identifier */ 269 bcm_mpls_label_t mpls_label; /* The MPLS label associated with packets received from the Peer Endpoint */ 270 bcm_compat6517_mpls_egress_label_t egress_label; /* The MPLS outgoing label information for the Local Endpoint */ 271 bcm_oam_mpls_network_info_t mpls_network_info; /* MPLS networks information */ 272 bcm_mac_t dst_mac_address; /* The destination MAC address associated with this endpoint */ 273 bcm_mac_t src_mac_address; /* The source MAC address associated with this endpoint */ 274 uint8 pkt_pri; /* Egress marking for outgoing CCMs */ 275 uint8 inner_pkt_pri; /* Packet priority of inner encpsulated packet */ 276 uint16 inner_tpid; /* Tpid of inner encpsulated packet */ 277 uint16 outer_tpid; /* Tpid of outer encpsulated packet */ 278 bcm_cos_t int_pri; /* Egress queuing for outgoing CCMs. For DownMEPs, this represents the index from the base queue. For UpMEPs, this represents the internal priority itself. */ 279 uint8 cpu_qid; /* CPU queue for CCMs */ 280 uint8 pri_map[BCM_OAM_INTPRI_MAX]; /* Priority mapping for LM counter table */ 281 uint32 faults; /* Fault flags */ 282 uint32 persistent_faults; /* Persistent fault flags */ 283 uint32 clear_persistent_faults; /* Persistent fault flags to clear on a 'get' */ 284 int ing_map; /* Ingress QoS map profile */ 285 int egr_map; /* Egress QoS map profile */ 286 uint8 ms_pw_ttl; /* TTL used for multi-segment pseudowire */ 287 uint8 port_state; /* Endpoint port status */ 288 uint8 interface_state; /* Endpoint interface status */ 289 bcm_oam_vccv_type_t vccv_type; /* VCCV pseudowire type */ 290 bcm_vpn_t vpn; /* VPN id */ 291 int lm_counter_base_id; /* Counter id associated with the mep */ 292 uint8 lm_counter_if; /* Counter interface associated with the mep */ 293 uint8 loc_clear_threshold; /* Number of packets required to reset the Loss-of-Continuity status per end point */ 294 bcm_oam_timestamp_format_t timestamp_format; /* DM time stamp format - NTP/IEEE1588(PTP) */ 295 uint16 subport_tpid; /* Tpid of subport Vlan in case of triple vlan encapsulation */ 296 bcm_gport_t remote_gport; /* Local endpoint CCMs are forwarded to this remote unit for processing. */ 297 bcm_gport_t mpls_out_gport; /* Out gport used for TX counting by BHH endpoints. */ 298 int sampling_ratio; /* 0 - No packets sampled to the CPU. 1-8 - Count of packets (with events) that need to arrive before one is sampled to the CPU. */ 299 uint32 lm_payload_offset; /* Offset in bytes from TOP of the MPLS label stack from where the payload starts for byte count computation. */ 300 uint32 lm_cos_offset; /* Offset of the Label from top of the stack which gives the EXP value for deriving the COS value - valid values are 0/1/2. */ 301 bcm_oam_lm_counter_type_t lm_ctr_type; /* BYTE/PACKET. */ 302 bcm_oam_lm_counter_size_t lm_ctr_sample_size; /* Valid values are 32/64. */ 303 uint32 pri_map_id; /* OAM priority map id. */ 304 int lm_ctr_pool_id; /* The loss measurement counter pool id from which the counters should be allocated. Valid values are 0/1/2. */ 305 uint32 ccm_tx_update_lm_counter_base_id[BCM_OAM_LM_COUNTER_MAX]; /* The base index of the LM counter to be updated by Tx CCM packets */ 306 uint32 ccm_tx_update_lm_counter_offset[BCM_OAM_LM_COUNTER_MAX]; /* Offset to the Base LM counter Id to be incremented by Tx CCM packets */ 307 uint8 ccm_tx_update_lm_counter_action[BCM_OAM_LM_COUNTER_MAX]; /* LM Counter action (type bcm_oam_lm_counter_action_t) to be used by TX CCM packets */ 308 uint8 ccm_tx_update_lm_counter_size; /* Number of LM counters to be incremented by Tx CCM packets */ 309 uint32 session_id; /* OAM session id for packet processing in BTE. In FP based OAM - This will indicate flex counter base ID */ 310 uint8 session_num_entries; /* Number of entries that can result in same session ID. In FP based OAM - This will indicate number of flex counter entries corresponding to same OAM session */ 311 uint8 lm_count_profile; /* LM count profile for this endpoint. It will be 1 or 0 for selecting one of the two OAM LM count profiles. */ 312 uint8 mpls_exp; /* EXP on which BHH will be running */ 313 bcm_oam_endpoint_t action_reference_id; /* Reference endpoint id whose actions will be used on the new created endpoint. Default value: BCM_OAM_ENDPOINT_INVALID. API call will set the parameter to BCM_OAM_ENDPOINT_INVALID */ 314 bcm_oam_profile_t acc_profile_id; /* Used by accelerated endpoints. */ 315 bcm_oam_endpoint_memory_type_t endpoint_memory_type; /* Type of default endpoint memory */ 316 int punt_good_packet_period; /* OAM good packets sampling period. Every punt_good_packet_period milliseconds, a single packet is punted to the CPU */ 317 uint16 extra_data_index; /* Pointer to first extra data entry used per MEP for additional features */ 318 } bcm_compat6517_oam_endpoint_info_t; 319 320 /* Create or replace an OAM endpoint object. */ 321 extern int bcm_compat6517_oam_endpoint_create( 322 int unit, 323 bcm_compat6517_oam_endpoint_info_t *endpoint_info); 324 325 /* Get an OAM endpoint object. */ 326 extern int bcm_compat6517_oam_endpoint_get( 327 int unit, 328 bcm_oam_endpoint_t endpoint, 329 bcm_compat6517_oam_endpoint_info_t *endpoint_info); 330 331 /* Structure that is used in SRv6 SRH Base initiator APIs, for managing device behavior at SRv6 Tunnel Encapsulation */ 332 typedef struct bcm_compat6517_srv6_srh_base_initiator_info_s { 333 uint32 flags; /* BCM_SRV6_SRH_BASE_INITIATOR_XXX */ 334 bcm_gport_t tunnel_id; /* Tunnel SRv6 SRH base object ID */ 335 int nof_sids; /* Number of SIDs in the SID list */ 336 int qos_map_id; /* QOS map identifier */ 337 int ttl; /* Tunnel header TTL */ 338 int dscp; /* Tunnel header DSCP value */ 339 bcm_compat6517_qos_egress_model_t egress_qos_model; /* Egress qos and ttl model */ 340 bcm_if_t next_encap_id; /* Next encapsulation ID */ 341 } bcm_compat6517_srv6_srh_base_initiator_info_t; 342 343 /* Create/Get/Delete/Traverse SRv6 SRH Base properties */ 344 extern int bcm_compat6517_srv6_srh_base_initiator_create( 345 int unit, 346 bcm_compat6517_srv6_srh_base_initiator_info_t *info); 347 348 /* Create/Get/Delete/Traverse SRv6 SRH Base properties */ 349 extern int bcm_compat6517_srv6_srh_base_initiator_get( 350 int unit, 351 bcm_compat6517_srv6_srh_base_initiator_info_t *info); 352 353 /* Create/Get/Delete/Traverse SRv6 SRH Base properties */ 354 extern int bcm_compat6517_srv6_srh_base_initiator_delete( 355 int unit, 356 bcm_compat6517_srv6_srh_base_initiator_info_t *info); 357 358 /* Layer 2 Logical port type */ 359 typedef struct bcm_compat6517_vlan_port_s { 360 bcm_vlan_port_match_t criteria; /* Match criteria. */ 361 uint32 flags; /* BCM_VLAN_PORT_xxx. */ 362 bcm_vlan_t vsi; /* Populated for bcm_vlan_port_find only */ 363 bcm_vlan_t match_vlan; /* Outer VLAN ID to match. */ 364 bcm_vlan_t match_inner_vlan; /* Inner VLAN ID to match. */ 365 int match_pcp; /* Outer PCP ID to match. */ 366 bcm_tunnel_id_t match_tunnel_value; /* Tunnel value to match. */ 367 bcm_port_ethertype_t match_ethertype; /* Ethernet type value to match. */ 368 bcm_gport_t port; /* Gport: local or remote Physical or logical gport. */ 369 uint8 pkt_pri; /* Service tag priority. */ 370 uint8 pkt_cfi; /* Service tag cfi. */ 371 uint16 egress_service_tpid; /* Service VLAN TPID value. */ 372 bcm_vlan_t egress_vlan; /* Egress Outer VLAN or SD-TAG VLAN ID. */ 373 bcm_vlan_t egress_inner_vlan; /* Egress Inner VLAN. */ 374 bcm_tunnel_id_t egress_tunnel_value; /* Egress Tunnel value. */ 375 bcm_if_t encap_id; /* Encapsulation Index. */ 376 int qos_map_id; /* QoS Map Index. */ 377 bcm_policer_t policer_id; /* Policer ID */ 378 bcm_policer_t egress_policer_id; /* Egress Policer ID */ 379 bcm_failover_t failover_id; /* Failover Object Index. */ 380 bcm_gport_t failover_port_id; /* Failover VLAN Port Identifier. */ 381 bcm_gport_t vlan_port_id; /* GPORT identifier */ 382 bcm_multicast_t failover_mc_group; /* MC group used for bi-cast. */ 383 bcm_failover_t ingress_failover_id; /* 1+1 protection. */ 384 bcm_failover_t egress_failover_id; /* Failover object index for Egress Protection */ 385 bcm_gport_t egress_failover_port_id; /* Failover VLAN Port Identifier for Egress Protection */ 386 bcm_switch_network_group_t ingress_network_group_id; /* Split Horizon ingress network group identifier */ 387 bcm_switch_network_group_t egress_network_group_id; /* Split Horizon egress network group identifier */ 388 int inlif_counting_profile; /* In LIF counting profile */ 389 int outlif_counting_profile; /* Out LIF counting profile */ 390 uint32 if_class; /* Egress Interface class ID */ 391 bcm_gport_t tunnel_id; /* Pointer from Native AC to next entry in EEDB list. */ 392 uint32 group; /* flush group id to be used by l2 flush mechanism */ 393 bcm_gport_t ingress_failover_port_id; /* Failover VLAN Port Identifier for ingress Protection. */ 394 uint16 class_id; /* Class ID of the source port */ 395 uint32 match_class_id; /* Match Namespace. */ 396 bcm_qos_ingress_model_t ingress_qos_model; /* ingress qos and ttl model */ 397 bcm_compat6517_qos_egress_model_t egress_qos_model; /* egress qos and ttl model */ 398 } bcm_compat6517_vlan_port_t; 399 400 /* Create a layer 2 logical port. */ 401 extern int bcm_compat6517_vlan_port_create( 402 int unit, 403 bcm_compat6517_vlan_port_t *vlan_port); 404 405 /* Get/find a layer 2 logical port given the GPORT ID or match criteria. */ 406 extern int bcm_compat6517_vlan_port_find( 407 int unit, 408 bcm_compat6517_vlan_port_t *vlan_port); 409 410 411 #if defined(INCLUDE_BFD) 412 /* BFD endpoint object. */ 413 typedef struct bcm_compat6517_bfd_endpoint_info_s { 414 uint32 flags; /* Control flags. */ 415 bcm_bfd_endpoint_t id; /* Endpoint identifier. */ 416 bcm_bfd_endpoint_t remote_id; /* Remote endpoint identifier. */ 417 bcm_bfd_tunnel_type_t type; /* Type of BFD encapsulation. */ 418 bcm_gport_t gport; /* Gport identifier. */ 419 bcm_gport_t tx_gport; /* TX gport associated with this endpoint. */ 420 bcm_gport_t remote_gport; /* Gport identifier of trapping destination: OAMP or CPU, local or remote. */ 421 int bfd_period; /* For local endpoints, this is the BFD transmission period in ms. */ 422 bcm_vpn_t vpn; /* VPN. */ 423 uint8 vlan_pri; /* VLAN tag priority. */ 424 uint8 inner_vlan_pri; /* Inner VLAN tag priority. */ 425 bcm_vrf_t vrf_id; /* Vrf identifier. */ 426 bcm_ip_t dst_ip_addr; /* Destination IPv4 address. */ 427 bcm_ip6_t dst_ip6_addr; /* Destination IPv6 address. */ 428 bcm_ip_t src_ip_addr; /* Source IPv4 address. */ 429 bcm_ip6_t src_ip6_addr; /* Source IPv6 address. */ 430 uint8 ip_tos; /* IPv4 Tos / IPv6 Traffic Class. */ 431 uint8 ip_ttl; /* IPv4 TTL / IPv6 Hop Count. */ 432 bcm_ip_t inner_dst_ip_addr; /* Inner destination IPv4 address. */ 433 bcm_ip6_t inner_dst_ip6_addr; /* Inner destination IPv6 address. */ 434 bcm_ip_t inner_src_ip_addr; /* Inner source IPv4 address. */ 435 bcm_ip6_t inner_src_ip6_addr; /* Inner source IPv6 address. */ 436 uint8 inner_ip_tos; /* Inner IPv4 Tos / IPv6 Traffic Class. */ 437 uint8 inner_ip_ttl; /* Inner IPv4 TTL / IPv6 Hop Count. */ 438 uint32 udp_src_port; /* UDP source port for Ipv4, Ipv6. */ 439 bcm_mpls_label_t label; /* Incoming inner label. */ 440 bcm_compat6517_mpls_egress_label_t egress_label; /* The MPLS outgoing label information. */ 441 bcm_if_t egress_if; /* Egress interface. */ 442 uint8 mep_id[BCM_BFD_ENDPOINT_MAX_MEP_ID_LENGTH]; /* MPLS-TP CC/CV TLV and Source MEP ID. */ 443 uint8 mep_id_length; /* Length of MPLS-TP CC/CV TLV and MEP-ID. */ 444 bcm_cos_t int_pri; /* Egress queuing for outgoing BFD to remote. */ 445 uint8 cpu_qid; /* CPU queue for BFD. */ 446 bcm_bfd_state_t local_state; /* Local session state. */ 447 uint32 local_discr; /* Local discriminator. */ 448 bcm_bfd_diag_code_t local_diag; /* Local diagnostic code. */ 449 uint32 local_flags; /* Flags combination on outgoing frames. */ 450 uint32 local_min_tx; /* Desired local min tx interval. */ 451 uint32 local_min_rx; /* Required local rx interval. */ 452 uint32 local_min_echo; /* Local minimum echo interval. */ 453 uint8 local_detect_mult; /* Local detection interval multiplier. */ 454 bcm_bfd_auth_type_t auth; /* Authentication type. */ 455 uint32 auth_index; /* Authentication index. */ 456 uint32 tx_auth_seq; /* Tx authentication sequence id. */ 457 uint32 rx_auth_seq; /* Rx authentication sequence id. */ 458 uint32 remote_flags; /* Remote flags. */ 459 bcm_bfd_state_t remote_state; /* Remote session state. */ 460 uint32 remote_discr; /* Remote discriminator. */ 461 bcm_bfd_diag_code_t remote_diag; /* Remote diagnostic code. */ 462 uint32 remote_min_tx; /* Desired remote min tx interval. */ 463 uint32 remote_min_rx; /* Required remote rx interval. */ 464 uint32 remote_min_echo; /* Remote minimum echo interval. */ 465 uint8 remote_detect_mult; /* Remote detection interval multiplier. */ 466 int sampling_ratio; /* 0 - No packets sampled to the CPU. 1-8 - Count of packets (with events) that need to arrive before one is sampled to the CPU. */ 467 uint8 loc_clear_threshold; /* Number of packets required to reset the Loss-of-Continuity status per endpoint. */ 468 uint32 ip_subnet_length; /* The subnet length for incoming packet validity check. Value 0 indicates no check is performed, positive values indicate the amount of MSBs to be compared. */ 469 uint8 remote_mep_id[BCM_BFD_ENDPOINT_MAX_MEP_ID_LENGTH]; /* MPLS-TP CC/CV TLV and Remote MEP ID. */ 470 uint8 remote_mep_id_length; /* Length of MPLS-TP CC/CV TLV and REMOTE MEP-ID. */ 471 uint8 mis_conn_mep_id[BCM_BFD_ENDPOINT_MAX_MEP_ID_LENGTH]; /* MPLS-TP CC/CV TLV and Mis connectivity MEP ID. */ 472 uint8 mis_conn_mep_id_length; /* Length of MPLS-TP CC/CV TLV and Mis connectivity MEP-ID. */ 473 uint32 bfd_detection_time; /* Optional: BFD Detection Time, in microseconds. */ 474 bcm_vlan_t pkt_vlan_id; /* TX Packet Vlan Id. */ 475 bcm_vlan_t rx_pkt_vlan_id; /* RX Packet Vlan Id. */ 476 bcm_mpls_label_t gal_label; /* MPLS GAL label. */ 477 uint32 faults; /* Fault flags. */ 478 uint32 flags2; /* Second set of control flags. */ 479 int ipv6_extra_data_index; /* Pointer to first extended data entry */ 480 int punt_good_packet_period; /* BFD good packets sampling period. Every punt_good_packet_period milliseconds, a single packet is punted to the CPU */ 481 uint8 bfd_period_cluster; /* Tx period group. All MEPs in a group must be created with the same Tx period. Modifying the Tx period in one MEP affects the others. */ 482 } bcm_compat6517_bfd_endpoint_info_t; 483 484 /* Create or update an BFD endpoint object */ 485 extern int bcm_compat6517_bfd_endpoint_create( 486 int unit, 487 bcm_compat6517_bfd_endpoint_info_t *endpoint_info); 488 489 /* Get an BFD endpoint object. */ 490 extern int bcm_compat6517_bfd_endpoint_get( 491 int unit, 492 bcm_bfd_endpoint_t endpoint, 493 bcm_compat6517_bfd_endpoint_info_t *endpoint_info); 494 495 496 #endif /* defined(INCLUDE_BFD) */ 497 #if defined(INCLUDE_L3) 498 typedef struct bcm_compat6517_l3_intf_s { 499 uint32 l3a_flags; /* See BCM_L3_FLAGS_XXX flags 500 definitions. */ 501 uint32 l3a_flags2; /* See BCM_L3_FLAGS2_XXX flags 502 definitions. */ 503 bcm_vrf_t l3a_vrf; /* Virtual router instance. */ 504 bcm_if_t l3a_intf_id; /* Interface ID. */ 505 bcm_mac_t l3a_mac_addr; /* MAC address. */ 506 bcm_vlan_t l3a_vid; /* VLAN ID. */ 507 bcm_vlan_t l3a_inner_vlan; /* Inner vlan for double tagged packets. */ 508 int l3a_tunnel_idx; /* Tunnel (initiator) index. */ 509 int l3a_ttl; /* TTL threshold. */ 510 int l3a_mtu; /* MTU. */ 511 int l3a_mtu_forwarding; /* Forwarding Layer MTU. */ 512 bcm_if_group_t l3a_group; /* Interface group number. */ 513 bcm_l3_intf_qos_t vlan_qos; /* Outer-Vlan QoS Setting. */ 514 bcm_l3_intf_qos_t inner_vlan_qos; /* Inner-Vlan QoS Setting. */ 515 bcm_l3_intf_qos_t dscp_qos; /* DSCP QoS Setting. */ 516 int l3a_intf_class; /* L3 interface class ID */ 517 int l3a_ip4_options_profile_id; /* IP4 Options handling Profile ID */ 518 int l3a_nat_realm_id; /* Realm id of the interface for NAT */ 519 uint16 outer_tpid; /* TPID value */ 520 uint32 l3a_intf_flags; /* See BCM_L3_INTF_XXX flag definitions. */ 521 uint8 native_routing_vlan_tags; /* Set number of VLAN tags expected when 522 interface is used for native routing */ 523 bcm_gport_t l3a_source_vp; /* Source virtual port in overlay 524 domain. SVP is used for deriving port 525 properties in the egress device when 526 packets are sent over HG flow. */ 527 uint32 flow_handle; /* FLOW handle for flex entries. */ 528 uint32 flow_option_handle; /* FLOW option handle for flex entries. */ 529 bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex 530 entries. */ 531 uint32 num_of_fields; /* number of logical fields. */ 532 bcm_qos_ingress_model_t ingress_qos_model; /* ingress qos and ttl model */ 533 bcm_compat6517_qos_egress_model_t egress_qos_model; /* egress qos and ttl model */ 534 uint32 stat_id; /* Object statistics ID. */ 535 int stat_pp_profile; /* Statistics profile. */ 536 } bcm_compat6517_l3_intf_t; 537 538 /* Create a new L3 interface. */ 539 extern int bcm_compat6517_l3_intf_create( 540 int unit, 541 bcm_compat6517_l3_intf_t *intf); 542 543 /* Delete an L3 interface */ 544 extern int bcm_compat6517_l3_intf_delete( 545 int unit, 546 bcm_compat6517_l3_intf_t *intf); 547 548 /* Search for L3 interface by MAC address and VLAN. */ 549 extern int bcm_compat6517_l3_intf_find( 550 int unit, 551 bcm_compat6517_l3_intf_t *intf); 552 553 /* Search for L3 interface by VLAN only. */ 554 extern int bcm_compat6517_l3_intf_find_vlan( 555 int unit, 556 bcm_compat6517_l3_intf_t *intf); 557 558 /* Given the L3 interface number, return the interface information. */ 559 extern int bcm_compat6517_l3_intf_get( 560 int unit, 561 bcm_compat6517_l3_intf_t *intf); 562 563 564 /* L3 tunneling initiator. */ 565 typedef struct bcm_compat6517_tunnel_initiator_s { 566 uint32 flags; /* Configuration flags. */ 567 bcm_tunnel_type_t type; /* Tunnel type. */ 568 int ttl; /* Tunnel header TTL. */ 569 bcm_mac_t dmac; /* Destination MAC address. */ 570 bcm_ip_t dip; /* Tunnel header DIP (IPv4). */ 571 bcm_ip_t sip; /* Tunnel header SIP (IPv4). */ 572 bcm_ip6_t sip6; /* Tunnel header SIP (IPv6). */ 573 bcm_ip6_t dip6; /* Tunnel header DIP (IPv6). */ 574 uint32 flow_label; /* Tunnel header flow label (IPv6). */ 575 bcm_tunnel_dscp_select_t dscp_sel; /* Tunnel header DSCP select. */ 576 int dscp; /* Tunnel header DSCP value. */ 577 int dscp_map; /* DSCP-map ID. */ 578 bcm_gport_t tunnel_id; /* Tunnel ID */ 579 uint16 udp_dst_port; /* Destination UDP port */ 580 uint16 udp_src_port; /* Source UDP port */ 581 bcm_mac_t smac; /* WLAN outer MAC */ 582 int mtu; /* WLAN MTU */ 583 bcm_vlan_t vlan; /* Tunnel VLAN */ 584 uint16 tpid; /* Tunnel TPID */ 585 uint8 pkt_pri; /* Tunnel priority */ 586 uint8 pkt_cfi; /* Tunnel CFI */ 587 uint16 ip4_id; /* IPv4 ID. */ 588 bcm_if_t l3_intf_id; /* l3 Interface ID. */ 589 uint16 span_id; /* Erspan Span ID. */ 590 uint32 aux_data; /* Tunnel associated data. */ 591 int outlif_counting_profile; /* Out LIF counting profile */ 592 bcm_encap_access_t encap_access; /* Encapsulation Access stage */ 593 uint8 hw_id; /* Unique identifier of an ERSPAN engine within a system */ 594 uint16 switch_id; /* Identifies a source switch at the receiving end */ 595 uint16 class_id; /* Class ID of the RSPAN advanced tunnel */ 596 bcm_compat6517_qos_egress_model_t egress_qos_model; /* egress qos and ttl model */ 597 int qos_map_id; /* general remark profile */ 598 uint8 ecn; /* Tunnel header ECN value. */ 599 bcm_tunnel_flow_label_select_t flow_label_sel; /* Tunnel header flow label select. */ 600 bcm_tunnel_dscp_ecn_select_t dscp_ecn_sel; /* Tunnel header DSCP and ECN select. */ 601 int dscp_ecn_map; /* DSCP and ECN map ID. */ 602 } bcm_compat6517_tunnel_initiator_t; 603 604 /* Set the tunneling initiator parameters on an L3 interface. */ 605 extern int bcm_compat6517_tunnel_initiator_set( 606 int unit, 607 bcm_compat6517_l3_intf_t *intf, 608 bcm_compat6517_tunnel_initiator_t *tunnel); 609 610 /* Set the tunneling initiator parameters on an L3 interface. */ 611 extern int bcm_compat6517_tunnel_initiator_create( 612 int unit, 613 bcm_compat6517_l3_intf_t *intf, 614 bcm_compat6517_tunnel_initiator_t *tunnel); 615 616 /* Delete the tunnel association for the given L3 interface. */ 617 extern int bcm_compat6517_tunnel_initiator_clear( 618 int unit, 619 bcm_compat6517_l3_intf_t *intf); 620 621 /* Get the tunnel property for the given L3 interface. */ 622 extern int bcm_compat6517_tunnel_initiator_get( 623 int unit, 624 bcm_compat6517_l3_intf_t *intf, 625 bcm_compat6517_tunnel_initiator_t *tunnel); 626 627 /* Create VXLAN Tunnel Initiator. */ 628 extern int bcm_compat6517_vxlan_tunnel_initiator_create( 629 int unit, 630 bcm_compat6517_tunnel_initiator_t *info); 631 632 /* Get VXLAN Tunnel Initiator. */ 633 extern int bcm_compat6517_vxlan_tunnel_initiator_get( 634 int unit, 635 bcm_compat6517_tunnel_initiator_t *info); 636 637 /* Set the tunneling initiator parameters for a WLAN tunnel. */ 638 extern int bcm_compat6517_wlan_tunnel_initiator_create( 639 int unit, 640 bcm_compat6517_tunnel_initiator_t *info); 641 642 /* Get the tunnel properties for an outgoing WLAN tunnel. */ 643 extern int bcm_compat6517_wlan_tunnel_initiator_get( 644 int unit, 645 bcm_compat6517_tunnel_initiator_t *info); 646 647 /* Create L2GRE Tunnel Initiator. */ 648 extern int bcm_compat6517_l2gre_tunnel_initiator_create( 649 int unit, 650 bcm_compat6517_tunnel_initiator_t *info); 651 652 /* Get L2GRE Tunnel Initiator. */ 653 extern int bcm_compat6517_l2gre_tunnel_initiator_get( 654 int unit, 655 bcm_compat6517_tunnel_initiator_t *info); 656 657 typedef struct bcm_compat6517_l3_ingress_s { 658 uint32 flags; /* Interface flags. */ 659 bcm_vrf_t vrf; /* Virtual router id. */ 660 bcm_l3_ingress_urpf_mode_t urpf_mode; /* URPF mode setting for L3 Ingress 661 Interface. */ 662 int intf_class; /* Classification class ID. */ 663 bcm_vlan_t ipmc_intf_id; /* IPMC L2 distribution Vlan. */ 664 int qos_map_id; /* QoS DSCP priority map. */ 665 int ip4_options_profile_id; /* IP4 Options handling Profile ID */ 666 int nat_realm_id; /* Realm id of the interface for NAT */ 667 int tunnel_term_ecn_map_id; /* Tunnel termination ecn map id */ 668 uint32 intf_class_route_disable; /* routing enablers bit map in rif 669 profile */ 670 int oam_default_profile; /* OAM profile for RIF */ 671 uint32 hash_layers_disable; /* load balancing disable hash layers 672 bit map using the 673 BCM_SWITCH_HASH_LAYER_XXX_DISABLE 674 flags */ 675 } bcm_compat6517_l3_ingress_t; 676 677 extern int bcm_compat6517_l3_ingress_create( 678 int unit, 679 bcm_compat6517_l3_ingress_t *ing_intf, 680 bcm_if_t *intf_id); 681 682 extern int bcm_compat6517_l3_ingress_get( 683 int unit, 684 bcm_if_t intf_id, 685 bcm_compat6517_l3_ingress_t *ing_intf); 686 687 extern int bcm_compat6517_l3_ingress_find( 688 int unit, 689 bcm_compat6517_l3_ingress_t *ing_intf, 690 bcm_if_t *intf_id); 691 692 /* 693 * L3 Egress Structure. 694 * 695 * Description of an L3 forwarding destination. 696 */ 697 typedef struct bcm_compat6517_l3_egress_s { 698 uint32 flags; /* Interface flags (BCM_L3_TGID, 699 BCM_L3_L2TOCPU). */ 700 uint32 flags2; /* See BCM_L3_FLAGS2_xxx flag 701 definitions. */ 702 bcm_if_t intf; /* L3 interface (source MAC, tunnel). */ 703 bcm_mac_t mac_addr; /* Next hop forwarding destination mac. */ 704 bcm_vlan_t vlan; /* Next hop vlan id. */ 705 bcm_module_t module; 706 bcm_port_t port; /* Port packet switched to (if 707 !BCM_L3_TGID). */ 708 bcm_trunk_t trunk; /* Trunk packet switched to (if 709 BCM_L3_TGID). */ 710 uint32 mpls_flags; /* BCM_MPLS flag definitions. */ 711 bcm_mpls_label_t mpls_label; /* MPLS label. */ 712 bcm_mpls_egress_action_t mpls_action; /* MPLS action. */ 713 int mpls_qos_map_id; /* MPLS EXP map ID. */ 714 int mpls_ttl; /* MPLS TTL threshold. */ 715 uint8 mpls_pkt_pri; /* MPLS Packet Priority Value. */ 716 uint8 mpls_pkt_cfi; /* MPLS Packet CFI Value. */ 717 uint8 mpls_exp; /* MPLS Exp. */ 718 int qos_map_id; /* General QOS map id */ 719 bcm_if_t encap_id; /* Encapsulation index. */ 720 bcm_failover_t failover_id; /* Failover Object Index. */ 721 bcm_if_t failover_if_id; /* Failover Egress Object index. */ 722 bcm_multicast_t failover_mc_group; /* Failover Multicast Group. */ 723 int dynamic_scaling_factor; /* Scaling factor for dynamic load 724 balancing thresholds. */ 725 int dynamic_load_weight; /* Weight of traffic load in determining 726 a dynamic load balancing member's 727 quality. */ 728 int dynamic_queue_size_weight; /* Weight of queue size in determining a 729 dynamic load balancing member's 730 quality. */ 731 int intf_class; /* L3 interface class ID */ 732 uint32 multicast_flags; /* BCM_L3_MULTICAST flag definitions. */ 733 uint16 oam_global_context_id; /* OAM global context id passed from 734 ingress to egress XGS chip. */ 735 bcm_vntag_t vntag; /* VNTAG. */ 736 bcm_vntag_action_t vntag_action; /* VNTAG action. */ 737 bcm_etag_t etag; /* ETAG. */ 738 bcm_etag_action_t etag_action; /* ETAG action. */ 739 uint32 flow_handle; /* FLOW handle for flex entries. */ 740 uint32 flow_option_handle; /* FLOW option handle for flex entries. */ 741 uint32 flow_label_option_handle; /* FLOW option handle for egress label 742 flex entries. */ 743 bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex 744 entries. */ 745 uint32 num_of_fields; /* number of logical fields. */ 746 int counting_profile; /* counting profile. If not required, 747 set it to 748 BCM_STAT_LIF_COUNTING_PROFILE_NONE */ 749 int mpls_ecn_map_id; /* IP ECN/INT CN to MPLS EXP map ID. */ 750 bcm_l3_ingress_urpf_mode_t urpf_mode; /* fec rpf mode. */ 751 bcm_multicast_t mc_group; /* Multicast Group. */ 752 bcm_mac_t src_mac_addr; /* Source MAC Address. */ 753 bcm_gport_t hierarchical_gport; /* Hierarchical TM-Flow. */ 754 uint32 stat_id; /* Object statistics ID. */ 755 int stat_pp_profile; /* Statistics profile. */ 756 bcm_gport_t vlan_port_id; /* Pointer to egress vlan translation 757 lif entry in EEDB. */ 758 int replication_id; /* Replication copy ID of multicast 759 Egress object. */ 760 int mtu; /* MTU. */ 761 } bcm_compat6517_l3_egress_t; 762 763 extern int bcm_compat6517_l3_egress_create( 764 int unit, 765 uint32 flags, 766 bcm_compat6517_l3_egress_t *egr, 767 bcm_if_t *if_id); 768 769 extern int bcm_compat6517_l3_egress_get( 770 int unit, 771 bcm_if_t intf, 772 bcm_compat6517_l3_egress_t *egr); 773 774 extern int bcm_compat6517_l3_egress_find( 775 int unit, 776 bcm_compat6517_l3_egress_t *egr, 777 bcm_if_t *intf); 778 779 extern int bcm_compat6517_l3_egress_allocation_get( 780 int unit, 781 uint32 flags, 782 bcm_compat6517_l3_egress_t *egr, 783 uint32 nof_members, 784 bcm_if_t *if_id); 785 786 extern int bcm_compat6517_failover_egress_set( 787 int unit, 788 bcm_if_t intf, 789 bcm_compat6517_l3_egress_t *failover_egr); 790 791 extern int bcm_compat6517_failover_egress_get( 792 int unit, 793 bcm_if_t intf, 794 bcm_compat6517_l3_egress_t *failover_egr); 795 796 /* L3 ECMP member structure */ 797 typedef struct bcm_compat6517_l3_ecmp_member_s { 798 uint32 flags; /* Member flag. */ 799 bcm_if_t egress_if; /* L3 interface ID pointing to Egress 800 Forwarding Object. */ 801 bcm_failover_t failover_id; /* Failover Object Identifier. */ 802 bcm_if_t failover_egress_if; /* Failover Egress L3 Interface ID. */ 803 int status; /* Member status. */ 804 int weight; /* Member weight value. */ 805 } bcm_compat6517_l3_ecmp_member_t; 806 807 /* Create an Egress ECMP forwarding object. */ 808 extern int bcm_compat6517_l3_ecmp_create( 809 int unit, 810 uint32 options, 811 bcm_l3_egress_ecmp_t *ecmp_info, 812 int ecmp_member_count, 813 bcm_compat6517_l3_ecmp_member_t *ecmp_member_array); 814 815 /* Get info about an Egress ECMP forwarding object. */ 816 extern int bcm_compat6517_l3_ecmp_get( 817 int unit, 818 bcm_l3_egress_ecmp_t *ecmp_info, 819 int ecmp_member_size, 820 bcm_compat6517_l3_ecmp_member_t *ecmp_member_array, 821 int *ecmp_member_count); 822 823 /* Add a member to an Egress ECMP forwarding object. */ 824 extern int bcm_compat6517_l3_ecmp_member_add( 825 int unit, 826 bcm_if_t ecmp_group_id, 827 bcm_compat6517_l3_ecmp_member_t *ecmp_member); 828 829 /* Delete a member from an Egress ECMP forwarding object. */ 830 extern int bcm_compat6517_l3_ecmp_member_delete( 831 int unit, 832 bcm_if_t ecmp_group_id, 833 bcm_compat6517_l3_ecmp_member_t *ecmp_member); 834 835 /* Find an Egress ECMP forwarding object. */ 836 extern int bcm_compat6517_l3_ecmp_find( 837 int unit, 838 int ecmp_member_count, 839 bcm_compat6517_l3_ecmp_member_t *ecmp_member_array, 840 bcm_l3_egress_ecmp_t *ecmp_info); 841 842 #endif /* INCLUDE_L3 */ 843 844 typedef struct bcm_compat6517_port_config_s { 845 bcm_pbmp_t fe; /* Mask of FE ports. */ 846 bcm_pbmp_t ge; /* Mask of GE ports. */ 847 bcm_pbmp_t xe; /* Mask of 10gig ports. */ 848 bcm_pbmp_t ce; /* Mask of 100gig ports. */ 849 bcm_pbmp_t le; /* Mask of 50gig ports. */ 850 bcm_pbmp_t cc; /* Mask of 200gig ports. */ 851 bcm_pbmp_t cd; /* Mask of 400gig ports. */ 852 bcm_pbmp_t e; /* Mask of eth ports. */ 853 bcm_pbmp_t hg; /* Mask of HiGig ports. */ 854 bcm_pbmp_t sci; /* Mask of SCI ports. */ 855 bcm_pbmp_t sfi; /* Mask of SFI ports. */ 856 bcm_pbmp_t spi; /* Mask of SPI ports. */ 857 bcm_pbmp_t spi_subport; /* Mask of SPI subports. */ 858 bcm_pbmp_t port; /* Mask of all front panel ports. */ 859 bcm_pbmp_t cpu; /* Mask of CPU ports. */ 860 bcm_pbmp_t all; /* Mask of all ports. */ 861 bcm_pbmp_t stack_int; /* Deprecated - unused. */ 862 bcm_pbmp_t stack_ext; /* Mask of Stack ports. */ 863 bcm_pbmp_t tdm; /* Mask of TDM ports. */ 864 bcm_pbmp_t pon; /* Mask of PON ports. */ 865 bcm_pbmp_t llid; /* Mask of LLID ports. */ 866 bcm_pbmp_t il; /* Mask of ILKN ports. */ 867 bcm_pbmp_t xl; /* Mask of XLAUI ports. */ 868 bcm_pbmp_t rcy; /* Mask of RECYCLE ports. */ 869 bcm_pbmp_t sat; /* Mask of SAT ports. */ 870 bcm_pbmp_t ipsec; /* Mask of IPSEC ports. */ 871 bcm_pbmp_t per_pipe[BCM_PIPES_MAX]; /* Mask of ports per pipe. The number of 872 pipes per device can be obtained via 873 num_pipes field of bcm_info_t. */ 874 bcm_pbmp_t nif; /* Mask of Network Interfaces ports. */ 875 bcm_pbmp_t control; /* Mask of hot swap controlling ports. */ 876 bcm_pbmp_t eventor; /* Mask of Eventor ports. */ 877 bcm_pbmp_t olp; /* Mask of OLP ports. */ 878 bcm_pbmp_t oamp; /* Mask of OAMP ports. */ 879 bcm_pbmp_t erp; /* Mask of ERP ports. */ 880 bcm_pbmp_t roe; /* Mask of ROE ports. */ 881 bcm_pbmp_t rcy_mirror; /* Mask of mirror recycle ports (sniff) */ 882 } bcm_compat6517_port_config_t; 883 884 extern int bcm_compat6517_port_config_get( 885 int unit, 886 bcm_compat6517_port_config_t *config); 887 888 /* Mirror source structure. */ 889 typedef struct bcm_compat6517_mirror_source_s { 890 bcm_mirror_source_type_t type; /* Mirror source type. */ 891 uint32 flags; /* Mirror source flags only with port 892 source type. */ 893 bcm_port_t port; /* Port/gport id. */ 894 bcm_pkt_trace_event_t trace_event; /* Trace event. */ 895 bcm_pkt_drop_event_t drop_event; /* Drop event. */ 896 } bcm_compat6517_mirror_source_t; 897 898 /* Add a mirror destination to a mirror source. */ 899 extern int bcm_compat6517_mirror_source_dest_add( 900 int unit, 901 bcm_compat6517_mirror_source_t *source, 902 bcm_gport_t mirror_dest_id); 903 904 /* Delete a mirror destination from a mirror source. */ 905 extern int bcm_compat6517_mirror_source_dest_delete( 906 int unit, 907 bcm_compat6517_mirror_source_t *source, 908 bcm_gport_t mirror_dest_id); 909 910 /* Delete all mirror destinations applied on a mirror source. */ 911 extern int bcm_compat6517_mirror_source_dest_delete_all( 912 int unit, 913 bcm_compat6517_mirror_source_t *source); 914 915 /* Get all mirror destinations applied on a mirror source. */ 916 extern int bcm_compat6517_mirror_source_dest_get_all( 917 int unit, 918 bcm_compat6517_mirror_source_t *source, 919 int array_size, 920 bcm_gport_t *mirror_dest, 921 int *count); 922 923 /* Field name. */ 924 typedef struct bcm_compat6517_field_presel_config_s { 925 uint8 name[BCM_FIELD_MAX_NAME_LEN]; 926 } bcm_compat6517_field_presel_config_t; 927 928 /* Map a presel id to a name */ 929 extern int bcm_compat6517_field_presel_config_set( 930 int unit, 931 bcm_field_presel_t presel_id, 932 bcm_compat6517_field_presel_config_t *presel_config); 933 934 /* Get name from presel id */ 935 extern int bcm_compat6517_field_presel_config_get( 936 int unit, 937 bcm_field_presel_t presel_id, 938 bcm_compat6517_field_presel_config_t *presel_config); 939 940 /* Vlan block structure. */ 941 typedef struct bcm_compat6517_vlan_block_s { 942 bcm_pbmp_t known_multicast; 943 bcm_pbmp_t unknown_multicast; 944 bcm_pbmp_t unknown_unicast; 945 bcm_pbmp_t broadcast; 946 } bcm_compat6517_vlan_block_t; 947 948 /* Get VLAN block properties. */ 949 extern int bcm_compat6517_vlan_block_get( 950 int unit, 951 bcm_vlan_t vlan, 952 bcm_compat6517_vlan_block_t *vlan_block); 953 954 /* Set VLAN block properties. */ 955 extern int bcm_compat6517_vlan_block_set( 956 int unit, 957 bcm_vlan_t vlan, 958 bcm_compat6517_vlan_block_t *vlan_block); 959 960 /* Packet protocol match structure. */ 961 typedef struct bcm_compat6517_switch_pkt_protocol_match_s { 962 uint8 l2_iif_opaque_ctrl_id; /* L2 iif based control id. */ 963 uint8 l2_iif_opaque_ctrl_id_mask; /* L2 iif based control id mask. */ 964 bcm_vlan_t vfi; /* Virtual forwarding instance. */ 965 bcm_vlan_t vfi_mask; /* VFI mask. */ 966 bcm_mac_t macda; /* Destination MAC address. */ 967 bcm_mac_t macda_mask; /* Destination MAC address mask. */ 968 uint16 ethertype; /* Ethernet type. */ 969 uint16 ethertype_mask; /* Ethernet type mask. */ 970 uint16 arp_rarp_opcode; /* ARP/RARP packet operation code. */ 971 uint16 arp_rarp_opcode_mask; /* ARP/RARP packet operation code mask. */ 972 uint8 icmp_type; /* ICMP type. */ 973 uint8 icmp_type_mask; /* ICMP type mask. */ 974 uint8 igmp_type; /* IGMP type. */ 975 uint8 igmp_type_mask; /* IGMP type mask. */ 976 uint8 l4_valid; /* If set, layer 4 header present. */ 977 uint8 l4_valid_mask; /* L4_valid mask. */ 978 uint16 l4_src_port; /* Layer 4 source port. */ 979 uint16 l4_src_port_mask; /* Layer 4 source port mask. */ 980 uint16 l4_dst_port; /* Layer 4 destination port. */ 981 uint16 l4_dst_port_mask; /* Layer 4 destination port mask. */ 982 uint16 l5_bytes_0_1; /* First 2 bytes of layer 5 header. */ 983 uint16 l5_bytes_0_1_mask; /* L5_bytes_0_1 mask. */ 984 uint16 outer_l5_bytes_0_1; /* Outer l5 bytes 0 1. */ 985 uint16 outer_l5_bytes_0_1_mask; /* Outer l5 bytes 0 1 mask. */ 986 uint8 ip_last_protocol; /* Protocol from IP extension header if 987 present, otherwise from IP header. */ 988 uint8 ip_last_protocol_mask; /* Ip_last_protocol mask. */ 989 uint8 fixed_hve_result_set_1; /* Fixed HVE result 1. */ 990 uint8 fixed_hve_result_set_1_mask; /* Fixed HVE result 1 mask. */ 991 uint8 fixed_hve_result_set_5; /* Fixed HVE result 5. */ 992 uint8 fixed_hve_result_set_5_mask; /* Fixed HVE result 5 mask. */ 993 uint8 flex_hve_result_set_1; /* Flex HVE result 1. */ 994 uint8 flex_hve_result_set_1_mask; /* Flex HVE result 1 mask. */ 995 uint8 tunnel_processing_results_1; /* Tunnel processing results 1. */ 996 uint8 tunnel_processing_results_1_mask; /* Tunnel processing results 1 mask. */ 997 } bcm_compat6517_switch_pkt_protocol_match_t; 998 999 /* An API to add a protocol control entry. */ 1000 extern int bcm_compat6517_switch_pkt_protocol_control_add( 1001 int unit, 1002 uint32 options, 1003 bcm_compat6517_switch_pkt_protocol_match_t *match, 1004 bcm_switch_pkt_control_action_t *action, 1005 int priority); 1006 1007 /* An API to get action and priority for a protocol control entry. */ 1008 extern int bcm_compat6517_switch_pkt_protocol_control_get( 1009 int unit, 1010 bcm_compat6517_switch_pkt_protocol_match_t *match, 1011 bcm_switch_pkt_control_action_t *action, 1012 int *priority); 1013 1014 /* An API to delete a protocol control entry. */ 1015 extern int bcm_compat6517_switch_pkt_protocol_control_delete( 1016 int unit, 1017 bcm_compat6517_switch_pkt_protocol_match_t *match); 1018 1019 /* Internals */ 1020 typedef struct bcm_compat6517_pkt_dnx_internal_s { 1021 uint32 trap_qualifier; /* Trap Qualifier */ 1022 uint32 trap_id; /* Trap Id */ 1023 } bcm_compat6517_pkt_dnx_internal_t; 1024 1025 /* Fabric header updates of mirrored packets */ 1026 typedef struct bcm_compat6517_mirror_pkt_header_fabric_s { 1027 uint32 ftmh_valid; /* Used to specify which fields to use for header changes. Possible values will be named BCM_MIRROR_PKT_HEADER_FABRIC_UPDATE_FTMH_ */ 1028 uint32 internal_valid; /* Used to specify which fields to use for header changes. Possible values will be named BCM_MIRROR_PKT_HEADER_FABRIC_UPDATE_INTERNAL_ */ 1029 uint32 oam_ts_valid; /* Used to specify which fields to use for header changes. Possible values will be named BCM_MIRROR_PKT_HEADER_FABRIC_UPDATE_OAM_TS_ */ 1030 bcm_pkt_dnx_ftmh_t ftmh; /* FTMH header fields */ 1031 bcm_compat6517_pkt_dnx_internal_t internal; /* Internal header fields */ 1032 bcm_pkt_dnx_otsh_t oam_ts; /* OAM-TS header fields */ 1033 } bcm_compat6517_mirror_pkt_header_fabric_t; 1034 1035 /* represents header updates of mirrored packets */ 1036 typedef struct bcm_compat6517_mirror_pkt_header_updates_s { 1037 uint32 valid; /* Used to specify which fields to use for header changes. Possible values will be named BCM_MIRROR_PKT_HEADER_UPDATE_* */ 1038 bcm_color_t color; /* drop precedence */ 1039 uint8 prio; /* the internal packet priority (traffic class before ingress mapping to cosq) */ 1040 uint8 ecn_value; /* ECN capable and congestion encoding */ 1041 uint8 cnm_cancel; /* Ignore Congestion Point (CNM) */ 1042 uint32 trunk_hash_result; /* LAG load balancing key */ 1043 bcm_gport_t in_port; /* 8b should be exposed? */ 1044 uint16 vsq; /* selects STF (statistics flow) VSQ */ 1045 uint16 fabric_header_editing; /* changes to the fabric headers */ 1046 bcm_compat6517_mirror_pkt_header_fabric_t header_fabric; /* Fabric header updates of mirrored packets */ 1047 uint32 metadata; /* Metadata for counting */ 1048 } bcm_compat6517_mirror_pkt_header_updates_t; 1049 1050 /* 1051 * Mirror destination Structure 1052 * 1053 * Contains information required for manipulating mirror destinations. 1054 */ 1055 typedef struct bcm_compat6517_mirror_destination_s { 1056 bcm_gport_t mirror_dest_id; /* Unique mirror destination and encapsulation identifier. */ 1057 uint32 flags; /* See BCM_MIRROR_DEST_xxx flag definitions. */ 1058 bcm_gport_t gport; /* Mirror destination. */ 1059 uint8 version; /* IP header version. */ 1060 uint8 tos; /* Traffic Class/Tos byte. */ 1061 uint8 ttl; /* Hop limit. */ 1062 bcm_ip_t src_addr; /* Tunnel source ip address (IPv4). */ 1063 bcm_ip_t dst_addr; /* Tunnel destination ip address (IPv4). */ 1064 bcm_ip6_t src6_addr; /* Tunnel source ip address (IPv6). */ 1065 bcm_ip6_t dst6_addr; /* Tunnel destination ip address (IPv6). */ 1066 uint32 flow_label; /* IPv6 header flow label field. */ 1067 bcm_mac_t src_mac; /* L2 source mac address. */ 1068 bcm_mac_t dst_mac; /* L2 destination mac address. */ 1069 uint16 tpid; /* L2 header outer TPID. */ 1070 bcm_vlan_t vlan_id; /* Vlan id. */ 1071 bcm_trill_name_t trill_src_name; /* TRILL source bridge nickname */ 1072 bcm_trill_name_t trill_dst_name; /* TRILL destination bridge nickname */ 1073 int trill_hopcount; /* TRILL hop count */ 1074 uint16 niv_src_vif; /* Source Virtual Interface of NIV tag */ 1075 uint16 niv_dst_vif; /* Destination Virtual Interface of NIV tag */ 1076 uint32 niv_flags; /* NIV flags BCM_MIRROR_NIV_XXX */ 1077 uint16 gre_protocol; /* L3 GRE header protocol */ 1078 bcm_policer_t policer_id; /* policer_id */ 1079 int stat_id; /* stat_id */ 1080 int stat_id2; /* stat_id2 for second counter pointer */ 1081 bcm_if_t encap_id; /* Encapsulation index */ 1082 bcm_if_t tunnel_id; /* IP tunnel for encapsulation. Valid only if BCM_MIRROR_DEST_TUNNEL_IP_GRE is set */ 1083 uint16 span_id; /* SPAN-ID. Valid only if BCM_MIRROR_DEST_TUNNEL_WITH_SPAN_ID is set */ 1084 uint8 pkt_prio; /* L2 header PCP */ 1085 uint32 sample_rate_dividend; /* The probability of mirroring a packet is: sample_rate_dividend >= sample_rate_divisor ? 1 : sample_rate_dividend / sample_rate_divisor */ 1086 uint32 sample_rate_divisor; /* */ 1087 uint8 int_pri; /* Internal Priority */ 1088 uint16 etag_src_vid; /* Extended (source) port vlan id */ 1089 uint16 etag_dst_vid; /* Extended (destination) port vlan id */ 1090 uint16 udp_src_port; /* UDP source port */ 1091 uint16 udp_dst_port; /* UDP destination port */ 1092 uint32 egress_sample_rate_dividend; /* The probability of outbound mirroring a packet from the destination is sample_rate_dividend >= sample_rate_divisor ? 1 : sample_rate_dividend / sample_rate_divisor */ 1093 uint32 egress_sample_rate_divisor; /* */ 1094 uint8 recycle_context; /* recycle context of egress originating packets */ 1095 uint16 packet_copy_size; /* If non zero, the copied packet will be truncated to the first packet_copy_size . Current supported values for DNX are 0, 64, 128, 192 */ 1096 uint16 egress_packet_copy_size; /* If non zero and the packet is copied from the egress, the packet will be truncated to the first packet_copy_size . Current supported values for DNX are 0, 256. */ 1097 bcm_compat6517_mirror_pkt_header_updates_t packet_control_updates; /* */ 1098 bcm_mirror_psc_t rtag; /* specify RTAG HASH algorithm used for shared-id mirror destination */ 1099 uint8 df; /* Set the do not fragment bit of IP header in mirror encapsulation */ 1100 uint8 truncate; /* Setting truncate would result in mirroring a truncated frame */ 1101 uint16 template_id; /* Template ID for IPFIX HDR */ 1102 uint32 observation_domain; /* Observation domain for IPFIX HDR */ 1103 uint32 is_recycle_strict_priority; /* Recycle priority (1-lossless, 0-high) */ 1104 int ext_stat_id[BCM_MIRROR_EXT_STAT_ID_COUNT]; /* ext_stat_id to support statistic interface for mirror packets. */ 1105 uint32 flags2; /* See BCM_MIRROR_DEST_FLAGS2_xxx flag definitions. */ 1106 uint32 vni; /* Virtual Network Interface ID. */ 1107 uint32 gre_seq_number; /* Sequence number value used in GRE header. If no value is provided, gre_seq_number will start with 0. Valid only if BCM_MIRROR_DEST_TUNNEL_IP_GRE is set. */ 1108 bcm_mirror_pkt_erspan_encap_t erspan_header; /* ERSPAN encapsulation header fields. Valid only if only BCM_MIRROR_DEST_TUNNEL_IP_GRE is set. */ 1109 uint32 initial_seq_number; /* Starting seq number in SFLOW or PSAMP header */ 1110 bcm_mirror_psamp_fmt2_meta_data_t meta_data_type; /* Type of item in 'meta_data' */ 1111 uint16 meta_data; /* Actual value of class id or meta data, based on 'meta_data_type' */ 1112 int ext_stat_valid; /* Validates the ext_stat. */ 1113 int ext_stat_type_id[BCM_MIRROR_EXT_STAT_ID_COUNT]; /* Type ids for statistic interface. */ 1114 uint16 ipfix_version; /* IPFIX version number in PSAMP encapsulation. */ 1115 uint16 psamp_epoch; /* PSAMP epoch field. */ 1116 int cosq; /* Queue id that mirror copy is enqueued into. */ 1117 } bcm_compat6517_mirror_destination_t; 1118 1119 /* Create a mirror (destination, encapsulation) pair. */ 1120 extern int bcm_compat6517_mirror_destination_create( 1121 int unit, 1122 bcm_compat6517_mirror_destination_t *mirror_dest); 1123 1124 /* Get mirror (destination, encapsulation) pair. */ 1125 extern int bcm_compat6517_mirror_destination_get( 1126 int unit, 1127 bcm_gport_t mirror_dest_id, 1128 bcm_compat6517_mirror_destination_t *mirror_dest); 1129 1130 /* PP header information for mirrored packet in DNX devices */ 1131 typedef struct bcm_compat6517_mirror_pkt_dnx_pp_header_s { 1132 uint8 tail_edit_profile; /* Tail edit profile, used at ETPP for tail editing */ 1133 bcm_gport_t out_vport_ext[3]; /* Extended outlif(s) */ 1134 } bcm_compat6517_mirror_pkt_dnx_pp_header_t; 1135 1136 /* Mirror packet system header information for DNX devices */ 1137 typedef struct bcm_compat6517_mirror_header_info_s { 1138 bcm_mirror_pkt_dnx_ftmh_header_t tm; /* TM header */ 1139 bcm_compat6517_mirror_pkt_dnx_pp_header_t pp; /* PP header */ 1140 bcm_pkt_dnx_udh_t udh[4]; /* UDH header */ 1141 } bcm_compat6517_mirror_header_info_t; 1142 1143 /* Set system header information */ 1144 extern int bcm_compat6517_mirror_header_info_set( 1145 int unit, 1146 uint32 flags, 1147 bcm_gport_t mirror_dest_id, 1148 bcm_compat6517_mirror_header_info_t *mirror_header_info); 1149 1150 /* Get system header information */ 1151 extern int bcm_compat6517_mirror_header_info_get( 1152 int unit, 1153 bcm_gport_t mirror_dest_id, 1154 uint32 *flags, 1155 bcm_compat6517_mirror_header_info_t *mirror_header_info); 1156 1157 /* Parameters info for Field Action. */ 1158 typedef struct bcm_compat6517_field_action_params_s { 1159 uint32 param0; /* First Parameter to Action */ 1160 uint32 param1; /* Second Parameter to Action */ 1161 bcm_pbmp_t pbmp; /* Port bitmap */ 1162 } bcm_compat6517_field_action_params_t; 1163 1164 /* Add an action to a field entry */ 1165 extern int bcm_compat6517_field_action_config_info_add( 1166 int unit, 1167 bcm_field_entry_t entry, 1168 bcm_field_action_t action, 1169 bcm_compat6517_field_action_params_t *params, 1170 bcm_field_action_match_config_t *match_config); 1171 1172 /* Retrieve the parameters for an action previously added to a field entry */ 1173 extern int bcm_compat6517_field_action_config_info_get( 1174 int unit, 1175 bcm_field_entry_t entry, 1176 bcm_field_action_t action, 1177 bcm_compat6517_field_action_params_t *params, 1178 bcm_field_action_match_config_t *match_config); 1179 1180 #if defined(INCLUDE_L3) 1181 1182 /* L3 tunneling terminator. */ 1183 typedef struct bcm_compat6517_tunnel_terminator_s { 1184 uint32 flags; /* Configuration flags. */ 1185 uint32 multicast_flag; /* VXLAN Multicast trigger flags. */ 1186 bcm_vrf_t vrf; /* Virtual router instance. */ 1187 bcm_ip_t sip; /* SIP for tunnel header match. */ 1188 bcm_ip_t dip; /* DIP for tunnel header match. */ 1189 bcm_ip_t sip_mask; /* Source IP mask. */ 1190 bcm_ip_t dip_mask; /* Destination IP mask. */ 1191 bcm_ip6_t sip6; /* SIP for tunnel header match (IPv6). */ 1192 bcm_ip6_t dip6; /* DIP for tunnel header match (IPv6). */ 1193 bcm_ip6_t sip6_mask; /* Source IP mask (IPv6). */ 1194 bcm_ip6_t dip6_mask; /* Destination IP mask (IPv6). */ 1195 uint32 udp_dst_port; /* UDP dst port for UDP packets. */ 1196 uint32 udp_src_port; /* UDP src port for UDP packets */ 1197 bcm_tunnel_type_t type; /* Tunnel type */ 1198 bcm_pbmp_t pbmp; /* Port bitmap for this tunnel */ 1199 bcm_vlan_t vlan; /* The VLAN ID or L3 ingress interface 1200 ID for IPMC lookup or WLAN tunnel */ 1201 bcm_vlan_t fwd_vlan; /* VLAN ID for forwarding terminated IP 1202 Tunnel */ 1203 bcm_gport_t remote_port; /* Remote termination */ 1204 bcm_gport_t tunnel_id; /* Tunnel id */ 1205 int if_class; /* L3 interface class this tunnel. */ 1206 bcm_multicast_t failover_mc_group; /* MC group used for bi-cast. */ 1207 bcm_failover_t ingress_failover_id; /* 1+1 protection. */ 1208 bcm_failover_t failover_id; /* Failover Object Identifier for 1209 protected tunnel. */ 1210 bcm_gport_t failover_tunnel_id; /* Failover Tunnel ID. */ 1211 bcm_if_t tunnel_if; /* hierarchical interface. */ 1212 int tunnel_class; /* Tunnel class id for VFP match. */ 1213 int qos_map_id; /* QoS DSCP map this tunnel. */ 1214 int inlif_counting_profile; /* In LIF counting profile */ 1215 int tunnel_term_ecn_map_id; /* Tunnel termination ecn map id. */ 1216 bcm_qos_ingress_model_t ingress_qos_model; /* ingress qos and ttl model */ 1217 int priority; /* Entry priority. */ 1218 1219 } bcm_compat6517_tunnel_terminator_t; 1220 1221 1222 extern int bcm_compat6517_l2gre_tunnel_terminator_create( 1223 int unit, 1224 bcm_compat6517_tunnel_terminator_t *info); 1225 1226 extern int bcm_compat6517_l2gre_tunnel_terminator_get( 1227 int unit, 1228 bcm_compat6517_tunnel_terminator_t *info); 1229 1230 extern int bcm_compat6517_l2gre_tunnel_terminator_update( 1231 int unit, 1232 bcm_compat6517_tunnel_terminator_t *info); 1233 1234 1235 extern int bcm_compat6517_vxlan_tunnel_terminator_create( 1236 int unit, 1237 bcm_compat6517_tunnel_terminator_t *info); 1238 1239 extern int bcm_compat6517_vxlan_tunnel_terminator_get( 1240 int unit, 1241 bcm_compat6517_tunnel_terminator_t *info); 1242 1243 extern int bcm_compat6517_vxlan_tunnel_terminator_update( 1244 int unit, 1245 bcm_compat6517_tunnel_terminator_t *info); 1246 1247 1248 extern int bcm_compat6517_tunnel_terminator_add( 1249 int unit, 1250 bcm_compat6517_tunnel_terminator_t *info); 1251 1252 extern int bcm_compat6517_tunnel_terminator_delete( 1253 int unit, 1254 bcm_compat6517_tunnel_terminator_t *info); 1255 1256 extern int bcm_compat6517_tunnel_terminator_create( 1257 int unit, 1258 bcm_compat6517_tunnel_terminator_t *info); 1259 1260 extern int bcm_compat6517_tunnel_terminator_get( 1261 int unit, 1262 bcm_compat6517_tunnel_terminator_t *info); 1263 1264 extern int bcm_compat6517_tunnel_terminator_update( 1265 int unit, 1266 bcm_compat6517_tunnel_terminator_t *info); 1267 #endif /* INCLUDE_L3 */ 1268 1269 typedef struct bcm_compat6517_port_flexe_oam_alarm_s { 1270 uint8 alarm_active; /* Indicate if there is active alarm */ 1271 uint8 rx_base_csf_lpi; /* Rx base OAM client signal LPI fault alarm */ 1272 uint8 rx_base_cs_lf; /* Rx base OAM client signal Local Fault 1273 alarm */ 1274 uint8 rx_base_cs_rf; /* Rx base OAM client signal Remote Fault 1275 alarm */ 1276 uint8 base_oam_los; /* Base OAM no receive alarm */ 1277 uint8 rx_sdbip; /* Rx SDBIP alarm */ 1278 uint8 rx_base_crc; /* Rx OAM base CRC error alarm */ 1279 uint8 rx_base_rdi; /* Rx OAM base RDI alarm */ 1280 uint8 rx_base_period_mismatch; /* Rx base OAM period mismatch alarm */ 1281 } bcm_compat6517_port_flexe_oam_alarm_t; 1282 1283 /* Get OAM alarms. */ 1284 extern int bcm_compat6517_port_flexe_oam_alarm_get( 1285 int unit, 1286 bcm_port_t port, 1287 uint32 flags, 1288 bcm_compat6517_port_flexe_oam_alarm_t *alarms); 1289 1290 /* IFA configuration information data. */ 1291 typedef struct bcm_compat6517_ifa_config_info_s { 1292 uint32 probemarker_1; /* INT header ProbeMarker1 Value. */ 1293 uint32 probemarker_2; /* INT header ProbeMarker2 Value. */ 1294 uint32 device_id; /* Meta Data header Device ID. */ 1295 uint16 max_payload_length; /* INT header Maximum payload. */ 1296 uint16 module_id; /* Meta Data header Module Id used to 1297 identify loopback source port 1298 information. */ 1299 uint8 hop_limit; /* INT header Hop Limit condition. */ 1300 uint16 rx_packet_payload_length; /* Recieved packet payload length that 1301 can be sent to collector. */ 1302 uint16 lb_port_1; /* Loopback port for IFA E_APP. */ 1303 uint16 lb_port_2; /* Loopback port for IFA E_APP. */ 1304 uint8 optional_headers; /* Option to send with recieved packet 1305 headers. */ 1306 uint8 true_hop_count; /* Number of hops in the topology is 1307 greater than Hop limit, IFA MD stack 1308 contains Hop limit number of MDs in 1309 MD stack. */ 1310 } bcm_compat6517_ifa_config_info_t; 1311 1312 /* Set a In-band Flow Analyzer configuration information. */ 1313 extern int bcm_compat6517_ifa_config_info_set( 1314 int unit, 1315 uint32 options, 1316 bcm_compat6517_ifa_config_info_t *config_data); 1317 1318 /* Get a In-band Flow Analyzer Configuration information. */ 1319 extern int bcm_compat6517_ifa_config_info_get( 1320 int unit, 1321 bcm_compat6517_ifa_config_info_t *config_data); 1322 1323 /* IFA statistics information data. */ 1324 typedef struct bcm_compat6517_ifa_stat_info_s { 1325 uint32 rx_pkt_cnt; /* Number of packet recieved in FW. */ 1326 uint32 tx_pkt_cnt; /* Number of packet transmitted from FW. */ 1327 uint32 ifa_no_config_drop; /* Number of pkt dropped due to missing 1328 configuration. */ 1329 uint32 ifa_collector_not_present_drop; /* Number of pkt dropped due to missing 1330 collector configuration. */ 1331 uint32 ifa_hop_cnt_invalid_drop; /* Number of pkt dropped due to Hop 1332 count and Hop limit are out of order. */ 1333 uint32 ifa_int_hdr_len_invalid_drop; /* Number of pkt dropped due to maximum 1334 length and current length are out of 1335 order. */ 1336 uint32 ifa_pkt_size_invalid_drop; /* Number of pkt dropped due to invalid 1337 packet size. */ 1338 } bcm_compat6517_ifa_stat_info_t; 1339 1340 /* In-band flow analyzer - IFA statistics information */ 1341 extern int bcm_compat6517_ifa_stat_info_set( 1342 int unit, 1343 bcm_compat6517_ifa_stat_info_t *stat_data); 1344 1345 /* In-band flow analyzer - IFA statistics information */ 1346 extern int bcm_compat6517_ifa_stat_info_get( 1347 int unit, 1348 bcm_compat6517_ifa_stat_info_t *stat_data); 1349 1350 /* 1351 * Queue congestion monitor export trigger info. Calculate InterestFactor 1352 * of each view and export to collector. 1353 */ 1354 typedef struct bcm_compat6517_cosq_burst_monitor_export_trigger_s { 1355 uint32 export_threshold; /* Export threshold */ 1356 uint8 drop_weight; /* Flow drop counter weight */ 1357 uint8 rx_weight; /* Flow Rx counter weight */ 1358 } bcm_compat6517_cosq_burst_monitor_export_trigger_t; 1359 1360 /* Queue congestion monitor flow view Configuration. */ 1361 typedef struct bcm_compat6517_cosq_burst_monitor_flow_view_info_s { 1362 bcm_compat6517_cosq_burst_monitor_export_trigger_t export_param; /* Queue congestion monitor export 1363 trigger Info */ 1364 uint32 scan_interval_usecs; /* sample/scan Interval */ 1365 uint32 age_threshold; /* Aging persistent flows if sum of all 1366 sampled rx_byte_count values goes 1367 below threshold */ 1368 uint64 start_timer_usecs; /* Start time of Queue congestion 1369 monitor */ 1370 uint32 num_samples; /* Number of samples captured per view */ 1371 } bcm_compat6517_cosq_burst_monitor_flow_view_info_t; 1372 1373 /* Set Queue congestion monitoring flow view configuration. */ 1374 extern int bcm_compat6517_cosq_burst_monitor_flow_view_config_set( 1375 int unit, 1376 uint32 options, 1377 bcm_compat6517_cosq_burst_monitor_flow_view_info_t *flow_view_data); 1378 1379 /* Get Queue congestion monitoring flow view configuration. */ 1380 extern int bcm_compat6517_cosq_burst_monitor_flow_view_config_get( 1381 int unit, 1382 bcm_compat6517_cosq_burst_monitor_flow_view_info_t *flow_view_data); 1383 1384 typedef struct bcm_compat6517_flowtracker_group_info_s { 1385 bcm_flowtracker_ipfix_observation_domain_t observation_domain_id; /* IPFIX observation domain to which 1386 this flow group belongs to. */ 1387 int group_class; /* Flowtracker flow group Class id. */ 1388 uint32 group_flags; /* Flowtracker flow group flags. See 1389 BCM_FLOWTRACKER_GROUP_XXX. */ 1390 bcm_field_group_t field_group[BCM_PIPES_MAX]; /* Field group corresponding to the flow 1391 group. */ 1392 } bcm_compat6517_flowtracker_group_info_t; 1393 1394 typedef struct bcm_compat6517_flowtracker_check_info_s { 1395 uint32 flags; /* Configuration flags for Check 1396 Creation. */ 1397 bcm_flowtracker_tracking_param_type_t param; /* The attribute of flow on which the 1398 check is performed. */ 1399 uint32 min_value; /* Element value to do greater than or 1400 equal checks. Minimum value to do 1401 range checks. */ 1402 uint32 max_value; /* Element value to do smaller than or 1403 mask checks. Maximum value to do 1404 range checks. */ 1405 uint32 mask_value; /* Mask value to be applied on flow 1406 attribute. */ 1407 uint8 shift_value; /* Right shift value to be applied on 1408 flow attribute. */ 1409 bcm_flowtracker_check_operation_t operation; /* Operation to be performed for this 1410 check. */ 1411 bcm_flowtracker_check_t primary_check_id; /* primary check id to associate second 1412 check for aggregated checks on same 1413 flow. */ 1414 uint16 num_drop_reason_group_id; /* Number of drop reason group id. */ 1415 bcm_flowtracker_drop_reason_group_t drop_reason_group_id[BCM_FLOWTRACKER_DROP_REASON_GROUP_ID_MAX]; /* Flowtracker drop reason group ids. 1416 Applicable only if tracking param is 1417 IngDropReasonGroupIdVector or 1418 EgrDropReasonGroupIdVector. */ 1419 } bcm_compat6517_flowtracker_check_info_t; 1420 1421 extern int bcm_compat6517_flowtracker_group_create( 1422 int unit, 1423 uint32 options, 1424 bcm_flowtracker_group_t *flow_group_id, 1425 bcm_compat6517_flowtracker_group_info_t *flow_group_info); 1426 1427 extern int bcm_compat6517_flowtracker_group_get( 1428 int unit, 1429 bcm_flowtracker_group_t id, 1430 bcm_compat6517_flowtracker_group_info_t *flow_group_info); 1431 1432 extern int bcm_compat6517_flowtracker_check_create( 1433 int unit, 1434 uint32 options, 1435 bcm_compat6517_flowtracker_check_info_t check_info, 1436 bcm_flowtracker_check_t *check_id); 1437 1438 extern int bcm_compat6517_flowtracker_check_get( 1439 int unit, 1440 bcm_flowtracker_check_t check_id, 1441 bcm_compat6517_flowtracker_check_info_t *check_info); 1442 /* CPRI Decapsulation RoE Ordering Information */ 1443 typedef struct bcm_compat6517_cpri_decap_roe_oi_s { 1444 bcm_cpri_roe_info_type_t info_type; /* */ 1445 uint32 pcnt_size; /* Number in the range 1 to 32 */ 1446 uint32 pcnt_increment; /* seqNumPInc */ 1447 uint32 pcnt_max; /* seqNumPMax */ 1448 uint32 p_inc_p2; /* seqNumPInc to be power of 2 */ 1449 uint32 p_bias; /* Bias for P count */ 1450 uint32 qcnt_size; /* Number in the range 0 to (32-pcnt) */ 1451 uint32 qcnt_increment; /* seqNumQInc */ 1452 uint32 qcnt_max; /* seqNumQMax */ 1453 uint32 q_inc_p2; /* seqNumQInc to be power of 2 */ 1454 uint32 q_bias; /* Bias for Q count */ 1455 uint8 p_ext; /* Extended P Counter */ 1456 uint8 gsm_tsn_bitmap; /* TSN bitmap */ 1457 uint32 pcnt_pkt_count; /* Maximum pkt count described by P counter */ 1458 uint32 modulo_2; /* Queue Cycle Size is modulo 2 */ 1459 uint32 seq_rsvd; /* seqNumRsvd Value */ 1460 } bcm_compat6517_cpri_decap_roe_oi_t; 1461 1462 /* Set/Get the ordering info for Decapsulation. */ 1463 extern int bcm_compat6517_cpri_port_decap_roe_ordering_info_set( 1464 int unit, 1465 bcm_gport_t port, 1466 int index, 1467 bcm_compat6517_cpri_decap_roe_oi_t *ordering_info); 1468 1469 /* Set/Get the ordering info for Decapsulation. */ 1470 extern int bcm_compat6517_cpri_port_decap_roe_ordering_info_get( 1471 int unit, 1472 bcm_gport_t port, 1473 int index, 1474 bcm_compat6517_cpri_decap_roe_oi_t *ordering_info); 1475 1476 typedef struct bcm_compat6517_rx_trap_config_s { 1477 1478 uint32 flags; /* BCM_RX_TRAP_XXX FLAGS. */ 1479 bcm_gport_t dest_port; /* Destination port. */ 1480 bcm_multicast_t dest_group; /* Destination group. */ 1481 int prio; /* Internal priority of the packet. */ 1482 bcm_color_t color; /* Color of the packet. */ 1483 bcm_policer_t ether_policer_id; /* Ethernet Policer. */ 1484 bcm_policer_t policer_id; /* general policer id. */ 1485 int counter_num; /* counter. */ 1486 int trap_strength; /* Strength of this trap, strongest trap 1487 in processing holds. */ 1488 int snoop_cmnd; /* snoop command. */ 1489 int snoop_strength; /* Strength of this trap, strongest 1490 snoop in processing holds. */ 1491 bcm_forwarding_type_t forwarding_type; /* Forwarding type value */ 1492 bcm_rx_trap_forwarding_header_t forwarding_header; /* Forwarding header position overridden 1493 value */ 1494 bcm_if_t encap_id; /* Encap-ID */ 1495 bcm_mirror_options_t *mirror_cmd; /* Mirror options in ETPP traps */ 1496 bcm_rx_trap_core_config_t *core_config_arr; /* Destinations information per core */ 1497 int core_config_arr_len; /* core_config_arr length */ 1498 int qos_map_id; /* cos profile handle */ 1499 int tunnel_termination_trap_strength; /* Strength of tunnel termination trap, 1500 strongest trap in processing holds. */ 1501 int tunnel_termination_snoop_strength; /* Strength of tunnel termination trap, 1502 strongest snoop in processing holds. */ 1503 int meter_cmd; /* meter command. */ 1504 uint8 mapped_trap_strength; /* mapped trap strength */ 1505 uint8 is_recycle_high_priority; /* recycle high priority indication */ 1506 uint8 is_recycle_crop_pkt; /* crop recycle packet indication */ 1507 uint8 is_recycle_append_ftmh; /* indication regarding appending the 1508 original FTMH to the recycle packet */ 1509 bcm_gport_t cpu_trap_gport; /* cpu trap gport */ 1510 int stamped_trap_code; /* trap code stamped on packet headers */ 1511 bcm_if_t encap_id2; /* Encap-ID #2 */ 1512 uint8 ecn_value; /* Ethernet encapsulation */ 1513 uint16 vsq; /* Statistics VSQ pointer */ 1514 uint8 latency_flow_id_clear; /* Indication if to clear 1515 latency_flow_id */ 1516 uint8 visibility_value; /* Visibility value */ 1517 uint32 stat_clear_bitmap; /* Bitmap indicating which statistical 1518 objects are to clear */ 1519 bcm_rx_trap_stat_obj_config_t stat_obj_config_arr[BCM_RX_TRAP_MAX_STAT_OBJ_ARR_LEN]; /* Overwrite configuration of 1520 statistical objects */ 1521 uint32 stat_obj_config_len; /* stat_obj_config_arr length */ 1522 uint32 stat_metadata_mask; /* Statistical metadata mask */ 1523 int mirror_profile; /* mirror action profile */ 1524 uint32 egress_forwarding_index; /* Egress forwarding(parsing) index */ 1525 int pp_drop_reason; /* Packet processing drop reason */ 1526 1527 } bcm_compat6517_rx_trap_config_t; 1528 1529 /* rx_trap_set. */ 1530 extern int bcm_compat6517_rx_trap_set( 1531 int unit, 1532 int trap_id, 1533 bcm_compat6517_rx_trap_config_t *config); 1534 1535 /* rx_trap_get. */ 1536 extern int bcm_compat6517_rx_trap_get( 1537 int unit, 1538 int trap_id, 1539 bcm_compat6517_rx_trap_config_t *config); 1540 1541 /* Hash bank control structure. */ 1542 typedef struct bcm_compat6517_switch_hash_bank_control_s { 1543 bcm_switch_hash_bank_t bank_num; /* Hash bank number. */ 1544 uint32 valid_fields; /* Bitmap of valid fields. */ 1545 int robust; /* 0 to disable robust hash or 1 to 1546 enable robust hash. */ 1547 int hash_type; /* BCM_HASH_XXX definitions. */ 1548 uint32 offset; /* Hash offset. */ 1549 } bcm_compat6517_switch_hash_bank_control_t; 1550 1551 /* Hash bank control set/get function. */ 1552 extern int bcm_compat6517_switch_hash_bank_control_set( 1553 int unit, 1554 bcm_compat6517_switch_hash_bank_control_t *bank_control); 1555 1556 /* Hash bank control set/get function. */ 1557 extern int bcm_compat6517_switch_hash_bank_control_get( 1558 int unit, 1559 bcm_compat6517_switch_hash_bank_control_t *bank_control); 1560 1561 /* physical port properties structure. */ 1562 typedef struct bcm_compat6517_port_interface_info_s { 1563 uint32 phy_port; /* related phy port. */ 1564 bcm_port_if_t interface; /* interface of port. */ 1565 uint32 num_lanes; /* number of lanes the interface uses. */ 1566 bcm_pbmp_t phy_pbmp; /* bitmap of phy lanes the interface occupies. */ 1567 uint32 interface_id; /* should be indicated in case the id can't be derived from phy_port. */ 1568 } bcm_compat6517_port_interface_info_t; 1569 1570 /* port mapping properties structure. */ 1571 typedef struct bcm_compat6517_port_mapping_info_s { 1572 uint32 channel; /* logical port channel. */ 1573 int core; /* core id */ 1574 uint32 tm_port; /* tm port id */ 1575 uint32 pp_port; /* pp port id */ 1576 uint32 base_q_pair; /* base queue pair id */ 1577 uint32 num_priorities; /* number of port priorities */ 1578 uint32 base_hr; /* base hr id */ 1579 uint32 num_sch_priorities; /* number of sch port priorities */ 1580 } bcm_compat6517_port_mapping_info_t; 1581 1582 /* add/remove/get port */ 1583 extern int bcm_compat6517_port_add( 1584 int unit, 1585 bcm_port_t port, 1586 uint32 flags, 1587 bcm_compat6517_port_interface_info_t *interface_info, 1588 bcm_compat6517_port_mapping_info_t *mapping_info); 1589 1590 /* add/remove/get port */ 1591 extern int bcm_compat6517_port_get( 1592 int unit, 1593 bcm_port_t port, 1594 uint32 *flags, 1595 bcm_compat6517_port_interface_info_t *interface_info, 1596 bcm_compat6517_port_mapping_info_t *mapping_info); 1597 1598 1599 #endif /* BCM_RPC_SUPPORT */ 1600 #endif /* !_COMPAT_6517_H */