• F
    net/sonic: Fix interface error stats collection · 4ae5af30
    Finn Thain 提交于
    commit 427db97df1ee721c20bdc9a66db8a9e1da719855 upstream.
    
    The tx_aborted_errors statistic should count packets flagged with EXD,
    EXC, FU, or BCM bits because those bits denote an aborted transmission.
    That corresponds to the bitmask 0x0446, not 0x0642. Use macros for these
    constants to avoid mistakes. Better to leave out FIFO Underruns (FU) as
    there's a separate counter for that purpose.
    
    Don't lump all these errors in with the general tx_errors counter as
    that's used for tx timeout events.
    
    On the rx side, don't count RDE and RBAE interrupts as dropped packets.
    These interrupts don't indicate a lost packet, just a lack of resources.
    When a lack of resources results in a lost packet, this gets reported
    in the rx_missed_errors counter (along with RFO events).
    
    Don't double-count rx_frame_errors and rx_crc_errors.
    
    Don't use the general rx_errors counter for events that already have
    special counters.
    
    Fixes: 1da177e4 ("Linux-2.6.12-rc2")
    Tested-by: NStan Johnson <userm57@yahoo.com>
    Signed-off-by: NFinn Thain <fthain@telegraphics.com.au>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    4ae5af30
sonic.c 21.1 KB