[Bug 286762] igc driver doesn't properly recognize link status when in down state

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 13 May 2025 09:00:16 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286762

            Bug ID: 286762
           Summary: igc driver doesn't properly recognize link status when
                    in down state
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: aaron.styx@baesystems.com

I have an igc card (Intel I225-V device id 0x15f3) that doesn't properly report
link status when down. Without a cable attached, ifconfig properly reports a
status of no carrier. When a cable is then attached, ifconfig correctly reports
the status is active. However, when the cable is then removed, ifconfig
incorrectly reports that the status is active when it should report no carrier. 

I believe the root cause is that there is nothing in the ioctl SIOCGIFXMEDIA
path (through iflib and if_media that ultimately calls the driver's
igc_if_update_admin_status() function) that will set the igc_softc's
hw.mac.get_link_status variable to true when the device is down. When the
device is up, the 2Hz timer will check and set things appropriately, but the
timer doesn't run while the device is down. 

The hardware doesn't seem to trigger an admin interrupt on cable attach/detach
while down either. If it did, I don't think this would be a problem. I don't
know if it's only my specific card that doesn't generate admin interrupts on
link status change while down, or if that's common across all igc cards. 

A quick hack to fix this is to set at the top of igc_if_update_admin_status():
sc->hw.mac.get_link_status = true;
but that alone is clearly not a proper fix.

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