@@ -1678,33 +1678,42 @@ static void atl1_inc_smb(struct atl1_adapter *adapter)
1678
1678
struct net_device * netdev = adapter -> netdev ;
1679
1679
struct stats_msg_block * smb = adapter -> smb .smb ;
1680
1680
1681
+ u64 new_rx_errors = smb -> rx_frag +
1682
+ smb -> rx_fcs_err +
1683
+ smb -> rx_len_err +
1684
+ smb -> rx_sz_ov +
1685
+ smb -> rx_rxf_ov +
1686
+ smb -> rx_rrd_ov +
1687
+ smb -> rx_align_err ;
1688
+ u64 new_tx_errors = smb -> tx_late_col +
1689
+ smb -> tx_abort_col +
1690
+ smb -> tx_underrun +
1691
+ smb -> tx_trunc ;
1692
+
1681
1693
/* Fill out the OS statistics structure */
1682
- adapter -> soft_stats .rx_packets += smb -> rx_ok ;
1683
- adapter -> soft_stats .tx_packets += smb -> tx_ok ;
1694
+ adapter -> soft_stats .rx_packets += smb -> rx_ok + new_rx_errors ;
1695
+ adapter -> soft_stats .tx_packets += smb -> tx_ok + new_tx_errors ;
1684
1696
adapter -> soft_stats .rx_bytes += smb -> rx_byte_cnt ;
1685
1697
adapter -> soft_stats .tx_bytes += smb -> tx_byte_cnt ;
1686
1698
adapter -> soft_stats .multicast += smb -> rx_mcast ;
1687
- adapter -> soft_stats .collisions += (smb -> tx_1_col + smb -> tx_2_col * 2 +
1688
- smb -> tx_late_col + smb -> tx_abort_col * adapter -> hw .max_retry );
1699
+ adapter -> soft_stats .collisions += smb -> tx_1_col +
1700
+ smb -> tx_2_col +
1701
+ smb -> tx_late_col +
1702
+ smb -> tx_abort_col ;
1689
1703
1690
1704
/* Rx Errors */
1691
- adapter -> soft_stats .rx_errors += (smb -> rx_frag + smb -> rx_fcs_err +
1692
- smb -> rx_len_err + smb -> rx_sz_ov + smb -> rx_rxf_ov +
1693
- smb -> rx_rrd_ov + smb -> rx_align_err );
1705
+ adapter -> soft_stats .rx_errors += new_rx_errors ;
1694
1706
adapter -> soft_stats .rx_fifo_errors += smb -> rx_rxf_ov ;
1695
1707
adapter -> soft_stats .rx_length_errors += smb -> rx_len_err ;
1696
1708
adapter -> soft_stats .rx_crc_errors += smb -> rx_fcs_err ;
1697
1709
adapter -> soft_stats .rx_frame_errors += smb -> rx_align_err ;
1698
- adapter -> soft_stats .rx_missed_errors += (smb -> rx_rrd_ov +
1699
- smb -> rx_rxf_ov );
1700
1710
1701
1711
adapter -> soft_stats .rx_pause += smb -> rx_pause ;
1702
1712
adapter -> soft_stats .rx_rrd_ov += smb -> rx_rrd_ov ;
1703
1713
adapter -> soft_stats .rx_trunc += smb -> rx_sz_ov ;
1704
1714
1705
1715
/* Tx Errors */
1706
- adapter -> soft_stats .tx_errors += (smb -> tx_late_col +
1707
- smb -> tx_abort_col + smb -> tx_underrun + smb -> tx_trunc );
1716
+ adapter -> soft_stats .tx_errors += new_tx_errors ;
1708
1717
adapter -> soft_stats .tx_fifo_errors += smb -> tx_underrun ;
1709
1718
adapter -> soft_stats .tx_aborted_errors += smb -> tx_abort_col ;
1710
1719
adapter -> soft_stats .tx_window_errors += smb -> tx_late_col ;
@@ -1718,23 +1727,18 @@ static void atl1_inc_smb(struct atl1_adapter *adapter)
1718
1727
adapter -> soft_stats .tx_trunc += smb -> tx_trunc ;
1719
1728
adapter -> soft_stats .tx_pause += smb -> tx_pause ;
1720
1729
1721
- netdev -> stats .rx_packets = adapter -> soft_stats .rx_packets ;
1722
- netdev -> stats .tx_packets = adapter -> soft_stats .tx_packets ;
1723
1730
netdev -> stats .rx_bytes = adapter -> soft_stats .rx_bytes ;
1724
1731
netdev -> stats .tx_bytes = adapter -> soft_stats .tx_bytes ;
1725
1732
netdev -> stats .multicast = adapter -> soft_stats .multicast ;
1726
1733
netdev -> stats .collisions = adapter -> soft_stats .collisions ;
1727
1734
netdev -> stats .rx_errors = adapter -> soft_stats .rx_errors ;
1728
- netdev -> stats .rx_over_errors =
1729
- adapter -> soft_stats .rx_missed_errors ;
1730
1735
netdev -> stats .rx_length_errors =
1731
1736
adapter -> soft_stats .rx_length_errors ;
1732
1737
netdev -> stats .rx_crc_errors = adapter -> soft_stats .rx_crc_errors ;
1733
1738
netdev -> stats .rx_frame_errors =
1734
1739
adapter -> soft_stats .rx_frame_errors ;
1735
1740
netdev -> stats .rx_fifo_errors = adapter -> soft_stats .rx_fifo_errors ;
1736
- netdev -> stats .rx_missed_errors =
1737
- adapter -> soft_stats .rx_missed_errors ;
1741
+ netdev -> stats .rx_dropped = adapter -> soft_stats .rx_rrd_ov ;
1738
1742
netdev -> stats .tx_errors = adapter -> soft_stats .tx_errors ;
1739
1743
netdev -> stats .tx_fifo_errors = adapter -> soft_stats .tx_fifo_errors ;
1740
1744
netdev -> stats .tx_aborted_errors =
@@ -1743,6 +1747,9 @@ static void atl1_inc_smb(struct atl1_adapter *adapter)
1743
1747
adapter -> soft_stats .tx_window_errors ;
1744
1748
netdev -> stats .tx_carrier_errors =
1745
1749
adapter -> soft_stats .tx_carrier_errors ;
1750
+
1751
+ netdev -> stats .rx_packets = adapter -> soft_stats .rx_packets ;
1752
+ netdev -> stats .tx_packets = adapter -> soft_stats .tx_packets ;
1746
1753
}
1747
1754
1748
1755
static void atl1_update_mailbox (struct atl1_adapter * adapter )
@@ -1872,7 +1879,7 @@ static u16 atl1_alloc_rx_buffers(struct atl1_adapter *adapter)
1872
1879
adapter -> rx_buffer_len );
1873
1880
if (unlikely (!skb )) {
1874
1881
/* Better luck next round */
1875
- adapter -> netdev -> stats .rx_dropped ++ ;
1882
+ adapter -> soft_stats .rx_dropped ++ ;
1876
1883
break ;
1877
1884
}
1878
1885
0 commit comments