From e649b526cc1fc082c2eee4f06d6f9166060dbf5c Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Wed, 3 Jun 2020 22:30:44 +0000 Subject: [PATCH] [run] Fix up tx/rx frame size. This specifically fixes that TX frames are large enough now to hold a 3900 odd byte AMSDU (the little ones); me flipping it on earlier messed up transmit! Tested: * if_run, STA mode, TX/RX TCP/UDP iperf. TCP is now back to normal and correctly does ~ 3200 byte AMSDU/fast frames (2x1600ish byte MSDUs). --- sys/dev/usb/wlan/if_run.c | 5 +++-- sys/dev/usb/wlan/if_runvar.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c index 0bd967a09b1..bf732e4ca97 100644 --- a/sys/dev/usb/wlan/if_run.c +++ b/sys/dev/usb/wlan/if_run.c @@ -3050,10 +3050,11 @@ run_bulk_rx_callback(struct usb_xfer *xfer, usb_error_t error) tr_setup: if (sc->rx_m == NULL) { sc->rx_m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, - MJUMPAGESIZE /* xfer can be bigger than MCLBYTES */); + RUN_MAX_RXSZ); } if (sc->rx_m == NULL) { - RUN_DPRINTF(sc, RUN_DEBUG_RECV | RUN_DEBUG_RECV_DESC, + RUN_DPRINTF(sc, RUN_DEBUG_RECV | + RUN_DEBUG_RECV_DESC | RUN_DEBUG_USB, "could not allocate mbuf - idle with stall\n"); counter_u64_add(ic->ic_ierrors, 1); usbd_xfer_set_stall(xfer); diff --git a/sys/dev/usb/wlan/if_runvar.h b/sys/dev/usb/wlan/if_runvar.h index 98dff0bdfbd..bb6231c3f94 100644 --- a/sys/dev/usb/wlan/if_runvar.h +++ b/sys/dev/usb/wlan/if_runvar.h @@ -23,14 +23,15 @@ #ifndef _IF_RUNVAR_H_ #define _IF_RUNVAR_H_ +/* Support up to 4KB frames - useful for A-MSDU/FF. */ #define RUN_MAX_RXSZ \ MIN(4096, MJUMPAGESIZE) -/* NB: "11" is the maximum number of padding bytes needed for Tx */ +/* Support up to 8KB frames - useful for A-MSDU/FF. */ #define RUN_MAX_TXSZ \ (sizeof (struct rt2870_txd) + \ sizeof (struct rt2860_txwi) + \ - MCLBYTES + 11) + 8192 + 11) #define RUN_TX_TIMEOUT 5000 /* ms */