Netdev List
 help / color / mirror / Atom feed
From: Thomas Lange <thomas@corelatus.se>
To: netdev@vger.kernel.org
Cc: "davinci-linux-open-source@linux.davincidsp.com"
	<davinci-linux-open-source@linux.davincidsp.com>,
	davem@davemloft.net, anantgole@ti.com, chaithrika@ti.com
Subject: [PATCH] Davinci: Do not reset EMAC TX overruns counter on read
Date: Wed, 09 Mar 2011 15:41:16 +0100	[thread overview]
Message-ID: <4D77918C.9050800@corelatus.se> (raw)

Don't reset tx_fifo_errors when reading out current EMAC stats.
  (tx_fifo_errors shows up as TX overruns in netdev stats.)

Without this correction, the old counter value is lost every time
stats are read out.

Signed-off-by: Thomas Lange <thomas@corelatus.se>
---
  drivers/net/davinci_emac.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 2a628d1..922c8c5 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -1730,7 +1730,7 @@ static struct net_device_stats *emac_dev_getnetstats(struct net_device *ndev)
  		emac_read(EMAC_TXCARRIERSENSE);
  	emac_write(EMAC_TXCARRIERSENSE, stats_clear_mask);

-	ndev->stats.tx_fifo_errors = emac_read(EMAC_TXUNDERRUN);
+	ndev->stats.tx_fifo_errors += emac_read(EMAC_TXUNDERRUN);
  	emac_write(EMAC_TXUNDERRUN, stats_clear_mask);

  	return &ndev->stats;
-- 
1.7.2.5


                 reply	other threads:[~2011-03-09 14:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D77918C.9050800@corelatus.se \
    --to=thomas@corelatus.se \
    --cc=anantgole@ti.com \
    --cc=chaithrika@ti.com \
    --cc=davem@davemloft.net \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox