All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] e100:  Fix rx-over-length statistics.
@ 2012-02-16 18:55 greearb
  2012-02-17  0:08 ` Jeff Kirsher
  0 siblings, 1 reply; 2+ messages in thread
From: greearb @ 2012-02-16 18:55 UTC (permalink / raw)
  To: netdev; +Cc: jeffrey.t.kirsher, Ben Greear

From: Ben Greear <greearb@candelatech.com>

The old code would += the total errors every time
stats were gathered.  Instead, keep a count of short-pkt
and long-pkt counters and then simply add them together
for the rx-over-length stat.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 4d8a616... db20a36... M	drivers/net/ethernet/intel/e100.c
 drivers/net/ethernet/intel/e100.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index 4d8a616..db20a36 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -622,6 +622,7 @@ struct nic {
 	u32 rx_fc_pause;
 	u32 rx_fc_unsupported;
 	u32 rx_tco_frames;
+	u32 rx_short_frame_errors;
 	u32 rx_over_length_errors;
 
 	u16 eeprom_wc;
@@ -1622,7 +1623,8 @@ static void e100_update_stats(struct nic *nic)
 		ns->collisions += nic->tx_collisions;
 		ns->tx_errors += le32_to_cpu(s->tx_max_collisions) +
 			le32_to_cpu(s->tx_lost_crs);
-		ns->rx_length_errors += le32_to_cpu(s->rx_short_frame_errors) +
+		nic->rx_short_frame_errors += le32_to_cpu(s->rx_short_frame_errors);
+		ns->rx_length_errors = nic->rx_short_frame_errors +
 			nic->rx_over_length_errors;
 		ns->rx_crc_errors += le32_to_cpu(s->rx_crc_errors);
 		ns->rx_frame_errors += le32_to_cpu(s->rx_alignment_errors);
-- 
1.7.3.4

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

* Re: [PATCH] e100:  Fix rx-over-length statistics.
  2012-02-16 18:55 [PATCH] e100: Fix rx-over-length statistics greearb
@ 2012-02-17  0:08 ` Jeff Kirsher
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Kirsher @ 2012-02-17  0:08 UTC (permalink / raw)
  To: greearb; +Cc: netdev

[-- Attachment #1: Type: text/plain, Size: 617 bytes --]

On Thu, 2012-02-16 at 10:55 -0800, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> The old code would += the total errors every time
> stats were gathered.  Instead, keep a count of short-pkt
> and long-pkt counters and then simply add them together
> for the rx-over-length stat.
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
> :100644 100644 4d8a616... db20a36...
> M  drivers/net/ethernet/intel/e100.c
>  drivers/net/ethernet/intel/e100.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-) 

Thanks Ben, it has been added to my queue.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2012-02-17  0:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-16 18:55 [PATCH] e100: Fix rx-over-length statistics greearb
2012-02-17  0:08 ` Jeff Kirsher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.