openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

compat_6515.h (18107B)


      1 /*
      2  * 
      3  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      4  * 
      5  * Copyright 2007-2019 Broadcom Inc. All rights reserved.
      6  *
      7  * RPC Compatibility with sdk-6.5.15 routines
      8 */
      9 
     10 #ifndef _COMPAT_6515_H_
     11 #define _COMPAT_6515_H_
     12 
     13 #ifdef BCM_RPC_SUPPORT
     14 #include <bcm/types.h>
     15 #include <bcm/mpls.h>
     16 #include <bcm/l3.h>
     17 #include <bcm/ipmc.h>
     18 #include <bcm/qos.h>
     19 #include <bcm/tunnel.h>
     20 #include <bcm/l2gre.h>
     21 #include <bcm/vxlan.h>
     22 #include <bcm/failover.h>
     23 
     24 #ifdef INCLUDE_L3
     25 typedef struct bcm_compat6515_mpls_tunnel_switch_s {
     26     uint32 flags;                       /* BCM_MPLS_SWITCH_xxx. */
     27     uint32 flags2;                      /* BCM_MPLS_SWITCH2_xxx. */
     28     bcm_mpls_label_t label;             /* Incoming label value. */
     29     bcm_mpls_label_t second_label;      /* Incoming second label. */
     30     bcm_gport_t port;                   /* Incoming port. */
     31     bcm_mpls_switch_action_t action;    /* MPLS label action. */
     32     bcm_mpls_switch_action_t action_if_bos; /* MPLS label action if BOS. */
     33     bcm_mpls_switch_action_t action_if_not_bos; /* MPLS label action if not BOS. */
     34     bcm_multicast_t mc_group;           /* P2MP Multicast group. */
     35     int exp_map;                        /* EXP-map ID. */
     36     int int_pri;                        /* Internal priority. */
     37     bcm_policer_t policer_id;           /* Policer ID to be associated with the
     38                                            incoming label. */
     39     bcm_vpn_t vpn;                      /* L3 VPN used if action is POP. */
     40     bcm_mpls_egress_label_t egress_label; /* Outgoing label information. */
     41     bcm_if_t egress_if;                 /* Outgoing egress object. */
     42     bcm_if_t ingress_if;                /* Ingress Interface object. */
     43     int mtu;                            /* MTU. */
     44     int qos_map_id;                     /* QOS map identifier. */
     45     bcm_failover_t failover_id;         /* Failover Object Identifier for
     46                                            protected tunnel. Used for 1+1
     47                                            protection also */
     48     bcm_gport_t tunnel_id;              /* Tunnel ID. */
     49     bcm_gport_t failover_tunnel_id;     /* Failover Tunnel ID. */
     50     bcm_if_t tunnel_if;                 /* hierarchical interface, relevant for
     51                                            when action is
     52                                            BCM_MPLS_SWITCH_ACTION_POP. */
     53     bcm_gport_t egress_port;            /* Outgoing egress port. */
     54     uint16 oam_global_context_id;       /* OAM global context id passed from
     55                                            ingress to egress XGS chip. */
     56     uint32 class_id;                    /* Class ID */
     57     int inlif_counting_profile;         /* In LIF counting profile */
     58     int ecn_map_id;                     /* ECN map identifier */
     59     int tunnel_term_ecn_map_id;         /* Tunnel termination ecn map identifier */
     60 } bcm_compat6515_mpls_tunnel_switch_t;
     61 
     62 extern int bcm_compat6515_mpls_tunnel_switch_add(
     63     int unit, bcm_compat6515_mpls_tunnel_switch_t *info);
     64 
     65 extern int bcm_compat6515_mpls_tunnel_switch_delete(
     66     int unit, bcm_compat6515_mpls_tunnel_switch_t *info);
     67 
     68 extern int bcm_compat6515_mpls_tunnel_switch_get(
     69     int unit, bcm_compat6515_mpls_tunnel_switch_t *info);
     70 
     71 /* IPMC address type. */
     72 typedef struct bcm_compat6515_ipmc_addr_s {
     73     bcm_ip_t s_ip_addr;                 /* IPv4 Source address. */
     74     bcm_ip_t mc_ip_addr;                /* IPv4 Destination address. */
     75     bcm_ip6_t s_ip6_addr;               /* IPv6 Source address. */
     76     bcm_ip6_t mc_ip6_addr;              /* IPv6 Destination address. */
     77     bcm_vlan_t vid;                     /* VLAN identifier. */
     78     bcm_vrf_t vrf;                      /* Virtual Router Instance. */
     79     bcm_cos_t cos;                      /* COS based on dst IP multicast addr. */
     80     int ts;                             /* Source port or TGID bit. */
     81     int port_tgid;                      /* Source port or TGID. */
     82     int v;                              /* Valid bit. */
     83     int mod_id;                         /* Module ID. */
     84     bcm_multicast_t group;              /* Use this index to program IPMC table
     85                                            for XGS chips based on flags value.
     86                                            For SBX chips it is the Multicast
     87                                            Group index */
     88     uint32 flags;                       /* See BCM_IPMC_XXX flag definitions. */
     89     int lookup_class;                   /* Classification lookup class ID. */
     90     bcm_fabric_distribution_t distribution_class; /* Fabric Distribution Class. */
     91     bcm_if_t l3a_intf;                  /* L3 interface associated with route. */
     92     int rp_id;                          /* Rendezvous point ID. */
     93     bcm_ip_t s_ip_mask;                 /* IPv4 Source subnet mask. */
     94     bcm_if_t ing_intf;                  /* L3 interface associated with this
     95                                            Entry */
     96     bcm_ip_t mc_ip_mask;                /* IPv4 Destination subnet mask. */
     97     bcm_ip6_t mc_ip6_mask;              /* IPv6 Destination subnet mask. */
     98     bcm_multicast_t group_l2;           /* Use this index to program IPMC table
     99                                            for l2 recipients if TTL/RPF check
    100                                            fails. */
    101     uint32 stat_id;                     /* Object statistics ID. */
    102     int stat_pp_profile;                /* Statistics profile. */
    103     bcm_ip6_t s_ip6_mask;               /* IPv6 Source subnet mask. */
    104     int priority;                       /* Entry priority. */
    105 } bcm_compat6515_ipmc_addr_t;
    106 
    107 /* Add new IPMC group. */
    108 extern int bcm_compat6515_ipmc_add(
    109     int unit,
    110     bcm_compat6515_ipmc_addr_t *data);
    111 
    112 /* Find info of an IPMC group. */
    113 extern int bcm_compat6515_ipmc_find(
    114     int unit,
    115     bcm_compat6515_ipmc_addr_t *data);
    116 
    117 /* Remove IPMC group. */
    118 extern int bcm_compat6515_ipmc_remove(
    119     int unit,
    120     bcm_compat6515_ipmc_addr_t *data);
    121 
    122 #endif /* INCLUDE_L3 */
    123 /* Port Resource Configuration */
    124 typedef struct bcm_compat6515port_resource_s {
    125     uint32 flags;                   /* BCM_PORT_RESOURCE_XXX */
    126     bcm_gport_t port;               /* Local logical port number to connect to
    127                                        the given physical port */
    128     int physical_port;              /* Local physical port, -1 if the logical to
    129                                        physical mapping is to be deleted */
    130     int speed;                      /* Initial speed after FlexPort operation */
    131     int lanes;                      /* Number of PHY lanes for this physical
    132                                        port */
    133     bcm_port_encap_t encap;         /* Encapsulation mode for port */
    134     bcm_port_phy_fec_t fec_type;    /* fec_type for port */
    135     int phy_lane_config;            /* serdes pmd lane config for port */
    136     int link_training;              /* link training on or off */
    137     int roe_compression;            /* roe_compression enable */
    138 } bcm_compat6515_port_resource_t;
    139 
    140 
    141 /* Generic port match attribute structure */
    142 typedef struct bcm_compat6515_port_match_info_s {
    143     bcm_port_match_t match;             /* Match criteria */
    144     bcm_gport_t port;                   /* Match port */
    145     bcm_vlan_t match_vlan;              /* Outer VLAN ID to match */
    146     bcm_vlan_t match_vlan_max;          /* Maximum VLAN ID in range to match */
    147     bcm_vlan_t match_inner_vlan;        /* Inner VLAN ID to match */
    148     bcm_vlan_t match_inner_vlan_max;    /* Maximum Inner VLAN ID in range to
    149                                            match */
    150     bcm_vlan_t match_tunnel_vlan;       /* B-domain VID */
    151     bcm_mac_t match_tunnel_srcmac;      /* B-domain source MAC address */
    152     bcm_mpls_label_t match_label;       /* MPLS label */
    153     uint32 flags;                       /* BCM_PORT_MATCH_XXX flags */
    154     bcm_tunnel_id_t match_pon_tunnel;   /* PON Tunnel value to match. */
    155     bcm_port_ethertype_t match_ethertype; /* Ethernet type value to match */
    156     int match_pcp;                      /* Outer PCP ID to match */
    157     bcm_vlan_action_set_t *action;      /* Match action */
    158     uint16 extended_port_vid;           /* Extender port VID */
    159     bcm_vpn_t vpn;                      /* VPN ID */
    160     uint16 niv_port_vif;                /* NIV port VIF */
    161     uint32 isid;
    162 } bcm_compat6515_port_match_info_t;
    163 
    164 /* Add a match to an existing port */
    165 extern int bcm_compat6515_port_match_add(
    166     int unit,
    167     bcm_gport_t port,
    168     bcm_compat6515_port_match_info_t *match);
    169 
    170 /* Remove a match from an existing port */
    171 extern int bcm_compat6515_port_match_delete(
    172     int unit,
    173     bcm_gport_t port,
    174     bcm_compat6515_port_match_info_t *match);
    175 
    176 /* Replace an old match with a new one for an existing port */
    177 extern int bcm_compat6515_port_match_replace(
    178     int unit,
    179     bcm_gport_t port,
    180     bcm_compat6515_port_match_info_t *old_match,
    181     bcm_compat6515_port_match_info_t *new_match);
    182 
    183 /* Get all the matches for an existing port */
    184 extern int bcm_compat6515_port_match_multi_get(
    185     int unit,
    186     bcm_gport_t port,
    187     int size,
    188     bcm_compat6515_port_match_info_t *match_array,
    189     int *count);
    190 
    191 /* Assign a set of matches to an existing port */
    192 extern int bcm_compat6515_port_match_set(
    193     int unit,
    194     bcm_gport_t port,
    195     int size,
    196     bcm_compat6515_port_match_info_t *match_array);
    197 
    198 #ifdef INCLUDE_L3
    199 typedef struct bcm_compat6515_l3_egress_s {
    200     uint32 flags;                       /* Interface flags (BCM_L3_TGID,
    201                                            BCM_L3_L2TOCPU). */
    202     uint32 flags2;                      /* See BCM_L3_FLAGS2_xxx flag
    203                                            definitions. */
    204     bcm_if_t intf;                      /* L3 interface (source MAC, tunnel). */
    205     bcm_mac_t mac_addr;                 /* Next hop forwarding destination mac. */
    206     bcm_vlan_t vlan;                    /* Next hop vlan id. */
    207     bcm_module_t module;
    208     bcm_port_t port;                    /* Port packet switched to (if
    209                                            !BCM_L3_TGID). */
    210     bcm_trunk_t trunk;                  /* Trunk packet switched to (if
    211                                            BCM_L3_TGID). */
    212     uint32 mpls_flags;                  /* BCM_MPLS flag definitions. */
    213     bcm_mpls_label_t mpls_label;        /* MPLS label. */
    214     bcm_mpls_egress_action_t mpls_action; /* MPLS action. */
    215     int mpls_qos_map_id;                /* MPLS EXP map ID. */
    216     int mpls_ttl;                       /* MPLS TTL threshold. */
    217     uint8 mpls_pkt_pri;                 /* MPLS Packet Priority Value. */
    218     uint8 mpls_pkt_cfi;                 /* MPLS Packet CFI Value. */
    219     uint8 mpls_exp;                     /* MPLS Exp. */
    220     int qos_map_id;                     /* General QOS map id */
    221     bcm_if_t encap_id;                  /* Encapsulation index. */
    222     bcm_failover_t failover_id;         /* Failover Object Index. */
    223     bcm_if_t failover_if_id;            /* Failover Egress Object index. */
    224     bcm_multicast_t failover_mc_group;  /* Failover Multicast Group. */
    225     int dynamic_scaling_factor;         /* Scaling factor for dynamic load
    226                                            balancing thresholds. */
    227     int dynamic_load_weight;            /* Weight of traffic load in determining
    228                                            a dynamic load balancing member's
    229                                            quality. */
    230     int dynamic_queue_size_weight;      /* Weight of queue size in determining a
    231                                            dynamic load balancing member's
    232                                            quality. */
    233     int intf_class;                     /* L3 interface class ID */
    234     uint32 multicast_flags;             /* BCM_L3_MULTICAST flag definitions. */
    235     uint16 oam_global_context_id;       /* OAM global context id passed from
    236                                            ingress to egress XGS chip. */
    237     bcm_vntag_t vntag;                  /* VNTAG. */
    238     bcm_vntag_action_t vntag_action;    /* VNTAG action. */
    239     bcm_etag_t etag;                    /* ETAG. */
    240     bcm_etag_action_t etag_action;      /* ETAG action. */
    241     uint32 flow_handle;                 /* FLOW handle for flex entries. */
    242     uint32 flow_option_handle;          /* FLOW option handle for flex entries. */
    243     uint32 flow_label_option_handle;    /* FLOW option handle for egress label
    244                                            flex entries. */
    245     bcm_flow_logical_field_t logical_fields[BCM_FLOW_MAX_NOF_LOGICAL_FIELDS]; /* logical fields array for flex
    246                                            entries. */
    247     uint32 num_of_fields;               /* number of logical fields. */
    248     int counting_profile;               /* counting profile. If not required,
    249                                            set it to
    250                                            BCM_STAT_LIF_COUNTING_PROFILE_NONE */
    251     int mpls_ecn_map_id;                /* IP ECN/INT CN to MPLS EXP map ID. */
    252     bcm_l3_ingress_urpf_mode_t urpf_mode; /* fec rpf mode. */
    253     bcm_multicast_t mc_group;           /* Multicast Group. */
    254     bcm_mac_t src_mac_addr;             /* Source MAC Address. */
    255     bcm_gport_t hierarchical_gport;     /* Hierarchical TM-Flow. */
    256     uint32 stat_id;                     /* Object statistics ID. */
    257     int stat_pp_profile;                /* Statistics profile. */
    258 } bcm_compat6515_l3_egress_t;
    259 
    260 extern int bcm_compat6515_l3_egress_find(
    261     int unit,
    262     bcm_compat6515_l3_egress_t *egr,
    263     bcm_if_t *intf);
    264 
    265 extern int bcm_compat6515_l3_egress_create(
    266     int unit,
    267     uint32 flags,
    268     bcm_compat6515_l3_egress_t *egr,
    269     bcm_if_t *if_id);
    270 
    271 extern int bcm_compat6515_l3_egress_get(
    272     int unit,
    273     bcm_if_t intf,
    274     bcm_compat6515_l3_egress_t *egr);
    275 
    276 extern int bcm_compat6515_failover_egress_set(
    277     int unit,
    278     bcm_if_t intf,
    279     bcm_compat6515_l3_egress_t *failover_egr);
    280 
    281 extern int bcm_compat6515_failover_egress_get(
    282     int unit,
    283     bcm_if_t intf,
    284     bcm_compat6515_l3_egress_t *failover_egr);
    285 
    286 /* Ingress QoS model structure */
    287 typedef struct bcm_compat6515_qos_ingress_model_s {
    288     bcm_qos_ingress_model_type_t ingress_phb; /* ingress PHB model */
    289     bcm_qos_ingress_model_type_t ingress_remark; /* ingress remark model */
    290     bcm_qos_ingress_model_type_t ingress_ttl; /* ingress ttl model */
    291 } bcm_compat6515_qos_ingress_model_t;
    292 
    293 /* L3 tunneling terminator. */
    294 typedef struct bcm_compat6515_tunnel_terminator_s {
    295     uint32 flags;                       /* Configuration flags. */
    296     uint32 multicast_flag;              /* VXLAN Multicast trigger flags. */
    297     bcm_vrf_t vrf;                      /* Virtual router instance. */
    298     bcm_ip_t sip;                       /* SIP for tunnel header match. */
    299     bcm_ip_t dip;                       /* DIP for tunnel header match. */
    300     bcm_ip_t sip_mask;                  /* Source IP mask. */
    301     bcm_ip_t dip_mask;                  /* Destination IP mask. */
    302     bcm_ip6_t sip6;                     /* SIP for tunnel header match (IPv6). */
    303     bcm_ip6_t dip6;                     /* DIP for tunnel header match (IPv6). */
    304     bcm_ip6_t sip6_mask;                /* Source IP mask (IPv6). */
    305     bcm_ip6_t dip6_mask;                /* Destination IP mask (IPv6). */
    306     uint32 udp_dst_port;                /* UDP dst port for UDP packets. */
    307     uint32 udp_src_port;                /* UDP src port for UDP packets */
    308     bcm_tunnel_type_t type;             /* Tunnel type */
    309     bcm_pbmp_t pbmp;                    /* Port bitmap for this tunnel */
    310     bcm_vlan_t vlan;                    /* The VLAN ID for IPMC lookup or WLAN
    311                                            tunnel */
    312     bcm_gport_t remote_port;            /* Remote termination */
    313     bcm_gport_t tunnel_id;              /* Tunnel id */
    314     int if_class;                       /* L3 interface class this tunnel. */
    315     bcm_multicast_t failover_mc_group;  /* MC group used for bi-cast. */
    316     bcm_failover_t ingress_failover_id; /* 1+1 protection. */
    317     bcm_failover_t failover_id;         /* Failover Object Identifier for
    318                                            protected tunnel. */
    319     bcm_gport_t failover_tunnel_id;     /* Failover Tunnel ID. */
    320     bcm_if_t tunnel_if;                 /* hierarchical interface. */
    321     int tunnel_class;                   /* Tunnel class id for VFP match. */
    322     int qos_map_id;                     /* QoS DSCP map this tunnel. */
    323     int inlif_counting_profile;         /* In LIF counting profile */
    324     int tunnel_term_ecn_map_id;         /* Tunnel termination ecn map id. */
    325     bcm_compat6515_qos_ingress_model_t ingress_qos_model; /* ingress qos and ttl model */
    326 } bcm_compat6515_tunnel_terminator_t;
    327 
    328 extern int bcm_compat6515_l2gre_tunnel_terminator_get(
    329     int unit,
    330     bcm_compat6515_tunnel_terminator_t *info);
    331 
    332 extern int bcm_compat6515_l2gre_tunnel_terminator_create(
    333     int unit,
    334     bcm_compat6515_tunnel_terminator_t *info);
    335 
    336 extern int bcm_compat6515_l2gre_tunnel_terminator_update(
    337     int unit,
    338     bcm_compat6515_tunnel_terminator_t *info);
    339 
    340 extern int bcm_compat6515_tunnel_terminator_add(
    341     int unit,
    342     bcm_compat6515_tunnel_terminator_t *info);
    343 
    344 extern int bcm_compat6515_tunnel_terminator_create(
    345     int unit,
    346     bcm_compat6515_tunnel_terminator_t *info);
    347 
    348 extern int bcm_compat6515_tunnel_terminator_delete(
    349     int unit,
    350     bcm_compat6515_tunnel_terminator_t *info);
    351 
    352 extern int bcm_compat6515_tunnel_terminator_update(
    353     int unit,
    354     bcm_compat6515_tunnel_terminator_t *info);
    355 
    356 extern int bcm_compat6515_tunnel_terminator_get(
    357     int unit,
    358     bcm_compat6515_tunnel_terminator_t *info);
    359 
    360 extern int bcm_compat6515_vxlan_tunnel_terminator_get(
    361     int unit,
    362     bcm_compat6515_tunnel_terminator_t *info);
    363 
    364 extern int bcm_compat6515_vxlan_tunnel_terminator_create(
    365     int unit,
    366     bcm_compat6515_tunnel_terminator_t *info);
    367 
    368 extern int bcm_compat6515_vxlan_tunnel_terminator_update(
    369     int unit,
    370     bcm_compat6515_tunnel_terminator_t *info);
    371 
    372 #endif /* INCLUDE_L3 */
    373 #endif /* BCM_RPC_SUPPORT */
    374 #endif /* !_COMPAT_6515_H */