Bug 105361 - tg3 driver cannot use ethtool unless the ethernet interface is up
tg3 driver cannot use ethtool unless the ethernet interface is up
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: kernel (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Garzik
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2003-09-25 10:01 EDT by Neil Horman
Modified: 2013-07-02 22:15 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-09-25 10:46:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Neil Horman 2003-09-25 10:01:09 EDT
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:

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 10:46:57 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.