From: Eric Dumazet <eric.dumazet@gmail.com>
To: Junchang Wang <junchangwang@gmail.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: export netdev_stats_to_stats64
Date: Mon, 05 Mar 2012 20:43:24 -0800 [thread overview]
Message-ID: <1331009004.2474.25.camel@edumazet-laptop> (raw)
In-Reply-To: <CABoNC82c2G+2ubS8it+dAdQBK3EvyaArdGxhZh-KY=3YraMdNA@mail.gmail.com>
Le mardi 06 mars 2012 à 12:38 +0800, Junchang Wang a écrit :
> > Some drivers use internal netdev stats member to store part of their
> > stats, yet advertize ndo_get_stats64() to implement some 64bit fields.
> >
> > Allow them to use netdev_stats_to_stats64() helper to make the copy of
> > netdev stats before they compute their 64bit counters.
> >
> > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
>
> Hi Eric,
> And I think we can add a netdev_stats_add_to_stats64() helper to avoid
> following duplicate code. Is that acceptable? Thanks.
>
> drivers/net/bonding/bond_main.c
> stats->rx_packets += sstats->rx_packets;
> stats->rx_bytes += sstats->rx_bytes;
> stats->rx_errors += sstats->rx_errors;
> stats->rx_dropped += sstats->rx_dropped;
>
> stats->tx_packets += sstats->tx_packets;
> stats->tx_bytes += sstats->tx_bytes;
> stats->tx_errors += sstats->tx_errors;
> stats->tx_dropped += sstats->tx_dropped;
>
> stats->multicast += sstats->multicast;
> stats->collisions += sstats->collisions;
>
> stats->rx_length_errors += sstats->rx_length_errors;
> stats->rx_over_errors += sstats->rx_over_errors;
> stats->rx_crc_errors += sstats->rx_crc_errors;
> stats->rx_frame_errors += sstats->rx_frame_errors;
> stats->rx_fifo_errors += sstats->rx_fifo_errors;
> stats->rx_missed_errors += sstats->rx_missed_errors;
>
> stats->tx_aborted_errors += sstats->tx_aborted_errors;
> stats->tx_carrier_errors += sstats->tx_carrier_errors;
> stats->tx_fifo_errors += sstats->tx_fifo_errors;
> stats->tx_heartbeat_errors += sstats->tx_heartbeat_errors;
> stats->tx_window_errors += sstats->tx_window_errors;
>
Yep, I was currently preparing these patches :)
next prev parent reply other threads:[~2012-03-06 4:43 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
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 [this message]
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=1331009004.2474.25.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--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