netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Gloudon <jamie.gloudon@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH net-next] via-rhine: add 64bit statistics.
Date: Wed, 23 Jan 2013 20:20:52 -0400	[thread overview]
Message-ID: <51007e6c.4170ec0a.7218.18c2@mx.google.com> (raw)
In-Reply-To: <1358985772.12374.1250.camel@edumazet-glaptop>

On Wed, Jan 23, 2013 at 04:02:52PM -0800, Eric Dumazet wrote:
> On Wed, 2013-01-23 at 19:55 -0400, Jamie Gloudon wrote:
> 
> > Eric, do you mean like this below? If not, please illustrate.
> > 
> > +       netdev_stats_to_stats64(stats, &dev->stats);
> > +
> > +       do {
> > +               start = u64_stats_fetch_begin_bh(&rp->rx_stats.syncp);
> > +               stats->rx_packets = rp->rx_stats.packets;
> > +               stats->rx_bytes = rp->rx_stats.bytes;
> > +       } while (u64_stats_fetch_retry_bh(&rp->rx_stats.syncp, start));
> > +
> > +       do {
> > +               start = u64_stats_fetch_begin_bh(&rp->tx_stats.syncp);
> > +               stats->tx_packets = rp->tx_stats.packets;
> > +               stats->tx_bytes = rp->tx_stats.bytes;
> > +       } while (u64_stats_fetch_retry_bh(&rp->tx_stats.syncp, start));
> > +
> > +       return stats;
> > 
> 
> Yes, this is exactly how you should do that, since
> netdev_stats_to_stats64(stats, &dev->stats); would overwrite
> {tr}x_packets, {tr}x_bytes anyway.
> 
>

Right. Also, I added rx_dropped to increment for oversize ethernet. Is
that valid?

@@ -1857,6 +1869,7 @@ static int rhine_rx(struct net_device *dev, int
limit)
	"Oversized Ethernet frame %p vs %p\n", rp->rx_head_desc,                        	&rp->rx_ring[entry]);
+	dev->stats.rx_dropped++;
	dev->stats.rx_length_errors++;

  reply	other threads:[~2013-01-24  0:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-23 14:31 [PATCH net-next] via-rhine: add 64bit statistics Jamie Gloudon
2013-01-23 14:38 ` Eric Dumazet
2013-01-23 15:41   ` Jamie Gloudon
2013-01-23 16:17     ` Eric Dumazet
2013-01-23 23:55       ` Jamie Gloudon
2013-01-24  0:02         ` Eric Dumazet
2013-01-24  0:20           ` Jamie Gloudon [this message]
2013-01-24  0:27             ` Eric Dumazet
2013-01-24  0:34               ` Jamie Gloudon
2013-01-23 18:25     ` David Miller

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=51007e6c.4170ec0a.7218.18c2@mx.google.com \
    --to=jamie.gloudon@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.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;
as well as URLs for NNTP newsgroup(s).