compat_6516.h (90029B)
1 /* 2 * $Id: compat_6516.h,v 1.0 2019/04/03 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.16 routines 8 */ 9 10 #ifndef _COMPAT_6516_H_ 11 #define _COMPAT_6516_H_ 12 13 #ifdef BCM_RPC_SUPPORT 14 #include <bcm_int/compat/compat_6519.h> 15 #include <bcm_int/compat/compat_6518.h> 16 #include <bcm/types.h> 17 #include <bcm/trunk.h> 18 #include <bcm/flow.h> 19 #include <bcm/ecn.h> 20 #if defined(INCLUDE_L3) 21 #include <bcm/l3.h> 22 #include <bcm/tunnel.h> 23 #include <bcm/ipmc.h> 24 #include <bcm/failover.h> 25 #include <bcm/mim.h> 26 #include <bcm/vxlan.h> 27 #endif /* INCLUDE_L3 */ 28 #include <bcm/vlan.h> 29 #include <bcm/field.h> 30 #include <bcm/fcoe.h> 31 #include <bcm/init.h> 32 #include <bcm/l2.h> 33 #include <bcm/port.h> 34 #include <bcm_int/compat/compat_6517.h> 35 36 /* Flowtracker collector information. */ 37 typedef struct bcm_compat6516_flowtracker_collector_info_s { 38 bcm_flowtracker_collector_type_t collector_type; /* Flowtracker Collector type. Remote vs 39 Local */ 40 bcm_flowtracker_collector_transport_type_t transport_type; /* Transport type used for exporting 41 flow data to the collector. This 42 identifies the usable fields within 43 the encap structure member defined 44 below. */ 45 bcm_flowtracker_collector_eth_header_t eth; /* Ethernet encapsulation of the packet 46 sent to collector. */ 47 bcm_flowtracker_collector_ipv4_header_t ipv4; /* IPv4 encapsulation of the packet sent 48 to collector. */ 49 bcm_flowtracker_collector_ipv6_header_t ipv6; /* IPv6 encapsulation of the packet sent 50 to collector. */ 51 bcm_flowtracker_collector_udp_header_t udp; /* UDP encapsulation of the packet sent 52 to collector. */ 53 uint16 max_packet_length; /* The maximum packet length of an 54 export packet that can be sent to 55 this collector. */ 56 } bcm_compat6516_flowtracker_collector_info_t; 57 58 59 /* Create a flowtracker collector with given collector info. */ 60 extern int bcm_compat6516_flowtracker_collector_create( 61 int unit, 62 uint32 options, 63 bcm_flowtracker_collector_t *collector_id, 64 bcm_compat6516_flowtracker_collector_info_t *collector_info); 65 66 /* Get flowtracker collector information with ID. */ 67 extern int bcm_compat6516_flowtracker_collector_get( 68 int unit, 69 bcm_flowtracker_collector_t id, 70 bcm_compat6516_flowtracker_collector_info_t *collector_info); 71 72 73 /* Flowtracker check information. */ 74 typedef struct bcm_compat6516_flowtracker_check_info_s { 75 uint32 flags; /* Configuration flags for Check 76 Creation. */ 77 bcm_flowtracker_tracking_param_type_t param; /* The attribute of flow on which the 78 check is performed. */ 79 uint32 min_value; /* Element value to do greater than or 80 equal checks. Minimum value to do 81 range checks. */ 82 uint32 max_value; /* Element value to do smaller than or 83 mask checks. Maximum value to do 84 range checks. */ 85 bcm_flowtracker_check_operation_t operation; /* Operation to be performed for this 86 check. */ 87 bcm_flowtracker_check_t primary_check_id; /* primary check id to associate second 88 check for aggregated checks on same 89 flow. */ 90 } bcm_compat6516_flowtracker_check_info_t; 91 92 /* Create Flow check and return software ID. */ 93 extern int bcm_compat6516_flowtracker_check_create( 94 int unit, 95 uint32 options, 96 bcm_compat6516_flowtracker_check_info_t check_info, 97 bcm_flowtracker_check_t *check_id); 98 99 /* Get information of flow check. */ 100 extern int bcm_compat6516_flowtracker_check_get( 101 int unit, 102 bcm_flowtracker_check_t check_id, 103 bcm_compat6516_flowtracker_check_info_t *check_info); 104 105 106 /* Actions related information for Flow check. */ 107 typedef struct bcm_compat6516_flowtracker_check_action_info_s { 108 uint32 flags; /* Action flags. */ 109 bcm_flowtracker_tracking_param_type_t param; /* The attribute of flow on which the 110 check is performed. */ 111 bcm_flowtracker_check_action_t action; /* Action to be performed if check 112 passes. */ 113 } bcm_compat6516_flowtracker_check_action_info_t; 114 115 /* Set action information of flow check. */ 116 extern int bcm_compat6516_flowtracker_check_action_info_set( 117 int unit, 118 bcm_flowtracker_check_t check_id, 119 bcm_compat6516_flowtracker_check_action_info_t info); 120 121 /* Get action information of flow check. */ 122 extern int bcm_compat6516_flowtracker_check_action_info_get( 123 int unit, 124 bcm_flowtracker_check_t check_id, 125 bcm_compat6516_flowtracker_check_action_info_t *info); 126 127 128 /* Flowtracker tracking parameter information. */ 129 typedef struct bcm_compat6516_flowtracker_tracking_param_info_s { 130 uint32 flags; /* Flags for tracking parameters. */ 131 bcm_flowtracker_tracking_param_type_t param; /* Type of tracking parameter. */ 132 bcm_flowtracker_tracking_param_user_data_t tracking_data; /* Element data for the tracking param 133 to be used to add a flow. */ 134 bcm_flowtracker_tracking_param_mask_t mask; /* Mask to select granular information 135 from tracking parameter. By default, 136 mask is set to all enabled. */ 137 bcm_flowtracker_check_t check_id; /* Flowtracker check to be used to 138 tracking flow check data. */ 139 bcm_udf_id_t udf_id; /* UDF Id associated with the tracking 140 param. */ 141 } bcm_compat6516_flowtracker_tracking_param_info_t; 142 143 /* Set tracking parameter for this flowtracker group. */ 144 extern int bcm_compat6516_flowtracker_group_tracking_params_set( 145 int unit, 146 bcm_flowtracker_group_t id, 147 int num_tracking_params, 148 bcm_compat6516_flowtracker_tracking_param_info_t *list_of_tracking_params); 149 150 /* Get flowtracker tracking parameters for this group. */ 151 extern int bcm_compat6516_flowtracker_group_tracking_params_get( 152 int unit, 153 bcm_flowtracker_group_t id, 154 int max_size, 155 bcm_compat6516_flowtracker_tracking_param_info_t *list_of_tracking_params, 156 int *list_size); 157 158 /* 159 * Add a user flow entry basis user input key elements. API expects that 160 * all tracking parametrs of type = 'KEY' in the group are specified. 161 */ 162 extern int bcm_compat6516_flowtracker_user_entry_add( 163 int unit, 164 bcm_flowtracker_group_t flow_group_id, 165 uint32 options, 166 int num_user_entry_params, 167 bcm_compat6516_flowtracker_tracking_param_info_t *user_entry_param_list, 168 bcm_flowtracker_user_entry_handle_t *entry_handle); 169 170 /* Fetch user entry info given the entry handle. */ 171 extern int bcm_compat6516_flowtracker_user_entry_get( 172 int unit, 173 bcm_flowtracker_user_entry_handle_t *entry_handle, 174 int num_user_entry_params, 175 bcm_compat6516_flowtracker_tracking_param_info_t *user_entry_param_list, 176 int *actual_user_entry_params); 177 178 179 180 /* Collector information. */ 181 typedef struct bcm_compat6516_collector_info_s { 182 bcm_collector_type_t collector_type; /* Collector type. Remote vs Local */ 183 bcm_collector_transport_type_t transport_type; /* Transport type used for exporting 184 data to the collector. This 185 identifies the usable fields within 186 the encap structure member defined 187 below. */ 188 bcm_collector_eth_header_t eth; /* Ethernet encapsulation of the packet 189 sent to collector. */ 190 bcm_collector_ipv4_header_t ipv4; /* IPv4 encapsulation of the packet sent 191 to collector. */ 192 bcm_collector_ipv6_header_t ipv6; /* IPv6 encapsulation of the packet sent 193 to collector. */ 194 bcm_collector_udp_header_t udp; /* UDP encapsulation of the packet sent 195 to collector. */ 196 bcm_collector_ipfix_header_t ipfix; /* IPFIX encapsulation of the packet 197 sent to collector. */ 198 bcm_collector_protobuf_header_t protobuf; /* Protobuf header information. */ 199 } bcm_compat6516_collector_info_t; 200 201 /* Create a collector with given collector info. */ 202 extern int bcm_compat6516_collector_create( 203 int unit, 204 uint32 options, 205 bcm_collector_t *collector_id, 206 bcm_compat6516_collector_info_t *collector_info); 207 208 /* Get collector information with ID. */ 209 extern int bcm_compat6516_collector_get( 210 int unit, 211 bcm_collector_t id, 212 bcm_compat6516_collector_info_t *collector_info); 213 214 /* L2 Station address info. */ 215 typedef struct bcm_compat6516_l2_station_s { 216 uint32 flags; /* BCM_L2_STATION_xxx flags. */ 217 int priority; /* Entry priority. */ 218 bcm_mac_t dst_mac; /* Destination MAC address to match. */ 219 bcm_mac_t dst_mac_mask; /* Destination MAC address mask value. */ 220 bcm_vlan_t vlan; /* VLAN to match. */ 221 bcm_vlan_t vlan_mask; /* VLAN mask value. */ 222 bcm_port_t src_port; /* Ingress port to match. */ 223 bcm_port_t src_port_mask; /* Ingress port mask value. */ 224 bcm_tsn_pri_map_t taf_gate_primap; /* TAF (Time Aware Filtering) gate 225 priority mapping */ 226 } bcm_compat6516_l2_station_t; 227 228 /* Add an entry to L2 Station Table. */ 229 int bcm_compat6516_l2_station_add( 230 int unit, 231 int *station_id, 232 bcm_compat6516_l2_station_t *station); 233 234 /* Get L2 station entry detail from Station Table. */ 235 int bcm_compat6516_l2_station_get( 236 int unit, 237 int station_id, 238 bcm_compat6516_l2_station_t *station); 239 240 /* Device-independent L2 address structure. */ 241 typedef struct bcm_compat6516_l2_addr_s { 242 uint32 flags; /* BCM_L2_xxx flags. */ 243 uint32 flags2; /* BCM_L2_FLAGS2_xxx flags. */ 244 uint32 station_flags; /* BCM_L2_STATION_xxx flags. */ 245 bcm_mac_t mac; /* 802.3 MAC address. */ 246 bcm_vlan_t vid; /* VLAN identifier. */ 247 int port; /* Zero-based port number. */ 248 int modid; /* XGS: modid. */ 249 bcm_trunk_t tgid; /* Trunk group ID. */ 250 bcm_cos_t cos_dst; /* COS based on dst addr. */ 251 bcm_cos_t cos_src; /* COS based on src addr. */ 252 bcm_multicast_t l2mc_group; /* XGS: index in L2MC table. */ 253 bcm_if_t egress_if; /* XGS: index in Next Hop Tables. Used 254 it with BCM_L2_FLAGS2_ROE_NHI flag */ 255 bcm_multicast_t l3mc_group; /* XGS: index in L3_IPMC table. Use it 256 with BCM_L2_FLAGS2_L3_MULTICAST. */ 257 bcm_pbmp_t block_bitmap; /* XGS: blocked egress bitmap. */ 258 int auth; /* Used if auth enabled on port. */ 259 int group; /* Group number for FP. */ 260 bcm_fabric_distribution_t distribution_class; /* Fabric Distribution Class. */ 261 int encap_id; /* out logical interface */ 262 int age_state; /* Age state of the entry */ 263 uint32 flow_handle; /* FLOW handle for flex entries. */ 264 uint32 flow_option_handle; /* FLOW option handle for flex entries. */ 265 bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex 266 entries. */ 267 uint32 num_of_fields; /* number of logical fields. */ 268 bcm_pbmp_t sa_source_filter_pbmp; /* Source port filter bitmap for this SA */ 269 bcm_tsn_flowset_t tsn_flowset; /* Time-Sensitive Networking: associated 270 flow set */ 271 bcm_tsn_sr_flowset_t sr_flowset; /* Seamless Redundancy: associated flow 272 set */ 273 bcm_policer_t policer_id; /* Base policer to be used */ 274 bcm_tsn_pri_map_t taf_gate_primap; /* TAF (Time Aware Filtering) gate 275 priority mapping */ 276 uint32 stat_id; /* Object statistics ID */ 277 int stat_pp_profile; /* Statistics profile */ 278 } bcm_compat6516_l2_addr_t; 279 280 extern int bcm_compat6516_l2_addr_add(int unit, 281 bcm_compat6516_l2_addr_t *l2addr); 282 extern int bcm_compat6516_l2_addr_multi_add(int unit, 283 bcm_compat6516_l2_addr_t *l2addr, int count); 284 extern int bcm_compat6516_l2_addr_multi_delete(int unit, 285 bcm_compat6516_l2_addr_t *l2addr, int count); 286 extern int bcm_compat6516_l2_addr_get(int unit, bcm_mac_t mac_addr, bcm_vlan_t vid, 287 bcm_compat6516_l2_addr_t *l2addr); 288 extern int bcm_compat6516_l2_conflict_get(int unit, bcm_compat6516_l2_addr_t *addr, 289 bcm_compat6516_l2_addr_t *cf_array, int cf_max, 290 int *cf_count); 291 extern int bcm_compat6516_l2_replace(int unit, uint32 flags, 292 bcm_compat6516_l2_addr_t *match_addr, 293 bcm_module_t new_module, 294 bcm_port_t new_port, bcm_trunk_t new_trunk); 295 extern int bcm_compat6516_l2_replace_match(int unit, uint32 flags, 296 bcm_compat6516_l2_addr_t *match_addr, 297 bcm_compat6516_l2_addr_t *mask_addr, 298 bcm_compat6516_l2_addr_t *replace_addr, 299 bcm_compat6516_l2_addr_t *replace_mask_addr); 300 extern int bcm_compat6516_l2_stat_get(int unit, 301 bcm_compat6516_l2_addr_t *l2addr, 302 bcm_l2_stat_t stat, uint64 *val); 303 extern int bcm_compat6516_l2_stat_get32(int unit, 304 bcm_compat6516_l2_addr_t *l2addr, 305 bcm_l2_stat_t stat, uint32 *val); 306 extern int bcm_compat6516_l2_stat_set(int unit, 307 bcm_compat6516_l2_addr_t *l2addr, 308 bcm_l2_stat_t stat, uint64 val); 309 extern int bcm_compat6516_l2_stat_set32(int unit, 310 bcm_compat6516_l2_addr_t *l2addr, 311 bcm_l2_stat_t stat, uint32 val); 312 extern int bcm_compat6516_l2_stat_enable_set(int unit, 313 bcm_compat6516_l2_addr_t *l2addr, 314 int enable); 315 316 /* Trunk group attributes structure. */ 317 typedef struct bcm_compat6516_trunk_info_s { 318 uint32 flags; /* BCM_TRUNK_FLAG_xxx. */ 319 int psc; /* Port selection criteria. */ 320 bcm_trunk_psc_profile_info_t psc_info; /* Port selection criteria information. */ 321 int ipmc_psc; /* Port selection criteria for software 322 IPMC trunk resolution. */ 323 int dlf_index; /* DLF/broadcast port for trunk group. */ 324 int mc_index; /* Multicast port for trunk group. */ 325 int ipmc_index; /* IPMC port for trunk group. */ 326 int dynamic_size; /* Number of flows for dynamic load 327 balancing. Valid values are 512, 1k, 328 doubling up to 32k */ 329 int dynamic_age; /* Inactivity duration, in microseconds. */ 330 int dynamic_load_exponent; /* The exponent used in the 331 exponentially weighted moving average 332 calculation of historical member 333 load. */ 334 int dynamic_expected_load_exponent; /* The exponent used in the 335 exponentially weighted moving average 336 calculation of historical expected 337 member load. */ 338 bcm_trunk_t master_tid; /* Master trunk id. */ 339 } bcm_compat6516_trunk_info_t; 340 341 /* Get the current parameters for the specified trunk group. */ 342 extern int bcm_compat6516_trunk_get( 343 int unit, 344 bcm_trunk_t tid, 345 bcm_compat6516_trunk_info_t *t_data, 346 int member_max, 347 bcm_trunk_member_t *member_array, 348 int *member_count); 349 350 /* Set member ports of a trunk group. */ 351 extern int bcm_compat6516_trunk_set( 352 int unit, 353 bcm_trunk_t tid, 354 bcm_compat6516_trunk_info_t *trunk_info, 355 int member_count, 356 bcm_trunk_member_t *member_array); 357 358 /* ECN traffic map info. */ 359 typedef struct bcm_compat6516_ecn_traffic_map_info_t { 360 uint32 flags; /* BCM_ECN_TRAFFIC_MAP_XXX flag definitions. */ 361 uint8 ecn; /* ECN value of packet's IP header. */ 362 int int_cn; /* Mapped internal congestion notification(int_cn) value. */ 363 } bcm_compat6516_ecn_traffic_map_info_t; 364 365 extern int bcm_compat6516_ecn_traffic_map_get( 366 int unit, 367 bcm_compat6516_ecn_traffic_map_info_t *map); 368 369 extern int bcm_compat6516_ecn_traffic_map_set( 370 int unit, 371 bcm_compat6516_ecn_traffic_map_info_t *map); 372 373 #if defined(INCLUDE_L3) 374 /* L3 tunneling initiator. */ 375 typedef struct bcm_compat6516_tunnel_initiator_s { 376 uint32 flags; /* Configuration flags. */ 377 bcm_tunnel_type_t type; /* Tunnel type. */ 378 int ttl; /* Tunnel header TTL. */ 379 bcm_mac_t dmac; /* Destination MAC address. */ 380 bcm_ip_t dip; /* Tunnel header DIP (IPv4). */ 381 bcm_ip_t sip; /* Tunnel header SIP (IPv4). */ 382 bcm_ip6_t sip6; /* Tunnel header SIP (IPv6). */ 383 bcm_ip6_t dip6; /* Tunnel header DIP (IPv6). */ 384 uint32 flow_label; /* Tunnel header flow label (IPv6). */ 385 bcm_tunnel_dscp_select_t dscp_sel; /* Tunnel header DSCP select. */ 386 int dscp; /* Tunnel header DSCP value. */ 387 int dscp_map; /* DSCP-map ID. */ 388 bcm_gport_t tunnel_id; /* Tunnel ID */ 389 uint16 udp_dst_port; /* Destination UDP port */ 390 uint16 udp_src_port; /* Source UDP port */ 391 bcm_mac_t smac; /* WLAN outer MAC */ 392 int mtu; /* WLAN MTU */ 393 bcm_vlan_t vlan; /* Tunnel VLAN */ 394 uint16 tpid; /* Tunnel TPID */ 395 uint8 pkt_pri; /* Tunnel priority */ 396 uint8 pkt_cfi; /* Tunnel CFI */ 397 uint16 ip4_id; /* IPv4 ID. */ 398 bcm_if_t l3_intf_id; /* l3 Interface ID. */ 399 uint16 span_id; /* Erspan Span ID. */ 400 uint32 aux_data; /* Tunnel associated data. */ 401 int outlif_counting_profile; /* Out LIF counting profile */ 402 bcm_encap_access_t encap_access; /* Encapsulation Access stage */ 403 uint8 hw_id; /* Unique identifier of an ERSPAN engine 404 within a system */ 405 uint16 switch_id; /* Identifies a source switch at the 406 receiving end */ 407 uint16 class_id; /* Class ID of the RSPAN advanced tunnel */ 408 bcm_qos_egress_model_t egress_qos_model; /* egress qos and ttl model */ 409 int qos_map_id; /* general remark profile */ 410 } bcm_compat6516_tunnel_initiator_t; 411 412 extern int bcm_compat6516_l2gre_tunnel_initiator_create( 413 int unit, 414 bcm_compat6516_tunnel_initiator_t *info); 415 416 extern int bcm_compat6516_l2gre_tunnel_initiator_get( 417 int unit, 418 bcm_compat6516_tunnel_initiator_t *info); 419 420 extern int bcm_compat6516_tunnel_initiator_set( 421 int unit, 422 bcm_compat6517_l3_intf_t *intf, 423 bcm_compat6516_tunnel_initiator_t *tunnel); 424 425 extern int bcm_compat6516_tunnel_initiator_create( 426 int unit, 427 bcm_compat6517_l3_intf_t *intf, 428 bcm_compat6516_tunnel_initiator_t *tunnel); 429 430 extern int bcm_compat6516_tunnel_initiator_get( 431 int unit, 432 bcm_compat6517_l3_intf_t *intf, 433 bcm_compat6516_tunnel_initiator_t *tunnel); 434 435 extern int bcm_compat6516_vxlan_tunnel_initiator_create( 436 int unit, 437 bcm_compat6516_tunnel_initiator_t *info); 438 439 extern int bcm_compat6516_vxlan_tunnel_initiator_get( 440 int unit, 441 bcm_compat6516_tunnel_initiator_t *info); 442 443 extern int bcm_compat6516_wlan_tunnel_initiator_create( 444 int unit, 445 bcm_compat6516_tunnel_initiator_t *info); 446 447 extern int bcm_compat6516_wlan_tunnel_initiator_get( 448 int unit, 449 bcm_compat6516_tunnel_initiator_t *info); 450 451 typedef struct bcm_compat6516_flow_port_encap_s { 452 bcm_gport_t flow_port; /* flow port id identifies DVP. */ 453 uint32 options; /* BCM_FLOW_PORT_ENCAP_xxx. */ 454 uint32 flags; /* BCM_FLOW_PORT_ENCAP_FLAG_xxx. */ 455 uint32 class_id; /* class id. */ 456 uint16 mtu; /* MTU. */ 457 uint32 network_group; /* network group ID */ 458 uint32 dvp_group; /* DVP group ID */ 459 uint8 pri; /* service tag priority. */ 460 uint8 cfi; /* service tag cfi */ 461 uint16 tpid; /* service tag tpid */ 462 bcm_vlan_t vlan; /* service VLAN ID. */ 463 bcm_if_t egress_if; /* egress object */ 464 uint32 valid_elements; /* bitmap of valid fields for hardware 465 parameters */ 466 bcm_flow_handle_t flow_handle; /* flow handle */ 467 uint32 flow_option; /* flow option id */ 468 } bcm_compat6516_flow_port_encap_t; 469 470 extern int bcm_compat6516_flow_port_encap_set( 471 int unit, 472 bcm_compat6516_flow_port_encap_t *info, 473 uint32 num_of_fields, 474 bcm_flow_logical_field_t *field); 475 476 extern int bcm_compat6516_flow_port_encap_get( 477 int unit, 478 bcm_compat6516_flow_port_encap_t *info, 479 uint32 num_of_fields, 480 bcm_flow_logical_field_t *field); 481 482 typedef struct bcm_compat6516_flow_tunnel_initiator_s { 483 uint32 flags; /* Configuration flags. */ 484 bcm_tunnel_type_t type; /* Tunnel type. */ 485 int ttl; /* Tunnel header TTL. */ 486 bcm_mac_t dmac; /* Destination MAC address. */ 487 bcm_ip_t dip; /* Tunnel header DIP (IPv4). */ 488 bcm_ip_t sip; /* Tunnel header SIP (IPv4). */ 489 bcm_ip6_t sip6; /* Tunnel header SIP (IPv6). */ 490 bcm_ip6_t dip6; /* Tunnel header DIP (IPv6). */ 491 uint32 flow_label; /* Tunnel header flow label (IPv6). */ 492 bcm_tunnel_dscp_select_t dscp_sel; /* Tunnel header DSCP select. */ 493 int dscp; /* Tunnel header DSCP value. */ 494 int dscp_map; /* DSCP-map ID. */ 495 bcm_gport_t tunnel_id; /* Tunnel ID */ 496 uint16 udp_dst_port; /* Destination UDP port */ 497 uint16 udp_src_port; /* Source UDP port */ 498 bcm_mac_t smac; /* Src MAC */ 499 bcm_vlan_t vlan; /* Tunnel VLAN */ 500 uint16 tpid; /* Tunnel TPID */ 501 uint8 pkt_pri; /* Tunnel priority */ 502 uint8 pkt_cfi; /* Tunnel CFI */ 503 uint16 ip4_id; /* IPv4 ID. */ 504 bcm_if_t l3_intf_id; /* l3 Interface ID. */ 505 bcm_gport_t flow_port; /* Flow port ID */ 506 uint32 valid_elements; /* bitmap of valid fields */ 507 uint32 flow_handle; /* flow handle */ 508 uint32 flow_option; /* flow option */ 509 } bcm_compat6516_flow_tunnel_initiator_t; 510 511 extern int bcm_compat6516_flow_tunnel_initiator_create( 512 int unit, 513 bcm_compat6516_flow_tunnel_initiator_t *info, 514 uint32 num_of_fields, 515 bcm_flow_logical_field_t *field); 516 517 extern int bcm_compat6516_flow_tunnel_initiator_get( 518 int unit, 519 bcm_compat6516_flow_tunnel_initiator_t *info, 520 uint32 num_of_fields, 521 bcm_flow_logical_field_t *field); 522 523 typedef struct bcm_compat6516_flow_match_config_s { 524 uint32 vnid; /* VN_ID. */ 525 bcm_vlan_t vlan; /* Outer VLAN ID to match. */ 526 bcm_vlan_t inner_vlan; /* Inner VLAN ID to match. */ 527 bcm_gport_t port; /* Match port / trunk */ 528 bcm_ip_t sip; /* source IPv4 address */ 529 bcm_ip_t sip_mask; /* source IPv4 address mask */ 530 bcm_ip6_t sip6; /* source IPv6 address */ 531 bcm_ip6_t sip6_mask; /* source IPv6 address mask */ 532 bcm_ip_t dip; /* destination IPv4 address */ 533 bcm_ip_t dip_mask; /* destination IPv4 address mask */ 534 bcm_ip6_t dip6; /* destination IPv6 address */ 535 bcm_ip6_t dip6_mask; /* destination IPv6 address mask */ 536 uint16 udp_dst_port; /* udp destination port. */ 537 uint16 udp_src_port; /* udp source port. */ 538 uint16 protocol; /* IP protocol type. */ 539 bcm_mpls_label_t mpls_label; /* MPLS label. */ 540 bcm_gport_t flow_port; /* flow port id representing a SVP */ 541 bcm_vpn_t vpn; /* VPN representing a vfi or vrf */ 542 bcm_if_t intf_id; /* l3 interface id */ 543 uint32 options; /* BCM_FLOW_MATCH_OPTION_xxx. */ 544 bcm_flow_match_criteria_t criteria; /* flow match criteria. */ 545 uint32 valid_elements; /* bitmap of valid fields for the match 546 action */ 547 bcm_flow_handle_t flow_handle; /* flow handle derived from flow name */ 548 uint32 flow_option; /* flow option derived from flow option 549 name */ 550 } bcm_compat6516_flow_match_config_t; 551 552 extern int bcm_compat6516_flow_match_add( 553 int unit, 554 bcm_compat6516_flow_match_config_t *info, 555 uint32 num_of_fields, 556 bcm_flow_logical_field_t *field); 557 558 extern int bcm_compat6516_flow_match_delete( 559 int unit, 560 bcm_compat6516_flow_match_config_t *info, 561 uint32 num_of_fields, 562 bcm_flow_logical_field_t *field); 563 564 extern int bcm_compat6516_flow_match_get( 565 int unit, 566 bcm_compat6516_flow_match_config_t *info, 567 uint32 num_of_fields, 568 bcm_flow_logical_field_t *field); 569 570 typedef struct bcm_compat6516_l3_egress_s { 571 uint32 flags; /* Interface flags (BCM_L3_TGID, 572 BCM_L3_L2TOCPU). */ 573 uint32 flags2; /* See BCM_L3_FLAGS2_xxx flag 574 definitions. */ 575 bcm_if_t intf; /* L3 interface (source MAC, tunnel). */ 576 bcm_mac_t mac_addr; /* Next hop forwarding destination mac. */ 577 bcm_vlan_t vlan; /* Next hop vlan id. */ 578 bcm_module_t module; 579 bcm_port_t port; /* Port packet switched to (if 580 !BCM_L3_TGID). */ 581 bcm_trunk_t trunk; /* Trunk packet switched to (if 582 BCM_L3_TGID). */ 583 uint32 mpls_flags; /* BCM_MPLS flag definitions. */ 584 bcm_mpls_label_t mpls_label; /* MPLS label. */ 585 bcm_mpls_egress_action_t mpls_action; /* MPLS action. */ 586 int mpls_qos_map_id; /* MPLS EXP map ID. */ 587 int mpls_ttl; /* MPLS TTL threshold. */ 588 uint8 mpls_pkt_pri; /* MPLS Packet Priority Value. */ 589 uint8 mpls_pkt_cfi; /* MPLS Packet CFI Value. */ 590 uint8 mpls_exp; /* MPLS Exp. */ 591 int qos_map_id; /* General QOS map id */ 592 bcm_if_t encap_id; /* Encapsulation index. */ 593 bcm_failover_t failover_id; /* Failover Object Index. */ 594 bcm_if_t failover_if_id; /* Failover Egress Object index. */ 595 bcm_multicast_t failover_mc_group; /* Failover Multicast Group. */ 596 int dynamic_scaling_factor; /* Scaling factor for dynamic load 597 balancing thresholds. */ 598 int dynamic_load_weight; /* Weight of traffic load in determining 599 a dynamic load balancing member's 600 quality. */ 601 int dynamic_queue_size_weight; /* Weight of queue size in determining a 602 dynamic load balancing member's 603 quality. */ 604 int intf_class; /* L3 interface class ID */ 605 uint32 multicast_flags; /* BCM_L3_MULTICAST flag definitions. */ 606 uint16 oam_global_context_id; /* OAM global context id passed from 607 ingress to egress XGS chip. */ 608 bcm_vntag_t vntag; /* VNTAG. */ 609 bcm_vntag_action_t vntag_action; /* VNTAG action. */ 610 bcm_etag_t etag; /* ETAG. */ 611 bcm_etag_action_t etag_action; /* ETAG action. */ 612 uint32 flow_handle; /* FLOW handle for flex entries. */ 613 uint32 flow_option_handle; /* FLOW option handle for flex entries. */ 614 uint32 flow_label_option_handle; /* FLOW option handle for egress label 615 flex entries. */ 616 bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex 617 entries. */ 618 uint32 num_of_fields; /* number of logical fields. */ 619 int counting_profile; /* counting profile. If not required, 620 set it to 621 BCM_STAT_LIF_COUNTING_PROFILE_NONE */ 622 int mpls_ecn_map_id; /* IP ECN/INT CN to MPLS EXP map ID. */ 623 bcm_l3_ingress_urpf_mode_t urpf_mode; /* fec rpf mode. */ 624 bcm_multicast_t mc_group; /* Multicast Group. */ 625 bcm_mac_t src_mac_addr; /* Source MAC Address. */ 626 bcm_gport_t hierarchical_gport; /* Hierarchical TM-Flow. */ 627 uint32 stat_id; /* Object statistics ID. */ 628 int stat_pp_profile; /* Statistics profile. */ 629 bcm_gport_t vlan_port_id; /* Pointer to egress vlan translation 630 lif entry in EEDB. */ 631 int replication_id; /* Replication copy ID of multicast 632 Egress object. */ 633 } bcm_compat6516_l3_egress_t; 634 635 extern int bcm_compat6516_l3_egress_create( 636 int unit, 637 uint32 flags, 638 bcm_compat6516_l3_egress_t *egr, 639 bcm_if_t *if_id); 640 641 extern int bcm_compat6516_l3_egress_get( 642 int unit, 643 bcm_if_t intf, 644 bcm_compat6516_l3_egress_t *egr); 645 646 extern int bcm_compat6516_l3_egress_find( 647 int unit, 648 bcm_compat6516_l3_egress_t *egr, 649 bcm_if_t *intf); 650 651 extern int bcm_compat6516_failover_egress_set( 652 int unit, 653 bcm_if_t intf, 654 bcm_compat6516_l3_egress_t *failover_egr); 655 656 extern int bcm_compat6516_failover_egress_get( 657 int unit, 658 bcm_if_t intf, 659 bcm_compat6516_l3_egress_t *failover_egr); 660 661 typedef struct bcm_compat6516_l3_host_s { 662 uint32 l3a_flags; /* See BCM_L3_xxx flag definitions. */ 663 uint32 l3a_flags2; /* See BCM_L3_FLAGS2_xxx flag 664 definitions. */ 665 bcm_vrf_t l3a_vrf; /* Virtual router instance. */ 666 bcm_ip_t l3a_ip_addr; /* Destination host IP address (IPv4). */ 667 bcm_ip6_t l3a_ip6_addr; /* Destination host IP address (IPv6). */ 668 bcm_cos_t l3a_pri; /* New priority in packet. */ 669 bcm_if_t l3a_intf; /* L3 intf associated with this address. */ 670 bcm_mac_t l3a_nexthop_mac; /* Next hop MAC addr. */ 671 bcm_module_t l3a_modid; /* Module ID packet is switched to. */ 672 bcm_port_t l3a_port_tgid; /* Port/TGID packet is switched to. */ 673 bcm_port_t l3a_stack_port; /* Used if modid not local (Strata 674 Only). */ 675 int l3a_ipmc_ptr; /* Pointer to IPMC table. */ 676 int l3a_lookup_class; /* Classification lookup class ID. */ 677 bcm_if_t encap_id; /* Encapsulation index. */ 678 bcm_if_t native_intf; /* L3 native interface (source MAC). */ 679 uint32 flow_handle; /* FLOW handle for flex entries. */ 680 uint32 flow_option_handle; /* FLOW option handle for flex entries. */ 681 bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex 682 entries. */ 683 uint32 num_of_fields; /* number of logical fields. */ 684 int l3a_ipmc_ptr_l2; /* Pointer to IPMC table for L2 685 recipients if TTL/RPF check fails. */ 686 uint32 stat_id; /* Object statistics ID. */ 687 int stat_pp_profile; /* Statistics profile. */ 688 } bcm_compat6516_l3_host_t; 689 690 extern int bcm_compat6516_l3_host_find( 691 int unit, 692 bcm_compat6516_l3_host_t *info); 693 694 extern int bcm_compat6516_l3_host_add( 695 int unit, 696 bcm_compat6516_l3_host_t *info); 697 698 extern int bcm_compat6516_l3_host_delete( 699 int unit, 700 bcm_compat6516_l3_host_t *ip_addr); 701 702 extern int bcm_compat6516_l3_host_delete_by_interface( 703 int unit, 704 bcm_compat6516_l3_host_t *info); 705 706 extern int bcm_compat6516_l3_host_delete_all( 707 int unit, 708 bcm_compat6516_l3_host_t *info); 709 710 extern int bcm_compat6516_l3_host_stat_attach( 711 int unit, 712 bcm_compat6516_l3_host_t *info, 713 uint32 stat_counter_id); 714 715 extern int bcm_compat6516_l3_host_stat_detach( 716 int unit, 717 bcm_compat6516_l3_host_t *info); 718 719 extern int bcm_compat6516_l3_host_stat_counter_get( 720 int unit, 721 bcm_compat6516_l3_host_t *info, 722 bcm_l3_stat_t stat, 723 uint32 num_entries, 724 uint32 *counter_indexes, 725 bcm_stat_value_t *counter_values); 726 727 extern int bcm_compat6516_l3_host_stat_counter_sync_get( 728 int unit, 729 bcm_compat6516_l3_host_t *info, 730 bcm_l3_stat_t stat, 731 uint32 num_entries, 732 uint32 *counter_indexes, 733 bcm_stat_value_t *counter_values); 734 735 extern int bcm_compat6516_l3_host_stat_counter_set( 736 int unit, 737 bcm_compat6516_l3_host_t *info, 738 bcm_l3_stat_t stat, 739 uint32 num_entries, 740 uint32 *counter_indexes, 741 bcm_stat_value_t *counter_values); 742 743 extern int bcm_compat6516_l3_host_stat_id_get( 744 int unit, 745 bcm_compat6516_l3_host_t *info, 746 bcm_l3_stat_t stat, 747 uint32 *stat_counter_id); 748 749 typedef struct bcm_compat6516_l3_route_s { 750 uint32 l3a_flags; /* See BCM_L3_xxx flag definitions. */ 751 uint32 l3a_flags2; /* See BCM_L3_FLAGS2_xxx flag 752 definitions. */ 753 uint32 l3a_ipmc_flags; /* Used for multicast route entry. See 754 BCM_IPMC_xxx flag definitions. */ 755 bcm_vrf_t l3a_vrf; /* Virtual router instance. */ 756 bcm_ip_t l3a_subnet; /* IP subnet address (IPv4). */ 757 bcm_ip6_t l3a_ip6_net; /* IP subnet address (IPv6). */ 758 bcm_ip_t l3a_ip_mask; /* IP subnet mask (IPv4). */ 759 bcm_ip6_t l3a_ip6_mask; /* IP subnet mask (IPv6). */ 760 bcm_if_t l3a_intf; /* L3 interface associated with route. */ 761 bcm_ip_t l3a_nexthop_ip; /* Next hop IP address (XGS1/2, IPv4). */ 762 bcm_mac_t l3a_nexthop_mac; /* Next hop MAC address. */ 763 bcm_module_t l3a_modid; /* Module ID. */ 764 bcm_port_t l3a_port_tgid; /* Port or trunk group ID. */ 765 bcm_port_t l3a_stack_port; /* Used if modid is not local (Strata 766 Only). */ 767 bcm_vlan_t l3a_vid; /* BCM5695 only - for per-VLAN def 768 route. */ 769 bcm_cos_t l3a_pri; /* Priority (COS). */ 770 uint32 l3a_tunnel_option; /* Tunnel option value. */ 771 bcm_mpls_label_t l3a_mpls_label; /* MPLS label. */ 772 int l3a_lookup_class; /* Classification class ID. */ 773 bcm_if_t l3a_expected_intf; /* Expected L3 Interface used for 774 multicast RPF check */ 775 int l3a_rp; /* Rendezvous point ID */ 776 bcm_multicast_t l3a_mc_group; /* L3 Multicast group index */ 777 bcm_gport_t l3a_expected_src_gport; /* L3 Multicast group expected source 778 port/trunk */ 779 uint32 flow_handle; /* FLOW handle for flex entries. */ 780 uint32 flow_option_handle; /* FLOW option handle for flex entries. */ 781 bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex 782 entries. */ 783 uint32 num_of_fields; /* number of logical fields. */ 784 uint32 stat_id; /* Object statistics ID. */ 785 int stat_pp_profile; /* Statistics profile. */ 786 } bcm_compat6516_l3_route_t; 787 788 extern int bcm_compat6516_l3_host_delete_by_network( 789 int unit, 790 bcm_compat6516_l3_route_t *ip_addr); 791 792 extern int bcm_compat6516_l3_route_add( 793 int unit, 794 bcm_compat6516_l3_route_t *info); 795 796 extern int bcm_compat6516_l3_route_delete( 797 int unit, 798 bcm_compat6516_l3_route_t *info); 799 800 extern int bcm_compat6516_l3_route_delete_by_interface( 801 int unit, 802 bcm_compat6516_l3_route_t *info); 803 804 extern int bcm_compat6516_l3_route_delete_all( 805 int unit, 806 bcm_compat6516_l3_route_t *info); 807 808 extern int bcm_compat6516_l3_route_get( 809 int unit, 810 bcm_compat6516_l3_route_t *info); 811 812 extern int bcm_compat6516_l3_route_multipath_get( 813 int unit, 814 bcm_compat6516_l3_route_t *the_route, 815 bcm_compat6516_l3_route_t *path_array, 816 int max_path, 817 int *path_count); 818 819 extern int bcm_compat6516_l3_route_stat_get( 820 int unit, 821 bcm_compat6516_l3_route_t *route, 822 bcm_l3_stat_t stat, 823 uint64 *val); 824 825 extern int bcm_compat6516_l3_route_stat_get32( 826 int unit, 827 bcm_compat6516_l3_route_t *route, 828 bcm_l3_stat_t stat, 829 uint32 *val); 830 831 extern int bcm_compat6516_l3_route_stat_set( 832 int unit, 833 bcm_compat6516_l3_route_t *route, 834 bcm_l3_stat_t stat, 835 uint64 val); 836 837 extern int bcm_compat6516_l3_route_stat_set32( 838 int unit, 839 bcm_compat6516_l3_route_t *route, 840 bcm_l3_stat_t stat, 841 uint32 val); 842 843 extern int bcm_compat6516_l3_route_stat_enable_set( 844 int unit, 845 bcm_compat6516_l3_route_t *route, 846 int enable); 847 848 extern int bcm_compat6516_l3_route_stat_attach( 849 int unit, 850 bcm_compat6516_l3_route_t *info, 851 uint32 stat_counter_id); 852 853 extern int bcm_compat6516_l3_route_stat_detach( 854 int unit, 855 bcm_compat6516_l3_route_t *info); 856 857 extern int bcm_compat6516_l3_route_stat_counter_get( 858 int unit, 859 bcm_compat6516_l3_route_t *info, 860 bcm_l3_route_stat_t stat, 861 uint32 num_entries, 862 uint32 *counter_indexes, 863 bcm_stat_value_t *counter_values); 864 865 extern int bcm_compat6516_l3_route_stat_counter_sync_get( 866 int unit, 867 bcm_compat6516_l3_route_t *info, 868 bcm_l3_route_stat_t stat, 869 uint32 num_entries, 870 uint32 *counter_indexes, 871 bcm_stat_value_t *counter_values); 872 873 extern int bcm_compat6516_l3_route_stat_counter_set( 874 int unit, 875 bcm_compat6516_l3_route_t *info, 876 bcm_l3_route_stat_t stat, 877 uint32 num_entries, 878 uint32 *counter_indexes, 879 bcm_stat_value_t *counter_values); 880 881 extern int bcm_compat6516_l3_route_stat_multi_get( 882 int unit, 883 bcm_compat6516_l3_route_t *info, 884 int nstat, 885 bcm_l3_route_stat_t *stat_arr, 886 uint64 *value_arr); 887 888 extern int bcm_compat6516_l3_route_stat_multi_get32( 889 int unit, 890 bcm_compat6516_l3_route_t *info, 891 int nstat, 892 bcm_l3_route_stat_t *stat_arr, 893 uint32 *value_arr); 894 895 extern int bcm_compat6516_l3_route_stat_multi_set( 896 int unit, 897 bcm_compat6516_l3_route_t *info, 898 int nstat, 899 bcm_l3_route_stat_t *stat_arr, 900 uint64 *value_arr); 901 902 extern int bcm_compat6516_l3_route_stat_multi_set32( 903 int unit, 904 bcm_compat6516_l3_route_t *info, 905 int nstat, 906 bcm_l3_route_stat_t *stat_arr, 907 uint32 *value_arr); 908 909 extern int bcm_compat6516_l3_route_stat_id_get( 910 int unit, 911 bcm_compat6516_l3_route_t *info, 912 bcm_l3_route_stat_t stat, 913 uint32 *stat_counter_id); 914 915 extern int bcm_compat6516_l3_route_find( 916 int unit, 917 bcm_compat6516_l3_host_t *host, 918 bcm_compat6516_l3_route_t *route); 919 920 extern int bcm_compat6516_l3_subnet_route_find( 921 int unit, 922 bcm_compat6516_l3_route_t *input, 923 bcm_compat6516_l3_route_t *route); 924 925 typedef struct bcm_compat6516_ipmc_addr_s { 926 bcm_ip_t s_ip_addr; /* IPv4 Source address. */ 927 bcm_ip_t mc_ip_addr; /* IPv4 Destination address. */ 928 bcm_ip6_t s_ip6_addr; /* IPv6 Source address. */ 929 bcm_ip6_t mc_ip6_addr; /* IPv6 Destination address. */ 930 bcm_vlan_t vid; /* VLAN identifier. */ 931 bcm_vrf_t vrf; /* Virtual Router Instance. */ 932 bcm_cos_t cos; /* COS based on dst IP multicast addr. */ 933 int ts; /* Source port or TGID bit. */ 934 int port_tgid; /* Source port or TGID. */ 935 int v; /* Valid bit. */ 936 int mod_id; /* Module ID. */ 937 bcm_multicast_t group; /* Use this index to program IPMC table 938 for XGS chips based on flags value */ 939 uint32 flags; /* See BCM_IPMC_XXX flag definitions. */ 940 int lookup_class; /* Classification lookup class ID. */ 941 bcm_fabric_distribution_t distribution_class; /* Fabric Distribution Class. */ 942 bcm_if_t l3a_intf; /* L3 interface associated with route. */ 943 int rp_id; /* Rendezvous point ID. */ 944 bcm_ip_t s_ip_mask; /* IPv4 Source subnet mask. */ 945 bcm_if_t ing_intf; /* L3 interface associated with this 946 Entry */ 947 bcm_ip_t mc_ip_mask; /* IPv4 Destination subnet mask. */ 948 bcm_ip6_t mc_ip6_mask; /* IPv6 Destination subnet mask. */ 949 bcm_multicast_t group_l2; /* Use this index to program IPMC table 950 for l2 recipients if TTL/RPF check 951 fails. */ 952 uint32 stat_id; /* Object statistics ID. */ 953 int stat_pp_profile; /* Statistics profile. */ 954 bcm_ip6_t s_ip6_mask; /* IPv6 Source subnet mask. */ 955 int priority; /* Entry priority. */ 956 uint32 flow_handle; /* FLOW handle for flex entries. */ 957 uint32 flow_option_handle; /* FLOW option handle for flex entries. */ 958 bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex 959 entries. */ 960 uint32 num_logical_fields; /* number of logical fields. */ 961 } bcm_compat6516_ipmc_addr_t; 962 963 extern int bcm_compat6516_ipmc_add( 964 int unit, 965 bcm_compat6516_ipmc_addr_t *data); 966 967 extern int bcm_compat6516_ipmc_find( 968 int unit, 969 bcm_compat6516_ipmc_addr_t *data); 970 971 extern int bcm_compat6516_ipmc_remove( 972 int unit, 973 bcm_compat6516_ipmc_addr_t *data); 974 975 extern int bcm_compat6516_ipmc_stat_attach( 976 int unit, 977 bcm_compat6516_ipmc_addr_t *info, 978 uint32 stat_counter_id); 979 980 extern int bcm_compat6516_ipmc_stat_detach( 981 int unit, 982 bcm_compat6516_ipmc_addr_t *info); 983 984 extern int bcm_compat6516_ipmc_stat_counter_get( 985 int unit, 986 bcm_compat6516_ipmc_addr_t *info, 987 bcm_ipmc_stat_t stat, 988 uint32 num_entries, 989 uint32 *counter_indexes, 990 bcm_stat_value_t *counter_values); 991 992 extern int bcm_compat6516_ipmc_stat_counter_sync_get( 993 int unit, 994 bcm_compat6516_ipmc_addr_t *info, 995 bcm_ipmc_stat_t stat, 996 uint32 num_entries, 997 uint32 *counter_indexes, 998 bcm_stat_value_t *counter_values); 999 1000 extern int bcm_compat6516_ipmc_stat_counter_set( 1001 int unit, 1002 bcm_compat6516_ipmc_addr_t *info, 1003 bcm_ipmc_stat_t stat, 1004 uint32 num_entries, 1005 uint32 *counter_indexes, 1006 bcm_stat_value_t *counter_values); 1007 1008 extern int bcm_compat6516_ipmc_stat_multi_get( 1009 int unit, 1010 bcm_compat6516_ipmc_addr_t *info, 1011 int nstat, 1012 bcm_ipmc_stat_t *stat_arr, 1013 uint64 *value_arr); 1014 1015 extern int bcm_compat6516_ipmc_stat_multi_get32( 1016 int unit, 1017 bcm_compat6516_ipmc_addr_t *info, 1018 int nstat, 1019 bcm_ipmc_stat_t *stat_arr, 1020 uint32 *value_arr); 1021 1022 extern int bcm_compat6516_ipmc_stat_multi_set( 1023 int unit, 1024 bcm_compat6516_ipmc_addr_t *info, 1025 int nstat, 1026 bcm_ipmc_stat_t *stat_arr, 1027 uint64 *value_arr); 1028 1029 extern int bcm_compat6516_ipmc_stat_multi_set32( 1030 int unit, 1031 bcm_compat6516_ipmc_addr_t *info, 1032 int nstat, 1033 bcm_ipmc_stat_t *stat_arr, 1034 uint32 *value_arr); 1035 1036 extern int bcm_compat6516_ipmc_stat_id_get( 1037 int unit, 1038 bcm_compat6516_ipmc_addr_t *info, 1039 bcm_ipmc_stat_t stat, 1040 uint32 *stat_counter_id); 1041 1042 #endif /* INCLUDE_L3 */ 1043 1044 /* Initialize a VLAN tag action set structure. */ 1045 typedef struct bcm_compat6516_vlan_action_set_s { 1046 bcm_vlan_t new_outer_vlan; /* New outer VLAN for Add/Replace 1047 actions. */ 1048 bcm_vlan_t new_inner_vlan; /* New inner VLAN for Add/Replace 1049 actions. */ 1050 uint8 new_inner_pkt_prio; /* New inner packet priority for 1051 Add/Replace actions. */ 1052 uint8 new_outer_cfi; /* New outer packet CFI for Add/Replace 1053 actions. */ 1054 uint8 new_inner_cfi; /* New inner packet CFI for Add/Replace 1055 actions. */ 1056 bcm_if_t ingress_if; /* L3 Ingress Interface. */ 1057 int priority; /* Internal or packet priority. */ 1058 bcm_vlan_action_t dt_outer; /* Outer-tag action for double-tagged 1059 packets. */ 1060 bcm_vlan_action_t dt_outer_prio; /* Outer-priority-tag action for 1061 double-tagged packets. */ 1062 bcm_vlan_action_t dt_outer_pkt_prio; /* Outer packet priority action for 1063 double-tagged packets. */ 1064 bcm_vlan_action_t dt_outer_cfi; /* Outer packet CFI action for 1065 double-tagged packets. */ 1066 bcm_vlan_action_t dt_inner; /* Inner-tag action for double-tagged 1067 packets. */ 1068 bcm_vlan_action_t dt_inner_prio; /* Inner-priority-tag action for 1069 double-tagged packets. */ 1070 bcm_vlan_action_t dt_inner_pkt_prio; /* Inner packet priority action for 1071 double-tagged packets. */ 1072 bcm_vlan_action_t dt_inner_cfi; /* Inner packet CFI action for 1073 double-tagged packets. */ 1074 bcm_vlan_action_t ot_outer; /* Outer-tag action for 1075 single-outer-tagged packets. */ 1076 bcm_vlan_action_t ot_outer_prio; /* Outer-priority-tag action for 1077 single-outer-tagged packets. */ 1078 bcm_vlan_action_t ot_outer_pkt_prio; /* Outer packet priority action for 1079 single-outer-tagged packets. */ 1080 bcm_vlan_action_t ot_outer_cfi; /* Outer packet CFI action for 1081 single-outer-tagged packets. */ 1082 bcm_vlan_action_t ot_inner; /* Inner-tag action for 1083 single-outer-tagged packets. */ 1084 bcm_vlan_action_t ot_inner_pkt_prio; /* Inner packet priority action for 1085 single-outer-tagged packets. */ 1086 bcm_vlan_action_t ot_inner_cfi; /* Inner packet CFI action for 1087 single-outer-tagged packets. */ 1088 bcm_vlan_action_t it_outer; /* Outer-tag action for 1089 single-inner-tagged packets. */ 1090 bcm_vlan_action_t it_outer_pkt_prio; /* Outer packet priority action for 1091 single-inner-tagged packets. */ 1092 bcm_vlan_action_t it_outer_cfi; /* Outer packet CFI action for 1093 single-inner-tagged packets. */ 1094 bcm_vlan_action_t it_inner; /* Inner-tag action for 1095 single-inner-tagged packets. */ 1096 bcm_vlan_action_t it_inner_prio; /* Inner-priority-tag action for 1097 single-inner-tagged packets. */ 1098 bcm_vlan_action_t it_inner_pkt_prio; /* Inner packet priority action for 1099 single-inner-tagged packets. */ 1100 bcm_vlan_action_t it_inner_cfi; /* Inner packet CFI action for 1101 single-inner-tagged packets. */ 1102 bcm_vlan_action_t ut_outer; /* Outer-tag action for untagged 1103 packets. */ 1104 bcm_vlan_action_t ut_outer_pkt_prio; /* Outer packet priority action for 1105 untagged packets. */ 1106 bcm_vlan_action_t ut_outer_cfi; /* Outer packet CFI action for untagged 1107 packets. */ 1108 bcm_vlan_action_t ut_inner; /* Inner-tag action for untagged 1109 packets. */ 1110 bcm_vlan_action_t ut_inner_pkt_prio; /* Inner packet priority action for 1111 untagged packets. */ 1112 bcm_vlan_action_t ut_inner_cfi; /* Inner packet CFI action for untagged 1113 packets. */ 1114 bcm_vlan_pcp_action_t outer_pcp; /* Outer tag's pcp field action of 1115 outgoing packets. */ 1116 bcm_vlan_pcp_action_t inner_pcp; /* Inner tag's pcp field action of 1117 outgoing packets. */ 1118 bcm_policer_t policer_id; /* Base policer to be used */ 1119 uint16 outer_tpid; /* New outer-tag's tpid field for modify 1120 action */ 1121 uint16 inner_tpid; /* New inner-tag's tpid field for modify 1122 action */ 1123 bcm_vlan_tpid_action_t outer_tpid_action; /* Action of outer-tag's tpid field */ 1124 bcm_vlan_tpid_action_t inner_tpid_action; /* Action of inner-tag's tpid field */ 1125 int action_id; /* Action Set index */ 1126 uint32 class_id; /* Class ID */ 1127 bcm_tsn_pri_map_t taf_gate_primap; /* TAF (Time Aware Filtering) gate 1128 priority mapping */ 1129 uint32 flags; /* BCM_VLAN_ACTION_SET_xxx. */ 1130 } bcm_compat6516_vlan_action_set_t; 1131 1132 /* This structure contains the configuration of a VLAN. */ 1133 typedef struct bcm_compat6516_vlan_control_vlan_s { 1134 bcm_vrf_t vrf; 1135 bcm_vlan_t forwarding_vlan; /* Shared VLAN ID. */ 1136 bcm_if_t ingress_if; /* Mapped Ingress interface. */ 1137 uint16 outer_tpid; 1138 uint32 flags; 1139 bcm_vlan_mcast_flood_t ip6_mcast_flood_mode; 1140 bcm_vlan_mcast_flood_t ip4_mcast_flood_mode; 1141 bcm_vlan_mcast_flood_t l2_mcast_flood_mode; 1142 int if_class; 1143 bcm_vlan_forward_t forwarding_mode; 1144 bcm_vlan_urpf_mode_t urpf_mode; 1145 bcm_cos_queue_t cosq; 1146 int qos_map_id; /* index to int_pri->queue offset 1147 mapping profile */ 1148 bcm_fabric_distribution_t distribution_class; /* Fabric Distribution Class. */ 1149 bcm_multicast_t broadcast_group; /* Group to handle broadcast frames */ 1150 bcm_multicast_t unknown_multicast_group; /* Group to handle unknown multicast 1151 frames */ 1152 bcm_multicast_t unknown_unicast_group; /* Group to handle unknown unicast 1153 frames */ 1154 bcm_multicast_t trill_nonunicast_group; /* Group to handle trill-domain 1155 nonunicast frames */ 1156 bcm_trill_name_t source_trill_name; /* Source RBridge nickname per VLAN */ 1157 int trunk_index; /* Trunk index for static PSC */ 1158 bcm_vlan_protocol_packet_ctrl_t protocol_pkt; /* Protocol packet control per VLAN */ 1159 int nat_realm_id; /* Realm id of interface that this vlan 1160 maps to */ 1161 int l3_if_class; /* L3IIF class id. */ 1162 bcm_vlan_vp_mc_ctrl_t vp_mc_ctrl; /* VP replication control, Auto, Enable, 1163 Disable */ 1164 int aging_cycles; /* number of aging meta-cycles */ 1165 int entropy_id; /* aging profile ID */ 1166 bcm_vpn_t vpn; /* vpn */ 1167 bcm_vlan_t egress_vlan; /* egress outer vlan */ 1168 uint32 learn_flags; /* Learn control flags for VLAN-based 1169 (BCM_VLAN_LEARN_CONTROL_XXX) */ 1170 uint32 sr_flags; /* Flags for Seamless Redundancy: 1171 BCM_VLAN_CONTROL_SR_FLAG_xxx */ 1172 uint32 flags2; /* BCM_VLAN_FLAGS2_XXX */ 1173 uint32 ingress_stat_id; /* Object statistics id ingress. */ 1174 int ingress_stat_pp_profile; /* Statistic profile ingress. */ 1175 uint32 egress_stat_id; /* Object statistics id egress. */ 1176 int egress_stat_pp_profile; /* Statistic profile egress. */ 1177 } bcm_compat6516_vlan_control_vlan_t; 1178 1179 /*Get or set the port's default VLAN tag actions. */ 1180 extern int bcm_compat6516_vlan_port_default_action_get( 1181 int unit, 1182 bcm_port_t port, 1183 bcm_compat6516_vlan_action_set_t *action); 1184 1185 /*Get or set the port's default VLAN tag actions. */ 1186 extern int bcm_compat6516_vlan_port_default_action_set( 1187 int unit, 1188 bcm_port_t port, 1189 bcm_compat6516_vlan_action_set_t *action); 1190 1191 /*Get or set the egress default VLAN tag actions. */ 1192 extern int bcm_compat6516_vlan_port_egress_default_action_get( 1193 int unit, 1194 bcm_port_t port, 1195 bcm_compat6516_vlan_action_set_t *action); 1196 1197 /*Get or set the egress default VLAN tag actions. */ 1198 extern int bcm_compat6516_vlan_port_egress_default_action_set( 1199 int unit, 1200 bcm_port_t port, 1201 bcm_compat6516_vlan_action_set_t *action); 1202 1203 /* 1204 * Add protocol based VLAN with specified action. If the entry already 1205 * exists, update the action. 1206 */ 1207 extern int bcm_compat6516_vlan_port_protocol_action_add( 1208 int unit, 1209 bcm_port_t port, 1210 bcm_port_frametype_t frame, 1211 bcm_port_ethertype_t ether, 1212 bcm_compat6516_vlan_action_set_t *action); 1213 1214 /*Get protocol based VLAN action. */ 1215 extern int bcm_compat6516_vlan_port_protocol_action_get( 1216 int unit, 1217 bcm_port_t port, 1218 bcm_port_frametype_t frame, 1219 bcm_port_ethertype_t ether, 1220 bcm_compat6516_vlan_action_set_t *action); 1221 1222 /* 1223 * Add an association from MAC address to VLAN actions, which are 1224 * used for VLAN tag/s assignment to untagged packets. 1225 */ 1226 extern int bcm_compat6516_vlan_mac_action_add( 1227 int unit, 1228 bcm_mac_t mac, 1229 bcm_compat6516_vlan_action_set_t *action); 1230 1231 /* 1232 * Retrive an association from MAC address to VLAN actions, which 1233 * are used for VLAN tag assignment to untagged packets. 1234 */ 1235 extern int bcm_compat6516_vlan_mac_action_get( 1236 int unit, 1237 bcm_mac_t mac, 1238 bcm_compat6516_vlan_action_set_t *action); 1239 1240 /*Add an entry to the VLAN Translation table and assign VLAN actions. */ 1241 extern int bcm_compat6516_vlan_translate_action_add( 1242 int unit, 1243 bcm_gport_t port, 1244 bcm_vlan_translate_key_t key_type, 1245 bcm_vlan_t outer_vlan, 1246 bcm_vlan_t inner_vlan, 1247 bcm_compat6516_vlan_action_set_t *action); 1248 1249 /*Add an entry to the VLAN Translation table and assign VLAN actions. */ 1250 extern int bcm_compat6516_vlan_translate_action_create( 1251 int unit, 1252 bcm_gport_t port, 1253 bcm_vlan_translate_key_t key_type, 1254 bcm_vlan_t outer_vlan, 1255 bcm_vlan_t inner_vlan, 1256 bcm_compat6516_vlan_action_set_t *action); 1257 1258 /*Get an entry to the VLAN Translation table and assign VLAN actions. */ 1259 extern int bcm_compat6516_vlan_translate_action_get( 1260 int unit, 1261 bcm_gport_t port, 1262 bcm_vlan_translate_key_t key_type, 1263 bcm_vlan_t outer_vlan, 1264 bcm_vlan_t inner_vlan, 1265 bcm_compat6516_vlan_action_set_t *action); 1266 1267 /* 1268 * Add an entry to the egress VLAN Translation table and assign VLAN 1269 * actions. 1270 */ 1271 extern int bcm_compat6516_vlan_translate_egress_action_add( 1272 int unit, 1273 int port_class, 1274 bcm_vlan_t outer_vlan, 1275 bcm_vlan_t inner_vlan, 1276 bcm_compat6516_vlan_action_set_t *action); 1277 1278 /* 1279 * Get an entry to the egress VLAN Translation table and assign VLAN 1280 * actions. 1281 */ 1282 extern int bcm_compat6516_vlan_translate_egress_action_get( 1283 int unit, 1284 int port_class, 1285 bcm_vlan_t outer_vlan, 1286 bcm_vlan_t inner_vlan, 1287 bcm_compat6516_vlan_action_set_t *action); 1288 1289 /* 1290 * Add an entry based on gport and VLANs to the egress VLAN Translation 1291 * table and assign VLAN actions. 1292 */ 1293 extern int bcm_compat6516_vlan_translate_egress_gport_action_add( 1294 int unit, 1295 bcm_gport_t port, 1296 bcm_vlan_t outer_vlan, 1297 bcm_vlan_t inner_vlan, 1298 bcm_compat6516_vlan_action_set_t *action); 1299 1300 /* 1301 * Get VLAN actions for an entry based on gport and VLANS in the egress 1302 * VLAN Translation table. 1303 */ 1304 extern int bcm_compat6516_vlan_translate_egress_gport_action_get( 1305 int unit, 1306 bcm_gport_t port, 1307 bcm_vlan_t outer_vlan, 1308 bcm_vlan_t inner_vlan, 1309 bcm_compat6516_vlan_action_set_t *action); 1310 1311 1312 /*bcm_vlan_translate_action_range_add */ 1313 extern int bcm_compat6516_vlan_translate_action_range_add( 1314 int unit, 1315 bcm_gport_t port, 1316 bcm_vlan_t outer_vlan_low, 1317 bcm_vlan_t outer_vlan_high, 1318 bcm_vlan_t inner_vlan_low, 1319 bcm_vlan_t inner_vlan_high, 1320 bcm_compat6516_vlan_action_set_t *action); 1321 1322 /*bcm_vlan_translate_action_range_get */ 1323 extern int bcm_compat6516_vlan_translate_action_range_get( 1324 int unit, 1325 bcm_gport_t port, 1326 bcm_vlan_t outer_vlan_low, 1327 bcm_vlan_t outer_vlan_high, 1328 bcm_vlan_t inner_vlan_low, 1329 bcm_vlan_t inner_vlan_high, 1330 bcm_compat6516_vlan_action_set_t *action); 1331 1332 /*Set a VLAN translation ID instance with tag actions */ 1333 extern int bcm_compat6516_vlan_translate_action_id_set( 1334 int unit, 1335 uint32 flags, 1336 int action_id, 1337 bcm_compat6516_vlan_action_set_t *action); 1338 1339 /*Get tag actions from a VLAN translation ID instance */ 1340 extern int bcm_compat6516_vlan_translate_action_id_get( 1341 int unit, 1342 uint32 flags, 1343 int action_id, 1344 bcm_compat6516_vlan_action_set_t *action); 1345 1346 /* 1347 * Add an association from IP subnet to VLAN actions to use for assigning 1348 * VLAN tag actions to untagged packets. 1349 */ 1350 extern int bcm_compat6516_vlan_ip_action_add( 1351 int unit, 1352 bcm_vlan_ip_t *vlan_ip, 1353 bcm_compat6516_vlan_action_set_t *action); 1354 1355 /* 1356 * Get an association from IP subnet to VLAN actions to use for assigning 1357 * VLAN tag actions to untagged packets. 1358 */ 1359 extern int bcm_compat6516_vlan_ip_action_get( 1360 int unit, 1361 bcm_vlan_ip_t *vlan_ip, 1362 bcm_compat6516_vlan_action_set_t *action); 1363 1364 /*Set or retrieve current vlan properties selectively. */ 1365 extern int bcm_compat6516_vlan_control_vlan_selective_get( 1366 int unit, 1367 bcm_vlan_t vlan, 1368 uint32 valid_fields, 1369 bcm_compat6516_vlan_control_vlan_t *control); 1370 1371 /*Set or retrieve current vlan properties selectively. */ 1372 extern int bcm_compat6516_vlan_control_vlan_selective_set( 1373 int unit, 1374 bcm_vlan_t vlan, 1375 uint32 valid_fields, 1376 bcm_compat6516_vlan_control_vlan_t *control); 1377 1378 /*Set or retrieve current vlan properties. */ 1379 extern int bcm_compat6516_vlan_control_vlan_get( 1380 int unit, 1381 bcm_vlan_t vlan, 1382 bcm_compat6516_vlan_control_vlan_t *control); 1383 1384 /*Set or retrieve current vlan properties. */ 1385 extern int bcm_compat6516_vlan_control_vlan_set( 1386 int unit, 1387 bcm_vlan_t vlan, 1388 bcm_compat6516_vlan_control_vlan_t control); 1389 1390 /*Add action for match criteria for Vlan assignment. */ 1391 extern int bcm_compat6516_vlan_match_action_add( 1392 int unit, 1393 uint32 options, 1394 bcm_vlan_match_info_t *match_info, 1395 bcm_compat6516_vlan_action_set_t *action_set); 1396 1397 /*Get action for given match criteria. */ 1398 extern int bcm_compat6516_vlan_match_action_get( 1399 int unit, 1400 bcm_vlan_match_info_t *match_info, 1401 bcm_compat6516_vlan_action_set_t *action_set); 1402 1403 /*Get all actions and match criteria for given vlan match. */ 1404 extern int bcm_compat6516_vlan_match_action_multi_get( 1405 int unit, 1406 bcm_vlan_match_t match, 1407 int size, 1408 bcm_vlan_match_info_t *match_info_array, 1409 bcm_compat6516_vlan_action_set_t *action_set_array, 1410 int *count); 1411 1412 /*Add VLAN actions to a field entry. */ 1413 extern int bcm_compat6516_field_action_vlan_actions_add( 1414 int unit, 1415 bcm_field_entry_t entry, 1416 bcm_field_action_t action, 1417 bcm_compat6516_vlan_action_set_t *vlan_action_set); 1418 1419 /*Retrieve VLAN actions configured to a field entry. */ 1420 extern int bcm_compat6516_field_action_vlan_actions_get( 1421 int unit, 1422 bcm_field_entry_t entry, 1423 bcm_field_action_t action, 1424 bcm_compat6516_vlan_action_set_t *vlan_action_set); 1425 1426 /* VLAN/VSAN Translation Action Set. */ 1427 typedef struct bcm_compat6516_fcoe_vsan_action_set_t { 1428 uint32 flags; /* BCM_FCOE_VSAN_ACTION_* */ 1429 bcm_fcoe_vsan_id_t new_vsan; /* new VSAN ID to replace with */ 1430 uint8 new_vsan_pri; /* new VSAN priority to replace with */ 1431 bcm_fcoe_vsan_vft_t vft; /* remaining fields of VFT header */ 1432 bcm_if_t ingress_if; /* TBD */ 1433 bcm_fcoe_vsan_action_t dt_vsan; /* Vsan action when double tagged */ 1434 bcm_fcoe_vsan_action_t dt_vsan_pri; /* VSAN Priority action when double 1435 tagged */ 1436 bcm_fcoe_vsan_action_t it_vsan; /* Vsan action when single inner tagged */ 1437 bcm_fcoe_vsan_action_t it_vsan_pri; /* Vsan Priority action when single 1438 inner tagged */ 1439 bcm_fcoe_vsan_action_t ot_vsan; /* Vsan action when single outer tagged */ 1440 bcm_fcoe_vsan_action_t ot_vsan_pri; /* Vsan Priority action when single 1441 outer tagged */ 1442 bcm_fcoe_vsan_action_t ut_vsan; /* Vsan action when un-tagged */ 1443 bcm_fcoe_vsan_action_t ut_vsan_pri; /* Vsan Priority action when un-tagged */ 1444 bcm_compat6516_vlan_action_set_t vlan_action; /* VLAN actions */ 1445 } bcm_compat6516_fcoe_vsan_action_set_t; 1446 1447 /* Add VSAN translation action */ 1448 extern int bcm_compat6516_fcoe_vsan_translate_action_add( 1449 int unit, 1450 bcm_fcoe_vsan_translate_key_config_t *key, 1451 bcm_compat6516_fcoe_vsan_action_set_t *action); 1452 /* BCM Information structure. */ 1453 typedef struct bcm_compat6516_info_s { 1454 uint32 vendor; /* PCI values used usually. */ 1455 uint32 device; /* PCI values used usually. */ 1456 uint32 revision; /* PCI values used usually. */ 1457 uint32 capability; 1458 int num_pipes; /* Number of pipes in the device. */ 1459 } bcm_compat6516_info_t; 1460 1461 /* Get information about a BCM unit. */ 1462 extern int bcm_compat6516_info_get(int unit, bcm_compat6516_info_t *info); 1463 1464 /* Generic port match attribute structure */ 1465 typedef struct bcm_compat6516_port_match_info_s { 1466 bcm_port_match_t match; /* Match criteria */ 1467 bcm_gport_t port; /* Match port */ 1468 bcm_vlan_t match_vlan; /* Outer VLAN ID to match */ 1469 bcm_vlan_t match_vlan_max; /* Maximum VLAN ID in range to match */ 1470 bcm_vlan_t match_inner_vlan; /* Inner VLAN ID to match */ 1471 bcm_vlan_t match_inner_vlan_max; /* Maximum Inner VLAN ID in range to 1472 match */ 1473 bcm_vlan_t match_tunnel_vlan; /* B-domain VID */ 1474 bcm_mac_t match_tunnel_srcmac; /* B-domain source MAC address */ 1475 bcm_mpls_label_t match_label; /* MPLS label */ 1476 uint32 flags; /* BCM_PORT_MATCH_XXX flags */ 1477 bcm_tunnel_id_t match_pon_tunnel; /* PON Tunnel value to match. */ 1478 bcm_port_ethertype_t match_ethertype; /* Ethernet type value to match */ 1479 int match_pcp; /* Outer PCP ID to match */ 1480 bcm_compat6516_vlan_action_set_t *action; 1481 /* Match action */ 1482 uint16 extended_port_vid; /* Extender port VID */ 1483 bcm_vpn_t vpn; /* VPN ID */ 1484 uint16 niv_port_vif; /* NIV port VIF */ 1485 uint32 isid; 1486 bcm_mac_t src_mac; /* Source Mac Address */ 1487 uint32 port_class; /* Port Class Id */ 1488 }bcm_compat6516_port_match_info_t; 1489 1490 /* Add a match to an existing port */ 1491 extern int bcm_compat6516_port_match_add( 1492 int unit, 1493 bcm_gport_t port, 1494 bcm_compat6516_port_match_info_t *match); 1495 1496 /* Remove a match from an existing port */ 1497 extern int bcm_compat6516_port_match_delete( 1498 int unit, 1499 bcm_gport_t port, 1500 bcm_compat6516_port_match_info_t *match); 1501 1502 /* Replace an old match with a new one for an existing port */ 1503 extern int bcm_compat6516_port_match_replace( 1504 int unit, 1505 bcm_gport_t port, 1506 bcm_compat6516_port_match_info_t *old_match, 1507 bcm_compat6516_port_match_info_t *new_match); 1508 1509 /* Get all the matches for an existing port */ 1510 extern int bcm_compat6516_port_match_multi_get( 1511 int unit, 1512 bcm_gport_t port, 1513 int size, 1514 bcm_compat6516_port_match_info_t *match_array, 1515 int *count); 1516 1517 /* Assign a set of matches to an existing port */ 1518 extern int bcm_compat6516_port_match_set( 1519 int unit, 1520 bcm_gport_t port, 1521 int size, 1522 bcm_compat6516_port_match_info_t *match_array); 1523 1524 /* speed_ability supported by a port */ 1525 typedef struct bcm_compat6516_port_speed_ability_s { 1526 uint32 speed; /* port speed in mbps */ 1527 uint32 resolved_num_lanes; /* autoneg resolved speed num lane */ 1528 bcm_port_phy_fec_t fec_type; /* fec_type for port */ 1529 bcm_port_medium_t medium; /* medium type of a port */ 1530 bcm_port_phy_pause_t pause; /* pause */ 1531 bcm_port_phy_channel_t channel; /* short/long channel for a port */ 1532 bcm_port_autoneg_mode_t an_mode; /* autoneg mode */ 1533 } bcm_compat6516_port_speed_ability_t; 1534 1535 /*Set the local port advertisement for autonegotiation*/ 1536 extern int bcm_compat6516_port_autoneg_ability_advert_set(int unit, 1537 bcm_port_t port, 1538 int num_ability, 1539 bcm_compat6516_port_speed_ability_t *match_array); 1540 1541 /*Retrieve the advert port abilities*/ 1542 extern int bcm_compat6516_port_autoneg_ability_advert_get(int unit, 1543 bcm_port_t port, 1544 int max_num_ability, 1545 bcm_compat6516_port_speed_ability_t *match_array, 1546 int *actual_num_ability); 1547 1548 /*Retrieve the local port abilities*/ 1549 extern int bcm_compat6516_port_speed_ability_local_get(int unit, bcm_port_t port, 1550 int max_num_ability, bcm_compat6516_port_speed_ability_t *match_array, 1551 int *actual_num_ability); 1552 1553 /*Retrieve the remote port abilities*/ 1554 extern int bcm_compat6516_port_autoneg_ability_remote_get(int unit, bcm_port_t port, 1555 int max_num_ability, bcm_compat6516_port_speed_ability_t *match_array, 1556 int *actual_num_ability); 1557 1558 /*Port phy tx fir*/ 1559 typedef struct bcm_compat6516_port_phy_tx_s { 1560 int pre2; 1561 int pre; 1562 int main; 1563 int post; 1564 int post2; 1565 int post3; 1566 bcm_port_phy_tx_tap_mode_t tx_tap_mode; 1567 bcm_port_phy_signalling_mode_t signalling_mode; 1568 } bcm_compat6516_port_phy_tx_t; 1569 1570 /*Set port phy tx fir*/ 1571 extern int bcm_compat6516_port_phy_tx_set( 1572 int unit, 1573 bcm_port_t port, 1574 bcm_compat6516_port_phy_tx_t *match); 1575 1576 /*Get port phy tx fir*/ 1577 extern int bcm_compat6516_port_phy_tx_get( 1578 int unit, 1579 bcm_port_t port, 1580 bcm_compat6516_port_phy_tx_t *match); 1581 1582 1583 /* Rx cosq mapping. */ 1584 typedef struct bcm_compat6516_rx_cosq_mapping_s { 1585 uint32 flags; /* flags */ 1586 int index; /* Index into COSQ mapping table (0 is 1587 highest match priority) */ 1588 bcm_rx_reasons_t reasons; /* packet reasons bitmap */ 1589 bcm_rx_reasons_t reasons_mask; /* mask for packet reasons bitmap */ 1590 uint8 int_prio; /* internal priority value */ 1591 uint8 int_prio_mask; /* mask for internal priority value */ 1592 uint32 packet_type; /* packet type bitmap */ 1593 uint32 packet_type_mask; /* mask for packet type bitmap */ 1594 bcm_cos_queue_t cosq; /* cosq value */ 1595 } bcm_compat6516_rx_cosq_mapping_t; 1596 1597 /* Map packets to a CPU COS queue. */ 1598 extern int bcm_compat6516_rx_cosq_mapping_extended_set( 1599 int unit, 1600 uint32 options, 1601 bcm_compat6516_rx_cosq_mapping_t *rx_cosq_mapping); 1602 1603 /* Get packets to CPU COS queue mappings. */ 1604 extern int bcm_compat6516_rx_cosq_mapping_extended_get( 1605 int unit, 1606 bcm_compat6516_rx_cosq_mapping_t *rx_cosq_mapping); 1607 1608 /* 1609 * Group configuration structure. Used to create a field group with 1610 * specific attributes. 1611 */ 1612 typedef struct bcm_compat6516_field_group_config_s { 1613 uint32 flags; /* Group create flags 1614 BCM_FIELD_GROUP_CREATE_XXX. */ 1615 bcm_field_qset_t qset; /* Group qualifier set. */ 1616 int priority; /* Group priority. */ 1617 bcm_field_group_mode_t mode; /* Group mode. */ 1618 bcm_pbmp_t ports; /* Group member ports. */ 1619 bcm_field_group_t group; /* Group. */ 1620 bcm_field_aset_t aset; /* Group action set */ 1621 bcm_field_presel_set_t preselset; /* Group preselector set */ 1622 bcm_field_presel_set_t group_ref; /* Reference Field group for operation 1623 set by the Flag. */ 1624 int max_entry_priorities; /* Number of entries priorities in the 1625 group. 0 means unlimited. */ 1626 bcm_field_hintid_t hintid; /* Hints for Group Creation. */ 1627 int action_res_id; /* Action resolution id for Group. */ 1628 uint8 name[BCM_FIELD_MAX_NAME_LEN]; /* Name for Group. */ 1629 bcm_field_group_cycle_t cycle; /* Create Field Group Cycle. */ 1630 uint32 pgm_bmp; /* Bitmap of program-ids which the 1631 current field group will be pointing 1632 to. */ 1633 uint32 share_id; /* Group share ID. Groups created with 1634 same share ID may share TCAM banks. */ 1635 } bcm_compat6516_field_group_config_t; 1636 1637 /* Create a field group with specific attributes. */ 1638 extern int bcm_compat6516_field_group_config_create( 1639 int unit, 1640 bcm_compat6516_field_group_config_t *group_config); 1641 1642 /* To verify whether a group can be created with a given qset and mode */ 1643 extern int bcm_compat6516_field_group_config_validate( 1644 int unit, 1645 bcm_compat6516_field_group_config_t *group_config, 1646 bcm_field_group_mode_t *mode); 1647 1648 /* 1649 * Mirror destination Structure 1650 * 1651 * Contains information required for manipulating mirror destinations. 1652 */ 1653 typedef struct bcm_compat6516_mirror_destination_s { 1654 bcm_gport_t mirror_dest_id; /* Unique mirror destination and 1655 encapsulation identifier. */ 1656 uint32 flags; /* See BCM_MIRROR_DEST_xxx flag 1657 definitions. */ 1658 bcm_gport_t gport; /* Mirror destination. */ 1659 uint8 version; /* IP header version. */ 1660 uint8 tos; /* Traffic Class/Tos byte. */ 1661 uint8 ttl; /* Hop limit. */ 1662 bcm_ip_t src_addr; /* Tunnel source ip address (IPv4). */ 1663 bcm_ip_t dst_addr; /* Tunnel destination ip address (IPv4). */ 1664 bcm_ip6_t src6_addr; /* Tunnel source ip address (IPv6). */ 1665 bcm_ip6_t dst6_addr; /* Tunnel destination ip address (IPv6). */ 1666 uint32 flow_label; /* IPv6 header flow label field. */ 1667 bcm_mac_t src_mac; /* L2 source mac address. */ 1668 bcm_mac_t dst_mac; /* L2 destination mac address. */ 1669 uint16 tpid; /* L2 header outer TPID. */ 1670 bcm_vlan_t vlan_id; /* Vlan id. */ 1671 bcm_trill_name_t trill_src_name; /* TRILL source bridge nickname */ 1672 bcm_trill_name_t trill_dst_name; /* TRILL destination bridge nickname */ 1673 int trill_hopcount; /* TRILL hop count */ 1674 uint16 niv_src_vif; /* Source Virtual Interface of NIV tag */ 1675 uint16 niv_dst_vif; /* Destination Virtual Interface of NIV 1676 tag */ 1677 uint32 niv_flags; /* NIV flags BCM_MIRROR_NIV_XXX */ 1678 uint16 gre_protocol; /* L3 GRE header protocol */ 1679 bcm_policer_t policer_id; /* policer_id */ 1680 int stat_id; /* stat_id */ 1681 int stat_id2; /* stat_id2 for second counter pointer */ 1682 bcm_if_t encap_id; /* Encapsulation index */ 1683 bcm_if_t tunnel_id; /* IP tunnel for encapsulation. Valid 1684 only if BCM_MIRROR_DEST_TUNNEL_IP_GRE 1685 is set */ 1686 uint16 span_id; /* SPAN-ID. Valid only if 1687 BCM_MIRROR_DEST_TUNNEL_WITH_SPAN_ID 1688 is set */ 1689 uint8 pkt_prio; /* L2 header PCP */ 1690 uint32 sample_rate_dividend; /* The probability of mirroring a packet 1691 is: sample_rate_dividend >= 1692 sample_rate_divisor ? 1 : 1693 sample_rate_dividend / 1694 sample_rate_divisor */ 1695 uint32 sample_rate_divisor; 1696 uint8 int_pri; /* Internal Priority */ 1697 uint16 etag_src_vid; /* Extended (source) port vlan id */ 1698 uint16 etag_dst_vid; /* Extended (destination) port vlan id */ 1699 uint16 udp_src_port; /* UDP source port */ 1700 uint16 udp_dst_port; /* UDP destination port */ 1701 uint32 egress_sample_rate_dividend; /* The probability of outbound mirroring 1702 a packet from the destination is 1703 sample_rate_dividend >= 1704 sample_rate_divisor ? 1 : 1705 sample_rate_dividend / 1706 sample_rate_divisor */ 1707 uint32 egress_sample_rate_divisor; 1708 uint8 recycle_context; /* recycle context of egress originating 1709 packets */ 1710 uint16 packet_copy_size; /* If non zero, the copied packet will 1711 be truncated to the first 1712 packet_copy_size . Current supported 1713 values for DNX are 0, 64, 128, 192 */ 1714 uint16 egress_packet_copy_size; /* If non zero and the packet is copied 1715 from the egress, the packet will be 1716 truncated to the first 1717 packet_copy_size . Current supported 1718 values for DNX are 0, 256. */ 1719 bcm_mirror_pkt_header_updates_t packet_control_updates; 1720 bcm_mirror_psc_t rtag; /* specify RTAG HASH algorithm used for 1721 shared-id mirror destination */ 1722 uint8 df; /* Set the do not fragment bit of IP 1723 header in mirror encapsulation */ 1724 uint8 truncate; /* Setting truncate would result in 1725 mirroring a truncated frame */ 1726 uint16 template_id; /* Template ID for IPFIX HDR */ 1727 uint32 observation_domain; /* Observation domain for IPFIX HDR */ 1728 uint32 is_recycle_strict_priority; /* Recycle priority (1-lossless, 0-high) */ 1729 int ext_stat_id[BCM_MIRROR_EXT_STAT_ID_COUNT]; /* ext_stat_id to support statistic 1730 interface for mirror packets. */ 1731 uint32 flags2; /* See BCM_MIRROR_DEST_FLAGS2_xxx flag 1732 definitions. */ 1733 uint32 vni; /* Virtual Network Interface ID. */ 1734 uint32 gre_seq_number; /* Sequence number value used in GRE 1735 header. If no value is provided, 1736 gre_seq_number will start with 0. 1737 Valid only if 1738 BCM_MIRROR_DEST_TUNNEL_IP_GRE is set. */ 1739 bcm_mirror_pkt_erspan_encap_t erspan_header; /* ERSPAN encapsulation header fields. 1740 Valid only if only 1741 BCM_MIRROR_DEST_TUNNEL_IP_GRE is set. */ 1742 uint32 initial_seq_number; /* Starting seq number in SFLOW or PSAMP 1743 header */ 1744 bcm_mirror_psamp_fmt2_meta_data_t meta_data_type; /* Type of item in 'meta_data' */ 1745 uint16 meta_data; /* Actual value of class id or meta 1746 data, based on 'meta_data_type' */ 1747 int ext_stat_valid; /* Validates the ext_stat. */ 1748 int ext_stat_type_id[BCM_MIRROR_EXT_STAT_ID_COUNT]; /* Type ids for statistic interface. */ 1749 } bcm_compat6516_mirror_destination_t; 1750 1751 /* Create a mirror (destination, encapsulation) pair. */ 1752 extern int bcm_compat6516_mirror_destination_create( 1753 int unit, 1754 bcm_compat6516_mirror_destination_t *mirror_dest); 1755 1756 /* Get mirror (destination, encapsulation) pair. */ 1757 extern int bcm_compat6516_mirror_destination_get( 1758 int unit, 1759 bcm_gport_t mirror_dest_id, 1760 bcm_compat6516_mirror_destination_t *mirror_dest); 1761 1762 /* QoS Map structure */ 1763 typedef struct bcm_compat6516_qos_map_s { 1764 uint8 pkt_pri; /* Packet priority */ 1765 uint8 pkt_cfi; /* Packet CFI */ 1766 int dscp; /* Packet DSCP */ 1767 int exp; /* Packet EXP */ 1768 int int_pri; /* Internal priority */ 1769 bcm_color_t color; /* Color */ 1770 int remark_int_pri; /* (internal) remarking priority */ 1771 bcm_color_t remark_color; /* (internal) remark color */ 1772 int policer_offset; /* Offset based on pri/cos to fetch a policer */ 1773 int queue_offset; /* Offset based on int_pri to fetch cosq for 1774 subscriber ports */ 1775 int port_offset; /* Offset based on port connection for indexing 1776 into the action table */ 1777 uint8 etag_pcp; /* ETAG PCP field */ 1778 uint8 etag_de; /* ETAG DE field */ 1779 int counter_offset; /* Offset based on priority for indexing into 1780 the loss measurement counter table */ 1781 int inherited_dscp_exp; /* Inherited DSCP EXP value */ 1782 uint32 opcode; /* Set QOS Map Opcode ID */ 1783 } bcm_compat6516_qos_map_t; 1784 1785 /* bcm_qos_map_add */ 1786 extern int bcm_compat6516_qos_map_add( 1787 int unit, 1788 uint32 flags, 1789 bcm_compat6516_qos_map_t *map, 1790 int map_id); 1791 1792 /* bcm_qos_map_multi_get */ 1793 extern int bcm_compat6516_qos_map_multi_get( 1794 int unit, 1795 uint32 flags, 1796 int map_id, 1797 int array_size, 1798 bcm_compat6516_qos_map_t *array, 1799 int *array_count); 1800 1801 /* bcm_qos_map_delete */ 1802 extern int bcm_compat6516_qos_map_delete( 1803 int unit, 1804 uint32 flags, 1805 bcm_compat6516_qos_map_t *map, 1806 int map_id); 1807 1808 /* L3 NAT egress info. */ 1809 typedef struct bcm_compat6516_l3_nat_egress_s { 1810 uint32 flags; /* See BCM_L3_NAT_EGRESS_XXX flag definitions. */ 1811 bcm_l3_nat_id_t nat_id; /* Index into packet edit table. */ 1812 bcm_ip_t sip_addr; /* Translated source IP. */ 1813 bcm_ip_t sip_addr_mask; /* Bits of source IP prefix to translate. */ 1814 uint16 src_port; /* Source l4 port for NAPT */ 1815 bcm_ip_t dip_addr; /* Translated dest IP. */ 1816 bcm_ip_t dip_addr_mask; /* Bits of dest IP prefix to translate. */ 1817 uint16 dst_port; /* Destination l4 port for NAPT */ 1818 } bcm_compat6516_l3_nat_egress_t; 1819 1820 /* Add an L3 NAT egress entry. */ 1821 extern int bcm_compat6516_l3_nat_egress_add( 1822 int unit, 1823 bcm_compat6516_l3_nat_egress_t *nat_info); 1824 1825 /* Get an L3 NAT egress entry. */ 1826 extern int bcm_compat6516_l3_nat_egress_get( 1827 int unit, 1828 bcm_compat6516_l3_nat_egress_t *nat_info); 1829 1830 /* L3 NAT ingress info. */ 1831 typedef struct bcm_compat6516_l3_nat_ingress_s { 1832 uint32 flags; /* See BCM_L3_NAT_INGRESS_XXX flag definitions. */ 1833 bcm_ip_t ip_addr; /* IP address to be translated. */ 1834 bcm_vrf_t vrf; /* Virtual router instance. */ 1835 uint16 l4_port; /* TCP/UDP port. */ 1836 uint8 ip_proto; /* IP proto. */ 1837 bcm_l3_nat_id_t nat_id; /* nat edit index to use on egress on hit. */ 1838 bcm_cos_t pri; /* New priority in packet. */ 1839 int class_id; /* Classification lookup class id. */ 1840 bcm_if_t nexthop; /* Nexthop of ecmp_ptr depending on MULTIPATH flag 1841 setting. */ 1842 } bcm_compat6516_l3_nat_ingress_t; 1843 1844 /* Add an ingress NAT table entry. */ 1845 extern int bcm_compat6516_l3_nat_ingress_add( 1846 int unit, 1847 bcm_compat6516_l3_nat_ingress_t *nat_info); 1848 1849 /* Delete an ingress NAT table entry. */ 1850 extern int bcm_compat6516_l3_nat_ingress_delete( 1851 int unit, 1852 bcm_compat6516_l3_nat_ingress_t *nat_info); 1853 1854 /* Find an ingress NAT table entry. */ 1855 extern int bcm_compat6516_l3_nat_ingress_find( 1856 int unit, 1857 bcm_compat6516_l3_nat_ingress_t *nat_info); 1858 1859 /* Delete all the ingress NAT table entries specified by flags. */ 1860 extern int bcm_compat6516_l3_nat_ingress_delete_all( 1861 int unit, 1862 bcm_compat6516_l3_nat_ingress_t *nat_info); 1863 1864 #if defined(INCLUDE_L3) 1865 typedef struct bcm_compat6516_mim_vpn_config_s { 1866 uint32 flags; /* Configuration flags */ 1867 bcm_mim_vpn_t vpn; /* VPN ID. */ 1868 int lookup_id; /* The I-SID value */ 1869 uint16 match_service_tpid; /* Incoming SD tag TPID */ 1870 bcm_multicast_t broadcast_group; /* Broadcast group */ 1871 bcm_multicast_t unknown_unicast_group; /* Unknown unicast group */ 1872 bcm_multicast_t unknown_multicast_group; /* Unknown multicast group */ 1873 bcm_policer_t policer_id; /* Policer ID to be used */ 1874 bcm_if_t service_encap_id; /* Service encap Identifier */ 1875 uint8 int_pri; /* Fixed internal priority */ 1876 int qos_map_id; /* Mapped priority */ 1877 bcm_vlan_t tunnel_vlan; /* B-domain VID */ 1878 int inlif_counting_profile; /* In LIF counting profile */ 1879 int outlif_counting_profile; /* Out LIF counting profile */ 1880 bcm_vlan_protocol_packet_ctrl_t protocol_pkt; /* Protocol packet control */ 1881 uint16 egress_service_tpid; /* egress SD tag TPID */ 1882 bcm_mac_t match_service_smac; /* Source B-MAC address */ 1883 } bcm_compat6516_mim_vpn_config_t; 1884 1885 extern int bcm_compat6516_mim_vpn_create(int unit, 1886 bcm_compat6516_mim_vpn_config_t *info); 1887 extern int bcm_compat6516_mim_vpn_get(int unit, bcm_vpn_t l2vpn, 1888 bcm_compat6516_mim_vpn_config_t *info); 1889 1890 #endif /* end if defined(INCLUDE_L3) */ 1891 1892 #if defined(INCLUDE_L3) 1893 typedef struct bcm_compat6516_vxlan_port_s { 1894 bcm_gport_t vxlan_port_id; /* GPORT identifier. */ 1895 uint32 flags; /* BCM_VXLAN_PORT_xxx. */ 1896 uint32 if_class; /* Interface class ID. */ 1897 uint16 int_pri; /* Internal Priority */ 1898 uint8 pkt_pri; /* Packet Priority */ 1899 uint8 pkt_cfi; /* Packet CFI */ 1900 uint16 egress_service_tpid; /* Service Vlan TPID Value */ 1901 bcm_vlan_t egress_service_vlan; /* SD-TAG Vlan ID. */ 1902 uint16 mtu; /* MTU */ 1903 bcm_gport_t match_port; /* Match port / trunk */ 1904 bcm_vxlan_port_match_t criteria; /* Match criteria */ 1905 bcm_vlan_t match_vlan; /* Outer VLAN ID to match. */ 1906 bcm_vlan_t match_inner_vlan; /* Inner VLAN ID to match. */ 1907 bcm_gport_t egress_tunnel_id; /* Tunnel Initiator ID */ 1908 bcm_gport_t match_tunnel_id; /* Tunnel Terminator ID */ 1909 bcm_if_t egress_if; /* VXLAN egress object. */ 1910 bcm_switch_network_group_t network_group_id; /* Split Horizon network group 1911 identifier. */ 1912 uint32 vnid; /* VXLAN packet VNID. */ 1913 int qos_map_id; /* QoS Mapped priority */ 1914 uint8 tunnel_pkt_pri; /* Tunnel Packet Priority */ 1915 uint8 tunnel_pkt_cfi; /* Tunnel Packet CFI */ 1916 } bcm_compat6516_vxlan_port_t; 1917 1918 extern int bcm_compat6516_vxlan_port_add(int unit, bcm_vpn_t l2vpn, 1919 bcm_compat6516_vxlan_port_t *vxlan_port); 1920 extern int bcm_compat6516_vxlan_port_get(int unit, bcm_vpn_t l2vpn, 1921 bcm_compat6516_vxlan_port_t *vxlan_port); 1922 extern int bcm_compat6516_vxlan_port_get_all(int unit, bcm_vpn_t l2vpn, 1923 int port_max, 1924 bcm_compat6516_vxlan_port_t *port_array, 1925 int *port_count); 1926 1927 #endif /* end if defined(INCLUDE_L3) */ 1928 1929 typedef struct bcm_compat6516_l2_ring_s { 1930 uint32 flags; /* flags */ 1931 bcm_vlan_vector_t vlan_vector; /* List of Vlans. */ 1932 bcm_gport_t port0; /* VLAN gport */ 1933 bcm_gport_t port1; /* VLAN gport */ 1934 bcm_vpn_vector_t vpn_vector; /* List of VPN IDs. */ 1935 } bcm_compat6516_l2_ring_t; 1936 1937 extern int bcm_compat6516_l2_ring_replace(int unit, 1938 bcm_compat6516_l2_ring_t *l2_ring); 1939 1940 #endif /* BCM_RPC_SUPPORT */ 1941 #endif /* !_COMPAT_6516_H */