Kickstart parameter --ethtool is ignored

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 7, 8

Issue

The --ethtool parameter in network ... --ethtool="..." is ignored.
The option ETHTOOL_OPTS="..." added into the resulting /etc/sysconfig/network-scripts/ifcfg-ens1 is also ignored.

Resolution

Workaround - create a dispatcher script for NetworkManager

Excerpt of the kickstart configuration file creating the dispatcher script:

%post

ETHTOOL=/etc/NetworkManager/dispatcher.d/30-ethtool
INTERFACE=ens1

echo -e '#!/bin/bash

if [ "$1" == "'$INTERFACE'" ] && [ "$2" == "up" ]; then
    ethtool -G $1 rx 2047 tx 511
fi' > $ETHTOOL

chmod +x $ETHTOOL

%end

man NetworkManager contains more detailed information


After the first reboot, we see the output of the ethtool command:

# ethtool -g ens1
Ring parameters for ens1:
Pre-set maximums:
RX:             4096
RX Mini:        0
RX Jumbo:       0
TX:             4096
Current hardware settings:
RX:             2048
RX Mini:        0
RX Jumbo:       0
TX:             512

SELinux context is set correctly:

# ls -Z /etc/NetworkManager/dispatcher.d/
-rwxr-xr-x. root root system_u:object_r:NetworkManager_initrc_exec_t:s0 00-netreport
-rwxr-xr-x. root root system_u:object_r:NetworkManager_initrc_exec_t:s0 11-dhclient
-rwxr-xr-x. root root system_u:object_r:NetworkManager_initrc_exec_t:s0 20-chrony
-rwxr-xr-x. root root system_u:object_r:NetworkManager_initrc_exec_t:s0 30-ethtool
drwxr-xr-x. root root system_u:object_r:NetworkManager_initrc_exec_t:s0 no-wait.d
drwxr-xr-x. root root system_u:object_r:NetworkManager_initrc_exec_t:s0 pre-down.d
drwxr-xr-x. root root system_u:object_r:NetworkManager_initrc_exec_t:s0 pre-up.d

The script /etc/NetworkManager/dispatcher.d/30-ethtool created from the kickstart looks like this:

#!/bin/bash

if [ "$1" == "ens1" ] && [ "$2" == "up" ]; then
    ethtool -G $1 rx 2047 tx 511
fi

Root Cause

This is known bug currently tracked by BZ 1762749 (RHEL7).
This is known bug currently tracked by BZ 1886381 (RHEL8).

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments