aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
index c91e155c147c..544c88f19f24 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
@@ -1400,11 +1400,25 @@ int cudbg_collect_sge_indirect(struct cudbg_init *pdbg_init,
1400 struct cudbg_buffer temp_buff = { 0 }; 1400 struct cudbg_buffer temp_buff = { 0 };
1401 struct sge_qbase_reg_field *sge_qbase; 1401 struct sge_qbase_reg_field *sge_qbase;
1402 struct ireg_buf *ch_sge_dbg; 1402 struct ireg_buf *ch_sge_dbg;
1403 u8 padap_running = 0;
1403 int i, rc; 1404 int i, rc;
1405 u32 size;
1404 1406
1405 rc = cudbg_get_buff(pdbg_init, dbg_buff, 1407 /* Accessing SGE_QBASE_MAP[0-3] and SGE_QBASE_INDEX regs can
1406 sizeof(*ch_sge_dbg) * 2 + sizeof(*sge_qbase), 1408 * lead to SGE missing doorbells under heavy traffic. So, only
1407 &temp_buff); 1409 * collect them when adapter is idle.
1410 */
1411 for_each_port(padap, i) {
1412 padap_running = netif_running(padap->port[i]);
1413 if (padap_running)
1414 break;
1415 }
1416
1417 size = sizeof(*ch_sge_dbg) * 2;
1418 if (!padap_running)
1419 size += sizeof(*sge_qbase);
1420
1421 rc = cudbg_get_buff(pdbg_init, dbg_buff, size, &temp_buff);
1408 if (rc) 1422 if (rc)
1409 return rc; 1423 return rc;
1410 1424
@@ -1426,7 +1440,8 @@ int cudbg_collect_sge_indirect(struct cudbg_init *pdbg_init,
1426 ch_sge_dbg++; 1440 ch_sge_dbg++;
1427 } 1441 }
1428 1442
1429 if (CHELSIO_CHIP_VERSION(padap->params.chip) > CHELSIO_T5) { 1443 if (CHELSIO_CHIP_VERSION(padap->params.chip) > CHELSIO_T5 &&
1444 !padap_running) {
1430 sge_qbase = (struct sge_qbase_reg_field *)ch_sge_dbg; 1445 sge_qbase = (struct sge_qbase_reg_field *)ch_sge_dbg;
1431 /* 1 addr reg SGE_QBASE_INDEX and 4 data reg 1446 /* 1 addr reg SGE_QBASE_INDEX and 4 data reg
1432 * SGE_QBASE_MAP[0-3] 1447 * SGE_QBASE_MAP[0-3]