https://access.redhat.com/solutions/504293
Why are packet drops reported in ifconfig not reflected in ethtool?
环境
- Red Hat Enterprise Linux (All Versions).
问题
ifconfig
reports dropped packets or frames for an interface whileethtool
statistics show none
决议
The ethtool
statistics should be favoured over those of ifconfig
. The dropped
counter in ifconfig
was originally intended to log protocol-only drops, such as a protocol handler being unable to allocate memory, but has since been obscured by various drivers adding their statistics in no standard way to these counters.
根源
The ifconfig
statistics come from the NET_DRIVER structure while ethtool
statistics comes from the device's private structure. NIC drivers may re-initializing their private structure when the device goes down and back up, but may not re-initialize the NET_DRIVER structure.
翻译如下:
ifconfig统计数据来自net driver结构,ethtool统计数据来自设备的私有结构。网卡驱动程序可以在设备关闭和备份时重新初始化其私有结构,但不能重新初始化net driver程序结构。
诊断步骤
- View output from
ifconfig
and note dropped packets are reported:
$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr AA:AA:AA:AA:AA:A1
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:1139698 errors:0 dropped:365956 overruns:0 frame:0
TX packets:232 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:110397607 (105.2 MiB) TX bytes:106391 (103.8 KiB)
Interrupt:16
- View
ethtool -S
output and note no packet drops are listed:
$ ethtool -S eth0
NIC statistics:
rx_octets: 110403643
rx_fragments: 0
rx_ucast_packets: 523
rx_mcast_packets: 774623
rx_bcast_packets: 364610
rx_fcs_errors: 0
rx_align_errors: 0
rx_xon_pause_rcvd: 0
rx_xoff_pause_rcvd: 0
rx_mac_ctrl_rcvd: 0
rx_xoff_entered: 0
rx_frame_too_long_errors: 0
rx_jabbers: 0
rx_undersize_packets: 0
rx_in_length_errors: 0
rx_out_length_errors: 0
rx_64_or_less_octet_packets: 0
rx_65_to_127_octet_packets: 0
rx_128_to_255_octet_packets: 0
rx_256_to_511_octet_packets: 0
rx_512_to_1023_octet_packets: 0
rx_1024_to_1522_octet_packets: 0
rx_1523_to_2047_octet_packets: 0
rx_2048_to_4095_octet_packets: 0
rx_4096_to_8191_octet_packets: 0
rx_8192_to_9022_octet_packets: 0
tx_octets: 106391
tx_collisions: 0
tx_xon_sent: 0
tx_xoff_sent: 0
tx_flow_control: 0
tx_mac_errors: 0
tx_single_collisions: 0
tx_mult_collisions: 0
tx_deferred: 0
tx_excessive_collisions: 0
tx_late_collisions: 0
tx_collide_2times: 0
tx_collide_3times: 0
tx_collide_4times: 0
tx_collide_5times: 0
tx_collide_6times: 0
tx_collide_7times: 0
tx_collide_8times: 0
tx_collide_9times: 0
tx_collide_10times: 0
tx_collide_11times: 0
tx_collide_12times: 0
tx_collide_13times: 0
tx_collide_14times: 0
tx_collide_15times: 0
tx_ucast_packets: 230
tx_mcast_packets: 1
tx_bcast_packets: 1
tx_carrier_sense_errors: 0
tx_discards: 0
tx_errors: 0
dma_writeq_full: 0
dma_write_prioq_full: 0
rxbds_empty: 0
rx_discards: 0
rx_errors: 0
rx_threshold_hit: 0
dma_readq_full: 0
dma_read_prioq_full: 0
tx_comp_queue_full: 0
ring_set_send_prod_index: 0
ring_status_update: 0
nic_irqs: 0
nic_avoided_irqs: 0
nic_tx_threshold_hit: 0
mbuf_lwm_thresh_hit: 0