Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Mar 2024 18:19:30 +0000
From:      bugzilla-noreply@freebsd.org
To:        usb@FreeBSD.org
Subject:   [Bug 267514] AXGE(4) ASIX AX88179A ue0: link state changed to DOWN
Message-ID:  <bug-267514-19105-r8wU6pMQOS@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-267514-19105@https.bugs.freebsd.org/bugzilla/>
References:  <bug-267514-19105@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267514

Andrey Kosachenko <Andrey.Kosachenko@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Andrey.Kosachenko@gmail.com

--- Comment #8 from Andrey Kosachenko <Andrey.Kosachenko@gmail.com> ---
(In reply to karl from comment #5)

The same issue observed over here too.

=C2=BB uname -v
FreeBSD 14.0-RELEASE #0 releng/14.0-n265380-f9716eee8ab4: Fri Nov 10 05:57:=
23
UTC 2023=20=20=20=20
root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC


I've got a usb-dock with 1GB ethernet port:
=3D=3D=3D
~ =C2=BB usbconfig -d1.7 dump_device_desc
ugen1.7: <ASIX AX88179A> at usbus1, cfg=3D1 md=3DHOST spd=3DSUPER (5.0Gbps)=
 pwr=3DSAVE
(46mA)

  bLength =3D 0x0012=20
  bDescriptorType =3D 0x0001=20
  bcdUSB =3D 0x0320=20
  bDeviceClass =3D 0x0000  <Probed by interface class>
  bDeviceSubClass =3D 0x0000=20
  bDeviceProtocol =3D 0x0000=20
  bMaxPacketSize0 =3D 0x0009=20
  idVendor =3D 0x0b95=20
  idProduct =3D 0x1790=20
  bcdDevice =3D 0x0200=20
  iManufacturer =3D 0x0001  <ASIX>
  iProduct =3D 0x0002  <AX88179A>
  iSerialNumber =3D 0x0003  <00324FA6>
  bNumConfigurations =3D 0x0003=20
=3D=3D=3D

the links used to go up/down constantly (every 30-40 secs):

=3D=3D=3D
 =C2=BB ssed -nRe '/Mar  9.+ue0: link state/p;' /var/log/messages | tail=20=
=20=20=20=20=20=20=20=20=20=20=20
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20
silent@beastie
Mar  9 23:53:20 beastie kernel: ue0: link state changed to DOWN
Mar  9 23:53:21 beastie kernel: ue0: link state changed to UP
Mar  9 23:56:10 beastie kernel: ue0: link state changed to DOWN
Mar  9 23:56:10 beastie kernel: ue0: link state changed to UP
Mar  9 23:56:20 beastie kernel: ue0: link state changed to DOWN
Mar  9 23:56:21 beastie kernel: ue0: link state changed to UP
Mar  9 23:59:10 beastie kernel: ue0: link state changed to DOWN
Mar  9 23:59:10 beastie kernel: ue0: link state changed to UP
Mar  9 23:59:11 beastie kernel: ue0: link state changed to DOWN
Mar  9 23:59:11 beastie kernel: ue0: link state changed to UP

 =C2=BB ssed -nRe 's/(Mar  9 [0-9]+):[0-9]+:[0-9]+(.+ue0: link state
changed)/\1H:MM:SS\2/p;' /var/log/messages | sort | uniq -c
 121 Mar  9 21H:MM:SS beastie kernel: ue0: link state changed to DOWN
 121 Mar  9 21H:MM:SS beastie kernel: ue0: link state changed to UP
  97 Mar  9 22H:MM:SS beastie kernel: ue0: link state changed to DOWN
  97 Mar  9 22H:MM:SS beastie kernel: ue0: link state changed to UP
 102 Mar  9 23H:MM:SS beastie kernel: ue0: link state changed to DOWN
 102 Mar  9 23H:MM:SS beastie kernel: ue0: link state changed to UP
=3D=3D=3D


There is a workaround though found in this thread (suggested by PHK):
https://lists.freebsd.org/archives/freebsd-current/2024-March/005680.html.
NB: that workaround comes at cost though (speed decreases, nevertheless in =
my
case I was able to get more than 200Mbps which is fine for my use case)
Seems PHK added quirk into the src. Whereas the same can be achieved via
usbconfig.

In particular did the following:

By default device is attache axge driver:
=3D=3D=3D
=C2=BB usbconfig -d1.7 show_ifdrv
ugen1.7: <ASIX AX88179A> at usbus1, cfg=3D0 md=3DHOST spd=3DSUPER (5.0Gbps)=
 pwr=3DSAVE
(46mA)
ugen1.7.0: axge0: <NetworkInterface>
=3D=3D=3D


so decided to find out whether the suggested trick to replace it with cdce =
will
work.=20
First of all found out that device supports several configurations (default=
 is
0):
=3D=3D=3D
=C2=BB usbconfig -d1.7 dump_all_desc | egrep '(bNumConfigurations|Configura=
tion
index)'
  bNumConfigurations =3D 0x0003=20
 Configuration index 0
 Configuration index 1
 Configuration index 2
=3D=3D=3D


so tried it to change to 1 and it worked out:
=3D=3D=3D
~ =C2=BB sudo usbconfig -d 1.7 set_config 1

~ =C2=BB usbconfig -d1.7 show_ifdrv
ugen1.7: <ASIX AX88179A> at usbus1, cfg=3D1 md=3DHOST spd=3DSUPER (5.0Gbps)=
 pwr=3DSAVE
(46mA)
ugen1.7.0: cdce0: <ASIX AX88179A, class 0/0, rev 3.20/2.00, addr 33>
=3D=3D=3D


after that was done no link up/down flapping observed anymore.
Extended devd configuration (to avoid manual handling) and it works quite w=
ell
(configuration below includes lagg (failover to WiFi), so it looks a bit
excessive but I believe the idea is clear)
=3D=3D=3D
notify 100 {
    match "system"      "USB";
    match "subsystem"   "DEVICE";
    match "type"        "ATTACH";
    match "vendor"      "0x0b95";
    match "product"     "0x1790";
    # action "logger -tUE0 /usr/sbin/usbconfig -d $cdev set_config 1";
    action "/usr/sbin/usbconfig -d $cdev set_config 1 && /usr/sbin/usbconfi=
g -d
$cdev power_save";
};


notify 100 {
    match "system"      "IFNET";
    match "subsystem"   "ue0";
    match "type"        "ATTACH";
    action "/sbin/ifconfig $subsystem up promisc";
};


notify 100 {
    match "system"      "IFNET";
    match "subsystem"   "ue0";
    match "type"        "DETACH";
    action "/sbin/ifconfig lagg0 laggport wlan0 && /sbin/ifconfig wlan0 up";
};


notify 100 {
    match "system"      "IFNET";
    match "subsystem"   "ue0";
    match "type"        "LINK_UP";
    action "/sbin/ifconfig lagg0 laggport $subsystem -laggport wlan0 &&
/sbin/ifconfig wlan0 down";
};


notify 100 {
    match "system"      "IFNET";
    match "subsystem"   "ue0";
    match "type"        "LINK_DOWN";
    action "/sbin/ifconfig lagg0 laggport wlan0 && /sbin/ifconfig wlan0 up";
};

=3D=3D=3D


The workaroud (switchover from axge to cdce) is done very quickly:
=3D=3D=3D
Mar 10 19:26:28 beastie kernel: ugen1.7: <ASIX AX88179A> at usbus1
Mar 10 19:26:28 beastie kernel: axge0 on uhub5
Mar 10 19:26:28 beastie kernel: axge0: <NetworkInterface> on usbus1
Mar 10 19:26:28 beastie kernel: axge0: at uhub5, port 4, addr 33 (disconnec=
ted)
Mar 10 19:26:29 beastie kernel: axge0: attaching PHYs failed
Mar 10 19:26:29 beastie kernel: axge0: detached
Mar 10 19:26:29 beastie kernel: cdce0 on uhub5
Mar 10 19:26:29 beastie kernel: cdce0: <ASIX AX88179A, class 0/0, rev
3.20/2.00, addr 33> on usbus1
Mar 10 19:26:29 beastie kernel: ue0: <USB Ethernet> on cdce0
Mar 10 19:26:29 beastie kernel: ue0: Ethernet address: 20:7b:d2:32:4f:a6
=3D=3D=3D

and works with decent (for my use case) performance:
=3D=3D=3D
~ =C2=BB speedtest

   Speedtest by Ookla

      Server: xxxx - xxxx (id: 6088)
         ISP: xxxxxxx Net
Idle Latency:     1.27 ms   (jitter: 0.04ms, low: 1.24ms, high: 1.34ms)
    Download:   195.24 Mbps (data used: 295.3 MB)=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
                  1.61 ms   (jitter: 4.53ms, low: 1.14ms, high: 245.98ms)
      Upload:   194.79 Mbps (data used: 277.4 MB)=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
                  2.26 ms   (jitter: 9.39ms, low: 1.26ms, high: 260.40ms)
 Packet Loss:     0.0%
=3D=3D=3D

Hope that helps to workaround the issue until the up/down flapping is fixed
normally

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-267514-19105-r8wU6pMQOS>