转帖者注,个人的总结如下:
1. ifconfig -a 是总账( errors:255)
2. ethtool -S <网卡逻辑名> 是明细账(rx_errors: 255 和 rx_crc_errors: 255)
https://access.redhat.com/solutions/253703
How can I best see where packets are dropping on a network interface?
环境
-
Red Hat Enterprise Linux 6
-
Red Hat Enterprise Linux 5
-
Red Hat Enterprise Linux 4
问题
- A single interface, or an interface within a bond is dropping packets as visible within the output of
ifconfig
:
eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:X.X.X.X Bcast:X.X.X.X Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9514004 errors:255 dropped:255 overruns:0 frame:255
TX packets:3240402 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5761535684 (5.3 GiB) TX bytes:873500630 (833.0 MiB)
Interrupt:20 Memory:f1600000-f1620000
- How can I determine why these packets are dropping on a variety of drivers and interfaces?
决议
-
The
ethtool
command can give you driver-specific queues that are relative to the card and version which indicate how a drop is occurring: -
Use
ethtool -i
to check the version:
# ethtool -i eth0
driver: e1000e
version: 2.1.4-k
firmware-version: 0.13-3
bus-info: 0000:00:19.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no
- Then use
ethtool -S
on the interface to determine what queues are reporting drops or errors:
# ethtool -S eth0
NIC statistics:
rx_packets: 9519644
tx_packets: 3241625
rx_bytes: 5800638262
tx_bytes: 885572577
rx_broadcast: 2617040
tx_broadcast: 73
rx_multicast: 2254146
tx_multicast: 2481
rx_errors: 255 <--Errors
tx_errors: 0
tx_dropped: 0
multicast: 2254146
collisions: 0
rx_length_errors: 0
rx_over_errors: 0
rx_crc_errors: 255 <--Errors
rx_frame_errors: 0
rx_no_buffer_count: 0
rx_missed_errors: 0
tx_aborted_errors: 0
tx_carrier_errors: 0
tx_fifo_errors: 0
tx_heartbeat_errors: 0
tx_window_errors: 0
[...]
- The above example is to be used as an example only, and shows a situation wherein there is either a failing card, cable, or switchport. In many cases, each driver will need to be analyzed separately, as they have different counters listed. If you would like detailed information about these queues, please open a case with Red Hat Global Support Services concerning the drops.