netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] macb: Add rx overrun counter
@ 2011-04-13 15:03 Alexander Stein
  2011-04-13 18:50 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Stein @ 2011-04-13 15:03 UTC (permalink / raw)
  To: Nicolas Ferre; +Cc: netdev, Alexander Stein

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
---
 drivers/net/macb.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 79ccb54..76ce819 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -576,6 +576,11 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
 		 * add that if/when we get our hands on a full-blown MII PHY.
 		 */
 
+		if (status & MACB_BIT(ISR_ROVR)) {
+			/* We missed at least one packet */
+			bp->hw_stats.rx_overruns++;
+		}
+
 		if (status & MACB_BIT(HRESP)) {
 			/*
 			 * TODO: Reset the hardware, and maybe move the printk
@@ -1024,7 +1029,8 @@ static struct net_device_stats *macb_get_stats(struct net_device *dev)
 				   hwstat->rx_jabbers +
 				   hwstat->rx_undersize_pkts +
 				   hwstat->rx_length_mismatch);
-	nstat->rx_over_errors = hwstat->rx_resource_errors;
+	nstat->rx_over_errors = hwstat->rx_resource_errors +
+				   hwstat->rx_overruns;
 	nstat->rx_crc_errors = hwstat->rx_fcs_errors;
 	nstat->rx_frame_errors = hwstat->rx_align_errors;
 	nstat->rx_fifo_errors = hwstat->rx_overruns;
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] macb: Add rx overrun counter
  2011-04-13 15:03 [PATCH] macb: Add rx overrun counter Alexander Stein
@ 2011-04-13 18:50 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-04-13 18:50 UTC (permalink / raw)
  To: alexander.stein; +Cc: nicolas.ferre, netdev

From: Alexander Stein <alexander.stein@systec-electronic.com>
Date: Wed, 13 Apr 2011 17:03:24 +0200

> Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-13 18:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-13 15:03 [PATCH] macb: Add rx overrun counter Alexander Stein
2011-04-13 18:50 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).