Bug 105361 - tg3 driver cannot use ethtool unless the ethernet interface is up
Summary: tg3 driver cannot use ethtool unless the ethernet interface is up
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: kernel
Version: 2.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Garzik
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-09-25 14:01 UTC by Neil Horman
Modified: 2013-07-03 02:15 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-09-25 14:46:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.



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