Page MenuHomeFreeBSD

rtwn: enable periodic TX reporting support on RTL8188EU NICs.
ClosedPublic

Authored by adrian on Sun, Dec 15, 4:54 AM.
Referenced Files
Unknown Object (File)
Tue, Dec 31, 7:14 PM
Unknown Object (File)
Tue, Dec 31, 7:14 PM
Unknown Object (File)
Thu, Dec 26, 8:46 AM
Unknown Object (File)
Wed, Dec 25, 10:58 AM
Unknown Object (File)
Wed, Dec 25, 8:50 AM
Unknown Object (File)
Wed, Dec 25, 4:00 AM
Unknown Object (File)
Sun, Dec 22, 10:11 PM
Unknown Object (File)
Sun, Dec 22, 9:56 AM
Subscribers

Details

Summary

The RTL8188E firmware doesn't have the "full" offload firmware
rate control. Instead, the vendor driver has a bunch of logic
in the driver for rate probing and selection.

Part of this is the periodic TX report - which uploads a summary
of multi-rate retries and drops per MAC. Using it drastically
cuts down on the TX notifications - it's fired from a timer
(defaulting to ~ 1.6 seconds) and is a single receive frame in
the normal bulk RX path.

I've not ported / reimplemented the whole vendor driver rate adaption
code - instead, I'm just using the normal net80211 rate control APIs.
It seems to behave OK - I get 25-30mbit down and 20mbit up using TCP/
speedtest.

Locally tested:

  • RTL8188EU, STA mode

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I'm confused about your loop. It should be refactored.

sys/dev/rtwn/rtl8188e/r88e.h
89–90

For consistency.

sys/dev/rtwn/rtl8188e/r88e_rx.c
243

As per style(9)

262–264
280–281

Though I must say the whole valid variable is suspicious and should be eliminated; just move the check here, you don't need it then.

313

valid is always true at this point.

324–325

This is a for loop, make it one.

updated, please re-review! thanks!

Looks better, but could still be improved.

sys/dev/rtwn/rtl8188e/r88e_rx.c
272–276
284–285

Eliminate the valid variable.

more suggestions from fuz@

bz added a subscriber: bz.

Looks OK.

IMPORTANT: given you indicate that this is a partial adaption from upstream rewritten to net80211 it would be good to mention the repo URL and revision/hash this information is based on; I am not expecting adjustments to these registers or structs anymore if firmware changes but realtek sometimes seems to(?). And that's one of the problems we have with all the ported from upstream possibly through OBSD even that we have no way to track this information back to the original source at time. So would really appreciate if it's added if relevant enough.
This revision is now accepted and ready to land.Tue, Dec 31, 6:45 AM
In D48088#1100632, @bz wrote:

Looks OK.

IMPORTANT: given you indicate that this is a partial adaption from upstream rewritten to net80211 it would be good to mention the repo URL and revision/hash this information is based on; I am not expecting adjustments to these registers or structs anymore if firmware changes but realtek sometimes seems to(?). And that's one of the problems we have with all the ported from upstream possibly through OBSD even that we have no way to track this information back to the original source at time. So would really appreciate if it's added if relevant enough.

Lemme go find the reference in the rtl8188eu original driver, stay tuned.