compat_6513.h (8677B)
1 /* 2 * $Id: compat_6513.h,v 2.0 2017/10/14 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.13 routines 8 */ 9 10 #ifndef _COMPAT_6513_H_ 11 #define _COMPAT_6513_H_ 12 13 #ifdef BCM_RPC_SUPPORT 14 #include <bcm/types.h> 15 #include <bcm/field.h> 16 17 #ifdef INCLUDE_TCB 18 #include <bcm/cosq.h> 19 #endif 20 21 #if defined(INCLUDE_L3) 22 #include <bcm/flow.h> 23 24 typedef struct bcm_compat6513_flow_encap_config_s { 25 bcm_vpn_t vpn; /* VPN representing a vfi or vrf */ 26 bcm_gport_t flow_port; /* flow port id representing a DVP */ 27 bcm_if_t intf_id; /* l3 interface id */ 28 uint32 dvp_group; /* DVP group ID */ 29 uint32 oif_group; /* L3 OUT interface group ID */ 30 uint32 vnid; /* VN_ID. */ 31 uint8 pri; /* service tag priority. */ 32 uint8 cfi; /* service tag cfi */ 33 uint16 tpid; /* service tag tpid */ 34 bcm_vlan_t vlan; /* service VLAN ID. */ 35 uint32 flags; /* BCM_FLOW_ENCAP_FLAG_xxx. */ 36 uint32 options; /* BCM_FLOW_ENCAP_OPTION_xxx. */ 37 bcm_flow_encap_criteria_t criteria; /* flow encap criteria. */ 38 uint32 valid_elements; /* bitmap of valid fields for the encap 39 action */ 40 bcm_flow_handle_t flow_handle; /* flow handle derived from flow name */ 41 uint32 flow_option; /* flow option derived from flow option 42 name */ 43 } bcm_compat6513_flow_encap_config_t; 44 #endif 45 46 47 #if defined(INCLUDE_L3) 48 /* Add a flow encap rule. */ 49 extern int bcm_compat6513_flow_encap_add( 50 int unit, 51 bcm_compat6513_flow_encap_config_t *info, 52 uint32 num_of_fields, 53 bcm_flow_logical_field_t *field); 54 #endif 55 56 #if defined(INCLUDE_L3) 57 /* Delete a flow encap rule on the given encap key. */ 58 extern int bcm_compat6513_flow_encap_delete( 59 int unit, 60 bcm_compat6513_flow_encap_config_t *info, 61 uint32 num_of_fields, 62 bcm_flow_logical_field_t *field); 63 #endif 64 65 #if defined(INCLUDE_L3) 66 /* Get the encap attributes on the given encap key. */ 67 extern int bcm_compat6513_flow_encap_get( 68 int unit, 69 bcm_compat6513_flow_encap_config_t *info, 70 uint32 num_of_fields, 71 bcm_flow_logical_field_t *field); 72 #endif 73 74 #if defined(INCLUDE_L3) 75 /* 76 * L3 Egress Structure. 77 * 78 * Description of an L3 forwarding destination. 79 */ 80 typedef struct bcm_compat6513_l3_egress_s { 81 uint32 flags; /* Interface flags (BCM_L3_TGID, 82 BCM_L3_L2TOCPU). */ 83 uint32 flags2; /* See BCM_L3_FLAGS2_xxx flag 84 definitions. */ 85 bcm_if_t intf; /* L3 interface (source MAC, tunnel). */ 86 bcm_mac_t mac_addr; /* Next hop forwarding destination mac. */ 87 bcm_vlan_t vlan; /* Next hop vlan id. */ 88 bcm_module_t module; 89 bcm_port_t port; /* Port packet switched to (if 90 !BCM_L3_TGID). */ 91 bcm_trunk_t trunk; /* Trunk packet switched to (if 92 BCM_L3_TGID). */ 93 uint32 mpls_flags; /* BCM_MPLS flag definitions. */ 94 bcm_mpls_label_t mpls_label; /* MPLS label. */ 95 bcm_mpls_egress_action_t mpls_action; /* MPLS action. */ 96 int mpls_qos_map_id; /* MPLS EXP map ID. */ 97 int mpls_ttl; /* MPLS TTL threshold. */ 98 uint8 mpls_pkt_pri; /* MPLS Packet Priority Value. */ 99 uint8 mpls_pkt_cfi; /* MPLS Packet CFI Value. */ 100 uint8 mpls_exp; /* MPLS Exp. */ 101 int qos_map_id; /* General QOS map id */ 102 bcm_if_t encap_id; /* Encapsulation index. */ 103 bcm_failover_t failover_id; /* Failover Object Index. */ 104 bcm_if_t failover_if_id; /* Failover Egress Object index. */ 105 bcm_multicast_t failover_mc_group; /* Failover Multicast Group. */ 106 int dynamic_scaling_factor; /* Scaling factor for dynamic load 107 balancing thresholds. */ 108 int dynamic_load_weight; /* Weight of traffic load in determining 109 a dynamic load balancing member's 110 quality. */ 111 int dynamic_queue_size_weight; /* Weight of queue size in determining a 112 dynamic load balancing member's 113 quality. */ 114 int intf_class; /* L3 interface class ID */ 115 uint32 multicast_flags; /* BCM_L3_MULTICAST flag definitions. */ 116 uint16 oam_global_context_id; /* OAM global context id passed from 117 ingress to egress XGS chip. */ 118 bcm_vntag_t vntag; /* VNTAG. */ 119 bcm_vntag_action_t vntag_action; /* VNTAG action. */ 120 bcm_etag_t etag; /* ETAG. */ 121 bcm_etag_action_t etag_action; /* ETAG action. */ 122 uint32 flow_handle; /* FLOW handle for flex entries. */ 123 uint32 flow_option_handle; /* FLOW option handle for flex entries. */ 124 uint32 flow_label_option_handle; /* FLOW option handle for egress label 125 flex entries. */ 126 bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex 127 entries. */ 128 uint32 num_of_fields; /* number of logical fields. */ 129 int counting_profile; /* counting profile. If not required, 130 set it to 131 BCM_STAT_LIF_COUNTING_PROFILE_NONE */ 132 int mpls_ecn_map_id; /* IP ECN/INT CN to MPLS EXP map ID. */ 133 bcm_l3_ingress_urpf_mode_t urpf_mode; /* fec rpf mode. */ 134 } bcm_compat6513_l3_egress_t; 135 136 /* Create an Egress forwarding object. */ 137 extern int bcm_compat6513_l3_egress_create( 138 int unit, uint32 flags, bcm_compat6513_l3_egress_t *egr, bcm_if_t *intf); 139 140 /* Get an Egress forwarding object. */ 141 extern int bcm_compat6513_l3_egress_get( 142 int unit, bcm_if_t intf, bcm_compat6513_l3_egress_t *egr); 143 144 /* Find an egress forwarding object. */ 145 extern int bcm_compat6513_l3_egress_find( 146 int unit, bcm_compat6513_l3_egress_t *egr, bcm_if_t *intf); 147 #endif 148 149 #ifdef INCLUDE_TCB 150 typedef struct bcm_compat6513_cosq_tcb_config_s { 151 bcm_cosq_tcb_scope_t scope_type; /* TCB monitor scope type */ 152 bcm_gport_t gport; /* TCB monitor entity, can be a Unicast 153 queue gport or a physical port gport */ 154 bcm_cos_queue_t cosq; /* Reserved field */ 155 uint32 trigger_reason; /* Define the event which could trigger 156 the capture */ 157 uint32 pre_freeze_capture_num; /* Define the capture number after TCB 158 enter freeze status */ 159 uint32 pre_freeze_capture_time; /* Define the capture time after TCB 160 enter freeze status. Unit is usec */ 161 uint32 post_sample_probability; /* The sample probability in 162 post-trigger phase. Step is 1/16, 163 valid configure range is 1 to 16, 1 164 means 1/16 sample, 16 means sample 165 all */ 166 uint32 pre_sample_probability; /* The sample probability in pre-trigger 167 phase. Step is 1/16, valid configure 168 range is 1 to 16, 1 means 1/16 169 sample, 16 means sample all */ 170 } bcm_compat6513_cosq_tcb_config_t; 171 172 extern int bcm_compat6513_cosq_tcb_config_get( 173 int unit, 174 bcm_cosq_buffer_id_t buffer_id, 175 bcm_compat6513_cosq_tcb_config_t *config); 176 177 extern int bcm_compat6513_cosq_tcb_config_set( 178 int unit, 179 bcm_cosq_buffer_id_t buffer_id, 180 bcm_compat6513_cosq_tcb_config_t *config); 181 #endif 182 183 #endif 184 #endif /* !_COMPAT_6513_H */