public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Denis Kirjanov <dkirjanov@kernel.org>
Cc: netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
	Joe Perches <joe@perches.com>,
	Ben Hutchings <bhutchings@solarflare.com>,
	Jeff Garzik <jgarzik@redhat.com>
Subject: Re: [PATCH -next] sundance: Add initial ethtool stats support
Date: Wed, 13 Oct 2010 08:33:57 +0200	[thread overview]
Message-ID: <1286951637.2703.141.camel@edumazet-laptop> (raw)
In-Reply-To: <4CB54C4F.5070205@kernel.org>

Le mercredi 13 octobre 2010 à 10:06 +0400, Denis Kirjanov a écrit :

> @@ -1494,13 +1506,23 @@ static struct net_device_stats *get_stats(struct net_device *dev)
>  	dev->stats.rx_missed_errors	+= ioread8(ioaddr + RxMissed);
>  	dev->stats.tx_packets += ioread16(ioaddr + TxFramesOK);
>  	dev->stats.rx_packets += ioread16(ioaddr + RxFramesOK);
> -	dev->stats.collisions += ioread8(ioaddr + StatsLateColl);
> -	dev->stats.collisions += ioread8(ioaddr + StatsMultiColl);
> -	dev->stats.collisions += ioread8(ioaddr + StatsOneColl);
>  	dev->stats.tx_carrier_errors += ioread8(ioaddr + StatsCarrierError);
> -	ioread8(ioaddr + StatsTxDefer);
> -	for (i = StatsTxDefer; i <= StatsMcastRx; i++)
> -		ioread8(ioaddr + i);
> +
> +	np->xstats.tx_multiple_collisions += ioread8(ioaddr + StatsMultiColl);
> +	np->xstats.tx_single_collisions += ioread8(ioaddr + StatsOneColl);
> +	np->xstats.tx_late_collisions += ioread8(ioaddr + StatsLateColl);
> +	dev->stats.collisions += np->xstats.tx_multiple_collisions
> +		+ np->xstats.tx_single_collisions
> +		+ np->xstats.tx_late_collisions;


Oh well..., really ?

Each time we are calling get_stats(), you do

dev->stats.collisions += (number of accumulated collisions since device
is up)

instead of

dev->stats.collisions += (number of accumulated collisions since last
time we read counters)


Can you see the problem ?




  reply	other threads:[~2010-10-13  6:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-09  9:53 [PATCH -next] sundance: Add initial ethtool stats support Denis Kirjanov
2010-10-09 12:17 ` [PATCH net-next] sundance: get_stats proper locking Eric Dumazet
2010-10-09 16:24   ` David Miller
2010-10-09 12:33 ` [PATCH -next] sundance: Add initial ethtool stats support Eric Dumazet
2010-10-09 13:27 ` Ben Hutchings
2010-10-09 14:40   ` Denis Kirjanov
2010-10-09 19:41   ` Denis Kirjanov
2010-10-09 21:48     ` Jeff Garzik
2010-10-12 18:51     ` David Miller
2010-10-12 20:36       ` Denis Kirjanov
2010-10-12 20:57         ` Joe Perches
2010-10-13  6:06           ` Denis Kirjanov
2010-10-13  6:33             ` Eric Dumazet [this message]
2010-10-13  7:02               ` Denis Kirjanov
2010-10-13 10:28               ` Denis Kirjanov
2010-10-13 10:36                 ` Eric Dumazet
2010-10-13 10:56                   ` Denis Kirjanov
2010-10-13 19:44                     ` Eric Dumazet

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=1286951637.2703.141.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=dkirjanov@kernel.org \
    --cc=jgarzik@redhat.com \
    --cc=joe@perches.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