diff options
author | Eilon Greenstein <eilong@broadcom.com> | 2009-02-12 03:38:22 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-16 02:31:55 -0500 |
commit | 8440d2b63667c7d09ccbe43b8bd928d3c4662879 (patch) | |
tree | 6c11dc1b6b3f7191cf14adf37e5fccc7165fb892 /drivers/net/bnx2x_main.c | |
parent | 0febaa42a3fa90ce9453c67a549525f365b77a9d (diff) |
bnx2x: Driver dump
Re-arrange the driver debug print to support the Tx multi-queue and add support
for debug prints at the end of the ring (when start<end)
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r-- | drivers/net/bnx2x_main.c | 97 |
1 files changed, 59 insertions, 38 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 26451f6a7c49..78f628a07839 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -507,50 +507,54 @@ static void bnx2x_panic_dump(struct bnx2x *bp) | |||
507 | 507 | ||
508 | BNX2X_ERR("begin crash dump -----------------\n"); | 508 | BNX2X_ERR("begin crash dump -----------------\n"); |
509 | 509 | ||
510 | for_each_queue(bp, i) { | 510 | /* Indices */ |
511 | /* Common */ | ||
512 | BNX2X_ERR("def_c_idx(%u) def_u_idx(%u) def_x_idx(%u)" | ||
513 | " def_t_idx(%u) def_att_idx(%u) attn_state(%u)" | ||
514 | " spq_prod_idx(%u)\n", | ||
515 | bp->def_c_idx, bp->def_u_idx, bp->def_x_idx, bp->def_t_idx, | ||
516 | bp->def_att_idx, bp->attn_state, bp->spq_prod_idx); | ||
517 | |||
518 | /* Rx */ | ||
519 | for_each_rx_queue(bp, i) { | ||
511 | struct bnx2x_fastpath *fp = &bp->fp[i]; | 520 | struct bnx2x_fastpath *fp = &bp->fp[i]; |
512 | struct eth_tx_db_data *hw_prods = fp->hw_tx_prods; | ||
513 | 521 | ||
514 | BNX2X_ERR("queue[%d]: tx_pkt_prod(%x) tx_pkt_cons(%x)" | 522 | BNX2X_ERR("queue[%d]: rx_bd_prod(%x) rx_bd_cons(%x)" |
515 | " tx_bd_prod(%x) tx_bd_cons(%x) *tx_cons_sb(%x)\n", | ||
516 | i, fp->tx_pkt_prod, fp->tx_pkt_cons, fp->tx_bd_prod, | ||
517 | fp->tx_bd_cons, le16_to_cpu(*fp->tx_cons_sb)); | ||
518 | BNX2X_ERR(" rx_bd_prod(%x) rx_bd_cons(%x)" | ||
519 | " *rx_bd_cons_sb(%x) rx_comp_prod(%x)" | 523 | " *rx_bd_cons_sb(%x) rx_comp_prod(%x)" |
520 | " rx_comp_cons(%x) *rx_cons_sb(%x)\n", | 524 | " rx_comp_cons(%x) *rx_cons_sb(%x)\n", |
521 | fp->rx_bd_prod, fp->rx_bd_cons, | 525 | i, fp->rx_bd_prod, fp->rx_bd_cons, |
522 | le16_to_cpu(*fp->rx_bd_cons_sb), fp->rx_comp_prod, | 526 | le16_to_cpu(*fp->rx_bd_cons_sb), fp->rx_comp_prod, |
523 | fp->rx_comp_cons, le16_to_cpu(*fp->rx_cons_sb)); | 527 | fp->rx_comp_cons, le16_to_cpu(*fp->rx_cons_sb)); |
524 | BNX2X_ERR(" rx_sge_prod(%x) last_max_sge(%x)" | 528 | BNX2X_ERR(" rx_sge_prod(%x) last_max_sge(%x)" |
525 | " fp_c_idx(%x) *sb_c_idx(%x) fp_u_idx(%x)" | 529 | " fp_u_idx(%x) *sb_u_idx(%x)\n", |
526 | " *sb_u_idx(%x) bd data(%x,%x)\n", | 530 | fp->rx_sge_prod, fp->last_max_sge, |
527 | fp->rx_sge_prod, fp->last_max_sge, fp->fp_c_idx, | 531 | le16_to_cpu(fp->fp_u_idx), |
528 | fp->status_blk->c_status_block.status_block_index, | 532 | fp->status_blk->u_status_block.status_block_index); |
529 | fp->fp_u_idx, | 533 | } |
530 | fp->status_blk->u_status_block.status_block_index, | ||
531 | hw_prods->packets_prod, hw_prods->bds_prod); | ||
532 | |||
533 | start = TX_BD(le16_to_cpu(*fp->tx_cons_sb) - 10); | ||
534 | end = TX_BD(le16_to_cpu(*fp->tx_cons_sb) + 245); | ||
535 | for (j = start; j < end; j++) { | ||
536 | struct sw_tx_bd *sw_bd = &fp->tx_buf_ring[j]; | ||
537 | 534 | ||
538 | BNX2X_ERR("packet[%x]=[%p,%x]\n", j, | 535 | /* Tx */ |
539 | sw_bd->skb, sw_bd->first_bd); | 536 | for_each_tx_queue(bp, i) { |
540 | } | 537 | struct bnx2x_fastpath *fp = &bp->fp[i]; |
538 | struct eth_tx_db_data *hw_prods = fp->hw_tx_prods; | ||
541 | 539 | ||
542 | start = TX_BD(fp->tx_bd_cons - 10); | 540 | BNX2X_ERR("queue[%d]: tx_pkt_prod(%x) tx_pkt_cons(%x)" |
543 | end = TX_BD(fp->tx_bd_cons + 254); | 541 | " tx_bd_prod(%x) tx_bd_cons(%x) *tx_cons_sb(%x)\n", |
544 | for (j = start; j < end; j++) { | 542 | i, fp->tx_pkt_prod, fp->tx_pkt_cons, fp->tx_bd_prod, |
545 | u32 *tx_bd = (u32 *)&fp->tx_desc_ring[j]; | 543 | fp->tx_bd_cons, le16_to_cpu(*fp->tx_cons_sb)); |
544 | BNX2X_ERR(" fp_c_idx(%x) *sb_c_idx(%x)" | ||
545 | " bd data(%x,%x)\n", le16_to_cpu(fp->fp_c_idx), | ||
546 | fp->status_blk->c_status_block.status_block_index, | ||
547 | hw_prods->packets_prod, hw_prods->bds_prod); | ||
548 | } | ||
546 | 549 | ||
547 | BNX2X_ERR("tx_bd[%x]=[%x:%x:%x:%x]\n", | 550 | /* Rings */ |
548 | j, tx_bd[0], tx_bd[1], tx_bd[2], tx_bd[3]); | 551 | /* Rx */ |
549 | } | 552 | for_each_rx_queue(bp, i) { |
553 | struct bnx2x_fastpath *fp = &bp->fp[i]; | ||
550 | 554 | ||
551 | start = RX_BD(le16_to_cpu(*fp->rx_cons_sb) - 10); | 555 | start = RX_BD(le16_to_cpu(*fp->rx_cons_sb) - 10); |
552 | end = RX_BD(le16_to_cpu(*fp->rx_cons_sb) + 503); | 556 | end = RX_BD(le16_to_cpu(*fp->rx_cons_sb) + 503); |
553 | for (j = start; j < end; j++) { | 557 | for (j = start; j != end; j = RX_BD(j + 1)) { |
554 | u32 *rx_bd = (u32 *)&fp->rx_desc_ring[j]; | 558 | u32 *rx_bd = (u32 *)&fp->rx_desc_ring[j]; |
555 | struct sw_rx_bd *sw_bd = &fp->rx_buf_ring[j]; | 559 | struct sw_rx_bd *sw_bd = &fp->rx_buf_ring[j]; |
556 | 560 | ||
@@ -560,7 +564,7 @@ static void bnx2x_panic_dump(struct bnx2x *bp) | |||
560 | 564 | ||
561 | start = RX_SGE(fp->rx_sge_prod); | 565 | start = RX_SGE(fp->rx_sge_prod); |
562 | end = RX_SGE(fp->last_max_sge); | 566 | end = RX_SGE(fp->last_max_sge); |
563 | for (j = start; j < end; j++) { | 567 | for (j = start; j != end; j = RX_SGE(j + 1)) { |
564 | u32 *rx_sge = (u32 *)&fp->rx_sge_ring[j]; | 568 | u32 *rx_sge = (u32 *)&fp->rx_sge_ring[j]; |
565 | struct sw_rx_page *sw_page = &fp->rx_page_ring[j]; | 569 | struct sw_rx_page *sw_page = &fp->rx_page_ring[j]; |
566 | 570 | ||
@@ -570,7 +574,7 @@ static void bnx2x_panic_dump(struct bnx2x *bp) | |||
570 | 574 | ||
571 | start = RCQ_BD(fp->rx_comp_cons - 10); | 575 | start = RCQ_BD(fp->rx_comp_cons - 10); |
572 | end = RCQ_BD(fp->rx_comp_cons + 503); | 576 | end = RCQ_BD(fp->rx_comp_cons + 503); |
573 | for (j = start; j < end; j++) { | 577 | for (j = start; j != end; j = RCQ_BD(j + 1)) { |
574 | u32 *cqe = (u32 *)&fp->rx_comp_ring[j]; | 578 | u32 *cqe = (u32 *)&fp->rx_comp_ring[j]; |
575 | 579 | ||
576 | BNX2X_ERR("cqe[%x]=[%x:%x:%x:%x]\n", | 580 | BNX2X_ERR("cqe[%x]=[%x:%x:%x:%x]\n", |
@@ -578,11 +582,28 @@ static void bnx2x_panic_dump(struct bnx2x *bp) | |||
578 | } | 582 | } |
579 | } | 583 | } |
580 | 584 | ||
581 | BNX2X_ERR("def_c_idx(%u) def_u_idx(%u) def_x_idx(%u)" | 585 | /* Tx */ |
582 | " def_t_idx(%u) def_att_idx(%u) attn_state(%u)" | 586 | for_each_tx_queue(bp, i) { |
583 | " spq_prod_idx(%u)\n", | 587 | struct bnx2x_fastpath *fp = &bp->fp[i]; |
584 | bp->def_c_idx, bp->def_u_idx, bp->def_x_idx, bp->def_t_idx, | 588 | |
585 | bp->def_att_idx, bp->attn_state, bp->spq_prod_idx); | 589 | start = TX_BD(le16_to_cpu(*fp->tx_cons_sb) - 10); |
590 | end = TX_BD(le16_to_cpu(*fp->tx_cons_sb) + 245); | ||
591 | for (j = start; j != end; j = TX_BD(j + 1)) { | ||
592 | struct sw_tx_bd *sw_bd = &fp->tx_buf_ring[j]; | ||
593 | |||
594 | BNX2X_ERR("packet[%x]=[%p,%x]\n", j, | ||
595 | sw_bd->skb, sw_bd->first_bd); | ||
596 | } | ||
597 | |||
598 | start = TX_BD(fp->tx_bd_cons - 10); | ||
599 | end = TX_BD(fp->tx_bd_cons + 254); | ||
600 | for (j = start; j != end; j = TX_BD(j + 1)) { | ||
601 | u32 *tx_bd = (u32 *)&fp->tx_desc_ring[j]; | ||
602 | |||
603 | BNX2X_ERR("tx_bd[%x]=[%x:%x:%x:%x]\n", | ||
604 | j, tx_bd[0], tx_bd[1], tx_bd[2], tx_bd[3]); | ||
605 | } | ||
606 | } | ||
586 | 607 | ||
587 | bnx2x_fw_dump(bp); | 608 | bnx2x_fw_dump(bp); |
588 | bnx2x_mc_assert(bp); | 609 | bnx2x_mc_assert(bp); |