Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp310199ybi; Wed, 29 May 2019 22:00:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8qpshqmh7d+8/FvSpfmVZHPAoGgsZ//8fCZfdPwGAmnr+6lGXh9oSTO42pTJYpIAlBUXS X-Received: by 2002:a17:902:1cb:: with SMTP id b69mr2031681plb.1.1559192451570; Wed, 29 May 2019 22:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559192451; cv=none; d=google.com; s=arc-20160816; b=qcdWTZu9Eepwp2OWx8la377lsOAeUdm+b91rVufEvk/sE6WeIRmXrONdxZHRABuWZZ TWfdmMOFXyt0osKOBKZLR1VhE7oLS2dyNooIjZL2WWic7LdxVCCvSZYFPXuByJYqc10f hEl5C2D3jiBk17IlribCeXkuv+wdi4/FjLKVxCbLiHHFboM3nZmSYJkqY3d6Z5YacOR6 0DgD1C5oZ0gsicvwwP1BwxWYVGKChmVSouofkxelXSWFaQs1gZUgUQjH2MX3zOFKEd2r fGkV01iupwEpUT51Phna2Vka5kTVbpwDSiM7fQzYPcpvI2z354HKVdcQ5YgH+LJ0+lwC NXXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rLmgEjHoFbZEgDIpNdCHV3eTKhj4yByl9zF5X6YEDyU=; b=kTDixczJkeeuRhZ6P862j2utcImMtKpu5z2ZfDKXLNCpwC6TZ6hmxHQ02WQNqoHZE6 h7+iRMG+9IY5o9KeWdXZ/FVqkgolrda86NS/azYdv04dDD1keP4tWUG6pXTbdGNpd+v0 ZCA9N38+QPIFY6OQ4ajbKu2c7qTNWf9xAYZw7Ervqv8b6q9inYiFxu3a9hS28sbpB57r dfBRtylRwBY+PAuV9/bzt1OgnQiL1surcWSD7AyVCfh8bp1JxkuCqmZxV7ck7DOhpF/k 1P36unKe+RXiO9P9f6BFU9NjkjZMpXADQpghgUEEtFbw9Vu7FpXndmJbgvr/sXBj7wrV qYkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=RPnZUCBg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si2717665pfw.143.2019.05.29.22.00.35; Wed, 29 May 2019 22:00:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=RPnZUCBg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389208AbfE3E6i (ORCPT + 99 others); Thu, 30 May 2019 00:58:38 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:40485 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389148AbfE3E6a (ORCPT ); Thu, 30 May 2019 00:58:30 -0400 Received: by mail-qt1-f194.google.com with SMTP id a15so3371464qtn.7 for ; Wed, 29 May 2019 21:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rLmgEjHoFbZEgDIpNdCHV3eTKhj4yByl9zF5X6YEDyU=; b=RPnZUCBgRQHtYNK14mI5pN632nIxFQ9nLcYN1I5h78/zyx3v50ePjNHdlKRtRu/G3C hWbB0se/iWL0ROpD9gWbN28s4bBolC9R9WmpJRKZC2D8eoPKqSvW0def9L5GLi1i/Wry /pDU7Y8f9zQecUtCv0HO2QRN3jWQE9FmsnMbyQOFm7EnrJeXK4zBTV7Hn3MZXpoe51Kq iXtMHowwtmYgFLmJ7S19FxXG5pOdjdcZ/Is90S8cWSvOKjbufCIYwRFwMViwfBAhxYg0 Yt+jtrrJdpuLDcqwyEaSLafp6AHzuWRI7L9f2qdZE+jVHczQoWI41SvYEzs+Bx/Nuat3 gadg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rLmgEjHoFbZEgDIpNdCHV3eTKhj4yByl9zF5X6YEDyU=; b=hnviHFsgbwbLGPPvlNCEPB7pTule4tlJyNMjLTVzmYmYAjdLNHHKdIyXGURNiI/8Z7 ffgbr6GC41GcLhv9b8Rpk8EEze6v+hN8yKb11d1KI91Z6G4+3BsO06gN205FVYmNJFCq XG+VU6lhKMgjBv11DbbYy9qDBudDAFudga38VSVg5OAMAWeYl+r0IbJHvLGa8LZIqgoS C1VVfAkIPNszuY8WNL6v17tV/iRJhgkseaQ2kdlBho2lowuBXlxUIYVY0fekyoxG79Br bEtG7nZiut5llImhPINr/zdaOwmIU/CfEmN2je9kkFb6F9eZbn9Ev5zrYZdfZUhtzRHW xZ8A== X-Gm-Message-State: APjAAAXD70yrDE2g854HHkSc8FSf1kVIBpIpk5jm2o+xMV9JvvvMUihD EIYwt5r27f9nSfkzpTSxhgquX7jllj+g4SmF+M2EZw== X-Received: by 2002:a0c:be87:: with SMTP id n7mr1524590qvi.65.1559192309628; Wed, 29 May 2019 21:58:29 -0700 (PDT) MIME-Version: 1.0 References: <20190529050335.72061-1-chiu@endlessm.com> <5f5e262d-aadb-cca0-8576-879735366a73@lwfinger.net> In-Reply-To: <5f5e262d-aadb-cca0-8576-879735366a73@lwfinger.net> From: Chris Chiu Date: Thu, 30 May 2019 12:58:18 +0800 Message-ID: Subject: Re: [RFC PATCH v3] rtl8xxxu: Improve TX performance of RTL8723BU on rtl8xxxu driver To: Larry Finger Cc: Jes Sorensen , Kalle Valo , David Miller , linux-wireless , netdev , Linux Kernel , Linux Upstreaming Team Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 30, 2019 at 2:22 AM Larry Finger wrote: > > On 5/29/19 12:03 AM, Chris Chiu wrote: > > We have 3 laptops which connect the wifi by the same RTL8723BU. > > The PCI VID/PID of the wifi chip is 10EC:B720 which is supported. > > They have the same problem with the in-kernel rtl8xxxu driver, the > > iperf (as a client to an ethernet-connected server) gets ~1Mbps. > > Nevertheless, the signal strength is reported as around -40dBm, > > which is quite good. From the wireshark capture, the tx rate for each > > data and qos data packet is only 1Mbps. Compare to the driver from > > https://github.com/lwfinger/rtl8723bu, the same iperf test gets ~12 > > Mbps or more. The signal strength is reported similarly around > > -40dBm. That's why we want to improve. > > The driver at GitHub was written by Realtek. I only published it in a prominent > location, and fix it for kernel API changes. I would say "the Realtek driver at > https://...", and every mention of "Larry's driver" should say "Realtek's > driver". That attribution is more correct. Thanks. I'll modify this in next revision. > > > > After reading the source code of the rtl8xxxu driver and Larry's, the > > major difference is that Larry's driver has a watchdog which will keep > > monitoring the signal quality and updating the rate mask just like the > > rtl8xxxu_gen2_update_rate_mask() does if signal quality changes. > > And this kind of watchdog also exists in rtlwifi driver of some specific > > chips, ex rtl8192ee, rtl8188ee, rtl8723ae, rtl8821ae...etc. They have > > the same member function named dm_watchdog and will invoke the > > corresponding dm_refresh_rate_adaptive_mask to adjust the tx rate > > mask. > > > > With this commit, the tx rate of each data and qos data packet will > > be 39Mbps (MCS4) with the 0xF00000 as the tx rate mask. The 20th bit > > to 23th bit means MCS4 to MCS7. It means that the firmware still picks > > the lowest rate from the rate mask and explains why the tx rate of > > data and qos data is always lowest 1Mbps because the default rate mask > > passed is always 0xFFFFFFF ranges from the basic CCK rate, OFDM rate, > > and MCS rate. However, with Larry's driver, the tx rate observed from > > wireshark under the same condition is almost 65Mbps or 72Mbps. > > > > I believe the firmware of RTL8723BU may need fix. And I think we > > can still bring in the dm_watchdog as rtlwifi to improve from the > > driver side. Please leave precious comments for my commits and > > suggest what I can do better. Or suggest if there's any better idea > > to fix this. Thanks. > > > > Signed-off-by: Chris Chiu > > I have not tested this patch, but I plan to soon. > > Larry > >