Bug 692410

Summary: [RFE] Add code in network-scripts to enable more ETHTOOL_OPTS options
Product: Red Hat Enterprise Linux 6 Reporter: J.H.M. Dassen (Ray) <rdassen>
Component: initscriptsAssignee: initscripts Maintenance Team <initscripts-maint-list>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: asersen, azelinka, fhirtz, jeder, notting, pknirsch, plautrba, rbinkhor, simon.matter, vendor-redhat
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: initscripts-9.03.24-1.el6 Doc Type: Enhancement
Doc Text:
Cause The network-scripts don't allows for some of the ETHTOOL_OPTS that were needed. Consequence Certain ethtool options couldn't be used when bringing up network interfaces. Change Network startup scripts were modified such that all supported ethool command options may be set via the ETHTOOL_OPTS in the nic config files in /etc/sysconfig/network-scripts. Result Specified desired ethtool options via ETHTOOL_OPTS variable in the network-scripts config files are set after reboot.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 18:09:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 607248, 658636, 697582    
Attachments:
Description Flags
Customer's proposed patch
none
modified patch
none
modified patch, v2 none

Description J.H.M. Dassen (Ray) 2011-03-31 09:45:10 UTC
2. What is the nature and description of the request?

Enhancement to the network startup to allow for more ETHTOOL_OPTS option.

   3. Why does the customer need this? (List the business requirements here)

Customer requires certain options be used when bringing up network interfaces.
Currently, the network-scripts don't allows for some of the ETHTOOL_OPTS that
the customer needs/wants to use. Having system boot with required options via
normal startup process is more convenient and "cleaner" that have to modify
/etc/rc.local or perform manual steps post startup. 

   4. How would the customer like to achieve this? (List the functional
requirements here)

Modify network startup scripts such that all supported ethool command options
may be set via the ETHTOOL_OPTS in the nic config files in
/etc/sysconfig/network-scripts.

   5. For each functional requirement listed in question 4, specify how Red Hat
and the customer can test to confirm the requirement is successfully
implemented.

Specify desired ethtool options via ETHTOOL_OPTS variable in the
network-scripts config files, boot the system, and check that the options were
picked up.

   6. Is there already an existing RFE upstream or in Red Hat bugzilla?

I did not find any.

   7. How quickly does this need resolved? (desired target release)

Time frame is not too critical. This is a patch they've been carrying along
since RHEL5.3 and they would like to see it get accepted upstream. If there is
alternative solutions they're open to the idea. If this is something that could
even make it in by RHEL 7/Fedora 16/17 it would be fine.

   8. Does this request meet the RHEL Inclusion criteria (please review)

Yes.

   9. List the affected packages

initscripts, ethtool.  Others?

  10. Would the customer be able to assist in testing this functionality if
implemented?

Yes.

Comment 2 J.H.M. Dassen (Ray) 2011-03-31 09:48:11 UTC
Created attachment 489015 [details]
Customer's proposed patch

Comment 4 Bill Nottingham 2011-04-05 15:18:18 UTC
*** Bug 693583 has been marked as a duplicate of this bug. ***

Comment 6 Vinod Kutty 2011-04-15 04:52:31 UTC
This is an ancient bug (assumption that all ETHTOOL_OPTS are arguments to -s option) that we've requested a fix for when RHEL 3.x was current.

Looking forward to a fix.

Comment 7 Vinod Kutty 2011-04-15 04:58:39 UTC
Also, by way of documenting use cases: with more folks using 10GigE solutions in latency sensitive environments, ethtool tuning of things like interrupt coalescing parameters is more common.

Allowing options to ethtool to be set in ifcfg-ethX would be useful and intuitive given that "ETHTOOL_OPTS" suggests this is possible.

Comment 18 Bill Nottingham 2011-06-28 18:31:45 UTC
Created attachment 510341 [details]
modified patch

Here's a modified version of the patch that I'm planning to commit to HEAD (it should backport pretty cleanly.)

This changes the patch so that you can specify multiple sets of options in ETHTOOL_OPTS. An example:

ETHTOOL_OPTS="autoneg off; -K eth0 rx on; -A etho autoneg off"

This should be backwards compatible, allow setting arbitrary options, and address the concerns from bug 693583.

Comment 19 Bill Nottingham 2011-06-28 18:36:51 UTC
Created attachment 510342 [details]
modified patch, v2

Patch v2, fixed an IFS issue.

Comment 21 Bill Nottingham 2011-06-28 18:50:58 UTC
This is upstream commit 982b6eb.

Comment 23 Frank Hirtz 2011-08-03 18:38:10 UTC
The patch tested out well for me:

<snip>
[root@vir ~]# rpm -q initscripts
initscripts-9.03.23-1.el6.test.1.x86_64
[root@vir ~]# grep ETHT /etc/sysconfig/network-scripts/ifcfg-eth0
ETHTOOL_OPTS="-K eth0 tx off rx off; -C eth0 rx-usecs 10; -G eth0 rx 4096 tx 4096" 
[root@vir ~]# ethtool -k eth0
Offload parameters for eth0:
rx-checksumming: off
tx-checksumming: off
scatter-gather: off
tcp-segmentation-offload: off
udp-fragmentation-offload: off
generic-segmentation-offload: on
generic-receive-offload: off
large-receive-offload: off
[root@vir ~]# ethtool -c eth0
Coalesce parameters for eth0:
Adaptive RX: off  TX: off
stats-block-usecs: 0
sample-interval: 0
pkt-rate-low: 0
pkt-rate-high: 0

rx-usecs: 10
rx-frames: 0
rx-usecs-irq: 0
rx-frames-irq: 0

tx-usecs: 0
tx-frames: 0
tx-usecs-irq: 0
tx-frames-irq: 0

rx-usecs-low: 0
rx-frame-low: 0
tx-usecs-low: 0
tx-frame-low: 0

rx-usecs-high: 0
rx-frame-high: 0
tx-usecs-high: 0
tx-frame-high: 0

[root@vir ~]# ethtool -g eth0
Ring parameters for eth0:
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:		4096

[root@vir ~]# 
</snip>

Comment 24 Vinod Kutty 2011-08-04 04:26:18 UTC
Thanks for working on this. This will make my life easier.

As a usability refinement, would it be possible to tokenize or somehow refer to the device with a variable name, such as ${DEVICE} or ${REALDEVICE} ? This would make it easier to maintain ifcfg-* files, especially on servers with lots of NICs.

I have not had a chance to test this patch, so it may already work, but I'd like to request that this be an explicit design criteria if it isn't already.

Thx

Comment 25 Bill Nottingham 2011-08-04 20:38:11 UTC
(In reply to comment #24)
> Thanks for working on this. This will make my life easier.
> 
> As a usability refinement, would it be possible to tokenize or somehow refer to
> the device with a variable name, such as ${DEVICE} or ${REALDEVICE} ? This
> would make it easier to maintain ifcfg-* files, especially on servers with lots
> of NICs.

It works now *if* DEVICE is declared before ETHTOOL_OPTS in the ifcfg-* file, via normal shell interpretation.

Comment 26 Vinod Kutty 2011-08-11 19:39:49 UTC
OK. I suspected it would work, but I wanted to emphasize this as a design requirement so that future changes will not break this capability.

Thx

Comment 35 Petr Lautrbach 2011-10-17 11:37:21 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
    The network-scripts don't allows for some of the ETHTOOL_OPTS that
were needed.
    Consequence
    Certain ethtool options couldn't be used when bringing up network 
interfaces.

Change
    Network startup scripts were modified such that all supported ethool 
command options may be set via the ETHTOOL_OPTS in the nic config files in
/etc/sysconfig/network-scripts.

Result
    Specified desired ethtool options via ETHTOOL_OPTS variable in the
network-scripts config files are set after reboot.

Comment 36 Simon Matter 2011-10-18 05:16:37 UTC
May I strongly suggest the following small change:

--- ethtool_set.orig    2011-10-18 07:05:57.000000000 +0200
+++ ethtool_set 2011-10-18 07:06:08.000000000 +0200
@@ -7,6 +7,7 @@
     for opts in $ETHTOOL_OPTS ; do
         IFS=$oldifs;
         if [[ "${opts}" =~ [[:space:]]*- ]]; then
+            opts=$(eval echo ${opts})
             /sbin/ethtool ${opts}
         else
             /sbin/ethtool -s ${REALDEVICE} ${opts}


That way options can be set like below, which is more correct because additional options can be set on the same device (the real device) as it does with the old style -s options:

ETHTOOL_OPTS="autoneg off; -K \$REALDEVICE rx on; -A \$REALDEVICE autoneg off"

While doing so, please also add a comment about the new feature to sysconfig.txt, it's still missing there.

Thanks,
Simon

Comment 37 errata-xmlrpc 2011-12-06 18:09:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1528.html