compat_659.h (8215B)
1 /* 2 * $Id: compat_659.h,v 1.0 2017/04/13 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.9 routines 8 */ 9 10 #ifndef _COMPAT_659_H_ 11 #define _COMPAT_659_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 19 #if defined(INCLUDE_L3) 20 #include <bcm/vlan.h> 21 22 /* Layer 2 Logical port type */ 23 typedef struct bcm_compat659_vlan_port_s { 24 bcm_vlan_port_match_t criteria; /* Match criteria. */ 25 uint32 flags; /* BCM_VLAN_PORT_xxx. */ 26 bcm_vlan_t vsi; /* Populated for bcm_vlan_port_find only */ 27 bcm_vlan_t match_vlan; /* Outer VLAN ID to match. */ 28 bcm_vlan_t match_inner_vlan; /* Inner VLAN ID to match. */ 29 int match_pcp; /* Outer PCP ID to match. */ 30 bcm_tunnel_id_t match_tunnel_value; /* Tunnel value to match. */ 31 bcm_port_ethertype_t match_ethertype; /* Ethernet type value to match. */ 32 bcm_gport_t port; /* Gport: local or remote Physical or 33 logical gport. */ 34 uint8 pkt_pri; /* Service tag priority. */ 35 uint8 pkt_cfi; /* Service tag cfi. */ 36 uint16 egress_service_tpid; /* Service VLAN TPID value. */ 37 bcm_vlan_t egress_vlan; /* Egress Outer VLAN or SD-TAG VLAN ID. */ 38 bcm_vlan_t egress_inner_vlan; /* Egress Inner VLAN. */ 39 bcm_tunnel_id_t egress_tunnel_value; /* Egress Tunnel value. */ 40 bcm_if_t encap_id; /* Encapsulation Index. */ 41 int qos_map_id; /* QoS Map Index. */ 42 bcm_policer_t policer_id; /* Policer ID */ 43 bcm_policer_t egress_policer_id; /* Egress Policer ID */ 44 bcm_failover_t failover_id; /* Failover Object Index. */ 45 bcm_gport_t failover_port_id; /* Failover VLAN Port Identifier. */ 46 bcm_gport_t vlan_port_id; /* GPORT identifier */ 47 bcm_multicast_t failover_mc_group; /* MC group used for bi-cast. */ 48 bcm_failover_t ingress_failover_id; /* 1+1 protection. */ 49 bcm_failover_t egress_failover_id; /* Failover object index for Egress 50 Protection */ 51 bcm_gport_t egress_failover_port_id; /* Failover VLAN Port Identifier for 52 Egress Protection */ 53 bcm_switch_network_group_t ingress_network_group_id; /* Split Horizon ingress network group 54 identifier */ 55 bcm_switch_network_group_t egress_network_group_id; /* Split Horizon egress network group 56 identifier */ 57 int inlif_counting_profile; /* In LIF counting profile */ 58 int outlif_counting_profile; /* Out LIF counting profile */ 59 } bcm_compat659_vlan_port_t; 60 61 /* 62 * Create a layer 2 logical port. Places the ID in the logical port 63 * descriptor if WITH_ID flag is not provided, uses the ID in the logical 64 * port descriptor if WITH_ID flag specified. 65 */ 66 extern int bcm_compat659_vlan_port_create(int unit, 67 bcm_compat659_vlan_port_t *vlan_port); 68 69 /* Get/find a layer 2 logical port given the GPORT id or match criteria. */ 70 extern int bcm_compat659_vlan_port_find(int unit, 71 bcm_compat659_vlan_port_t *vlan_port); 72 73 74 #endif /* INCLUDE_L3 */ 75 76 /* This structure contains the configuration of a VLAN. */ 77 typedef struct bcm_compat659_vlan_control_vlan_s { 78 bcm_vrf_t vrf; 79 bcm_vlan_t forwarding_vlan; /* Shared VLAN ID. */ 80 bcm_if_t ingress_if; /* Mapped Ingress interface. */ 81 uint16 outer_tpid; 82 uint32 flags; 83 bcm_vlan_mcast_flood_t ip6_mcast_flood_mode; 84 bcm_vlan_mcast_flood_t ip4_mcast_flood_mode; 85 bcm_vlan_mcast_flood_t l2_mcast_flood_mode; 86 int if_class; 87 bcm_vlan_forward_t forwarding_mode; 88 bcm_vlan_urpf_mode_t urpf_mode; 89 bcm_cos_queue_t cosq; 90 int qos_map_id; /* index to int_pri->queue offset 91 mapping profile */ 92 bcm_fabric_distribution_t distribution_class; /* Fabric Distribution Class. */ 93 bcm_multicast_t broadcast_group; /* Group to handle broadcast frames */ 94 bcm_multicast_t unknown_multicast_group; /* Group to handle unknown multicast 95 frames */ 96 bcm_multicast_t unknown_unicast_group; /* Group to handle unknown unicast 97 frames */ 98 bcm_multicast_t trill_nonunicast_group; /* Group to handle trill-domain 99 nonunicast frames */ 100 bcm_trill_name_t source_trill_name; /* Source RBridge nickname per VLAN */ 101 int trunk_index; /* Trunk index for static PSC */ 102 bcm_vlan_protocol_packet_ctrl_t protocol_pkt; /* Protocol packet control per VLAN */ 103 int nat_realm_id; /* Realm id of interface that this vlan 104 maps to */ 105 int l3_if_class; /* L3IIF class id. */ 106 bcm_vlan_vp_mc_ctrl_t vp_mc_ctrl; /* VP replication control, Auto, Enable, 107 Disable */ 108 int aging_cycles; /* number of aging meta-cycles */ 109 int entropy_id; /* aging profile ID */ 110 bcm_vpn_t vpn; /* vpn */ 111 bcm_vlan_t egress_vlan; /* egress outer vlan */ 112 uint32 learn_flags; /* Learn control flags for VLAN-based 113 (BCM_VLAN_LEARN_CONTROL_XXX) */ 114 uint32 sr_flags; /* Flags for Seamless Redundancy: 115 BCM_VLAN_CONTROL_SR_FLAG_xxx */ 116 } bcm_compat659_vlan_control_vlan_t; 117 118 /* Set per VLAN configuration */ 119 extern int bcm_compat659_vlan_control_vlan_selective_set(int unit, 120 bcm_vlan_t vlan, uint32 valid_fields, 121 bcm_compat659_vlan_control_vlan_t *control); 122 /* Get per VLAN configuration */ 123 extern int bcm_compat659_vlan_control_vlan_selective_get(int unit, 124 bcm_vlan_t vlan, uint32 valid_fields, 125 bcm_compat659_vlan_control_vlan_t *control); 126 127 extern int bcm_compat659_vlan_control_vlan_set(int unit, bcm_vlan_t vlan, 128 bcm_compat659_vlan_control_vlan_t control); 129 130 extern int bcm_compat659_vlan_control_vlan_get(int unit, bcm_vlan_t vlan, 131 bcm_compat659_vlan_control_vlan_t *control); 132 133 134 /* For Virtual output queues (system ports) */ 135 typedef struct bcm_compat659_cosq_gport_discard_s { 136 uint32 flags; 137 int min_thresh; /* Queue depth in bytes to begin dropping. */ 138 int max_thresh; /* Queue depth in bytes to drop all packets. */ 139 int drop_probability; /* Drop probability at max threshold. */ 140 int gain; /* Determines the smoothing that should be applied. */ 141 int ecn_thresh; /* Queue depth in bytes to stop marking and start 142 dropping. */ 143 int refresh_time; /* Actual average refresh time. */ 144 } bcm_compat659_cosq_gport_discard_t; 145 146 extern int bcm_compat659_cosq_gport_discard_set( 147 int unit, 148 bcm_gport_t gport, 149 bcm_cos_queue_t cosq, 150 bcm_compat659_cosq_gport_discard_t *discard); 151 152 extern int bcm_compat659_cosq_gport_discard_get( 153 int unit, 154 bcm_gport_t gport, 155 bcm_cos_queue_t cosq, 156 bcm_compat659_cosq_gport_discard_t *discard); 157 158 extern int bcm_compat659_cosq_gport_discard_extended_set( 159 int unit, 160 bcm_cosq_object_id_t *id, 161 bcm_compat659_cosq_gport_discard_t *discard); 162 163 extern int bcm_compat659_cosq_gport_discard_extended_get( 164 int unit, 165 bcm_cosq_object_id_t *id, 166 bcm_compat659_cosq_gport_discard_t *discard); 167 168 #endif 169 #endif /* !_COMPAT_659_H */