Page MenuHomeFreeBSD

axge: fix spurious link down from MII, frozen TX
Needs ReviewPublic

Authored by rkitover_gmail.com on Tue, Mar 3, 1:11 PM.
Referenced Files
Unknown Object (File)
Fri, Mar 13, 9:52 PM
Unknown Object (File)
Fri, Mar 13, 2:15 PM
Unknown Object (File)
Wed, Mar 11, 7:09 AM
Unknown Object (File)
Sun, Mar 8, 2:04 PM
Unknown Object (File)
Sun, Mar 8, 1:57 PM
Unknown Object (File)
Sun, Mar 8, 8:25 AM
Unknown Object (File)
Thu, Mar 5, 1:50 AM
Unknown Object (File)
Thu, Mar 5, 1:34 AM
Subscribers

Details

Reviewers
adrian
Group Reviewers
USB
network
Summary

A race condition in the MII layer causes spurious link down events, see:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252165

. In statchg, on link down, check if the PHY reports the link as
actually down using the BMSR register, if not, force the status of the
link to back up and restart TX. Do the same in a MII linkchg handler.

On actual link up, restart TX in case it went idle and down.

I have tested this patch with two of my USB-C hubs with this Ethernet
interface, and it gives me a stable permanent connection with no
interruptions to my internet connections.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 71153
Build 68036: arc lint + arc unit

Event Timeline

Add Differential Review URL

Add Differential Review URL to commit message.

style.9

sys/dev/usb/net/if_axge.c
334

use bool for new_link and old_link

392–394

Up to your judgement, but try to not break strings as much as possible.

488

style: Do not test without a comparison, or with unary ! (except for booleans).

I think I can remove the frozen TX fix given that the link doesn't go down, I'll do that and test it out, then update this patch.

pouria, I still want your ure logs, with and without the patch, I need to figure out why it didn't work for you as intended.

Remove frozen TX handling, unneeded if link up