首页 > 代码库 > ethtool常见命令使用方法

ethtool常见命令使用方法

  • 查看网卡信息:ethtool DEVNAME    

Settings for eth6:
Supported ports: [ FIBRE ]  #可以看出网卡类型:光口或电口
Supported link modes: 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: FIBRE
PHYAD: 0
Transceiver: external
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: d
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes

 

  • 查看网卡驱动:ethtool -i DEVNAME

driver: e1000e  #网卡驱动
version: 2.3.2-k
firmware-version: 5.11-6
bus-info: 0000:06:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no

  • 查看网卡统计信息:ethtool -S DEVNAME
  • 查看收发队列:ethtool -g DEVNAME    

Ring parameters for eth6:
Pre-set maximums:
RX: 4096  #预设最大接收队列大小
RX Mini: 0
RX Jumbo: 0
TX: 4096  #预设最大发送队列大小
Current hardware settings:
RX: 256  #当前接收队列大小
RX Mini: 0
RX Jumbo: 0
TX: 256  #当前发送队列大小

  • 设置收发队列:ethtool -G DEVNAME rx/tx N

ethtool -G eth6 rx 4096  #设置发送队列大小

Ring parameters for eth6:
Pre-set maximums:
RX: 4096  
RX Mini: 0
RX Jumbo: 0
TX: 4096  
Current hardware settings:
RX: 4096  #修改后的接收队列大小,网卡丢包的一个原因就是接收队列不够大。
RX Mini: 0
RX Jumbo: 0
TX: 256  

 

ethtool常见命令使用方法