ixgbe ifmedia handling
Eric Joyner
ricera10 at gmail.com
Wed Oct 22 21:55:48 UTC 2014
Hi,
On Wed, Oct 22, 2014 at 3:43 AM, Alexander V. Chernikov <
melifaro at freebsd.org> wrote:
> There is a problem with correct media reporting in ixgbe:
>
> ixgbe_setup_optics() is called only at ixgbe_attach().
> This means that:
> 1) if SFP slot was empty at the attach() time, "media" part will be set to
> adapter->optics = IFM_ETHER | IFM_AUTO;
> e.g. after attaching SFP status will look like
> media: Ethernet autoselect (autoselect <full-duplex>)
> status: active
> 2) If SFP slot was not empty, ifmedia will not be updated.
>
> The former case may trigger problems in other places inside kernel relying
> for ifmedia to be set correctly.
> For example, ifmedia_baudrate() will return 0 for given active interface
> (and this breaks best LACP aggregator selection
> making lagg interface attach impossible until module unload or reboot.
>
> Attached patch seems to work for 82599 NIC, but I'm pretty sure that it
> needs more checks.
> (And I wonder if we have the same problems with if_ixl).
>
Your attached patch seems to work okay, but it doesn't deal with changing
the baudrate. I don't think
we should print out a message every time an SFP module is removed though.
Aside from that, what kind of checks should there be?
>
> While investigating this case/performing tests I've noticed the following:
>
> * code inside ixgbe_local_timer() probing SFP seems to be dead
> /* Check for pluggable optics */
> if (adapter->sfp_probe)
> was always false (due to failure to detect/set IXGBE_ERR_SFP_NOT_PRESENT
> status?)
I will look at removing that.
>
>
* ixgbe_handle_mod() was triggered in 1/4 of cases:
> e.g. if you detach SFP witin 2-3 seconds after attach it will not trigger.
> Even if detaching SFP which was inserted half an hour ago (and link was
> UP) this interrupt does not always trigger.
>
You mean ixgbe_handle_msf(), right? I've just tried it, and noticed the
same thing you do.
I think this could be extended -- it'd be good to change if_baudrate when
the media type changes if that value
is important. For adding to the list of media types, it sounds like it
could be an unnecessary hassle. Is it important
to be able to force speeds using ifconfig media types vs a sysctl?
- Eric
More information about the freebsd-net
mailing list