AX88179B USB NIC: 57 -> 979 Mbps by fixing four bugs in axge(4)

Started by web, August 08, 2026, 01:45:15 PM

Previous topic - Next topic
heads up before the technical bit, i dont really do forum posts, panic disorder, so this is a bit outside my comfort zone. but i spent an evening on this and it seems genuinely useful to anyone with one of these adapters, so here it is

setup: tp-link ue306 (ax88179b) as wan on opnsense 26.7, vlan 10 for spark fibre nz, 930/930 plan

out of the box axge attaches but is basically broken on the b revision. i was getting 57-73 mbps with input drops climbing constantly, and dhclient spamming send_packet: No buffer space available — half the time it couldnt even hold a lease. only workaround anyone documents is a usb quirk forcing config 1 so the generic cdce driver takes over instead. thats stable but caps at 350

went through the driver instead. same driver, now 979 mbps. four separate bugs, all in sys/dev/usb/net/if_axge.c

1. rx aggregation hold timer is 12x too short. axge_bulk_size[], first row, superspeed gigabit. its 0x004f. the chip never accumulates so it does one ethernet frame per usb transfer. 58k packets/sec, capped ~700mbps, router cpu 97 percent idle. swept it live during a transfer:


0x004f -> 705 Mbps, 58k pkt/s   (default)
0x0100 -> 952 Mbps, 79k pkt/s
0x0400 -> 979 Mbps, 81k pkt/s
0x4000 -> 979 Mbps, 81k pkt/s
went back to 0x004f at the end and it dropped again, so its the timer not something else. this one isnt b specific, it affects every axge adapter

2. axge_read_cmd_1/2 return uninitialised stack memory when the control transfer fails. they call axge_read_mem() and throw away the error. these are control transfers sharing the bus with bulk data and they absolutely do fail under load, so the mii layer gets garbage as link status. link flapped 462 times in 30 seconds under load, zero at idle. thats what was killing my dhcp lease every couple of minutes

3. AXGE_PADDING is defined in the header and never used anywhere. linux sets that bit when a frame plus header lands exactly on a usb packet boundary, freebsd doesnt, so the tx pipe wedges. this is where the ENOBUFS came from

4. only one rx transfer in flight. raised to 4, same as if_ure does. took packets/sec from 162 to 42k. tried 8 and it got much worse, 4 is right

single patch against stable/26.7, applies clean, builds with no warnings, running on my box right now. filing it on freebsd bugzilla too since thats where the driver actually lives — link once its up

tested on freebsd 15.1-p1 / opnsense 26.7, ax88179b, 1000baseT full duplex over superspeed, vlan tagged wan. before: 57-73 on axge, 350 via the cdce workaround. after: 979, no errors, no drops, no tcp retransmits

i only have the one adapter so i cant confirm on plain ax88179 or the a revision, but nothing in 1, 2 or 4 is revision specific. would be interested if anyone with other axge hardware tries the timer change, i suspect theres a lot of people on 500-700 who think thats just what usb ethernet does

patch is attached (axge-fixes.patch), applies with patch -p1 from the root of an opnsense/freebsd source tree.
21f sort of a beginner sorry if i get some stuff mixed up!

Quote from: web on August 08, 2026, 01:45:15 PMi suspect theres a lot of people on 500-700 who think thats just what usb ethernet does
USB 2.0 = 8 x 30 to 35 MB/s average = 240 to 280 Mbps bandwidth
USB 3.0 = Should be good for at least up to 5 Gbps

So getting only 500 to 700 Mbps via a USB 3.0 or better USB LAN adapter would be weird IMHO :)


Anyways...


Thanks for posting this!
It's good to know which chipset it is exactly and what kind of performance one can expect from it :)
Weird guy who likes everything Linux and *BSD on PC/Laptop/Tablet/Mobile and funny little ARM based boards :)

thanks! yeah thats what made me go looking, the numbers just didnt add up for a superspeed link. hope it helps someone else with one of these!!
21f sort of a beginner sorry if i get some stuff mixed up!