Bug 199718 - [patch] urtwn(4): poor performance on rtl8188eu devices
Summary: [patch] urtwn(4): poor performance on rtl8188eu devices
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-wireless (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-04-26 19:22 UTC by mp39590
Modified: 2015-04-30 02:48 UTC (History)
1 user (show)

See Also:


Attachments
patch (779 bytes, patch)
2015-04-26 19:22 UTC, mp39590
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mp39590 2015-04-26 19:22:57 UTC
Created attachment 156016 [details]
patch

r264912[1] brought initial support of rtl8188eu chips into FreeBSD, it was noted by OpenBSD developers during porting efforts that it has bad performance compared to other urtwn chips.

The problem seem to be in the way the driver initialize aggregation mode: in native linux implementation USB aggregation is disabled[2] if RX DMA one is used (and it's actually used for 88 chips[3]), in FreeBSD both methods are enabled unconditionally.

Attached patch boosts performance for about 10 times for me.

Please review and commit if appropriate.

[1] - https://svnweb.freebsd.org/base?view=revision&revision=264912
[2] - https://github.com/lwfinger/rtl8188eu/blob/master/hal/usb_halinit.c#L524
[3] - https://github.com/lwfinger/rtl8188eu/blob/master/hal/usb_halinit.c#L95
Comment 1 Kevin Lo freebsd_committer freebsd_triage 2015-04-27 15:34:03 UTC
I'm not surprised. :)  As I mentioned that issue on current@:
http://lists.freebsd.org/pipermail/freebsd-current/2014-April/049562.html

Like RTL8192CUS, RTL8188EU chips could support both dma and aggregation
modes.  It seems that initializing rate adaptation and descriptors setting
are incorrect.  I'll investigate further, thanks.
Comment 2 commit-hook freebsd_committer freebsd_triage 2015-04-30 02:47:34 UTC
A commit references this bug:

Author: kevlo
Date: Thu Apr 30 02:47:22 UTC 2015
New revision: 282266
URL: https://svnweb.freebsd.org/changeset/base/282266

Log:
  - Disable usb aggregation mode by default since it boots performance
  - Minor tweak

  PR:	199718
  Submitted by:	Mikhail <mp39590 at gmail dot com>

Changes:
  head/sys/dev/usb/wlan/if_urtwn.c
Comment 3 Kevin Lo freebsd_committer freebsd_triage 2015-04-30 02:48:43 UTC
Disabling usb aggregation mode does boost performance and it turns out
later Realtek chips don't usb aggregation mode. 

I committed it as r282266 with minor tweak, thanks.