Description of problem: I'm trying to use ETHTOOL_OPTS in /etc/sysconfig/network-scripts/ifcfg-eth1 to disable tcp offload using this value: ETHTOOL_OPTS="-K eth1 tso off" This fails because the ifup script assumes any options passed to ethtool will be arguments of the "-s" option: [root@perceus network-scripts]# grep ETHTOOL * ifcfg-eth1:ETHTOOL_OPTS="-K eth1 tso off" ifup-eth: if [ -n "$ETHTOOL_OPTS" ] ; then ifup-eth: /sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS ifup-eth: if [ -n "$ETHTOOL_OPTS" ] ; then ifup-eth: /sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS ifup-eth: if [ -n "$ETHTOOL_OPTS" ] ; then ifup-eth: /sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS ifup-eth: if [ -n "$ETHTOOL_OPTS" ] ; then ifup-eth: /sbin/ethtool -s ${REALDEVICE} $ETHTOOL_OPTS Version-Release number of selected component (if applicable): initscripts-8.45.25 (CentOS 5.3) initscripts-8.95 (Fedora 11) How reproducible: Setting any option other than those for the -s flag of ethtool causes ethtool to silently (AFAICT) fail. Steps to Reproduce: 1. Add any non -s options to ETHTOOL_OPTS 2. Restart network 3. Examine device settings with ethtool Actual results: No settings change. Expected results: Settings change to match ETHTOOL_OPTS Additional info: This is simple enough to workaround by placing an ethtool line in /etc/rc.local for extra device changes, but it would be nice for the sake of consistency if all ethtool options could be specified in one place and activated by the network startup scripts (not necessarily the ifcfg-$device file, it just happens to be the current documented place.)
Created attachment 358796 [details] Add additional ETHTOOL_OPTS_* options to ifup script. This patch adds handling for 4 new variables in the ifcfg-eth* file: ETHTOOL_OPTS_GENERIC ETHTOOL_OPTS_PAUSE ETHTOOL_OPTS_COALESCE ETHTOOL_OPTS_OFFLOAD If ETHTOOL_OPTS is defined, then the script behaves in the classic manner, passing those options to 'ethtool -s'. If ETHTOOL_OPTS is not defined, then the 4 new variables are checked and for each one that is defined, ethtool is called with the appropriate flag and the ETHTOOL_OPTS_* settings. So that for my case the following in ifcfg-eth1, ETHTOOL_OPTS_OFFLOAD="tso off" would result in ethtool -K eth1 tso off I have only lightly tested this patch on one server, mainly for syntax, with the ETHTOOL_OPTS_OFFLOAD variable set, no bonding or any other special networking configurations. Just throwing out a possible idea for adding the functionality without breaking backward compatibility.
ethtool tweaking is the sort of device-specific configuration that really should be udev rules. For example, a sample /etc/udev/rules.d/50-ethtool.rules: ACTION=="add", SUBSYSTEM=="net", NAME=="eth0", RUN+="/sbin/ethtool <your opts here>" Since the base ETHTOOL_OPTS predates udev for device-specific configuration, we'll keep it around. But I'd prefer not to extend it any more.
Could we revisit this, please? RHEL6 correctly parses ETHTOOL_OPTS in the ifcfg-eth* files, but RHEL5 does not. Compare the OP's details to RHEL6 network-functions script: mock6 network-scripts]$ grep -A 8 ETHTOOL_OPTS * network-functions: for opts in $ETHTOOL_OPTS ; do network-functions- IFS=$oldifs; network-functions- if [[ "${opts}" =~ [[:space:]]*- ]]; then network-functions- /sbin/ethtool $opts network-functions- else network-functions- /sbin/ethtool -s ${REALDEVICE} $opts network-functions- fi network-functions- IFS=';'; network-functions- done Could we have the behavior match?