Ethtool

Ethtool is a standard Linux utility for controlling network drivers and hardware, particularly for wired Ethernet devices. It can be used to:

  • Get identification and diagnostic information

  • Get extended device statistics

  • Control speed, duplex, auto-negotiation and flow control for Ethernet devices

  • Control checksum offload and other hardware offload features

  • Control DMA ring sizes and interrupt moderation

  • Flash device firmware using a .mfa2 image

Ethtool Supported Options

Options

Description

ethtool --set-priv-flags eth<x> <priv flag> <on/off>

Enables/disables driver feature matching the given private flag.

ethtool --show-priv-flags eth<x>

Shows driver private flags and their states (ON/OFF).

ethtool -a eth<x>

Queries the pause frame settings.

ethtool -A eth<x> [rx on|off] [tx on|off]

Sets the pause frame settings.

ethtool -c eth<x>

Queries interrupt coalescing settings.

ethtool -C eth<x> [pkt-rate-low N] [pkt-rate-high N] [rx-usecs-low N] [rx-usecs-high N]

Sets the values for packet rate limits and for moderation time high and low values.

ethtool -C eth<x> [rx-usecs N] [rx-frames N]

Sets the interrupt coalescing setting.

rx-frames will be enforced immediately, rx-usecs will be enforced only when adaptive moderation is disabled.

Note: usec settings correspond to the time to wait after the *last* packet is sent/received before triggering an interrupt.

ethtool -C eth<x> adaptive-rx on|off

Enables/disables adaptive interrupt moderation.

By default, the driver uses adaptive interrupt moderation for the receive path, which adjusts the moderation time to the traffic pattern.

ethtool -C eth<x> adaptive-tx on|off

Note: Supported by mlx5e for ConnectX-4 and above adapter cards.

Enables/disables adaptive interrupt moderation.

By default, the driver uses adaptive interrupt moderation for the transmit path, which adjusts the moderation parameters (time/frames) to the traffic pattern.

ethtool -g eth<x>

Queries the ring size values.

ethtool -G eth<x> [rx <N>] [tx <N>]

Modifies the ring size.

ethtool -i eth<x>

Checks driver and device information.

For example:

 
 driver: mlx5_core
 version: 5.1-0.4.0
 firmware-version: 4.6.4046 (MT_QEMU000000)
 expansion-rom-version: 
 bus-info: 0000:07:00.0
 supports-statistics: yes
 supports-test: yes 
 supports-eeprom-access: no
 supports-register-dump: no
 supports-priv-flags: yes

ethtool -k eth<x>

Queries the stateless offload status.

ethtool -K eth<x> [rx on|off] [tx on|off] [sg on|off] [tso on|off] [lro on|off] [gro on|off] [gso on|off] [rxvlan on|off] [txvlan on|off] [ntuple on/off] [rxhash on/off] [rx-all on/off] [rx-fcs on/off]

Sets the stateless offload status.

TCP Segmentation Offload (TSO), Generic Segmentation Offload (GSO): increase outbound throughput by reducing CPU overhead. It works by queuing up large buffers and letting the network interface card split them into separate packets.

Large Receive Offload (LRO): increases inbound throughput of high-bandwidth network connections by reducing CPU overhead. It works by aggregating multiple incoming packets from a single stream into a larger buffer before they are passed higher up the networking stack, thus reducing the number of packets that have to be processed. LRO is available in kernel versions < 3.1 for untagged traffic.

Hardware VLAN insertion Offload (txvlan): When enabled, the sent VLAN tag will be inserted into the packet by the hardware.

Note: LRO will be done whenever possible. Otherwise GRO will be done. Generic Receive Offload (GRO) is available throughout all kernels.

Hardware VLAN Striping Offload (rxvlan): When enabled received VLAN traffic will be stripped from the VLAN tag by the hardware.

RX FCS (rx-fcs): Keeps FCS field in the received packets.Sets the stateless offload status.

RX FCS validation (rx-all): Ignores FCS validation on the received packets.

ethtool -l eth<x>

Shows the number of channels.

ethtool -L eth<x> [rx <N>] [tx <N>]

Sets the number of channels.

Notes:

  • This also resets the RSS table to its default distribution, which is uniform across the cores on the NUMA (non-uniform memory access) node that is closer to the NIC.

  • For ConnectX®-4 cards, use ethtool -L eth<x> combined <N> to set both RX and TX channels.

ethtool -m|--dump-module-eeprom eth<x> [ raw on|off ] [ hex on|off ] [ offset N ] [ length N ]

Queries/decodes the cable module eeprom information.

ethtool -p|--identify DEVNAME

Enables visual identification of the port by LED blinking [TIME-IN-SECONDS].

ethtool -p|--identify eth<x> <LED duration>

Allows users to identify interface's physical port by turning the ports LED on for a number of seconds.

Note: The limit for the LED duration is 65535 seconds.

ethtool -S eth<x>

Obtains additional device statistics.

ethtool -s eth<x> advertise <N> autoneg on

Changes the advertised link modes to requested link modes <N>

To check the link modes’ hex values, run <man ethtool> and to check the supported link modes, run ethtool eth<x>

For advertising new link modes, make sure to configure the entire bitmap as follows:

200GAUI-4 / 200GBASE-CR4/KR4

0x7c000000000000000

100GAUI-2 / 100GBASE-CR2 / KR2

0x3E00000000000000

CAUI-4 / 100GBASE-CR4 / KR4

0xF000000000

50GAUI-1 / LAUI-1/ 50GBASE-CR / KR

0x1F0000000000000

50GAUI-2 / LAUI-2/ 50GBASE-CR2/KR2

0x10C00000000

XLAUI-4/XLPPI-4 // 40G

0x7800000

25GAUI-1/ 25GBASE-CR / KR

0x380000000

XFI / XAUI-1 // 10G

0x7C0000181000

5GBASE-R

0x1000000000000

2.5GBASE-X / 2.5GMII

0x820000000000

1000BASE-X / SGMII

0x20000020020

Notes:

  • Both previous and new link modes configurations are supported, however, they must be run separately.

  • Any link mode configuration on Kernels below v5.1 and ConnectX-6 HCAs will result in the advertisement of the full capabilities.

  • <autoneg on> only sends a hint to the driver that the user wants to modify advertised link modes and not speed.

ethtool -s eth<x> msglvl [N]

Changes the current driver message level.

ethtool -s eth<x> speed <SPEED> autoneg off

Changes the link speed to requested <SPEED>. To check the supported speeds, run ethtool eth<x>.

Note: does not set autoneg OFF, it only hints the driver to set a specific speed.

ethtool -t eth<x>

Performs a self-diagnostics test.

ethtool -T eth<x>

Shows time stamping capabilities

ethtool -x eth<x>

Retrieves the receive flow hash indirection table.

ethtool -X eth<x> equal a b c...

Sets the receive flow hash indirection table.

Note: The RSS table configuration is reset whenever the number of channels is modified (using ethtool -L command).

ethtool --show-fec eth<x>

Queries current Forward Error Correction (FEC) encoding in case FEC is supported.

Note: An output of "baser" implies Firecode encoding.

ethtool --set-fec eth<x> encoding auto|off|rs|baser

Configures Forward Error Correction (FEC).

Note: ‘baser’ encoding applies to the Firecode encoding, and ‘auto’ regards the HCA’s default.

ethtool -f|--flash <devname> FILE [N]

Flash firmware image on the device using the specified .mfa2 file (FILE). By default, the command flashes all the regions on the device unless a region number (N) is specified.

© Copyright 2023, NVIDIA. Last updated on Oct 23, 2023.