Spidernet add net_ratelimit to suppress long output
authorLinas Vepstas <linas@austin.ibm.com>
Wed, 13 Dec 2006 21:08:25 +0000 (15:08 -0600)
committerJeff Garzik <jeff@garzik.org>
Mon, 5 Feb 2007 21:58:44 +0000 (16:58 -0500)
This patch adds net_ratelimit to many of the printks in order to
limit extraneous warning messages (created in response to Bug 28554).
This patch supercedes all previous ratelimit patches.
This has been tested, please apply.

From: James K Lewis <jklewis@us.ibm.com>
Signed-off-by: James K Lewis <jklewis@us.ibm.com>
Signed-off-by: Linas Vepstas <jlinas@austin.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/spider_net.c
drivers/net/spider_net.h

index 8c8381cbce0a9a689ed6b02541c6f7d4532bd5f6..ce27e8d318df0a31c9b120f252eed3205935f7df 100644 (file)
@@ -1038,11 +1038,10 @@ spider_net_decode_one_descr(struct spider_net_card *card, int napi)
 
        if ( (status != SPIDER_NET_DESCR_COMPLETE) &&
             (status != SPIDER_NET_DESCR_FRAME_END) ) {
-               if (netif_msg_rx_err(card)) {
+               if (netif_msg_rx_err(card))
                        pr_err("%s: RX descriptor with state %d\n",
                               card->netdev->name, status);
-                       card->spider_stats.rx_desc_unk_state++;
-               }
+               card->spider_stats.rx_desc_unk_state++;
                goto refill;
        }
 
@@ -1361,7 +1360,7 @@ spider_net_handle_error_irq(struct spider_net_card *card, u32 status_reg)
        case SPIDER_NET_GRFAFLLINT: /* fallthrough */
        case SPIDER_NET_GRMFLLINT:
                if (netif_msg_intr(card) && net_ratelimit())
-                       pr_debug("Spider RX RAM full, incoming packets "
+                       pr_err("Spider RX RAM full, incoming packets "
                               "might be discarded!\n");
                spider_net_rx_irq_off(card);
                tasklet_schedule(&card->rxram_full_tl);
@@ -1379,7 +1378,7 @@ spider_net_handle_error_irq(struct spider_net_card *card, u32 status_reg)
        case SPIDER_NET_GDCDCEINT: /* fallthrough */
        case SPIDER_NET_GDBDCEINT: /* fallthrough */
        case SPIDER_NET_GDADCEINT:
-               if (netif_msg_intr(card))
+               if (netif_msg_intr(card) && net_ratelimit())
                        pr_err("got descriptor chain end interrupt, "
                               "restarting DMAC %c.\n",
                               'D'-(i-SPIDER_NET_GDDDCEINT)/3);
@@ -1450,7 +1449,7 @@ spider_net_handle_error_irq(struct spider_net_card *card, u32 status_reg)
                        break;
        }
 
-       if ((show_error) && (netif_msg_intr(card)))
+       if ((show_error) && (netif_msg_intr(card)) && net_ratelimit())
                pr_err("Got error interrupt on %s, GHIINT0STS = 0x%08x, "
                       "GHIINT1STS = 0x%08x, GHIINT2STS = 0x%08x\n",
                       card->netdev->name,
index 4b76ef9524d17a4ff2f1366a8d4a694de8b07a9e..0810e12e210b994d0e2a14d5fe3869e7ba04f958 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef _SPIDER_NET_H
 #define _SPIDER_NET_H
 
-#define VERSION "1.6 A"
+#define VERSION "1.6 B"
 
 #include "sungem_phy.h"