]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
e100: Fix rx-over-length statistics.
authorBen Greear <greearb@candelatech.com>
Fri, 17 Feb 2012 13:44:23 +0000 (13:44 +0000)
committerJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 02:58:50 +0000 (10:58 +0800)
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.

(cherry picked from commit d24d65eda97fe51f2996538148e85d309e2460e4)
Signed-off-by: Ben Greear <greearb@candelatech.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/e100.c

index aeaadb50aa7de5df629cbcc0ab78c5f9ead5a80a..995a31599ec333b04ab4b59983543fdf90704669 100644 (file)
@@ -615,6 +615,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;
@@ -1605,7 +1606,9 @@ 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);