NIU: Implement discard counters, info/debug statements.
authorJesper Dangaard Brouer <hawk@comx.dk>
Fri, 19 Dec 2008 03:51:26 +0000 (19:51 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Dec 2008 06:27:40 +0000 (22:27 -0800)
Discard packet counter debug statements that can be turned on
at runtime by users to assist debugging of the driver code.

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/niu.c

index 7b6cdd07c85f0b761a9b42db7b7c3f8860c5b815..671721c8ca65b5d1515a9868c5c5a26d7cb137dd 100644 (file)
@@ -3558,6 +3558,9 @@ static inline void niu_sync_rx_discard_stats(struct niu *np,
                if (unlikely(misc & RXMISC_OFLOW))
                        dev_err(np->device, "rx-%d: Counter overflow "
                                "RXMISC discard\n", rx_channel);
+
+               niudbg(RX_ERR, "%s-rx-%d: MISC drop=%u over=%u\n",
+                      np->dev->name, rx_channel, misc, misc-limit);
        }
 
        /* WRED (Weighted Random Early Discard) by hardware */
@@ -3569,6 +3572,9 @@ static inline void niu_sync_rx_discard_stats(struct niu *np,
                if (unlikely(wred & RED_DIS_CNT_OFLOW))
                        dev_err(np->device, "rx-%d: Counter overflow "
                                "WRED discard\n", rx_channel);
+
+               niudbg(RX_ERR, "%s-rx-%d: WRED drop=%u over=%u\n",
+                      np->dev->name, rx_channel, wred, wred-limit);
        }
 }