|
@@ -129,6 +129,108 @@ int cudbg_collect_fw_devlog(struct cudbg_init *pdbg_init,
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
+int cudbg_collect_cim_la(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ int size, rc;
|
|
|
+ u32 cfg = 0;
|
|
|
+
|
|
|
+ if (is_t6(padap->params.chip)) {
|
|
|
+ size = padap->params.cim_la_size / 10 + 1;
|
|
|
+ size *= 11 * sizeof(u32);
|
|
|
+ } else {
|
|
|
+ size = padap->params.cim_la_size / 8;
|
|
|
+ size *= 8 * sizeof(u32);
|
|
|
+ }
|
|
|
+
|
|
|
+ size += sizeof(cfg);
|
|
|
+ rc = cudbg_get_buff(dbg_buff, size, &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ rc = t4_cim_read(padap, UP_UP_DBG_LA_CFG_A, 1, &cfg);
|
|
|
+ if (rc) {
|
|
|
+ cudbg_err->sys_err = rc;
|
|
|
+ cudbg_put_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+ }
|
|
|
+
|
|
|
+ memcpy((char *)temp_buff.data, &cfg, sizeof(cfg));
|
|
|
+ rc = t4_cim_read_la(padap,
|
|
|
+ (u32 *)((char *)temp_buff.data + sizeof(cfg)),
|
|
|
+ NULL);
|
|
|
+ if (rc < 0) {
|
|
|
+ cudbg_err->sys_err = rc;
|
|
|
+ cudbg_put_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+ }
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+int cudbg_collect_cim_ma_la(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ int size, rc;
|
|
|
+
|
|
|
+ size = 2 * CIM_MALA_SIZE * 5 * sizeof(u32);
|
|
|
+ rc = cudbg_get_buff(dbg_buff, size, &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ t4_cim_read_ma_la(padap,
|
|
|
+ (u32 *)temp_buff.data,
|
|
|
+ (u32 *)((char *)temp_buff.data +
|
|
|
+ 5 * CIM_MALA_SIZE));
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+int cudbg_collect_cim_qcfg(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ struct cudbg_cim_qcfg *cim_qcfg_data;
|
|
|
+ int rc;
|
|
|
+
|
|
|
+ rc = cudbg_get_buff(dbg_buff, sizeof(struct cudbg_cim_qcfg),
|
|
|
+ &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ cim_qcfg_data = (struct cudbg_cim_qcfg *)temp_buff.data;
|
|
|
+ cim_qcfg_data->chip = padap->params.chip;
|
|
|
+ rc = t4_cim_read(padap, UP_IBQ_0_RDADDR_A,
|
|
|
+ ARRAY_SIZE(cim_qcfg_data->stat), cim_qcfg_data->stat);
|
|
|
+ if (rc) {
|
|
|
+ cudbg_err->sys_err = rc;
|
|
|
+ cudbg_put_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+ }
|
|
|
+
|
|
|
+ rc = t4_cim_read(padap, UP_OBQ_0_REALADDR_A,
|
|
|
+ ARRAY_SIZE(cim_qcfg_data->obq_wr),
|
|
|
+ cim_qcfg_data->obq_wr);
|
|
|
+ if (rc) {
|
|
|
+ cudbg_err->sys_err = rc;
|
|
|
+ cudbg_put_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+ }
|
|
|
+
|
|
|
+ t4_read_cimq_cfg(padap, cim_qcfg_data->base, cim_qcfg_data->size,
|
|
|
+ cim_qcfg_data->thres);
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
static int cudbg_read_cim_ibq(struct cudbg_init *pdbg_init,
|
|
|
struct cudbg_buffer *dbg_buff,
|
|
|
struct cudbg_error *cudbg_err, int qid)
|
|
@@ -426,6 +528,115 @@ int cudbg_collect_edc1_meminfo(struct cudbg_init *pdbg_init,
|
|
|
MEM_EDC1);
|
|
|
}
|
|
|
|
|
|
+int cudbg_collect_rss(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ int rc;
|
|
|
+
|
|
|
+ rc = cudbg_get_buff(dbg_buff, RSS_NENTRIES * sizeof(u16), &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ rc = t4_read_rss(padap, (u16 *)temp_buff.data);
|
|
|
+ if (rc) {
|
|
|
+ cudbg_err->sys_err = rc;
|
|
|
+ cudbg_put_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+ }
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+int cudbg_collect_rss_vf_config(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ struct cudbg_rss_vf_conf *vfconf;
|
|
|
+ int vf, rc, vf_count;
|
|
|
+
|
|
|
+ vf_count = padap->params.arch.vfcount;
|
|
|
+ rc = cudbg_get_buff(dbg_buff,
|
|
|
+ vf_count * sizeof(struct cudbg_rss_vf_conf),
|
|
|
+ &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ vfconf = (struct cudbg_rss_vf_conf *)temp_buff.data;
|
|
|
+ for (vf = 0; vf < vf_count; vf++)
|
|
|
+ t4_read_rss_vf_config(padap, vf, &vfconf[vf].rss_vf_vfl,
|
|
|
+ &vfconf[vf].rss_vf_vfh, true);
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+int cudbg_collect_path_mtu(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ int rc;
|
|
|
+
|
|
|
+ rc = cudbg_get_buff(dbg_buff, NMTUS * sizeof(u16), &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ t4_read_mtu_tbl(padap, (u16 *)temp_buff.data, NULL);
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+int cudbg_collect_pm_stats(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ struct cudbg_pm_stats *pm_stats_buff;
|
|
|
+ int rc;
|
|
|
+
|
|
|
+ rc = cudbg_get_buff(dbg_buff, sizeof(struct cudbg_pm_stats),
|
|
|
+ &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ pm_stats_buff = (struct cudbg_pm_stats *)temp_buff.data;
|
|
|
+ t4_pmtx_get_stats(padap, pm_stats_buff->tx_cnt, pm_stats_buff->tx_cyc);
|
|
|
+ t4_pmrx_get_stats(padap, pm_stats_buff->rx_cnt, pm_stats_buff->rx_cyc);
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+int cudbg_collect_hw_sched(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ struct cudbg_hw_sched *hw_sched_buff;
|
|
|
+ int i, rc = 0;
|
|
|
+
|
|
|
+ if (!padap->params.vpd.cclk)
|
|
|
+ return CUDBG_STATUS_CCLK_NOT_DEFINED;
|
|
|
+
|
|
|
+ rc = cudbg_get_buff(dbg_buff, sizeof(struct cudbg_hw_sched),
|
|
|
+ &temp_buff);
|
|
|
+ hw_sched_buff = (struct cudbg_hw_sched *)temp_buff.data;
|
|
|
+ hw_sched_buff->map = t4_read_reg(padap, TP_TX_MOD_QUEUE_REQ_MAP_A);
|
|
|
+ hw_sched_buff->mode = TIMERMODE_G(t4_read_reg(padap, TP_MOD_CONFIG_A));
|
|
|
+ t4_read_pace_tbl(padap, hw_sched_buff->pace_tab);
|
|
|
+ for (i = 0; i < NTX_SCHED; ++i)
|
|
|
+ t4_get_tx_sched(padap, i, &hw_sched_buff->kbps[i],
|
|
|
+ &hw_sched_buff->ipg[i], true);
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
int cudbg_collect_tp_indirect(struct cudbg_init *pdbg_init,
|
|
|
struct cudbg_buffer *dbg_buff,
|
|
|
struct cudbg_error *cudbg_err)
|
|
@@ -574,6 +785,121 @@ int cudbg_collect_sge_indirect(struct cudbg_init *pdbg_init,
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
+int cudbg_collect_ulprx_la(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ struct cudbg_ulprx_la *ulprx_la_buff;
|
|
|
+ int rc;
|
|
|
+
|
|
|
+ rc = cudbg_get_buff(dbg_buff, sizeof(struct cudbg_ulprx_la),
|
|
|
+ &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ ulprx_la_buff = (struct cudbg_ulprx_la *)temp_buff.data;
|
|
|
+ t4_ulprx_read_la(padap, (u32 *)ulprx_la_buff->data);
|
|
|
+ ulprx_la_buff->size = ULPRX_LA_SIZE;
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+int cudbg_collect_tp_la(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ struct cudbg_tp_la *tp_la_buff;
|
|
|
+ int size, rc;
|
|
|
+
|
|
|
+ size = sizeof(struct cudbg_tp_la) + TPLA_SIZE * sizeof(u64);
|
|
|
+ rc = cudbg_get_buff(dbg_buff, size, &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ tp_la_buff = (struct cudbg_tp_la *)temp_buff.data;
|
|
|
+ tp_la_buff->mode = DBGLAMODE_G(t4_read_reg(padap, TP_DBG_LA_CONFIG_A));
|
|
|
+ t4_tp_read_la(padap, (u64 *)tp_la_buff->data, NULL);
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+int cudbg_collect_cim_pif_la(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct cudbg_cim_pif_la *cim_pif_la_buff;
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ int size, rc;
|
|
|
+
|
|
|
+ size = sizeof(struct cudbg_cim_pif_la) +
|
|
|
+ 2 * CIM_PIFLA_SIZE * 6 * sizeof(u32);
|
|
|
+ rc = cudbg_get_buff(dbg_buff, size, &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ cim_pif_la_buff = (struct cudbg_cim_pif_la *)temp_buff.data;
|
|
|
+ cim_pif_la_buff->size = CIM_PIFLA_SIZE;
|
|
|
+ t4_cim_read_pif_la(padap, (u32 *)cim_pif_la_buff->data,
|
|
|
+ (u32 *)cim_pif_la_buff->data + 6 * CIM_PIFLA_SIZE,
|
|
|
+ NULL, NULL);
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+int cudbg_collect_clk_info(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ struct cudbg_clk_info *clk_info_buff;
|
|
|
+ u64 tp_tick_us;
|
|
|
+ int rc;
|
|
|
+
|
|
|
+ if (!padap->params.vpd.cclk)
|
|
|
+ return CUDBG_STATUS_CCLK_NOT_DEFINED;
|
|
|
+
|
|
|
+ rc = cudbg_get_buff(dbg_buff, sizeof(struct cudbg_clk_info),
|
|
|
+ &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ clk_info_buff = (struct cudbg_clk_info *)temp_buff.data;
|
|
|
+ clk_info_buff->cclk_ps = 1000000000 / padap->params.vpd.cclk; /* psec */
|
|
|
+ clk_info_buff->res = t4_read_reg(padap, TP_TIMER_RESOLUTION_A);
|
|
|
+ clk_info_buff->tre = TIMERRESOLUTION_G(clk_info_buff->res);
|
|
|
+ clk_info_buff->dack_re = DELAYEDACKRESOLUTION_G(clk_info_buff->res);
|
|
|
+ tp_tick_us = (clk_info_buff->cclk_ps << clk_info_buff->tre) / 1000000;
|
|
|
+
|
|
|
+ clk_info_buff->dack_timer =
|
|
|
+ (clk_info_buff->cclk_ps << clk_info_buff->dack_re) / 1000000 *
|
|
|
+ t4_read_reg(padap, TP_DACK_TIMER_A);
|
|
|
+ clk_info_buff->retransmit_min =
|
|
|
+ tp_tick_us * t4_read_reg(padap, TP_RXT_MIN_A);
|
|
|
+ clk_info_buff->retransmit_max =
|
|
|
+ tp_tick_us * t4_read_reg(padap, TP_RXT_MAX_A);
|
|
|
+ clk_info_buff->persist_timer_min =
|
|
|
+ tp_tick_us * t4_read_reg(padap, TP_PERS_MIN_A);
|
|
|
+ clk_info_buff->persist_timer_max =
|
|
|
+ tp_tick_us * t4_read_reg(padap, TP_PERS_MAX_A);
|
|
|
+ clk_info_buff->keepalive_idle_timer =
|
|
|
+ tp_tick_us * t4_read_reg(padap, TP_KEEP_IDLE_A);
|
|
|
+ clk_info_buff->keepalive_interval =
|
|
|
+ tp_tick_us * t4_read_reg(padap, TP_KEEP_INTVL_A);
|
|
|
+ clk_info_buff->initial_srtt =
|
|
|
+ tp_tick_us * INITSRTT_G(t4_read_reg(padap, TP_INIT_SRTT_A));
|
|
|
+ clk_info_buff->finwait2_timer =
|
|
|
+ tp_tick_us * t4_read_reg(padap, TP_FINWAIT2_TIMER_A);
|
|
|
+
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
int cudbg_collect_pcie_indirect(struct cudbg_init *pdbg_init,
|
|
|
struct cudbg_buffer *dbg_buff,
|
|
|
struct cudbg_error *cudbg_err)
|
|
@@ -688,6 +1014,323 @@ int cudbg_collect_pm_indirect(struct cudbg_init *pdbg_init,
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
+int cudbg_collect_tid(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_tid_info_region_rev1 *tid1;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ struct cudbg_tid_info_region *tid;
|
|
|
+ u32 para[2], val[2];
|
|
|
+ int rc;
|
|
|
+
|
|
|
+ rc = cudbg_get_buff(dbg_buff, sizeof(struct cudbg_tid_info_region_rev1),
|
|
|
+ &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ tid1 = (struct cudbg_tid_info_region_rev1 *)temp_buff.data;
|
|
|
+ tid = &tid1->tid;
|
|
|
+ tid1->ver_hdr.signature = CUDBG_ENTITY_SIGNATURE;
|
|
|
+ tid1->ver_hdr.revision = CUDBG_TID_INFO_REV;
|
|
|
+ tid1->ver_hdr.size = sizeof(struct cudbg_tid_info_region_rev1) -
|
|
|
+ sizeof(struct cudbg_ver_hdr);
|
|
|
+
|
|
|
+#define FW_PARAM_PFVF_A(param) \
|
|
|
+ (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_PFVF) | \
|
|
|
+ FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_PFVF_##param) | \
|
|
|
+ FW_PARAMS_PARAM_Y_V(0) | \
|
|
|
+ FW_PARAMS_PARAM_Z_V(0))
|
|
|
+
|
|
|
+ para[0] = FW_PARAM_PFVF_A(ETHOFLD_START);
|
|
|
+ para[1] = FW_PARAM_PFVF_A(ETHOFLD_END);
|
|
|
+ rc = t4_query_params(padap, padap->mbox, padap->pf, 0, 2, para, val);
|
|
|
+ if (rc < 0) {
|
|
|
+ cudbg_err->sys_err = rc;
|
|
|
+ cudbg_put_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+ }
|
|
|
+ tid->uotid_base = val[0];
|
|
|
+ tid->nuotids = val[1] - val[0] + 1;
|
|
|
+
|
|
|
+ if (is_t5(padap->params.chip)) {
|
|
|
+ tid->sb = t4_read_reg(padap, LE_DB_SERVER_INDEX_A) / 4;
|
|
|
+ } else if (is_t6(padap->params.chip)) {
|
|
|
+ tid1->tid_start =
|
|
|
+ t4_read_reg(padap, LE_DB_ACTIVE_TABLE_START_INDEX_A);
|
|
|
+ tid->sb = t4_read_reg(padap, LE_DB_SRVR_START_INDEX_A);
|
|
|
+
|
|
|
+ para[0] = FW_PARAM_PFVF_A(HPFILTER_START);
|
|
|
+ para[1] = FW_PARAM_PFVF_A(HPFILTER_END);
|
|
|
+ rc = t4_query_params(padap, padap->mbox, padap->pf, 0, 2,
|
|
|
+ para, val);
|
|
|
+ if (rc < 0) {
|
|
|
+ cudbg_err->sys_err = rc;
|
|
|
+ cudbg_put_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+ }
|
|
|
+ tid->hpftid_base = val[0];
|
|
|
+ tid->nhpftids = val[1] - val[0] + 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ tid->ntids = padap->tids.ntids;
|
|
|
+ tid->nstids = padap->tids.nstids;
|
|
|
+ tid->stid_base = padap->tids.stid_base;
|
|
|
+ tid->hash_base = padap->tids.hash_base;
|
|
|
+
|
|
|
+ tid->natids = padap->tids.natids;
|
|
|
+ tid->nftids = padap->tids.nftids;
|
|
|
+ tid->ftid_base = padap->tids.ftid_base;
|
|
|
+ tid->aftid_base = padap->tids.aftid_base;
|
|
|
+ tid->aftid_end = padap->tids.aftid_end;
|
|
|
+
|
|
|
+ tid->sftid_base = padap->tids.sftid_base;
|
|
|
+ tid->nsftids = padap->tids.nsftids;
|
|
|
+
|
|
|
+ tid->flags = padap->flags;
|
|
|
+ tid->le_db_conf = t4_read_reg(padap, LE_DB_CONFIG_A);
|
|
|
+ tid->ip_users = t4_read_reg(padap, LE_DB_ACT_CNT_IPV4_A);
|
|
|
+ tid->ipv6_users = t4_read_reg(padap, LE_DB_ACT_CNT_IPV6_A);
|
|
|
+
|
|
|
+#undef FW_PARAM_PFVF_A
|
|
|
+
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+static inline void cudbg_tcamxy2valmask(u64 x, u64 y, u8 *addr, u64 *mask)
|
|
|
+{
|
|
|
+ *mask = x | y;
|
|
|
+ y = (__force u64)cpu_to_be64(y);
|
|
|
+ memcpy(addr, (char *)&y + 2, ETH_ALEN);
|
|
|
+}
|
|
|
+
|
|
|
+static void cudbg_mps_rpl_backdoor(struct adapter *padap,
|
|
|
+ struct fw_ldst_mps_rplc *mps_rplc)
|
|
|
+{
|
|
|
+ if (is_t5(padap->params.chip)) {
|
|
|
+ mps_rplc->rplc255_224 = htonl(t4_read_reg(padap,
|
|
|
+ MPS_VF_RPLCT_MAP3_A));
|
|
|
+ mps_rplc->rplc223_192 = htonl(t4_read_reg(padap,
|
|
|
+ MPS_VF_RPLCT_MAP2_A));
|
|
|
+ mps_rplc->rplc191_160 = htonl(t4_read_reg(padap,
|
|
|
+ MPS_VF_RPLCT_MAP1_A));
|
|
|
+ mps_rplc->rplc159_128 = htonl(t4_read_reg(padap,
|
|
|
+ MPS_VF_RPLCT_MAP0_A));
|
|
|
+ } else {
|
|
|
+ mps_rplc->rplc255_224 = htonl(t4_read_reg(padap,
|
|
|
+ MPS_VF_RPLCT_MAP7_A));
|
|
|
+ mps_rplc->rplc223_192 = htonl(t4_read_reg(padap,
|
|
|
+ MPS_VF_RPLCT_MAP6_A));
|
|
|
+ mps_rplc->rplc191_160 = htonl(t4_read_reg(padap,
|
|
|
+ MPS_VF_RPLCT_MAP5_A));
|
|
|
+ mps_rplc->rplc159_128 = htonl(t4_read_reg(padap,
|
|
|
+ MPS_VF_RPLCT_MAP4_A));
|
|
|
+ }
|
|
|
+ mps_rplc->rplc127_96 = htonl(t4_read_reg(padap, MPS_VF_RPLCT_MAP3_A));
|
|
|
+ mps_rplc->rplc95_64 = htonl(t4_read_reg(padap, MPS_VF_RPLCT_MAP2_A));
|
|
|
+ mps_rplc->rplc63_32 = htonl(t4_read_reg(padap, MPS_VF_RPLCT_MAP1_A));
|
|
|
+ mps_rplc->rplc31_0 = htonl(t4_read_reg(padap, MPS_VF_RPLCT_MAP0_A));
|
|
|
+}
|
|
|
+
|
|
|
+static int cudbg_collect_tcam_index(struct adapter *padap,
|
|
|
+ struct cudbg_mps_tcam *tcam, u32 idx)
|
|
|
+{
|
|
|
+ u64 tcamy, tcamx, val;
|
|
|
+ u32 ctl, data2;
|
|
|
+ int rc = 0;
|
|
|
+
|
|
|
+ if (CHELSIO_CHIP_VERSION(padap->params.chip) >= CHELSIO_T6) {
|
|
|
+ /* CtlReqID - 1: use Host Driver Requester ID
|
|
|
+ * CtlCmdType - 0: Read, 1: Write
|
|
|
+ * CtlTcamSel - 0: TCAM0, 1: TCAM1
|
|
|
+ * CtlXYBitSel- 0: Y bit, 1: X bit
|
|
|
+ */
|
|
|
+
|
|
|
+ /* Read tcamy */
|
|
|
+ ctl = CTLREQID_V(1) | CTLCMDTYPE_V(0) | CTLXYBITSEL_V(0);
|
|
|
+ if (idx < 256)
|
|
|
+ ctl |= CTLTCAMINDEX_V(idx) | CTLTCAMSEL_V(0);
|
|
|
+ else
|
|
|
+ ctl |= CTLTCAMINDEX_V(idx - 256) | CTLTCAMSEL_V(1);
|
|
|
+
|
|
|
+ t4_write_reg(padap, MPS_CLS_TCAM_DATA2_CTL_A, ctl);
|
|
|
+ val = t4_read_reg(padap, MPS_CLS_TCAM_RDATA1_REQ_ID1_A);
|
|
|
+ tcamy = DMACH_G(val) << 32;
|
|
|
+ tcamy |= t4_read_reg(padap, MPS_CLS_TCAM_RDATA0_REQ_ID1_A);
|
|
|
+ data2 = t4_read_reg(padap, MPS_CLS_TCAM_RDATA2_REQ_ID1_A);
|
|
|
+ tcam->lookup_type = DATALKPTYPE_G(data2);
|
|
|
+
|
|
|
+ /* 0 - Outer header, 1 - Inner header
|
|
|
+ * [71:48] bit locations are overloaded for
|
|
|
+ * outer vs. inner lookup types.
|
|
|
+ */
|
|
|
+ if (tcam->lookup_type && tcam->lookup_type != DATALKPTYPE_M) {
|
|
|
+ /* Inner header VNI */
|
|
|
+ tcam->vniy = (data2 & DATAVIDH2_F) | DATAVIDH1_G(data2);
|
|
|
+ tcam->vniy = (tcam->vniy << 16) | VIDL_G(val);
|
|
|
+ tcam->dip_hit = data2 & DATADIPHIT_F;
|
|
|
+ } else {
|
|
|
+ tcam->vlan_vld = data2 & DATAVIDH2_F;
|
|
|
+ tcam->ivlan = VIDL_G(val);
|
|
|
+ }
|
|
|
+
|
|
|
+ tcam->port_num = DATAPORTNUM_G(data2);
|
|
|
+
|
|
|
+ /* Read tcamx. Change the control param */
|
|
|
+ ctl |= CTLXYBITSEL_V(1);
|
|
|
+ t4_write_reg(padap, MPS_CLS_TCAM_DATA2_CTL_A, ctl);
|
|
|
+ val = t4_read_reg(padap, MPS_CLS_TCAM_RDATA1_REQ_ID1_A);
|
|
|
+ tcamx = DMACH_G(val) << 32;
|
|
|
+ tcamx |= t4_read_reg(padap, MPS_CLS_TCAM_RDATA0_REQ_ID1_A);
|
|
|
+ data2 = t4_read_reg(padap, MPS_CLS_TCAM_RDATA2_REQ_ID1_A);
|
|
|
+ if (tcam->lookup_type && tcam->lookup_type != DATALKPTYPE_M) {
|
|
|
+ /* Inner header VNI mask */
|
|
|
+ tcam->vnix = (data2 & DATAVIDH2_F) | DATAVIDH1_G(data2);
|
|
|
+ tcam->vnix = (tcam->vnix << 16) | VIDL_G(val);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ tcamy = t4_read_reg64(padap, MPS_CLS_TCAM_Y_L(idx));
|
|
|
+ tcamx = t4_read_reg64(padap, MPS_CLS_TCAM_X_L(idx));
|
|
|
+ }
|
|
|
+
|
|
|
+ /* If no entry, return */
|
|
|
+ if (tcamx & tcamy)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ tcam->cls_lo = t4_read_reg(padap, MPS_CLS_SRAM_L(idx));
|
|
|
+ tcam->cls_hi = t4_read_reg(padap, MPS_CLS_SRAM_H(idx));
|
|
|
+
|
|
|
+ if (is_t5(padap->params.chip))
|
|
|
+ tcam->repli = (tcam->cls_lo & REPLICATE_F);
|
|
|
+ else if (is_t6(padap->params.chip))
|
|
|
+ tcam->repli = (tcam->cls_lo & T6_REPLICATE_F);
|
|
|
+
|
|
|
+ if (tcam->repli) {
|
|
|
+ struct fw_ldst_cmd ldst_cmd;
|
|
|
+ struct fw_ldst_mps_rplc mps_rplc;
|
|
|
+
|
|
|
+ memset(&ldst_cmd, 0, sizeof(ldst_cmd));
|
|
|
+ ldst_cmd.op_to_addrspace =
|
|
|
+ htonl(FW_CMD_OP_V(FW_LDST_CMD) |
|
|
|
+ FW_CMD_REQUEST_F | FW_CMD_READ_F |
|
|
|
+ FW_LDST_CMD_ADDRSPACE_V(FW_LDST_ADDRSPC_MPS));
|
|
|
+ ldst_cmd.cycles_to_len16 = htonl(FW_LEN16(ldst_cmd));
|
|
|
+ ldst_cmd.u.mps.rplc.fid_idx =
|
|
|
+ htons(FW_LDST_CMD_FID_V(FW_LDST_MPS_RPLC) |
|
|
|
+ FW_LDST_CMD_IDX_V(idx));
|
|
|
+
|
|
|
+ rc = t4_wr_mbox(padap, padap->mbox, &ldst_cmd, sizeof(ldst_cmd),
|
|
|
+ &ldst_cmd);
|
|
|
+ if (rc)
|
|
|
+ cudbg_mps_rpl_backdoor(padap, &mps_rplc);
|
|
|
+ else
|
|
|
+ mps_rplc = ldst_cmd.u.mps.rplc;
|
|
|
+
|
|
|
+ tcam->rplc[0] = ntohl(mps_rplc.rplc31_0);
|
|
|
+ tcam->rplc[1] = ntohl(mps_rplc.rplc63_32);
|
|
|
+ tcam->rplc[2] = ntohl(mps_rplc.rplc95_64);
|
|
|
+ tcam->rplc[3] = ntohl(mps_rplc.rplc127_96);
|
|
|
+ if (padap->params.arch.mps_rplc_size > CUDBG_MAX_RPLC_SIZE) {
|
|
|
+ tcam->rplc[4] = ntohl(mps_rplc.rplc159_128);
|
|
|
+ tcam->rplc[5] = ntohl(mps_rplc.rplc191_160);
|
|
|
+ tcam->rplc[6] = ntohl(mps_rplc.rplc223_192);
|
|
|
+ tcam->rplc[7] = ntohl(mps_rplc.rplc255_224);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ cudbg_tcamxy2valmask(tcamx, tcamy, tcam->addr, &tcam->mask);
|
|
|
+ tcam->idx = idx;
|
|
|
+ tcam->rplc_size = padap->params.arch.mps_rplc_size;
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+int cudbg_collect_mps_tcam(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ u32 size = 0, i, n, total_size = 0;
|
|
|
+ struct cudbg_mps_tcam *tcam;
|
|
|
+ int rc;
|
|
|
+
|
|
|
+ n = padap->params.arch.mps_tcam_size;
|
|
|
+ size = sizeof(struct cudbg_mps_tcam) * n;
|
|
|
+ rc = cudbg_get_buff(dbg_buff, size, &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ tcam = (struct cudbg_mps_tcam *)temp_buff.data;
|
|
|
+ for (i = 0; i < n; i++) {
|
|
|
+ rc = cudbg_collect_tcam_index(padap, tcam, i);
|
|
|
+ if (rc) {
|
|
|
+ cudbg_err->sys_err = rc;
|
|
|
+ cudbg_put_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+ }
|
|
|
+ total_size += sizeof(struct cudbg_mps_tcam);
|
|
|
+ tcam++;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!total_size) {
|
|
|
+ rc = CUDBG_SYSTEM_ERROR;
|
|
|
+ cudbg_err->sys_err = rc;
|
|
|
+ cudbg_put_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+ }
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+int cudbg_collect_vpd_data(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ struct cudbg_vpd_data *vpd_data;
|
|
|
+ int rc;
|
|
|
+
|
|
|
+ rc = cudbg_get_buff(dbg_buff, sizeof(struct cudbg_vpd_data),
|
|
|
+ &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ vpd_data = (struct cudbg_vpd_data *)temp_buff.data;
|
|
|
+ memcpy(vpd_data->sn, padap->params.vpd.sn, SERNUM_LEN + 1);
|
|
|
+ memcpy(vpd_data->bn, padap->params.vpd.pn, PN_LEN + 1);
|
|
|
+ memcpy(vpd_data->na, padap->params.vpd.na, MACADDR_LEN + 1);
|
|
|
+ memcpy(vpd_data->mn, padap->params.vpd.id, ID_LEN + 1);
|
|
|
+ vpd_data->scfg_vers = padap->params.scfg_vers;
|
|
|
+ vpd_data->vpd_vers = padap->params.vpd_vers;
|
|
|
+ vpd_data->fw_major = FW_HDR_FW_VER_MAJOR_G(padap->params.fw_vers);
|
|
|
+ vpd_data->fw_minor = FW_HDR_FW_VER_MINOR_G(padap->params.fw_vers);
|
|
|
+ vpd_data->fw_micro = FW_HDR_FW_VER_MICRO_G(padap->params.fw_vers);
|
|
|
+ vpd_data->fw_build = FW_HDR_FW_VER_BUILD_G(padap->params.fw_vers);
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
+int cudbg_collect_cctrl(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ u32 size;
|
|
|
+ int rc;
|
|
|
+
|
|
|
+ size = sizeof(u16) * NMTUS * NCCTRL_WIN;
|
|
|
+ rc = cudbg_get_buff(dbg_buff, size, &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ t4_read_cong_tbl(padap, (void *)temp_buff.data);
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
int cudbg_collect_ma_indirect(struct cudbg_init *pdbg_init,
|
|
|
struct cudbg_buffer *dbg_buff,
|
|
|
struct cudbg_error *cudbg_err)
|
|
@@ -743,6 +1386,41 @@ int cudbg_collect_ma_indirect(struct cudbg_init *pdbg_init,
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
+int cudbg_collect_ulptx_la(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ struct cudbg_ulptx_la *ulptx_la_buff;
|
|
|
+ u32 i, j;
|
|
|
+ int rc;
|
|
|
+
|
|
|
+ rc = cudbg_get_buff(dbg_buff, sizeof(struct cudbg_ulptx_la),
|
|
|
+ &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ ulptx_la_buff = (struct cudbg_ulptx_la *)temp_buff.data;
|
|
|
+ for (i = 0; i < CUDBG_NUM_ULPTX; i++) {
|
|
|
+ ulptx_la_buff->rdptr[i] = t4_read_reg(padap,
|
|
|
+ ULP_TX_LA_RDPTR_0_A +
|
|
|
+ 0x10 * i);
|
|
|
+ ulptx_la_buff->wrptr[i] = t4_read_reg(padap,
|
|
|
+ ULP_TX_LA_WRPTR_0_A +
|
|
|
+ 0x10 * i);
|
|
|
+ ulptx_la_buff->rddata[i] = t4_read_reg(padap,
|
|
|
+ ULP_TX_LA_RDDATA_0_A +
|
|
|
+ 0x10 * i);
|
|
|
+ for (j = 0; j < CUDBG_NUM_ULPTX_READ; j++)
|
|
|
+ ulptx_la_buff->rd_data[i][j] =
|
|
|
+ t4_read_reg(padap,
|
|
|
+ ULP_TX_LA_RDDATA_0_A + 0x10 * i);
|
|
|
+ }
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
int cudbg_collect_up_cim_indirect(struct cudbg_init *pdbg_init,
|
|
|
struct cudbg_buffer *dbg_buff,
|
|
|
struct cudbg_error *cudbg_err)
|
|
@@ -792,6 +1470,74 @@ int cudbg_collect_up_cim_indirect(struct cudbg_init *pdbg_init,
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
+int cudbg_collect_pbt_tables(struct cudbg_init *pdbg_init,
|
|
|
+ struct cudbg_buffer *dbg_buff,
|
|
|
+ struct cudbg_error *cudbg_err)
|
|
|
+{
|
|
|
+ struct adapter *padap = pdbg_init->adap;
|
|
|
+ struct cudbg_buffer temp_buff = { 0 };
|
|
|
+ struct cudbg_pbt_tables *pbt;
|
|
|
+ int i, rc;
|
|
|
+ u32 addr;
|
|
|
+
|
|
|
+ rc = cudbg_get_buff(dbg_buff, sizeof(struct cudbg_pbt_tables),
|
|
|
+ &temp_buff);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ pbt = (struct cudbg_pbt_tables *)temp_buff.data;
|
|
|
+ /* PBT dynamic entries */
|
|
|
+ addr = CUDBG_CHAC_PBT_ADDR;
|
|
|
+ for (i = 0; i < CUDBG_PBT_DYNAMIC_ENTRIES; i++) {
|
|
|
+ rc = t4_cim_read(padap, addr + (i * 4), 1,
|
|
|
+ &pbt->pbt_dynamic[i]);
|
|
|
+ if (rc) {
|
|
|
+ cudbg_err->sys_err = rc;
|
|
|
+ cudbg_put_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* PBT static entries */
|
|
|
+ /* static entries start when bit 6 is set */
|
|
|
+ addr = CUDBG_CHAC_PBT_ADDR + (1 << 6);
|
|
|
+ for (i = 0; i < CUDBG_PBT_STATIC_ENTRIES; i++) {
|
|
|
+ rc = t4_cim_read(padap, addr + (i * 4), 1,
|
|
|
+ &pbt->pbt_static[i]);
|
|
|
+ if (rc) {
|
|
|
+ cudbg_err->sys_err = rc;
|
|
|
+ cudbg_put_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* LRF entries */
|
|
|
+ addr = CUDBG_CHAC_PBT_LRF;
|
|
|
+ for (i = 0; i < CUDBG_LRF_ENTRIES; i++) {
|
|
|
+ rc = t4_cim_read(padap, addr + (i * 4), 1,
|
|
|
+ &pbt->lrf_table[i]);
|
|
|
+ if (rc) {
|
|
|
+ cudbg_err->sys_err = rc;
|
|
|
+ cudbg_put_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /* PBT data entries */
|
|
|
+ addr = CUDBG_CHAC_PBT_DATA;
|
|
|
+ for (i = 0; i < CUDBG_PBT_DATA_ENTRIES; i++) {
|
|
|
+ rc = t4_cim_read(padap, addr + (i * 4), 1,
|
|
|
+ &pbt->pbt_data[i]);
|
|
|
+ if (rc) {
|
|
|
+ cudbg_err->sys_err = rc;
|
|
|
+ cudbg_put_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ cudbg_write_and_release_buff(&temp_buff, dbg_buff);
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+
|
|
|
int cudbg_collect_mbox_log(struct cudbg_init *pdbg_init,
|
|
|
struct cudbg_buffer *dbg_buff,
|
|
|
struct cudbg_error *cudbg_err)
|