netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] alx: add statistics
@ 2014-01-01 23:40 Sabrina Dubroca
  2014-01-01 23:40 ` [PATCH 1/5] alx: add a hardware stats structure Sabrina Dubroca
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Sabrina Dubroca @ 2014-01-01 23:40 UTC (permalink / raw)
  To: davem; +Cc: johannes, netdev, Sabrina Dubroca

Currently, the alx driver doesn't support statistics [1,2]. The
original alx driver [3] that Johannes Berg modified provided
statistics. This patch is an adaptation of the statistics code from
the original driver to the alx driver included in the kernel.

The original driver has a different version of the
__alx_update_hw_stats function (patch 3). I rewrote it because I
thought the code was not as clear, and it could be cause bugs if the
stats structure was modified. Here is the original version:

void __alx_update_hw_stats(struct alx_hw *hw)
{
	u16 reg;
	u32 data;
	unsigned long *p;

	/* RX stats */
	reg = ALX_RX_STATS_BIN;
	p = &hw->stats.rx_ok;
	while (reg <=  ALX_RX_STATS_END) {
		data = alx_read_mem32(hw, reg);
		*p++ += data;
		reg += 4;
	}

	/* TX stats */
	reg = ALX_TX_STATS_BIN;
	p = &hw->stats.tx_ok;
	while (reg <= ALX_TX_STATS_END) {
		data = alx_read_mem32(hw, reg);
		*p++ += data;
		reg += 4;
	}
}

If you prefer this version, I can resend the patches with this code
instead of the one in patch 3.
Patch 2 removes the constants used in the original version of the
update function and adds the ones necessary for patch 3, so it shouldn't
be used with the original version (above).

[1] https://bugzilla.kernel.org/show_bug.cgi?id=63401
[2] http://www.spinics.net/lists/netdev/msg245544.html
[3] https://github.com/mcgrof/alx

Sabrina Dubroca (5):
  alx: add a hardware stats structure
  alx: add constants for the stats fields
  alx: add stats update function
  alx: add alx_get_stats operation
  alx: add stats to ethtool

 drivers/net/ethernet/atheros/alx/alx.h     |  3 +
 drivers/net/ethernet/atheros/alx/ethtool.c | 95 ++++++++++++++++++++++++++++++
 drivers/net/ethernet/atheros/alx/hw.c      | 58 ++++++++++++++++++
 drivers/net/ethernet/atheros/alx/hw.h      | 61 +++++++++++++++++++
 drivers/net/ethernet/atheros/alx/main.c    | 44 ++++++++++++++
 drivers/net/ethernet/atheros/alx/reg.h     | 52 ++++++++++++++--
 6 files changed, 309 insertions(+), 4 deletions(-)

-- 
1.8.5.2

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

end of thread, other threads:[~2014-01-02 18:23 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-01 23:40 [PATCH 0/5] alx: add statistics Sabrina Dubroca
2014-01-01 23:40 ` [PATCH 1/5] alx: add a hardware stats structure Sabrina Dubroca
2014-01-02 11:52   ` Ben Hutchings
2014-01-01 23:40 ` [PATCH 2/5] alx: add constants for the stats fields Sabrina Dubroca
2014-01-01 23:40 ` [PATCH 3/5] alx: add stats update function Sabrina Dubroca
2014-01-02  5:55   ` Stephen Hemminger
2014-01-02 11:52     ` Ben Hutchings
2014-01-01 23:40 ` [PATCH 4/5] alx: add alx_get_stats operation Sabrina Dubroca
2014-01-02  3:27   ` David Miller
2014-01-02 11:56     ` Ben Hutchings
2014-01-02 16:05       ` Sabrina Dubroca
2014-01-02 16:25         ` Ben Hutchings
2014-01-02 17:39       ` David Miller
2014-01-02 11:57   ` Ben Hutchings
2014-01-01 23:40 ` [PATCH 5/5] alx: add stats to ethtool Sabrina Dubroca
2014-01-02 12:01   ` Ben Hutchings
2014-01-02 18:23     ` Ben Hutchings
2014-01-02 13:09   ` Johannes Berg
2014-01-02 18:19     ` Sabrina Dubroca

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