43#define TP_MIB_SIZE 0x5e
163 {
"tp_mib_mac_in_err_0", 0x0},
164 {
"tp_mib_mac_in_err_1", 0x1},
165 {
"tp_mib_mac_in_err_2", 0x2},
166 {
"tp_mib_mac_in_err_3", 0x3},
167 {
"tp_mib_hdr_in_err_0", 0x4},
168 {
"tp_mib_hdr_in_err_1", 0x5},
169 {
"tp_mib_hdr_in_err_2", 0x6},
170 {
"tp_mib_hdr_in_err_3", 0x7},
171 {
"tp_mib_tcp_in_err_0", 0x8},
172 {
"tp_mib_tcp_in_err_1", 0x9},
173 {
"tp_mib_tcp_in_err_2", 0xa},
174 {
"tp_mib_tcp_in_err_3", 0xb},
175 {
"tp_mib_tcp_out_rst", 0xc},
176 {
"tp_mib_tcp_in_seg_hi", 0x10},
177 {
"tp_mib_tcp_in_seg_lo", 0x11},
178 {
"tp_mib_tcp_out_seg_hi", 0x12},
179 {
"tp_mib_tcp_out_seg_lo", 0x13},
180 {
"tp_mib_tcp_rxt_seg_hi", 0x14},
181 {
"tp_mib_tcp_rxt_seg_lo", 0x15},
182 {
"tp_mib_tnl_cng_drop_0", 0x18},
183 {
"tp_mib_tnl_cng_drop_1", 0x19},
184 {
"tp_mib_tnl_cng_drop_2", 0x1a},
185 {
"tp_mib_tnl_cng_drop_3", 0x1b},
186 {
"tp_mib_ofd_chn_drop_0", 0x1c},
187 {
"tp_mib_ofd_chn_drop_1", 0x1d},
188 {
"tp_mib_ofd_chn_drop_2", 0x1e},
189 {
"tp_mib_ofd_chn_drop_3", 0x1f},
190 {
"tp_mib_tnl_out_pkt_0", 0x20},
191 {
"tp_mib_tnl_out_pkt_1", 0x21},
192 {
"tp_mib_tnl_out_pkt_2", 0x22},
193 {
"tp_mib_tnl_out_pkt_3", 0x23},
194 {
"tp_mib_tnl_in_pkt_0", 0x24},
195 {
"tp_mib_tnl_in_pkt_1", 0x25},
196 {
"tp_mib_tnl_in_pkt_2", 0x26},
197 {
"tp_mib_tnl_in_pkt_3", 0x27},
198 {
"tp_mib_tcp_v6in_err_0", 0x28},
199 {
"tp_mib_tcp_v6in_err_1", 0x29},
200 {
"tp_mib_tcp_v6in_err_2", 0x2a},
201 {
"tp_mib_tcp_v6in_err_3", 0x2b},
202 {
"tp_mib_tcp_v6out_rst", 0x2c},
203 {
"tp_mib_tcp_v6in_seg_hi", 0x30},
204 {
"tp_mib_tcp_v6in_seg_lo", 0x31},
205 {
"tp_mib_tcp_v6out_seg_hi", 0x32},
206 {
"tp_mib_tcp_v6out_seg_lo", 0x33},
207 {
"tp_mib_tcp_v6rxt_seg_hi", 0x34},
208 {
"tp_mib_tcp_v6rxt_seg_lo", 0x35},
209 {
"tp_mib_ofd_arp_drop", 0x36},
210 {
"tp_mib_ofd_dfr_drop", 0x37},
211 {
"tp_mib_cpl_in_req_0", 0x38},
212 {
"tp_mib_cpl_in_req_1", 0x39},
213 {
"tp_mib_cpl_in_req_2", 0x3a},
214 {
"tp_mib_cpl_in_req_3", 0x3b},
215 {
"tp_mib_cpl_out_rsp_0", 0x3c},
216 {
"tp_mib_cpl_out_rsp_1", 0x3d},
217 {
"tp_mib_cpl_out_rsp_2", 0x3e},
218 {
"tp_mib_cpl_out_rsp_3", 0x3f},
219 {
"tp_mib_tnl_lpbk_0", 0x40},
220 {
"tp_mib_tnl_lpbk_1", 0x41},
221 {
"tp_mib_tnl_lpbk_2", 0x42},
222 {
"tp_mib_tnl_lpbk_3", 0x43},
223 {
"tp_mib_tnl_drop_0", 0x44},
224 {
"tp_mib_tnl_drop_1", 0x45},
225 {
"tp_mib_tnl_drop_2", 0x46},
226 {
"tp_mib_tnl_drop_3", 0x47},
227 {
"tp_mib_fcoe_ddp_0", 0x48},
228 {
"tp_mib_fcoe_ddp_1", 0x49},
229 {
"tp_mib_fcoe_ddp_2", 0x4a},
230 {
"tp_mib_fcoe_ddp_3", 0x4b},
231 {
"tp_mib_fcoe_drop_0", 0x4c},
232 {
"tp_mib_fcoe_drop_1", 0x4d},
233 {
"tp_mib_fcoe_drop_2", 0x4e},
234 {
"tp_mib_fcoe_drop_3", 0x4f},
235 {
"tp_mib_fcoe_byte_0_hi", 0x50},
236 {
"tp_mib_fcoe_byte_0_lo", 0x51},
237 {
"tp_mib_fcoe_byte_1_hi", 0x52},
238 {
"tp_mib_fcoe_byte_1_lo", 0x53},
239 {
"tp_mib_fcoe_byte_2_hi", 0x54},
240 {
"tp_mib_fcoe_byte_2_lo", 0x55},
241 {
"tp_mib_fcoe_byte_3_hi", 0x56},
242 {
"tp_mib_fcoe_byte_3_lo", 0x57},
243 {
"tp_mib_ofd_vln_drop_0", 0x58},
244 {
"tp_mib_ofd_vln_drop_1", 0x59},
245 {
"tp_mib_ofd_vln_drop_2", 0x5a},
246 {
"tp_mib_ofd_vln_drop_3", 0x5b},
247 {
"tp_mib_usm_pkts", 0x5c},
248 {
"tp_mib_usm_drop", 0x5d},
249 {
"tp_mib_usm_bytes_hi", 0x5e},
250 {
"tp_mib_usm_bytes_lo", 0x5f},
251 {
"tp_mib_tid_del", 0x60},
252 {
"tp_mib_tid_inv", 0x61},
253 {
"tp_mib_tid_act", 0x62},
254 {
"tp_mib_tid_pas", 0x63},
255 {
"tp_mib_rqe_dfr_mod", 0x64},
256 {
"tp_mib_rqe_dfr_pkt", 0x65}
265 for (i = 0; i <= 15; i++) {
301 u32 Sge_Dbg[32] = {0};
314 offset = scratch_buff.
offset;
315 wtp = (
struct wtp_data *)((
char *)scratch_buff.
data + offset);
344 for (i = 0; i < 4; i++) {
373 for (i = 0; i < 4; i++) {
380 for (i = 0; i < 4; i++) {
381 value =
t4_read_reg(padap, 0x3081c + ((i * 4) << 12));
389 for (i = 0; i < 4; i++) {
390 value =
t4_read_reg(padap, 0x30a80 + ((i * 4) << 12));
491 for (i = 0; i < 4; i++) {
494 wtp->
utx_tp.
sop[i] = ((value >> 28) & 0xF);
495 wtp->
utx_tp.
eop[i] = ((value >> 24) & 0xF);
499 for (i = 0; i < 4; i++) {
514 for (i = 0; i < 4; i++) {
530 for (i = 0; i < 3; i++) {
537 for (i = 0; i < 3; i++) {
544 for (i = 0; i < 2; i++) {
555 for (i = 0; i < 2; i++) {
557 wtp->
tp_mps.
sop[(i*2)] = ((value >> 8) & 0xFF);
558 wtp->
tp_mps.
eop[(i*2)] = ((value >> 0) & 0xFF);
559 wtp->
tp_mps.
sop[(i*2) + 1] = ((value >> 24) & 0xFF);
561 wtp->
tp_mps.
eop[(i*2) + 1] = ((value >> 16) & 0xFF);
576 for (i = 0; i < 2; i++) {
578 wtp->
mps_xgm.
sop[(i*2)] = ((value >> 8) & 0xFF);
579 wtp->
mps_xgm.
eop[(i*2)] = ((value >> 0) & 0xFF);
580 wtp->
mps_xgm.
sop[(i*2) + 1] = ((value >> 24) & 0xFF);
582 wtp->
mps_xgm.
eop[(i*2) + 1] = ((value >> 16) & 0xFF);
585 for (i = 0; i < 4; i++) {
598 for (i = 0; i < 4; i++) {
611 for (i = 0; i < 4; i++) {
626 for (i = 0; i < 4; i++) {
640 for (i = 0; i < 8; i++) {
646 for (i = 0; i < 4; i++) {
649 drop += (value & 0xFFFF) + ((value >> 16) & 0xFFFF);
655 for (i = 0; i < 4; i++) {
695 for (i = 0; i < 4; i++) {
748 for (i = 0; i < 2; i++) {
751 wtp->
mps_tp.
sop[(i*2)] = ((value >> 8) & 0xFF);
752 wtp->
mps_tp.
eop[(i*2)] = ((value >> 0) & 0xFF);
753 wtp->
mps_tp.
sop[(i*2) + 1] = ((value >> 24) & 0xFF);
755 wtp->
mps_tp.
eop[(i*2) + 1] = ((value >> 16) & 0xFF);
779 for (i = 0; i < 4; i++) {
828 for (i = 0; i < 4; i++) {
837 for (i = 0; i < 4; i++) {
838 value =
t4_read_reg(padap, 0x30a88 + ((i * 4) << 12));
862 for (i = 0; i < 2; i++) {
886 for (i = 0; i < 4; i++) {
943 u32 Sge_Dbg[32] = {0};
956 offset = scratch_buff.
offset;
957 wtp = (
struct wtp_data *)((
char *)scratch_buff.
data + offset);
999 for (i = 0; i < 2; i++) {
1008 for (i = 0; i < 2; i++) {
1015 for (i = 0; i < 4; i++) {
1022 for (i = 0; i < 4; i++) {
1032 for (i = 0; i < 4; i++) {
1041 for (i = 0; i < 2; i++) {
1043 wtp->
tp_mps.
sop[(i*2)] = ((value >> 8) & 0xFF);
1044 wtp->
tp_mps.
eop[(i*2)] = ((value >> 0) & 0xFF);
1045 wtp->
tp_mps.
sop[(i*2) + 1] = ((value >> 24) & 0xFF);
1047 wtp->
tp_mps.
eop[(i*2) + 1] = ((value >> 16) & 0xFF);
1051 for (i = 0; i < 2; i++) {
1053 wtp->
mps_xgm.
sop[(i*2)] = ((value >> 8) & 0xFF);
1054 wtp->
mps_xgm.
eop[(i*2)] = ((value >> 0) & 0xFF);
1055 wtp->
mps_xgm.
sop[(i*2) + 1] = ((value >> 24) & 0xFF);
1057 wtp->
mps_xgm.
eop[(i*2) + 1] = ((value >> 16) & 0xFF);
1062 for (i = 0; i < 2; i++) {
1063 value =
t4_read_reg(padap, 0x3081c + ((i * 4) << 12));
1070 for (i = 0; i < 2; i++) {
1071 value =
t4_read_reg(padap, 0x30f20 + ((i * 4) << 12));
1078 for (i = 0; i < 2; i++) {
1079 value =
t4_read_reg(padap, 0x30f60 + ((i * 4) << 12));
1106 for (i = 0; i < 2; i++) {
1116 for (i = 0; i < 2; i++) {
1131 for (i = 0; i < 4; i++) {
1142 wtp->
mps_tp.
sop[0] = ((value >> 8) & 0xFF);
1143 wtp->
mps_tp.
eop[0] = ((value >> 0) & 0xFF);
1144 wtp->
mps_tp.
sop[1] = ((value >> 24) & 0xFF);
1145 wtp->
mps_tp.
eop[1] = ((value >> 16) & 0xFF);
1160 for (i = 0; i < 8; i++) {
1166 for (i = 0; i < 2; i++) {
1168 drop += (value & 0xFFFF) + ((value >> 16) & 0xFFFF);
1172 for (i = 0; i < 2; i++) {
1173 value =
t4_read_reg(padap, 0x30e20 + ((i * 4) << 12));
1179 for (i = 0; i < 2; i++) {
1180 value =
t4_read_reg(padap, 0x30e60 + ((i * 4) << 12));
1192 for (i = 0; i < 2; i++) {
1232 for (i = 0; i < 2; i++) {
1306 else if (
is_t6(padap))
static uint32_t t4_read_reg(struct adapter *sc, uint32_t reg)
static void t4_write_reg(struct adapter *sc, uint32_t reg, uint32_t val)
static int is_t6(struct adapter *adap)
void t4_tp_pio_read(struct adapter *adap, u32 *buff, u32 nregs, u32 start_index, bool sleep_ok)
void t4_tp_mib_read(struct adapter *adap, u32 *buff, u32 nregs, u32 start_index, bool sleep_ok)
static int is_t5(struct adapter *adap)
int get_scratch_buff(struct cudbg_buffer *pdbg_buff, u32 size, struct cudbg_buffer *pscratch_buff)
void release_scratch_buff(struct cudbg_buffer *pscratch_buff, struct cudbg_buffer *pdbg_buff)
int compress_buff(struct cudbg_buffer *, struct cudbg_buffer *)
int write_compression_hdr(struct cudbg_buffer *, struct cudbg_buffer *)
#define HTONL_NIBBLE(data)
int collect_wtp_data(struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
struct tp_mib_type tp_mib[]
static int t6_wtp_data(struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
static int t5_wtp_data(struct cudbg_init *pdbg_init, struct cudbg_buffer *dbg_buff, struct cudbg_error *cudbg_err)
static u32 read_sge_debug_data(struct cudbg_init *pdbg_init, u32 *sge_dbg_reg)
static u32 read_tp_mib_data(struct cudbg_init *pdbg_init, struct tp_mib_data **ppTp_Mib)
u32 debug_PD_Rsp_SOP0_cnt
u32 debug_PD_Req_EOP0_cnt
u32 debug_PD_Req_EOP2_cnt
u32 debug_PC_Req_SOP1_cnt
u32 debug_CPLSW_TP_Rx_SOP0_cnt
u32 debug_PC_Rsp_EOP0_cnt
u32 debug_PD_Req_SOP2_cnt
u32 debug_CPLSW_TP_Rx_SOP1_cnt
u32 debug_PD_Req_Int0_cnt
u32 debug_PD_Rsp_SOP2_cnt
u32 debug_PD_Rsp_EOP0_cnt
u32 debug_PD_Req_Int1_cnt
u32 debug_PC_Rsp_SOP0_cnt
u32 debug_PD_Rsp_EOP1_cnt
u32 debug_CPLSW_CIM_EOP1_cnt
u32 debug_CPLSW_TP_Rx_EOP0_cnt
u32 debug_PD_Req_EOP3_cnt
u32 debug_CPLSW_CIM_EOP0_cnt
u32 debug_PD_Req_SOP3_cnt
u32 debug_PD_Req_SOP1_cnt
u32 debug_PD_Req_SOP0_cnt
u32 debug_PC_Req_SOP0_cnt
u32 debug_PD_Req_Int3_cnt
u32 debug_CPLSW_TP_Rx_EOP1_cnt
u32 debug_PD_Rsp_EOP3_cnt
u32 debug_PC_Rsp_SOP1_cnt
u32 debug_PD_Req_Int2_cnt
u32 debug_PD_Rsp_SOP3_cnt
u32 debug_PD_Req_EOP1_cnt
u32 debug_CPLSW_CIM_SOP0_cnt
u32 debug_PC_Req_EOP1_cnt
u32 debug_PC_Req_EOP0_cnt
u32 debug_PC_Rsp_EOP1_cnt
u32 debug_CPLSW_CIM_SOP1_cnt
u32 debug_PD_Rsp_SOP1_cnt
u32 debug_PD_Rsp_EOP2_cnt
struct tp_mib_type TP_MIB_TNL_CNG_DROP_2
struct tp_mib_type TP_MIB_TNL_DROP_3
struct tp_mib_type TP_MIB_OFD_CHN_DROP_1
struct tp_mib_type TP_MIB_FCOE_DROP_3
struct tp_mib_type TP_MIB_OFD_CHN_DROP_2
struct tp_mib_type TP_MIB_TNL_CNG_DROP_0
struct tp_mib_type TP_MIB_TNL_CNG_DROP_3
struct tp_mib_type TP_MIB_TNL_CNG_DROP_1
struct tp_mib_type TP_MIB_FCOE_DROP_1
struct tp_mib_type TP_MIB_USM_DROP
struct tp_mib_type TP_MIB_OFD_DFR_DROP
struct tp_mib_type TP_MIB_OFD_VLN_DROP_2
struct tp_mib_type TP_MIB_OFD_CHN_DROP_3
struct tp_mib_type TP_MIB_TNL_DROP_1
struct tp_mib_type TP_MIB_OFD_ARP_DROP
struct tp_mib_type TP_MIB_OFD_VLN_DROP_1
struct tp_mib_type TP_MIB_TNL_DROP_0
struct tp_mib_type TP_MIB_OFD_VLN_DROP_0
struct tp_mib_type TP_MIB_OFD_CHN_DROP_0
struct tp_mib_type TP_MIB_OFD_VLN_DROP_3
struct tp_mib_type TP_MIB_TNL_DROP_2
struct tp_mib_type TP_MIB_FCOE_DROP_2
struct tp_mib_type TP_MIB_FCOE_DROP_0
struct wtp_type_2 sge_debug_data_high_index_6
struct wtp_type_1 sge_cim
struct wtp_type_2 sge_debug_data_high_indx7
struct wtp_type_2 pcie_cmd_stat2
struct wtp_type_2 sge_debug_data_high_index_3
struct wtp_type_2 rx_xgm_xgm
struct wtp_type_2 pcie_dma1_stat2_core
struct wtp_type_2 mac_porrx_aframestra_ok
struct wtp_type_1 mac_porrx_etherstatspkts
struct wtp_type_2 pcie_t5_dma_stat3
struct wtp_type_2 sge_pcie_dma_req
struct wtp_type_2 tpeside_pld
struct wtp_data::_xgm_mps xgm_mps
struct wtp_type_2 pcie_core_dmaw
struct wtp_type_2 tpcside_pm
struct wtp_type_2 utx_sge_dma_req
struct wtp_type_2 ulprx_tpcside
struct wtp_type_2 tpcside_rxcpl
struct wtp_type_1 core_pcie_cmd_rsp
struct wtp_type_2 tpcside_uturn
struct wtp_type_1 pcie_core_cmd_req
struct wtp_type_2 mps_tpeside
struct wtp_type_1 sge_debug_data_high_indx9
struct wtp_type_1 sge_debug_data_high_indx1
struct wtp_type_2 pcie_core_dmai
struct wtp_type_2 pcie_sge_dma_rsp
struct wtp_type_2 pcie_dma1_stat2
struct wtp_type_2 tpcside_txcpl
struct wtp_type_2 tpeside_mps
struct wtp_type_2 mac_portx_pkt_count
struct wtp_type_2 sge_pcie
struct wtp_type_2 tpeside_pm
struct wtp_type_1 mac_portx_etherstatspkts
struct wtp_type_2 wire_xgm
struct wtp_type_2 core_pcie_dma_rsp
struct wtp_type_2 pmrx_ulprx
struct wtp_type_1 pcie_sge_cmd_rsp
struct wtp_type_2 tpcside_rxarb
struct wtp_type_0 le_db_rsp_cnt
struct wtp_type_1 utx_tpcside_tx
struct wtp_type_1 sge_work_req_pkt
struct wtp_type_1 csw_sge
struct wtp_type_2 pcie_cmd_stat3
struct wtp_type_3 mps_xgm
struct wtp_type_2 pcie_core_dma_req
struct wtp_type_2 tp_dbg_eside_pktx
struct wtp_type_2 ulp_se_cnt_chx
struct wtp_type_1 sge_pcie_cmd_req
struct wtp_type_2 mac_portx_aframestra_ok
struct wtp_type_2 utx_tpcside
struct wtp_type_2 mac_porrx_pkt_count
struct wtp_type_2 tpcside_rxpld
struct wtp_type_2 xgm_wire
struct wtp_type_2 tpcside_csw
struct wtp_type_2 sge_utx
struct wtp_type_2 tx_xgm_xgm
struct wtp_type_2 sge_pcie_ints
#define A_SGE_DEBUG_DATA_LOW
#define A_MPS_STAT_RX_BG_0_LB_TRUNC_FRAME_L
#define A_MPS_TX_SE_CNT_MAC01
#define A_SGE_DEBUG_DATA_HIGH_INDEX_3
#define A_MPS_PORT_STAT_RX_PORT_SYM_ERROR_L
#define A_SGE_DEBUG_DATA_HIGH_INDEX_9
#define A_SGE_DEBUG_DATA_HIGH_INDEX_7
#define A_PCIE_DMAR_REQ_CNT
#define A_MPS_STAT_RX_BG_0_MAC_DROP_FRAME_L
#define A_SGE_DEBUG_DATA_HIGH_INDEX_6
#define A_MPS_PORT_STAT_RX_PORT_LEN_ERROR_L
#define A_PCIE_T5_DMA_STAT2
#define A_SGE_DEBUG_INDEX
#define A_PCIE_CMDR_REQ_CNT
#define A_PCIE_DMAR_RSP_EOP_CNT
#define A_MPS_STAT_RX_BG_0_MAC_TRUNC_FRAME_L
#define A_MPS_STAT_RX_BG_0_LB_DROP_FRAME_L
#define A_PCIE_CMDR_RSP_CNT
#define A_SGE_DEBUG_DATA_HIGH
#define A_MPS_PORT_STAT_RX_PORT_MTU_CRC_ERROR_L
#define A_MPS_PORT_STAT_RX_PORT_MTU_ERROR_L
#define A_TP_DBG_ESIDE_PKT0
#define A_MPS_PORT_STAT_RX_PORT_LESS_64B_L
#define A_PCIE_DMAR_RSP_SOP_CNT
#define A_TP_DBG_CSIDE_RX0
#define A_ULP_TX_SE_CNT_CH0
#define A_SGE_DEBUG_DATA_HIGH_INDEX_1
#define A_MPS_RX_SE_CNT_IN0
#define A_MAC_PORT_AFRAMESRECEIVEDOK
#define A_MPS_PORT_STAT_TX_PORT_DROP_L
#define A_PCIE_T5_CMD_STAT2
#define A_LE_DB_REQ_RSP_CNT
#define A_PCIE_T5_DMA_STAT3
#define A_MPS_PORT_STAT_RX_PORT_CRC_ERROR_L
#define A_MAC_PORT_PKT_COUNT
#define A_TP_DBG_CSIDE_TX0
#define A_MPS_TX_SE_CNT_TP01
#define A_PCIE_DMAW_SOP_CNT
#define A_MPS_PORT_STAT_LB_PORT_DROP_FRAMES
#define A_MPS_RX_SE_CNT_OUT01
#define A_PCIE_T5_CMD_STAT3
#define A_ULP_RX_SE_CNT_CH0
#define A_MAC_PORT_AFRAMESTRANSMITTEDOK
#define A_PCIE_DMAW_EOP_CNT
#define T5_PORT0_REG(reg_addr)
#define A_MPS_RX_CLS_DROP_CNT0