misc/150249: [ixgbe] Media type detection broken
Andrew Boyer
aboyer at averesystems.com
Fri Sep 3 15:20:04 UTC 2010
>Number: 150249
>Category: misc
>Synopsis: [ixgbe] Media type detection broken
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri Sep 03 15:20:03 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: Andrew Boyer
>Release: 7.1p3
>Organization:
Avere Systems
>Environment:
N/A
>Description:
Intel 82599 adapter cards can use either copper or optical modules. Currently, no matter which type of connection is used, ifconfig will report a media type of 10Gbase-SR.
Several changes are required to fix this.
1) In ixgbe_attach(), pci_device_id IXGBE_DEV_ID_82599_SFP causes adapter->optics to be set to IFM_10G_SR. This is incorrect. The "optics" type can not be set until the media is actually detected. (2) In our tree I added a switch statement at the end of ixgbe_handle_mod() to set the optics value based on the return value of hw->mac.ops.get_media_type().
That led me to discover that functions ixgbe_get_media_type_82598() and ixgbe_get_media_type_82599() have flaws:
3) In ixgbe_get_media_type_82598(), device_id IXGBE_DEV_ID_82598_DA_DUAL_PORT returns ixgbe_media_type_fiber, even though the DA card supports only copper.
4) In both, the initial test to detect if there is a copper PHY attached leaves out some possible values for copper PHYs:
ixgbe_phy_sfp_passive_tyco
ixgbe_phy_sfp_passive_unknown
ixgbe_phy_sfp_active_unknown
5) Once you fix this so that ixgbe_get_media_type_*() returns the correct value, you'll notice that ixgbe_identify_sfp_module_generic() stops working for copper cables. This is because it tests for (mac.ops.get_media_type() != ixgbe_media_type_fiber) and returns an error. In our internal tree I have commented out this check completely; the ID routine will fail gracefully if there isn't an SFP present, at least on all of our card types.
>How-To-Repeat:
Install an 82599 card and SFP+ copper cables. Run 'ifconfig' and observe that the media type is listed as (10Gbase-SR <full-duplex>).
>Fix:
See suggestions in the Full Description. I could put together a patch if it would help get this fixed in the tree, although a lot of it is in Intel common code (ixgbe_82598.c, ixgbe_82599.c, ixgbe_phy.c).
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list