netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] gianfar: make local stats atomic64
@ 2013-02-13  0:24 Paul Gortmaker
  2013-02-13  0:24 ` [PATCH net-next 1/2] gianfar: remove largely unused gfar_stats struct Paul Gortmaker
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Paul Gortmaker @ 2013-02-13  0:24 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Claudiu Manoil, Eric Dumazet, Paul Gortmaker

Eric noticed that the handling of local u64 ethtool counters for
this driver commonly found on Freescale ppc-32 boards was racy.

However, before converting them over to atomic64_t, I noticed
that an internal struct was being used to determine the offsets
for exporting this data into the ethtool buffer, and in doing
so, it assumed that the counters would always be u64.  Rather
than keep this implicit assumption, a simple code cleanup gets
rid of the struct completely, and leaves less conversion sites.

The alternative solution would have been to take advantage of
the fact that the counters are all relating to error conditions,
and hence make them internally u32.  In doing so, we'd be assuming
that U32_MAX of any particular error condition is highly unlikely.
This might have made sense if any increments were in a hot path.

Tested with "ethtool -S eth0" on sbc8548 board.

Paul.
--

The following changes since commit 0790bbb68f9d483348c1d65381f3dd92602bfd05:

  netpoll: cleanup sparse warnings (2013-02-11 19:19:58 -0500)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux.git gfar-ethtool-atomic

for you to fetch changes up to 212079df6d77c0daada96b1d906f4b7749871411:

  gianfar: convert u64 status counters to atomic64_t (2013-02-12 19:08:27 -0500)

----------------------------------------------------------------
Paul Gortmaker (2):
      gianfar: remove largely unused gfar_stats struct
      gianfar: convert u64 status counters to atomic64_t

 drivers/net/ethernet/freescale/gianfar.c         | 26 ++++++++--------
 drivers/net/ethernet/freescale/gianfar.h         | 39 +++++++++++-------------
 drivers/net/ethernet/freescale/gianfar_ethtool.c | 17 +++++------
 3 files changed, 37 insertions(+), 45 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-02-13 18:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-13  0:24 [PATCH net-next 0/2] gianfar: make local stats atomic64 Paul Gortmaker
2013-02-13  0:24 ` [PATCH net-next 1/2] gianfar: remove largely unused gfar_stats struct Paul Gortmaker
2013-02-13 13:13   ` Claudiu Manoil
2013-02-13  0:24 ` [PATCH net-next 2/2] gianfar: convert u64 status counters to atomic64_t Paul Gortmaker
2013-02-13 15:22   ` Claudiu Manoil
2013-02-13 16:14     ` Eric Dumazet
2013-02-13 17:47       ` Claudiu Manoil
2013-02-13 18:03         ` Eric Dumazet
2013-02-13 18:18 ` [PATCH net-next 0/2] gianfar: make local stats atomic64 David Miller

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).