| #
d99eb823
|
| 12-Nov-2024 |
Adrian Chadd <adrian@FreeBSD.org> |
rtwn: change the USB TX transfers to only do one pending transfer per endpoint
I found I was getting constant device timeouts when doing anything more complicated than a single SSH on laptop with RT
rtwn: change the USB TX transfers to only do one pending transfer per endpoint
I found I was getting constant device timeouts when doing anything more complicated than a single SSH on laptop with RTL8811AU.
After digging into it, i found a variety of fun situations, including traffic stalls that would recover w/ a shorter (1 second) USB transfer timeout. However, the big one is a straight up hang of any TX endpoint until the NIC was reset. The RX side kept going just fine; only the TX endpoints would hang.
Reproducing it was easy - just start up a couple of traffic streams on different WME AC's - eg a best effort + bulk transfer, like browsing the web and doing an ssh clone - throw in a ping -i 0.1 to your gateway, and it would very quickly hit device timeouts every couple of seconds.
I put everything into a single TX EP and the hangs went away. Well, mostly.
So after some MORE digging, I found that this driver isn't checking if the transfers are going into the correct EPs for the packet WME access category / 802.11 TID; and would frequently be able to schedule multiple transfers into the same endpoint.
Then there's a second problem - there's an array of endpoints used for setting up the USB device, with .endpoint = UE_ADDR_ANY, however they're also being setup with the same endpoint configured in multiple transfer configs. Eg, a NIC with 3 or 4 bulk TX endpoints will configure the BK and BE endpoints with the same physical endpoint ID. This also leads to timed out transfers.
My /guess/ was that the firmware isn't happy with one or both of the above, and so I solved both.
* drop the USB transfer timeout to 1 second, not 5 seconds - that way we'll either get a 1 second traffic pause and USB transfer failure, or a 5 second device timeout. Having both the TX timeout and the USB transfer timeout made recovery from a USB transfer timeout (without a NIC reset) almost impossible.
* enforce one transfer per endpoint; * separate pending/active buffer tracking per endpoint; * each endpoint now has its own TX callback to make sure the queue / end point ID is known; * and only frames from a given endpoint pending queue is going into the active queue and into that endpoint. * Finally, create a local wme2qid array and populate it with the endpoint mapping that ensures unique physical endpoint use.
Locally tested:
* rtl8812AU, 11n STA mode * rtl8192EU, 11n STA mode (with diffs to fix the channel config / power timeouts.)
Differential Revision: https://reviews.freebsd.org/D47522
show more ...
|
| #
fdafd315
|
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remov
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
show more ...
|
| #
685dc743
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| #
1bbc46a8
|
| 09-May-2022 |
John Baldwin <jhb@FreeBSD.org> |
rtwn: Remove unused devclass arguments to DRIVER_MODULE.
|
| #
b3512b30
|
| 01-Sep-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
rtwn: clean up empty lines in .c and .h files
|
| #
d99eb823
|
| 12-Nov-2024 |
Adrian Chadd <adrian@FreeBSD.org> |
rtwn: change the USB TX transfers to only do one pending transfer per endpoint
I found I was getting constant device timeouts when doing anything more complicated than a single SSH on laptop with RT
rtwn: change the USB TX transfers to only do one pending transfer per endpoint
I found I was getting constant device timeouts when doing anything more complicated than a single SSH on laptop with RTL8811AU.
After digging into it, i found a variety of fun situations, including traffic stalls that would recover w/ a shorter (1 second) USB transfer timeout. However, the big one is a straight up hang of any TX endpoint until the NIC was reset. The RX side kept going just fine; only the TX endpoints would hang.
Reproducing it was easy - just start up a couple of traffic streams on different WME AC's - eg a best effort + bulk transfer, like browsing the web and doing an ssh clone - throw in a ping -i 0.1 to your gateway, and it would very quickly hit device timeouts every couple of seconds.
I put everything into a single TX EP and the hangs went away. Well, mostly.
So after some MORE digging, I found that this driver isn't checking if the transfers are going into the correct EPs for the packet WME access category / 802.11 TID; and would frequently be able to schedule multiple transfers into the same endpoint.
Then there's a second problem - there's an array of endpoints used for setting up the USB device, with .endpoint = UE_ADDR_ANY, however they're also being setup with the same endpoint configured in multiple transfer configs. Eg, a NIC with 3 or 4 bulk TX endpoints will configure the BK and BE endpoints with the same physical endpoint ID. This also leads to timed out transfers.
My /guess/ was that the firmware isn't happy with one or both of the above, and so I solved both.
* drop the USB transfer timeout to 1 second, not 5 seconds - that way we'll either get a 1 second traffic pause and USB transfer failure, or a 5 second device timeout. Having both the TX timeout and the USB transfer timeout made recovery from a USB transfer timeout (without a NIC reset) almost impossible.
* enforce one transfer per endpoint; * separate pending/active buffer tracking per endpoint; * each endpoint now has its own TX callback to make sure the queue / end point ID is known; * and only frames from a given endpoint pending queue is going into the active queue and into that endpoint. * Finally, create a local wme2qid array and populate it with the endpoint mapping that ensures unique physical endpoint use.
Locally tested:
* rtl8812AU, 11n STA mode * rtl8192EU, 11n STA mode (with diffs to fix the channel config / power timeouts.)
Differential Revision: https://reviews.freebsd.org/D47522
show more ...
|
| #
fdafd315
|
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remov
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
show more ...
|
| #
685dc743
|
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| #
1bbc46a8
|
| 09-May-2022 |
John Baldwin <jhb@FreeBSD.org> |
rtwn: Remove unused devclass arguments to DRIVER_MODULE.
|
| #
b3512b30
|
| 01-Sep-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
rtwn: clean up empty lines in .c and .h files
|
| #
0275f9db
|
| 11-Aug-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r321383 through r322397.
|
| #
69ef36e3
|
| 31-Jul-2017 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r321829
|
| #
0e34ba73
|
| 31-Jul-2017 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r321755
|
| #
9dba6128
|
| 30-Jul-2017 |
Andriy Voskoboinyk <avos@FreeBSD.org> |
rtwn_usb: add support for fragmented Rx.
Since device can pass multiple frames in a single payload temporary Rx buffer was big enough to hold all of them; now the driver can concatenate a single fra
rtwn_usb: add support for fragmented Rx.
Since device can pass multiple frames in a single payload temporary Rx buffer was big enough to hold all of them; now the driver can concatenate a single frame from multiple payloads.
The Rx buffer size may be configured via tunable (dev.rtwn.%d.rx_buf_size).
Tested with: - rtl8188cus, rtl8188eu and rtl8821au (STA mode). - (by kevlo) rtl8192cu and rtl8188eu.
PR: 218527 Reviewed by: kevlo Differential Revision: https://reviews.freebsd.org/D11705
show more ...
|
| #
531c2d7a
|
| 24-Jul-2017 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r320180
|
| #
bca9d05f
|
| 23-Jul-2017 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Merge ^/head r319973 through 321382.
|
| #
d2043ca3
|
| 13-Jul-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r320573 through r320970.
|
| #
37376971
|
| 04-Jul-2017 |
Andriy Voskoboinyk <avos@FreeBSD.org> |
rtwn_usb: reject too long (>16K) mbufs.
While here move RTWN_TXBUFSZ constant from common to USB specific code (it's not used anywhere else).
|
| #
b0cc56ed
|
| 09-Jan-2017 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r311692 through r311807.
|
| #
0866194c
|
| 08-Jan-2017 |
Andriy Voskoboinyk <avos@FreeBSD.org> |
rtwn_usb(4): fix Rx buffer size calculation.
Use device-specific Rx buffer size to ensure that data will not be truncated + add a warning if truncation was detected (the driver cannot handle this ca
rtwn_usb(4): fix Rx buffer size calculation.
Use device-specific Rx buffer size to ensure that data will not be truncated + add a warning if truncation was detected (the driver cannot handle this case correctly yet).
Tested with: - RTL8188CUS, RTL8188EU and RTL8821AU, STA / AP modes.
show more ...
|
| #
2828dafc
|
| 10-Nov-2016 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r308227 through r308490.
|
| #
d067ef0f
|
| 06-Nov-2016 |
Andriy Voskoboinyk <avos@FreeBSD.org> |
rtwn: add HOSTAP / IBSS mode support for RTL8188CE.
NOTE: some multi-vap configurations (e.g., STA+IBSS) are not stable; that will be fixed later.
Tested with: - RTL8188CE, STA + AP mode; - RTL81
rtwn: add HOSTAP / IBSS mode support for RTL8188CE.
NOTE: some multi-vap configurations (e.g., STA+IBSS) are not stable; that will be fixed later.
Tested with: - RTL8188CE, STA + AP mode; - RTL8188CE, IBSS mode; - RTL8188CUS, IBSS mode; - RTL8188EU, IBSS mode.
Relnotes: yes
show more ...
|
| #
77cbc479
|
| 06-Nov-2016 |
Andriy Voskoboinyk <avos@FreeBSD.org> |
rtwn_pci: omit tx_done() stage if device is not running. rtwn_usb: drain USB transfers during device shutdown; this fixes possible panic with 'options IEEE80211_SUPPORT_SUPERG' during device detach.
rtwn_pci: omit tx_done() stage if device is not running. rtwn_usb: drain USB transfers during device shutdown; this fixes possible panic with 'options IEEE80211_SUPPORT_SUPERG' during device detach.
Tested with RTL8188CE, STA mode.
show more ...
|
| #
5763f796
|
| 21-Oct-2016 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r307383 through r307735.
|
| #
7453645f
|
| 17-Oct-2016 |
Andriy Voskoboinyk <avos@FreeBSD.org> |
rtwn(4), urtwn(4): merge common code, add support for 11ac devices.
All devices: - add support for rate adaptation via ieee80211_amrr(9); - use short preamble for transmitted frames when needed; - m
rtwn(4), urtwn(4): merge common code, add support for 11ac devices.
All devices: - add support for rate adaptation via ieee80211_amrr(9); - use short preamble for transmitted frames when needed; - multi-bss support: * for RTL8821AU: 2 VAPs at the same time; * other: 1 any VAP + 1 sta VAP. RTL8188CE: - fix IQ calibration bug (reason of significant speed degradation); - add h/w crypto acceleration support. USB: - A-MPDU Tx support; - short GI support; Other: - add support for RTL8812AU / RTL8821AU chipsets (a/b/g/n only; no ac yet); - split merged code into subparts: * bus glue (usb/*, pci/*, rtl*/usb/*, rtl*/pci/*) * common (if_rtwn*) * chip-specific (rtl*/*) - various other bugfixes.
Due to code reorganization, module names / requirements were changed too: urtwn urtwnfw -> rtwn rtwn_usb rtwnfw rtwn rtwnfw -> rtwn rtwn_pci rtwnfw
Tested with RTL8188CE, RTL8188CUS, RTL8188EU and RTL8821AU.
Tested by: kevlo, garga, Peter Garshtja <peter.garshtja@ambient-md.com>, Kevin McAleavey <kevin.mcaleavey@knosproject.com>, Ilias-Dimitrios Vrachnis <id@vrachnis.com>, <otacilio.neto@bsd.com.br> Relnotes: yes
show more ...
|