When running a Ralink RT3070/3020/2870 based USB WiFi adapter with FreeBSD current on a Raspberry Pi, the output of "netstat -nr" kept reporting an increasing number of mbufs up to (a few thousands) a point where the adapter would disconnect from the WiFi network and never reconnect again, at which point only a reboot would solve the problem. The adapter reports as: Aug 2 23:21:10 witch kernel: run0: MAC/BBP RT3070 (rev 0x0201), RF RT3020 (MIMO 1T1R), address 00:23:28:01:89:a2 Aug 2 23:21:11 witch kernel: wlan0: Ethernet address: 00:23:28:01:89:a2 Aug 2 23:21:12 witch kernel: run0: firmware RT2870 ver. 0.236 loaded Setting sysctl hw.usb.run.debug=1 caused a lot of error messages, mainly such as: Aug 3 03:05:01 witch kernel: run_bulk_rx_callback: bad DMA length 60329 Aug 3 03:05:02 witch kernel: run_bulk_rx_callback: bad DMA length 21348 > 2600 Aug 3 03:05:02 witch kernel: run_bulk_rx_callback: bad DMA length 2787 Aug 3 03:05:02 witch kernel: run_bulk_rx_callback: bad DMA length 26261 Aug 3 03:05:02 witch kernel: run_bulk_rx_callback: bad DMA length 55261 Which suggest alignment problems. Fix: A friend suggested the following patch to base/head/sys/dev/usb/wlan/if_run.c which seems to have solved the problem of the increasing number of mbufs and hence the leak. Mbufs are now stable. This does not however solve the problem of misalignment observed on the Raspberry Pi/arm causing the error messages to be triggered. How-To-Repeat: Plugin a run(4) adapter to an arm based FreeBSD and let it flow traffic... see the mbufs increasing up to the point where the adapter disconnects and no longer recovers.
Responsible Changed From-To: freebsd-bugs->freebsd-net Over to maintainer(s).
Sorry, just a couple of mistakes/corrections: 1. Where it reads "netstat -nr" should read "netstat -m". 2. It might not be an alignment problem at all, but just a display/check = problem in the driver. --- But the patch seems to have fixed the issue and the network hasn't = hanged since and the mbufs are now stable:=20 jcnc@witch ~]$ netstat -m 2/268/270 mbufs in use (current/cache/total) 2/132/134/31744 mbuf clusters in use (current/cache/total/max) 2/126 mbuf+clusters out of packet secondary zone in use (current/cache) 1/8/9/15872 4k (page size) jumbo clusters in use = (current/cache/total/max) 0/0/0/4702 9k jumbo clusters in use (current/cache/total/max) 0/0/0/2645 16k jumbo clusters in use (current/cache/total/max) 8K/363K/371K bytes allocated to network (current/cache/total) 0/0/0 requests for mbufs denied (mbufs/clusters/mbuf+clusters) 0/0/0 requests for mbufs delayed (mbufs/clusters/mbuf+clusters) 0/0/0 requests for jumbo clusters delayed (4k/9k/16k) 0/0/0 requests for jumbo clusters denied (4k/9k/16k) 0/4/4608 sfbufs in use (current/peak/max) 0 requests for sfbufs denied 0 requests for sfbufs delayed 0 requests for I/O initiated by sendfile 0 calls to protocol drain routines
State Changed From-To: open->closed This was fixed in HEAD with r257435 and merged back to 9-STABLE in r259457. Thanks for the report!