aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/atheros
diff options
context:
space:
mode:
authorSabrina Dubroca <sd@queasysnail.net>2014-01-12 12:50:39 -0500
committerDavid S. Miller <davem@davemloft.net>2014-01-14 20:18:05 -0500
commitfb3a42fc39bf4453dc6fab25bbbf6f0416936887 (patch)
tree8957bb51e0accecb248c50b7fffe0b7d605e4490 /drivers/net/ethernet/atheros
parent8560258f0e67104278816211443e63bda5d300ea (diff)
atl1e: update statistics code
As Ben Hutchings pointed out for the stats in alx, some hardware-specific stats aren't matched to the right net_device_stats field. Also fix the collision field and include errors in the total number of RX/TX packets. Minor whitespace fixes to match the style in alx. Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Reviewed-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/atheros')
-rw-r--r--drivers/net/ethernet/atheros/atl1e/atl1e_main.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index 7a73f3a9fcb5..d5c2d3e912e5 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -1177,32 +1177,40 @@ static struct net_device_stats *atl1e_get_stats(struct net_device *netdev)
1177 struct atl1e_hw_stats *hw_stats = &adapter->hw_stats; 1177 struct atl1e_hw_stats *hw_stats = &adapter->hw_stats;
1178 struct net_device_stats *net_stats = &netdev->stats; 1178 struct net_device_stats *net_stats = &netdev->stats;
1179 1179
1180 net_stats->rx_packets = hw_stats->rx_ok;
1181 net_stats->tx_packets = hw_stats->tx_ok;
1182 net_stats->rx_bytes = hw_stats->rx_byte_cnt; 1180 net_stats->rx_bytes = hw_stats->rx_byte_cnt;
1183 net_stats->tx_bytes = hw_stats->tx_byte_cnt; 1181 net_stats->tx_bytes = hw_stats->tx_byte_cnt;
1184 net_stats->multicast = hw_stats->rx_mcast; 1182 net_stats->multicast = hw_stats->rx_mcast;
1185 net_stats->collisions = hw_stats->tx_1_col + 1183 net_stats->collisions = hw_stats->tx_1_col +
1186 hw_stats->tx_2_col * 2 + 1184 hw_stats->tx_2_col +
1187 hw_stats->tx_late_col + hw_stats->tx_abort_col; 1185 hw_stats->tx_late_col +
1186 hw_stats->tx_abort_col;
1187
1188 net_stats->rx_errors = hw_stats->rx_frag +
1189 hw_stats->rx_fcs_err +
1190 hw_stats->rx_len_err +
1191 hw_stats->rx_sz_ov +
1192 hw_stats->rx_rrd_ov +
1193 hw_stats->rx_align_err +
1194 hw_stats->rx_rxf_ov;
1188 1195
1189 net_stats->rx_errors = hw_stats->rx_frag + hw_stats->rx_fcs_err +
1190 hw_stats->rx_len_err + hw_stats->rx_sz_ov +
1191 hw_stats->rx_rrd_ov + hw_stats->rx_align_err;
1192 net_stats->rx_fifo_errors = hw_stats->rx_rxf_ov; 1196 net_stats->rx_fifo_errors = hw_stats->rx_rxf_ov;
1193 net_stats->rx_length_errors = hw_stats->rx_len_err; 1197 net_stats->rx_length_errors = hw_stats->rx_len_err;
1194 net_stats->rx_crc_errors = hw_stats->rx_fcs_err; 1198 net_stats->rx_crc_errors = hw_stats->rx_fcs_err;
1195 net_stats->rx_frame_errors = hw_stats->rx_align_err; 1199 net_stats->rx_frame_errors = hw_stats->rx_align_err;
1196 net_stats->rx_over_errors = hw_stats->rx_rrd_ov + hw_stats->rx_rxf_ov; 1200 net_stats->rx_dropped = hw_stats->rx_rrd_ov;
1197 1201
1198 net_stats->rx_missed_errors = hw_stats->rx_rrd_ov + hw_stats->rx_rxf_ov; 1202 net_stats->tx_errors = hw_stats->tx_late_col +
1203 hw_stats->tx_abort_col +
1204 hw_stats->tx_underrun +
1205 hw_stats->tx_trunc;
1199 1206
1200 net_stats->tx_errors = hw_stats->tx_late_col + hw_stats->tx_abort_col +
1201 hw_stats->tx_underrun + hw_stats->tx_trunc;
1202 net_stats->tx_fifo_errors = hw_stats->tx_underrun; 1207 net_stats->tx_fifo_errors = hw_stats->tx_underrun;
1203 net_stats->tx_aborted_errors = hw_stats->tx_abort_col; 1208 net_stats->tx_aborted_errors = hw_stats->tx_abort_col;
1204 net_stats->tx_window_errors = hw_stats->tx_late_col; 1209 net_stats->tx_window_errors = hw_stats->tx_late_col;
1205 1210
1211 net_stats->rx_packets = hw_stats->rx_ok + net_stats->rx_errors;
1212 net_stats->tx_packets = hw_stats->tx_ok + net_stats->tx_errors;
1213
1206 return net_stats; 1214 return net_stats;
1207} 1215}
1208 1216