[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1358985772.12374.1250.camel@edumazet-glaptop>
Date: Wed, 23 Jan 2013 16:02:52 -0800
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jamie Gloudon <jamie.gloudon@...il.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH net-next] via-rhine: add 64bit statistics.
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists