aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinas Vepstas <linas@austin.ibm.com>2006-12-13 16:23:56 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-05 16:58:45 -0500
commit6d24998f07588ca83ce04e60af5a79e805df7532 (patch)
treec155b2a9e9924b2dfdfa169734b09ebb70af2734
parentdf519ab2c5a774e813459fcb3e3d080276baa7d8 (diff)
Spidernet RX Debugging printout
Add some debugging and error printing. The show_rx_chain() prints out the status of the rx chain, which shows that the status of the descriptors gets messed up after the second & subsequent RX ramfulls. Print out contents of bad packets if error occurs. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: James K Lewis <jklewis@us.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/net/spider_net.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 2239c16da543..d73018b5cfc8 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -961,6 +961,34 @@ spider_net_pass_skb_up(struct spider_net_descr *descr,
961 card->netdev_stats.rx_bytes += skb->len; 961 card->netdev_stats.rx_bytes += skb->len;
962} 962}
963 963
964#ifdef DEBUG
965static void show_rx_chain(struct spider_net_card *card)
966{
967 struct spider_net_descr_chain *chain = &card->rx_chain;
968 struct spider_net_descr *start= chain->tail;
969 struct spider_net_descr *descr= start;
970 int status;
971
972 int cnt = 0;
973 int cstat = spider_net_get_descr_status(descr);
974 printk(KERN_INFO "RX chain tail at descr=%ld\n",
975 (start - card->descr) - card->tx_chain.num_desc);
976 status = cstat;
977 do
978 {
979 status = spider_net_get_descr_status(descr);
980 if (cstat != status) {
981 printk(KERN_INFO "Have %d descrs with stat=x%08x\n", cnt, cstat);
982 cstat = status;
983 cnt = 0;
984 }
985 cnt ++;
986 descr = descr->next;
987 } while (descr != start);
988 printk(KERN_INFO "Last %d descrs with stat=x%08x\n", cnt, cstat);
989}
990#endif
991
964/** 992/**
965 * spider_net_decode_one_descr - processes an rx descriptor 993 * spider_net_decode_one_descr - processes an rx descriptor
966 * @card: card structure 994 * @card: card structure
@@ -1021,6 +1049,24 @@ spider_net_decode_one_descr(struct spider_net_card *card)
1021 goto bad_desc; 1049 goto bad_desc;
1022 } 1050 }
1023 1051
1052 if (descr->dmac_cmd_status & 0xfefe) {
1053 pr_err("%s: bad status, cmd_status=x%08x\n",
1054 card->netdev->name,
1055 descr->dmac_cmd_status);
1056 pr_err("buf_addr=x%08x\n", descr->buf_addr);
1057 pr_err("buf_size=x%08x\n", descr->buf_size);
1058 pr_err("next_descr_addr=x%08x\n", descr->next_descr_addr);
1059 pr_err("result_size=x%08x\n", descr->result_size);
1060 pr_err("valid_size=x%08x\n", descr->valid_size);
1061 pr_err("data_status=x%08x\n", descr->data_status);
1062 pr_err("data_error=x%08x\n", descr->data_error);
1063 pr_err("bus_addr=x%08x\n", descr->bus_addr);
1064 pr_err("which=%ld\n", descr - card->rx_chain.ring);
1065
1066 card->spider_stats.rx_desc_error++;
1067 goto bad_desc;
1068 }
1069
1024 /* Ok, we've got a packet in descr */ 1070 /* Ok, we've got a packet in descr */
1025 spider_net_pass_skb_up(descr, card); 1071 spider_net_pass_skb_up(descr, card);
1026 descr->dmac_cmd_status = SPIDER_NET_DESCR_NOT_IN_USE; 1072 descr->dmac_cmd_status = SPIDER_NET_DESCR_NOT_IN_USE;