From: Eric Dumazet <eric.dumazet@gmail.com>
To: Junchang Wang <junchangwang@gmail.com>
Cc: davem@davemloft.net, greearb@candelatech.com,
adobriyan@gmail.com, jasowang@redhat.com, joe@perches.com,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next] 8139too: Add 64bit statistics
Date: Mon, 05 Mar 2012 05:32:06 -0800 [thread overview]
Message-ID: <1330954326.2474.9.camel@edumazet-laptop> (raw)
In-Reply-To: <20120305113353.GA12969@Spy32>
Le lundi 05 mars 2012 à 19:33 +0800, Junchang Wang a écrit :
> Switch to use ndo_get_stats64 to get 64bit statistics.
> Two sync entries are used (one for Rx and one for Tx).
>
> Signed-off-by: Junchang Wang <junchangwang@gmail.com>
> ---
...
> + stats->rx_errors = dev->stats.rx_errors;
> + stats->tx_errors = dev->stats.tx_errors;
> + stats->rx_dropped = dev->stats.rx_dropped;
> + stats->tx_dropped = dev->stats.tx_dropped;
> + stats->collisions = dev->stats.collisions;
> +
> + stats->rx_length_errors = dev->stats.rx_length_errors;
> + stats->rx_crc_errors = dev->stats.rx_crc_errors;
> + stats->rx_frame_errors = dev->stats.rx_frame_errors;
> + stats->rx_fifo_errors = dev->stats.rx_fifo_errors;
> + stats->rx_missed_errors = dev->stats.rx_missed_errors;
> +
> + stats->tx_aborted_errors = dev->stats.tx_aborted_errors;
> + stats->tx_carrier_errors = dev->stats.tx_carrier_errors;
> + stats->tx_fifo_errors = dev->stats.tx_fifo_errors;
> + stats->tx_window_errors = dev->stats.tx_window_errors;
> +
> + return stats;
> }
>
Maybe its time to export netdev_stats_to_stats64() after all, to avoid
all this duplicate code.
I'll submit a patch.
Could you repost this after netdev_stats_to_stats64() being available to
drivers ?
Thanks
next prev parent reply other threads:[~2012-03-05 13:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-05 11:33 [PATCH net-next] 8139too: Add 64bit statistics Junchang Wang
2012-03-05 13:32 ` Eric Dumazet [this message]
2012-03-05 13:58 ` [PATCH net-next] net: export netdev_stats_to_stats64 Eric Dumazet
2012-03-05 14:20 ` Eric Dumazet
2012-03-05 14:50 ` [PATCH net-next v2] " Eric Dumazet
2012-03-05 20:40 ` David Miller
2012-03-06 4:38 ` [PATCH net-next] " Junchang Wang
2012-03-06 4:43 ` Eric Dumazet
2012-03-06 4:44 ` Eric Dumazet
2012-03-06 5:00 ` Junchang Wang
2012-03-05 14:07 ` [PATCH net-next] 8139too: Add 64bit statistics Junchang Wang
2012-03-06 3:13 ` [PATCH net-next V2] " Junchang Wang
2012-03-06 5:05 ` 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=1330954326.2474.9.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=adobriyan@gmail.com \
--cc=davem@davemloft.net \
--cc=greearb@candelatech.com \
--cc=jasowang@redhat.com \
--cc=joe@perches.com \
--cc=junchangwang@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