compat_6514.h (22345B)
1 /* 2 * $Id: compat_6514.h,v 2.0 2018/04/09 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.14 routines 8 */ 9 10 #ifndef _COMPAT_6514_H_ 11 #define _COMPAT_6514_H_ 12 13 #ifdef BCM_RPC_SUPPORT 14 #include <bcm_int/compat/compat_6518.h> 15 #include <bcm/types.h> 16 #include <bcm/field.h> 17 #include <bcm/cosq.h> 18 #include <bcm/mpls.h> 19 #include <bcm/l3.h> 20 #include <bcm/ipmc.h> 21 #include <bcm_int/compat/compat_6516.h> 22 23 /* Device-independent L2 address structure. */ 24 typedef struct bcm_compat6514_l2_addr_s { 25 uint32 flags; /* BCM_L2_xxx flags. */ 26 uint32 flags2; /* BCM_L2_FLAGS2_xxx flags. */ 27 uint32 station_flags; /* BCM_L2_STATION_xxx flags. */ 28 bcm_mac_t mac; /* 802.3 MAC address. */ 29 bcm_vlan_t vid; /* VLAN identifier. */ 30 int port; /* Zero-based port number. */ 31 int modid; /* XGS: modid. */ 32 bcm_trunk_t tgid; /* Trunk group ID. */ 33 bcm_cos_t cos_dst; /* COS based on dst addr. */ 34 bcm_cos_t cos_src; /* COS based on src addr. */ 35 bcm_multicast_t l2mc_group; /* XGS: index in L2MC table. */ 36 bcm_if_t egress_if; /* XGS: index in Next Hop Tables. Used 37 it with BCM_L2_FLAGS2_ROE_NHI flag */ 38 bcm_multicast_t l3mc_group; /* XGS: index in L3_IPMC table. Use it 39 with BCM_L2_FLAGS2_L3_MULTICAST. */ 40 bcm_pbmp_t block_bitmap; /* XGS: blocked egress bitmap. */ 41 int auth; /* Used if auth enabled on port. */ 42 int group; /* Group number for FP. */ 43 bcm_fabric_distribution_t distribution_class; /* Fabric Distribution Class. */ 44 int encap_id; /* out logical interface */ 45 int age_state; /* Age state of the entry */ 46 uint32 flow_handle; /* FLOW handle for flex entries. */ 47 uint32 flow_option_handle; /* FLOW option handle for flex entries. */ 48 bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex 49 entries. */ 50 uint32 num_of_fields; /* number of logical fields. */ 51 bcm_pbmp_t sa_source_filter_pbmp; /* Source port filter bitmap for this SA */ 52 bcm_tsn_flowset_t tsn_flowset; /* Time-Sensitive Networking: associated 53 flow set */ 54 bcm_tsn_sr_flowset_t sr_flowset; /* Seamless Redundancy: associated flow 55 set */ 56 bcm_policer_t policer_id; /* Base policer to be used */ 57 bcm_tsn_pri_map_t taf_gate_primap; /* TAF (Time Aware Filtering) gate 58 priority mapping */ 59 } bcm_compat6514_l2_addr_t; 60 61 extern int bcm_compat6514_l2_addr_add(int unit, 62 bcm_compat6514_l2_addr_t *l2addr); 63 64 extern int bcm_compat6514_l2_addr_multi_add(int unit, 65 bcm_compat6514_l2_addr_t *l2addr, int count); 66 67 extern int bcm_compat6514_l2_addr_multi_delete(int unit, 68 bcm_compat6514_l2_addr_t *l2addr, int count); 69 70 extern int bcm_compat6514_l2_addr_get(int unit, bcm_mac_t mac_addr, bcm_vlan_t vid, 71 bcm_compat6514_l2_addr_t *l2addr); 72 73 extern int bcm_compat6514_l2_conflict_get(int unit, bcm_compat6514_l2_addr_t *addr, 74 bcm_compat6514_l2_addr_t *cf_array, int cf_max, 75 int *cf_count); 76 77 extern int bcm_compat6514_l2_replace(int unit, uint32 flags, 78 bcm_compat6514_l2_addr_t *match_addr, 79 bcm_module_t new_module, 80 bcm_port_t new_port, bcm_trunk_t new_trunk); 81 82 extern int bcm_compat6514_l2_replace_match(int unit, uint32 flags, 83 bcm_compat6514_l2_addr_t *match_addr, 84 bcm_compat6514_l2_addr_t *mask_addr, 85 bcm_compat6514_l2_addr_t *replace_addr, 86 bcm_compat6514_l2_addr_t *replace_mask_addr); 87 88 extern int bcm_compat6514_l2_stat_get(int unit, 89 bcm_compat6514_l2_addr_t *l2addr, 90 bcm_l2_stat_t stat, uint64 *val); 91 92 extern int bcm_compat6514_l2_stat_get32(int unit, 93 bcm_compat6514_l2_addr_t *l2addr, 94 bcm_l2_stat_t stat, uint32 *val); 95 96 extern int bcm_compat6514_l2_stat_set(int unit, 97 bcm_compat6514_l2_addr_t *l2addr, 98 bcm_l2_stat_t stat, uint64 val); 99 100 extern int bcm_compat6514_l2_stat_set32(int unit, 101 bcm_compat6514_l2_addr_t *l2addr, 102 bcm_l2_stat_t stat, uint32 val); 103 104 extern int bcm_compat6514_l2_stat_enable_set(int unit, 105 bcm_compat6514_l2_addr_t *l2addr, 106 int enable); 107 /* This structure contains the configuration of a VLAN. */ 108 typedef struct bcm_compat6514_vlan_control_vlan_s { 109 bcm_vrf_t vrf; 110 bcm_vlan_t forwarding_vlan; /* Shared VLAN ID. */ 111 bcm_if_t ingress_if; /* Mapped Ingress interface. */ 112 uint16 outer_tpid; 113 uint32 flags; 114 bcm_vlan_mcast_flood_t ip6_mcast_flood_mode; 115 bcm_vlan_mcast_flood_t ip4_mcast_flood_mode; 116 bcm_vlan_mcast_flood_t l2_mcast_flood_mode; 117 int if_class; 118 bcm_vlan_forward_t forwarding_mode; 119 bcm_vlan_urpf_mode_t urpf_mode; 120 bcm_cos_queue_t cosq; 121 int qos_map_id; /* index to int_pri->queue offset 122 mapping profile */ 123 bcm_fabric_distribution_t distribution_class; /* Fabric Distribution Class. */ 124 bcm_multicast_t broadcast_group; /* Group to handle broadcast frames */ 125 bcm_multicast_t unknown_multicast_group; /* Group to handle unknown multicast 126 frames */ 127 bcm_multicast_t unknown_unicast_group; /* Group to handle unknown unicast 128 frames */ 129 bcm_multicast_t trill_nonunicast_group; /* Group to handle trill-domain 130 nonunicast frames */ 131 bcm_trill_name_t source_trill_name; /* Source RBridge nickname per VLAN */ 132 int trunk_index; /* Trunk index for static PSC */ 133 bcm_vlan_protocol_packet_ctrl_t protocol_pkt; /* Protocol packet control per VLAN */ 134 int nat_realm_id; /* Realm id of interface that this vlan 135 maps to */ 136 int l3_if_class; /* L3IIF class id. */ 137 bcm_vlan_vp_mc_ctrl_t vp_mc_ctrl; /* VP replication control, Auto, Enable, 138 Disable */ 139 int aging_cycles; /* number of aging meta-cycles */ 140 int entropy_id; /* aging profile ID */ 141 bcm_vpn_t vpn; /* vpn */ 142 bcm_vlan_t egress_vlan; /* egress outer vlan */ 143 uint32 learn_flags; /* Learn control flags for VLAN-based 144 (BCM_VLAN_LEARN_CONTROL_XXX) */ 145 uint32 sr_flags; /* Flags for Seamless Redundancy: 146 BCM_VLAN_CONTROL_SR_FLAG_xxx */ 147 uint32 flags2; /* BCM_VLAN_FLAGS2_XXX */ 148 } bcm_compat6514_vlan_control_vlan_t; 149 150 /*Set or retrieve current vlan properties selectively. */ 151 extern int bcm_compat6514_vlan_control_vlan_selective_get( 152 int unit, 153 bcm_vlan_t vlan, 154 uint32 valid_fields, 155 bcm_compat6514_vlan_control_vlan_t *control); 156 157 /*Set or retrieve current vlan properties selectively. */ 158 extern int bcm_compat6514_vlan_control_vlan_selective_set( 159 int unit, 160 bcm_vlan_t vlan, 161 uint32 valid_fields, 162 bcm_compat6514_vlan_control_vlan_t *control); 163 164 /*Set or retrieve current vlan properties. */ 165 extern int bcm_compat6514_vlan_control_vlan_get( 166 int unit, 167 bcm_vlan_t vlan, 168 bcm_compat6514_vlan_control_vlan_t *control); 169 170 /*Set or retrieve current vlan properties. */ 171 extern int bcm_compat6514_vlan_control_vlan_set( 172 int unit, 173 bcm_vlan_t vlan, 174 bcm_compat6514_vlan_control_vlan_t control); 175 176 /* Generic port match attribute structure */ 177 typedef struct bcm_compat6514_port_match_info_s { 178 bcm_port_match_t match; /* Match criteria */ 179 bcm_gport_t port; /* Match port */ 180 bcm_vlan_t match_vlan; /* Outer VLAN ID to match */ 181 bcm_vlan_t match_vlan_max; /* Maximum VLAN ID in range to match */ 182 bcm_vlan_t match_inner_vlan; /* Inner VLAN ID to match */ 183 bcm_vlan_t match_inner_vlan_max; /* Maximum Inner VLAN ID in range to 184 match */ 185 bcm_vlan_t match_tunnel_vlan; /* B-domain VID */ 186 bcm_mac_t match_tunnel_srcmac; /* B-domain source MAC address */ 187 bcm_mpls_label_t match_label; /* MPLS label */ 188 uint32 flags; /* BCM_PORT_MATCH_XXX flags */ 189 bcm_tunnel_id_t match_pon_tunnel; /* PON Tunnel value to match. */ 190 bcm_port_ethertype_t match_ethertype; /* Ethernet type value to match */ 191 int match_pcp; /* Outer PCP ID to match */ 192 bcm_compat6516_vlan_action_set_t *action; /* Match action */ 193 uint16 extended_port_vid; /* Extender port VID */ 194 bcm_vpn_t vpn; /* VPN ID */ 195 uint16 niv_port_vif; /* NIV port VIF */ 196 uint32 isid; 197 } bcm_compat6514_port_match_info_t; 198 199 /* Add a match to an existing port */ 200 extern int bcm_compat6514_port_match_add( 201 int unit, 202 bcm_gport_t port, 203 bcm_compat6514_port_match_info_t *match); 204 205 /* Remove a match from an existing port */ 206 extern int bcm_compat6514_port_match_delete( 207 int unit, 208 bcm_gport_t port, 209 bcm_compat6514_port_match_info_t *match); 210 211 /* Replace an old match with a new one for an existing port */ 212 extern int bcm_compat6514_port_match_replace( 213 int unit, 214 bcm_gport_t port, 215 bcm_compat6514_port_match_info_t *old_match, 216 bcm_compat6514_port_match_info_t *new_match); 217 218 /* Get all the matches for an existing port */ 219 extern int bcm_compat6514_port_match_multi_get( 220 int unit, 221 bcm_gport_t port, 222 int size, 223 bcm_compat6514_port_match_info_t *match_array, 224 int *count); 225 226 /* Assign a set of matches to an existing port */ 227 extern int bcm_compat6514_port_match_set( 228 int unit, 229 bcm_gport_t port, 230 int size, 231 bcm_compat6514_port_match_info_t *match_array); 232 233 #ifdef INCLUDE_L3 234 /* IPMC address type. */ 235 typedef struct bcm_compat6514_ipmc_addr_s { 236 bcm_ip_t s_ip_addr; /* IPv4 Source address. */ 237 bcm_ip_t mc_ip_addr; /* IPv4 Destination address. */ 238 bcm_ip6_t s_ip6_addr; /* IPv6 Source address. */ 239 bcm_ip6_t mc_ip6_addr; /* IPv6 Destination address. */ 240 bcm_vlan_t vid; /* VLAN identifier. */ 241 bcm_vrf_t vrf; /* Virtual Router Instance. */ 242 bcm_cos_t cos; /* COS based on dst IP multicast addr. */ 243 int ts; /* Source port or TGID bit. */ 244 int port_tgid; /* Source port or TGID. */ 245 int v; /* Valid bit. */ 246 int mod_id; /* Module ID. */ 247 bcm_multicast_t group; /* Use this index to program IPMC table 248 for XGS chips based on flags value. 249 For SBX chips it is the Multicast 250 Group index */ 251 uint32 flags; /* See BCM_IPMC_XXX flag definitions. */ 252 int lookup_class; /* Classification lookup class ID. */ 253 bcm_fabric_distribution_t distribution_class; /* Fabric Distribution Class. */ 254 bcm_if_t l3a_intf; /* L3 interface associated with route. */ 255 int rp_id; /* Rendezvous point ID. */ 256 bcm_ip_t s_ip_mask; /* IPv4 Source subnet mask. */ 257 bcm_if_t ing_intf; /* L3 interface associated with this 258 Entry */ 259 bcm_ip_t mc_ip_mask; /* IPv4 Destination subnet mask. */ 260 bcm_ip6_t mc_ip6_mask; /* IPv6 Destination subnet mask. */ 261 bcm_multicast_t group_l2; /* Use this index to program IPMC table 262 for l2 recipients if TTL/RPF check 263 fails. */ 264 } bcm_compat6514_ipmc_addr_t; 265 266 /* Add new IPMC group. */ 267 extern int bcm_compat6514_ipmc_add( 268 int unit, 269 bcm_compat6514_ipmc_addr_t *data); 270 271 /* Find info of an IPMC group. */ 272 extern int bcm_compat6514_ipmc_find( 273 int unit, 274 bcm_compat6514_ipmc_addr_t *data); 275 276 /* Remove IPMC group. */ 277 extern int bcm_compat6514_ipmc_remove( 278 int unit, 279 bcm_compat6514_ipmc_addr_t *data); 280 281 /* 282 * L3 Egress Structure. 283 * 284 * Description of an L3 forwarding destination. 285 */ 286 typedef struct bcm_compat6514_l3_egress_s { 287 uint32 flags; /* Interface flags (BCM_L3_TGID, 288 BCM_L3_L2TOCPU). */ 289 uint32 flags2; /* See BCM_L3_FLAGS2_xxx flag 290 definitions. */ 291 bcm_if_t intf; /* L3 interface (source MAC, tunnel). */ 292 bcm_mac_t mac_addr; /* Next hop forwarding destination mac. */ 293 bcm_vlan_t vlan; /* Next hop vlan id. */ 294 bcm_module_t module; 295 bcm_port_t port; /* Port packet switched to (if 296 !BCM_L3_TGID). */ 297 bcm_trunk_t trunk; /* Trunk packet switched to (if 298 BCM_L3_TGID). */ 299 uint32 mpls_flags; /* BCM_MPLS flag definitions. */ 300 bcm_mpls_label_t mpls_label; /* MPLS label. */ 301 bcm_mpls_egress_action_t mpls_action; /* MPLS action. */ 302 int mpls_qos_map_id; /* MPLS EXP map ID. */ 303 int mpls_ttl; /* MPLS TTL threshold. */ 304 uint8 mpls_pkt_pri; /* MPLS Packet Priority Value. */ 305 uint8 mpls_pkt_cfi; /* MPLS Packet CFI Value. */ 306 uint8 mpls_exp; /* MPLS Exp. */ 307 int qos_map_id; /* General QOS map id */ 308 bcm_if_t encap_id; /* Encapsulation index. */ 309 bcm_failover_t failover_id; /* Failover Object Index. */ 310 bcm_if_t failover_if_id; /* Failover Egress Object index. */ 311 bcm_multicast_t failover_mc_group; /* Failover Multicast Group. */ 312 int dynamic_scaling_factor; /* Scaling factor for dynamic load 313 balancing thresholds. */ 314 int dynamic_load_weight; /* Weight of traffic load in determining 315 a dynamic load balancing member's 316 quality. */ 317 int dynamic_queue_size_weight; /* Weight of queue size in determining a 318 dynamic load balancing member's 319 quality. */ 320 int intf_class; /* L3 interface class ID */ 321 uint32 multicast_flags; /* BCM_L3_MULTICAST flag definitions. */ 322 uint16 oam_global_context_id; /* OAM global context id passed from 323 ingress to egress XGS chip. */ 324 bcm_vntag_t vntag; /* VNTAG. */ 325 bcm_vntag_action_t vntag_action; /* VNTAG action. */ 326 bcm_etag_t etag; /* ETAG. */ 327 bcm_etag_action_t etag_action; /* ETAG action. */ 328 uint32 flow_handle; /* FLOW handle for flex entries. */ 329 uint32 flow_option_handle; /* FLOW option handle for flex entries. */ 330 uint32 flow_label_option_handle; /* FLOW option handle for egress label 331 flex entries. */ 332 bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex 333 entries. */ 334 uint32 num_of_fields; /* number of logical fields. */ 335 int counting_profile; /* counting profile. If not required, 336 set it to 337 BCM_STAT_LIF_COUNTING_PROFILE_NONE */ 338 int mpls_ecn_map_id; /* IP ECN/INT CN to MPLS EXP map ID. */ 339 bcm_l3_ingress_urpf_mode_t urpf_mode; /* fec rpf mode. */ 340 bcm_multicast_t mc_group; /* Multicast Group. */ 341 } bcm_compat6514_l3_egress_t; 342 343 extern int bcm_compat6514_l3_egress_create( 344 int unit, 345 uint32 flags, 346 bcm_compat6514_l3_egress_t *egr, 347 bcm_if_t *if_id); 348 349 extern int bcm_compat6514_l3_egress_get( 350 int unit, 351 bcm_if_t intf, 352 bcm_compat6514_l3_egress_t *egr); 353 354 extern int bcm_compat6514_l3_egress_find( 355 int unit, 356 bcm_compat6514_l3_egress_t *egr, 357 bcm_if_t *intf); 358 359 extern int bcm_compat6514_failover_egress_set( 360 int unit, 361 bcm_if_t intf, 362 bcm_compat6514_l3_egress_t *failover_egr); 363 364 extern int bcm_compat6514_failover_egress_get( 365 int unit, 366 bcm_if_t intf, 367 bcm_compat6514_l3_egress_t *failover_egr); 368 369 typedef struct bcm_compat6514_mpls_egress_label_s { 370 uint32 flags; /* BCM_MPLS_EGRESS_LABEL_xxx. */ 371 bcm_mpls_label_t label; 372 int qos_map_id; /* EXP map ID. */ 373 uint8 exp; 374 uint8 ttl; 375 uint8 pkt_pri; 376 uint8 pkt_cfi; 377 bcm_if_t tunnel_id; /* Tunnel Interface. */ 378 bcm_if_t l3_intf_id; /* l3 Interface ID. */ 379 bcm_mpls_egress_action_t action; /* MPLS label action, relevant when 380 BCM_MPLS_EGRESS_LABEL_ACTION_VALID is 381 set. */ 382 int ecn_map_id; /* Ecn map id for IP ECN to EXP mapping. */ 383 int int_cn_map_id; /* Ecn map id for INT_CN to EXP mapping. */ 384 bcm_failover_t egress_failover_id; /* Failover object index for Egress 385 Protection. */ 386 bcm_if_t egress_failover_if_id; /* Failover MPLS Tunnel identifier for 387 Egress Protection. */ 388 int outlif_counting_profile; /* Out LIF counting profile */ 389 bcm_mpls_special_label_push_type_t spl_label_push_type; /* Special label push type */ 390 bcm_encap_access_t encap_access; /* Encapsulation Access stage */ 391 } bcm_compat6514_mpls_egress_label_t; 392 393 typedef struct bcm_compat6514_mpls_tunnel_switch_s { 394 uint32 flags; /* BCM_MPLS_SWITCH_xxx. */ 395 uint32 flags2; /* BCM_MPLS_SWITCH2_xxx. */ 396 bcm_mpls_label_t label; /* Incoming label value. */ 397 bcm_mpls_label_t second_label; /* Incoming second label. */ 398 bcm_gport_t port; /* Incoming port. */ 399 bcm_mpls_switch_action_t action; /* MPLS label action. */ 400 bcm_mpls_switch_action_t action_if_bos; /* MPLS label action if BOS. */ 401 bcm_mpls_switch_action_t action_if_not_bos; /* MPLS label action if not BOS. */ 402 bcm_multicast_t mc_group; /* P2MP Multicast group. */ 403 int exp_map; /* EXP-map ID. */ 404 int int_pri; /* Internal priority. */ 405 bcm_policer_t policer_id; /* Policer ID to be associated with the 406 incoming label. */ 407 bcm_vpn_t vpn; /* L3 VPN used if action is POP. */ 408 bcm_compat6514_mpls_egress_label_t egress_label; /* Outgoing label information. */ 409 bcm_if_t egress_if; /* Outgoing egress object. */ 410 bcm_if_t ingress_if; /* Ingress Interface object. */ 411 int mtu; /* MTU. */ 412 int qos_map_id; /* QOS map identifier. */ 413 bcm_failover_t failover_id; /* Failover Object Identifier for 414 protected tunnel. Used for 1+1 415 protection also */ 416 bcm_gport_t tunnel_id; /* Tunnel ID. */ 417 bcm_gport_t failover_tunnel_id; /* Failover Tunnel ID. */ 418 bcm_if_t tunnel_if; /* hierarchical interface, relevant for 419 when action is 420 BCM_MPLS_SWITCH_ACTION_POP. */ 421 bcm_gport_t egress_port; /* Outgoing egress port. */ 422 uint16 oam_global_context_id; /* OAM global context id passed from 423 ingress to egress XGS chip. */ 424 uint32 class_id; /* Class ID */ 425 int inlif_counting_profile; /* In LIF counting profile */ 426 int ecn_map_id; /* ECN map identifier */ 427 int tunnel_term_ecn_map_id; /* Tunnel termination ecn map identifier */ 428 } bcm_compat6514_mpls_tunnel_switch_t; 429 430 extern int bcm_compat6514_mpls_tunnel_switch_add( 431 int unit, bcm_compat6514_mpls_tunnel_switch_t *info); 432 433 extern int bcm_compat6514_mpls_tunnel_switch_delete( 434 int unit, bcm_compat6514_mpls_tunnel_switch_t *info); 435 436 extern int bcm_compat6514_mpls_tunnel_switch_get( 437 int unit, bcm_compat6514_mpls_tunnel_switch_t *info); 438 #endif 439 440 #endif 441 #endif /* !_COMPAT_6514_H */