0001
0002
0003
0004
0005
0006
0007
0008 #ifndef IB_PMA_H
0009 #define IB_PMA_H
0010
0011 #include <rdma/ib_mad.h>
0012
0013
0014
0015
0016 #define IB_PMA_CLASS_CAP_ALLPORTSELECT cpu_to_be16(1 << 8)
0017 #define IB_PMA_CLASS_CAP_EXT_WIDTH cpu_to_be16(1 << 9)
0018 #define IB_PMA_CLASS_CAP_EXT_WIDTH_NOIETF cpu_to_be16(1 << 10)
0019 #define IB_PMA_CLASS_CAP_XMIT_WAIT cpu_to_be16(1 << 12)
0020
0021 #define IB_PMA_CLASS_PORT_INFO cpu_to_be16(0x0001)
0022 #define IB_PMA_PORT_SAMPLES_CONTROL cpu_to_be16(0x0010)
0023 #define IB_PMA_PORT_SAMPLES_RESULT cpu_to_be16(0x0011)
0024 #define IB_PMA_PORT_COUNTERS cpu_to_be16(0x0012)
0025 #define IB_PMA_PORT_COUNTERS_EXT cpu_to_be16(0x001D)
0026 #define IB_PMA_PORT_SAMPLES_RESULT_EXT cpu_to_be16(0x001E)
0027
0028 struct ib_pma_mad {
0029 struct ib_mad_hdr mad_hdr;
0030 u8 reserved[40];
0031 u8 data[192];
0032 } __packed;
0033
0034 struct ib_pma_portsamplescontrol {
0035 u8 opcode;
0036 u8 port_select;
0037 u8 tick;
0038 u8 counter_width;
0039 __be32 counter_mask0_9;
0040 __be16 counter_mask10_14;
0041 u8 sample_mechanisms;
0042 u8 sample_status;
0043 __be64 option_mask;
0044 __be64 vendor_mask;
0045 __be32 sample_start;
0046 __be32 sample_interval;
0047 __be16 tag;
0048 __be16 counter_select[15];
0049 __be32 reserved1;
0050 __be64 samples_only_option_mask;
0051 __be32 reserved2[28];
0052 };
0053
0054 struct ib_pma_portsamplesresult {
0055 __be16 tag;
0056 __be16 sample_status;
0057 __be32 counter[15];
0058 };
0059
0060 struct ib_pma_portsamplesresult_ext {
0061 __be16 tag;
0062 __be16 sample_status;
0063 __be32 extended_width;
0064 __be64 counter[15];
0065 };
0066
0067 struct ib_pma_portcounters {
0068 u8 reserved;
0069 u8 port_select;
0070 __be16 counter_select;
0071 __be16 symbol_error_counter;
0072 u8 link_error_recovery_counter;
0073 u8 link_downed_counter;
0074 __be16 port_rcv_errors;
0075 __be16 port_rcv_remphys_errors;
0076 __be16 port_rcv_switch_relay_errors;
0077 __be16 port_xmit_discards;
0078 u8 port_xmit_constraint_errors;
0079 u8 port_rcv_constraint_errors;
0080 u8 reserved1;
0081 u8 link_overrun_errors;
0082 __be16 reserved2;
0083 __be16 vl15_dropped;
0084 __be32 port_xmit_data;
0085 __be32 port_rcv_data;
0086 __be32 port_xmit_packets;
0087 __be32 port_rcv_packets;
0088 __be32 port_xmit_wait;
0089 } __packed;
0090
0091
0092 #define IB_PMA_SEL_SYMBOL_ERROR cpu_to_be16(0x0001)
0093 #define IB_PMA_SEL_LINK_ERROR_RECOVERY cpu_to_be16(0x0002)
0094 #define IB_PMA_SEL_LINK_DOWNED cpu_to_be16(0x0004)
0095 #define IB_PMA_SEL_PORT_RCV_ERRORS cpu_to_be16(0x0008)
0096 #define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS cpu_to_be16(0x0010)
0097 #define IB_PMA_SEL_PORT_XMIT_DISCARDS cpu_to_be16(0x0040)
0098 #define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS cpu_to_be16(0x0200)
0099 #define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS cpu_to_be16(0x0400)
0100 #define IB_PMA_SEL_PORT_VL15_DROPPED cpu_to_be16(0x0800)
0101 #define IB_PMA_SEL_PORT_XMIT_DATA cpu_to_be16(0x1000)
0102 #define IB_PMA_SEL_PORT_RCV_DATA cpu_to_be16(0x2000)
0103 #define IB_PMA_SEL_PORT_XMIT_PACKETS cpu_to_be16(0x4000)
0104 #define IB_PMA_SEL_PORT_RCV_PACKETS cpu_to_be16(0x8000)
0105
0106 struct ib_pma_portcounters_ext {
0107 u8 reserved;
0108 u8 port_select;
0109 __be16 counter_select;
0110 __be32 reserved1;
0111 __be64 port_xmit_data;
0112 __be64 port_rcv_data;
0113 __be64 port_xmit_packets;
0114 __be64 port_rcv_packets;
0115 __be64 port_unicast_xmit_packets;
0116 __be64 port_unicast_rcv_packets;
0117 __be64 port_multicast_xmit_packets;
0118 __be64 port_multicast_rcv_packets;
0119 } __packed;
0120
0121 #define IB_PMA_SELX_PORT_XMIT_DATA cpu_to_be16(0x0001)
0122 #define IB_PMA_SELX_PORT_RCV_DATA cpu_to_be16(0x0002)
0123 #define IB_PMA_SELX_PORT_XMIT_PACKETS cpu_to_be16(0x0004)
0124 #define IB_PMA_SELX_PORT_RCV_PACKETS cpu_to_be16(0x0008)
0125 #define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS cpu_to_be16(0x0010)
0126 #define IB_PMA_SELX_PORT_UNI_RCV_PACKETS cpu_to_be16(0x0020)
0127 #define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS cpu_to_be16(0x0040)
0128 #define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS cpu_to_be16(0x0080)
0129
0130 #endif