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

ifa_msg.h (3984B)


      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  * File:    shr_ifa_msg.h
      8  */
      9 
     10 #ifndef SHR_IFA_MSG_H_
     11 #define SHR_IFA_MSG_H_
     12 
     13 #include <soc/shared/ifa.h>
     14 #include <soc/shared/shr_pkt.h>
     15 #include <shared/pack.h>
     16 
     17 #ifdef BCM_UKERNEL
     18 #define __COMPILER_ATTR__ __attribute__ ((packed, aligned(4)))
     19 #else
     20 #define __COMPILER_ATTR__
     21 #endif
     22 
     23 
     24 typedef struct __COMPILER_ATTR__ shr_ifa_msg_ctrl_init_s {
     25     /* Local RX DMA channel */
     26     uint32 rx_channel;
     27 
     28     /* Local TX DMA channel */
     29     uint32 tx_channel;
     30 
     31 } shr_ifa_msg_ctrl_init_t;
     32 
     33 /*
     34  * Create IFA collector information
     35  */
     36 typedef struct __COMPILER_ATTR__ shr_ifa_msg_ctrl_collector_info_s {
     37     /* Transport type */
     38     uint8 transport_type;
     39 
     40     /* L2 HDR information */
     41     uint32 outer_vlan_tag;
     42     uint32 inner_vlan_tag;
     43     uint16 outer_tpid;
     44     uint16 inner_tpid;
     45     uint8  vlan_tag_structure;
     46 
     47     /* Checksum of IP header excluding length */
     48     uint32 ip_base_checksum;
     49 
     50     /* UDP psuedo header checksum */
     51     uint32 udp_base_checksum;
     52 
     53     /* Length of the IFA encapsulation */
     54     uint16 encap_length;
     55 
     56     /* Max size of the packet that can be sent to collector */
     57     uint16 mtu;
     58 
     59     /* Offset to start of IP header in the encap */
     60     uint16 ip_offset;
     61 
     62     /* Offset to start of UDP header in the encap */
     63     uint16 udp_offset;
     64 
     65     /* Collector encapsulation */
     66     uint8 encap[SHR_IFA_MAX_COLLECTOR_ENCAP_LENGTH];
     67 } shr_ifa_msg_ctrl_collector_info_t;
     68 
     69 /*
     70  * Create IFA config information
     71  */
     72 typedef struct __COMPILER_ATTR__ shr_ifa_msg_ctrl_config_info_s {
     73     /* INT header ProbeMarkers Value. */
     74     uint32 probemarker_1;
     75     uint32 probemarker_2;
     76 
     77     /* In-band flow analyzer. Meta Data header Device ID */
     78     uint32 device_id;
     79 
     80     /* INT header Maximum payload. */
     81     uint16 max_payload_length;
     82 
     83     /* In-band flow analyzer Loopback ports for IFA E_APP in switch */
     84     uint16 lb_port_1;
     85     uint16 lb_port_2;
     86 
     87     /* Meta Data header Module ID */
     88     /* Module Id used to identify loopback source port information. */
     89     uint16 module_id;
     90 
     91     /* The Payload packet length that can be sent to this collector.*/
     92     uint16 rx_packet_payload_length;
     93 
     94     /* Option to send with recieved header */
     95     uint8 optional_headers;
     96 
     97     /* INT header Hop Limit. */
     98     uint8 hop_limit;
     99 
    100     /* Length of the IFA INT header encapsulation */
    101     uint16 int_encap_length;
    102 
    103     /* Length of the IFA LB header encapsulation */
    104     uint16 lb_encap_length;
    105 
    106     /* INT header encapsulation */
    107     uint8 int_encap[SHR_INT_HEADER_LENGTH];
    108 
    109     /* LoopBack header encapsulation */
    110     uint8 lb_encap[SHR_LB_HEADER_LENGTH];
    111 
    112 } shr_ifa_msg_ctrl_config_info_t;
    113 
    114 /*
    115  * Create IFA statistics information
    116  */
    117 typedef struct __COMPILER_ATTR__ shr_ifa_msg_ctrl_stat_info_s {
    118     /* Recieved packet count into the FW. */
    119     uint32 rx_pkt_cnt;
    120 
    121     /* Transmitted packet count form the FW */
    122     uint32 tx_pkt_cnt;
    123 
    124     /* Number of pkt dropped due to missing configuration. */
    125     uint32 ifa_no_config_drop;
    126 
    127     /* Number of pkt dropped due to missing collector configuration. */
    128     uint32 ifa_collector_not_present_drop;
    129 
    130     /* Number of pkt dropped due to Hop count and Hop limit are out of order. */
    131     uint32 ifa_hop_cnt_invalid_drop;
    132 
    133     /* Number of pkt dropped due to maximum length and current length are out of order. */
    134     uint32 ifa_int_hdr_len_invalid_drop;
    135 
    136     /* Number of pkt dropped due to invalid packet size. */
    137     uint32 ifa_pkt_size_invalid_drop;
    138 } shr_ifa_msg_ctrl_stat_info_t;
    139 
    140 /*
    141  *  IFA control messages
    142  */
    143 typedef union shr_ifa_msg_ctrl_s {
    144     shr_ifa_msg_ctrl_init_t                 ifa_init;
    145     shr_ifa_msg_ctrl_collector_info_t       ifa_collector_info;
    146     shr_ifa_msg_ctrl_config_info_t          ifa_config_info;
    147     shr_ifa_msg_ctrl_stat_info_t            ifa_stat_info;
    148 } shr_ifa_msg_ctrl_t;
    149 #endif /* SHR_IFA_MSG_H_ */