[Bug 261866] ixgbe(4) with optics not setting media type

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 10 Feb 2022 15:48:29 UTC

            Bug ID: 261866
           Summary: ixgbe(4) with optics not setting media type
           Product: Base System
           Version: 12.3-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: brian90013@gmail.com


I am testing FreeBSD-12.3 using an '82599ES 10-Gigabit SFI/SFP+ Network
Connection' with an 10Gbase-LR transceiver. A similar box at a remote location
was unable to establish a 10GbE link and fell back to 1GbE. I wanted to force
the 1000baseLX media type to see if that could be established reliably. After
my testing, I believe ixgbe resets the media type to autoselect immediately
after setting any other type - making the 'ifconfig ixl0 media 1000baseLX'
command useless. I believe it is revision r312544 that causes this behavior. I
am interested if ixgbe can be reworked so that fixed media types can be
applied. Thank you!

When linked at 10G, the output of 'ifconfig ixl0' includes:
        media: Ethernet autoselect (10Gbase-LR <full-duplex>)
My understanding is the first 'Ethernet autoselect' reflects what is configured
while the section in parenthesis '10Gbase-LR' is what is negotiated. I can try
to force the negotiated speed but ifconfig still reports 'Ethernet autoselect':
# ifconfig ixl0 media 10Gbase-LR
        media: Ethernet autoselect (10Gbase-LR <full-duplex>)
Note if I try this on a 1GbE igb driver, the configured media type is
# ifconfig igb0 media 100baseTX
       media: Ethernet 100baseTX (100baseTX <half-duplex>)

Next, I built the kernel using options 'IFMEDIA_DEBUG' and after booting set
'sysctl debug.ifmedia=1'. I added additional logging before the two
ifmedia_set() calls in the if_ix.c - in ixgbe_setup_interface() and
ixgbe_handl_msf(). Testing showed that after setting a new mode, the link goes
down then comes back up, and the handle_msf() function is called. That function
clears and reloads the available media types then sets the interface to auto.
That cancels out the forced media type.

I traced this problem to r312544 where ifmedia_set() was added to avoid an
invalid memory access. Is there a way to retain the configured media state and
attempt to use it after reloading the available types? Otherwise, at least when
using optics, it seems like I am unable to set a media type. I see ixl and ice
drivers don't support setting a media type - perhaps it is related to this

You are receiving this mail because:
You are the assignee for the bug.