From d231776fda4a1ed754298720c5fbc29eb34f130c Mon Sep 17 00:00:00 2001 From: Jesper Dangaard Brouer Date: Thu, 18 Dec 2008 19:51:26 -0800 Subject: [PATCH] NIU: Implement discard counters, info/debug statements. 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 Signed-off-by: David S. Miller --- drivers/net/niu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 7b6cdd0..671721c 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c @@ -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); } } -- 2.7.4