Page MenuHomeFreeBSD

aue(4): fix incorrect media detection
Needs ReviewPublic

Authored by rkitover_gmail.com on Sun, Jun 14, 3:21 AM.
Referenced Files
F160640231: D57566.id179705.diff
Fri, Jun 26, 10:11 AM
Unknown Object (File)
Thu, Jun 25, 1:04 PM
Unknown Object (File)
Sun, Jun 21, 5:09 AM
Unknown Object (File)
Sat, Jun 20, 12:03 AM
Unknown Object (File)
Fri, Jun 19, 2:16 AM
Unknown Object (File)
Fri, Jun 19, 1:46 AM
Unknown Object (File)
Wed, Jun 17, 9:01 PM
Unknown Object (File)
Wed, Jun 17, 8:57 AM
Subscribers

Details

Summary

aue_miibus_statchg() unconditionally programmed the chip speed register
from mii_media_active without checking link validity. If statchg was
called during auto-negotiation before it completed, mii_media_active
would not yet be IFM_100_TX, causing the chip to be forced to 10Mbps.

Additionally, aue_tick() never called aue_miibus_statchg() to update
the hardware after auto-negotiation completed, so the chip stayed at
10Mbps even after the PHY negotiated 100Mbps.

Fix by adding IFM_ACTIVE|IFM_AVALID link validation to statchg before
programming the speed register, and by having tick call statchg to
re-evaluate and program the hardware, matching the axe(4) driver.

Tested with Belkin USB 10/100 Ethernet Adapter F5D5050.

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

Diff Detail

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

Event Timeline

Add Differential Review to commit message

MII bus lock patch is here:

https://reviews.freebsd.org/D57567

, the add reviewers action was greyed out.

@rkitover_gmail.com
Thank you for your effort.

I will test this and D57567 patch for aue with UFFALO LUA2-TX USB.

I tested this patch with two BUFFALO LUA2-TX (aue(4)) dongles that show the exact same dmesg.

Dongle A (still has a media detection issue):

  • With patch: 10baseTX <full-duplex> -> NG
  • Without patch: 100baseTX <half-duplex> -> NG

Dongle B (works fine even without this patch):

  • With patch: 100baseTX <full-duplex> -> OK
  • Without patch: 100baseTX <full-duplex> -> OK

I am not sure what the internal difference is between Dongle A and B. When I use both dongles on Linux (Raspberry Pi OS), ethtool reports 100baseTX <full-duplex> OK and they work fine.

Note that without this patch and D57567, I cannot run iperf at all on Dongle B.
Please let me know if I need to test network connectivity without D57567 or provide any further logs.

[dmesg]
aue0 on uhub1
aue0: <LUA2-TX BUFFALO LUA2-TX, class 0/0, rev 1.10/1.01, addr 2> on usbus0
miibus1: <MII bus> on aue0
acphy0: <ACXXX 10/100 media interface> PHY 1 on miibus1
acphy0: 100baseFX, 100baseFX-FDX, none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ue0: <USB Ethernet> on aue0
ue0: Ethernet address: 00:40:26:c0:xx:xx
ue0: link state changed to DOWN
ue0: link state changed to UP