Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 2.1 product line. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 105361

Summary: tg3 driver cannot use ethtool unless the ethernet interface is up
Product: Red Hat Enterprise Linux 2.1 Reporter: Neil Horman <nhorman>
Component: kernelAssignee: Jeff Garzik <jgarzik>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.1CC: peterm, riel, tao
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-09-25 14:46:57 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:

Description Neil Horman 2003-09-25 14:01:09 UTC
Description of problem:
the tg3 driver does not allow the use of ethtool until the open method has been
called on the driver.  The use of any ethtool ioctls is gated in all versions of
the driver by the TG3_FLAG_INIT_COMPLETE flag.  This flag:

a) I not initalized during module initalization (it probably should be) - we
seem to be getting lucky and reading it as zero in the return from alloc_etherdev

b) Set at the end of tg3_open

c) Cleared at the start of tg3_close

(a) is pretty clearly a bug
(b) and (c) seem reasonable, but they imply that anytime an interface owned by
this driver is closed, or not explicitly opened, any call to tg3_ethtool_ioctl
(or the successor funtions in later versions of the driver), will return
-EAGAIN.  I've poked about, and it appears that all of the data which is
manipulated by the ethtool ioctls is set during pci probing in the module
initalization code, so I would guess that it would be safe to just remove the
check for TG3_FLAG_INIT_COMPLETE in the ioctl functions.  However, I don't know
if thats a safe assumption in the long term.

Version-Release number of selected component (if applicable):
all driver versions

How reproducible:
Always

Steps to Reproduce:
1.Boot a linux system containing a NIC managed by the tg3 driver. Ensure that it
is not activated at boot time.
2.run "ethtool speed 1000 duplex full" on the interface while it is down

    
Actual results:
ioctl call to tg3 drvier will return -EAGAIN

Expected results:
ioctl call will change tg3 driver settings to force 1000f 

Additional info:
Opened in response to issuetracker #27010

Comment 1 Jeff Garzik 2003-09-25 14:46:57 UTC
This is expected behavior.

For the flag, TG3_FLAG_INIT_COMPLETE is only set when initialization is
complete.  This only occurs after tg3_open() finishes.

However, that has nothing to do with the issue described in the summary -- tg3
requires the interface to be up, to use ethtool.  This is because the hardware
is shut down, when the interface is downed.