Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6681849ybi; Wed, 29 May 2019 11:23:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxzBGeVKyBNitRWmUdVTFfzXssASWRmsV4ZN3MoyFGDgQt+IU/HQE5s8QeVDRqV/oM6IHwc X-Received: by 2002:a17:90a:cf12:: with SMTP id h18mr14202681pju.77.1559154229253; Wed, 29 May 2019 11:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559154229; cv=none; d=google.com; s=arc-20160816; b=Q3e8BTKGuT4W39J8fFWcqmEEmA8fJ6ozWz81BHEHUxh5YAhc6XKp9Chz+lARrLo83o iy9e2CgKb4FTK7HicjFYoIl87rvnoMD7HfQR/OX+FknG7qeRy9Mxa8sZ6pfHT3ubxiO4 FOTvhrv4rrhH6y/3AXl+9Pg2z3tvcqYwkAMhzezo87HvVkRYqPQh71iGAuexNu6CHKv0 zirMCQodbeA8qhhkhECzApQo24xtvA/QYhAASO6+uFQVfJi2qmqvI7szR143qu9dr+R3 x58V3LfFKSphnBjEYCVItgTFlnVgSIhCABDg3JseyZ56oTksiBqwk8qb+r8BvBzd8ozN FBwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=amJi0jbjD9M6vUHKgUTYZgac6U4sNICfW2Wh2jnSQXI=; b=lCKk7PV4GJF4ebkXy85BXou66nfQNRGm+3SzAu0EFQPaJ3UdfGfUFWddu6sCZ5Hwow meRxmiEH7MHZhSducdoFQkaY9Wrf6NlpIiS1AjaqAzGjGKucW9wLlXF1ZfY2Dnq7WdQD g+igxUjOOgvhkaI+hIV0umBOvG/7nfeZVf6fYCOKeINshFAzvejH0a+Ar0QvKe8EfLjy VzT2glpl0gUkh91pykZthqq3ycrcGO4Rm3XO8VLsfe81KaEie0PkUcye/pg/+MX0CwqD YsHVb8r8fvWukJUWs79DOcHyxg6ueIzhKFGwD8ZfxsgDLEVo6qTO0lW0cLyXL+iWNi9/ 2axw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=R8c2oA5F; 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 i1si343378pfd.258.2019.05.29.11.23.32; Wed, 29 May 2019 11:23:49 -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=fail header.i=@gmail.com header.s=20161025 header.b=R8c2oA5F; 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 S1727403AbfE2SW0 (ORCPT + 99 others); Wed, 29 May 2019 14:22:26 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:44842 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726947AbfE2SW0 (ORCPT ); Wed, 29 May 2019 14:22:26 -0400 Received: by mail-ot1-f66.google.com with SMTP id g18so2993114otj.11; Wed, 29 May 2019 11:22:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=amJi0jbjD9M6vUHKgUTYZgac6U4sNICfW2Wh2jnSQXI=; b=R8c2oA5Fl36xHbwRZd3mPECu98msS2gC5wxHUo1gjNyD42EJWz14QKvHjGofU1qbos snZb+IxY8/sp9K3ckuwl7SAOOde9Lc9Bd/0Ju1zOgMki4HJZ/W7+GEOw+/6nFV9Shc7N tdzmCJifBTO8UHIPOnv9S3TIo05p8AA4gOML2aZD49Oj06qsQT0cYgHTGcl/oJuEeqpA TzHC+Z32hjbRXqaMM3ZqP3gw33B5+wc/keNRFb7SJgLZTeEP3UvQinmq9pyfzCiYHaUs uNqV8278AmSpyNisgMzDNToAR0XdeDErauSyPCdVZSG6nW206TH7+VrwdH8uz5zxkpfh 9BzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=amJi0jbjD9M6vUHKgUTYZgac6U4sNICfW2Wh2jnSQXI=; b=ZlDPOTSo0GriI009l4yAIJSsOSnFCQpp5pSg9hsUAB9xfOZxtN/S1padtRb6D/7WWG CNMXemGwShM8kYMXEi+g70cktzxyHdsUP/9mYtiShUhQUJWW1r3htq0H6HX8oGQTZggw RrZycFDKrZZV1nzOwofpnrvx1aa0B1vREoDqsP5JQRYzlmbYGtWJLHhp3718GnRTWitX ubeQ2PMHrhJOnLs3D1YLN7c1fLnx/dMJ+pBU0ca6mS3AxoD/Hp0YXAzTOZ8b8h3z5c1d O52H8UH7dZHnKdG587SwFmQkkdFuCiD/R9wAUZRg4eydXg6egDinv6/UVAtkJm1DCbJQ 7bzg== X-Gm-Message-State: APjAAAX4tZMj+tAa+sB+n09WZ240zkqjTjnA4zt6vhVeVVlJ3e7QqGOO RXqkIuhF7O1BL8r6pZZdbKA= X-Received: by 2002:a9d:7a4d:: with SMTP id z13mr172718otm.246.1559154145557; Wed, 29 May 2019 11:22:25 -0700 (PDT) Received: from [192.168.1.112] (cpe-24-31-245-230.kc.res.rr.com. [24.31.245.230]) by smtp.gmail.com with ESMTPSA id t139sm122687oie.21.2019.05.29.11.22.24 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 29 May 2019 11:22:24 -0700 (PDT) Subject: Re: [RFC PATCH v3] rtl8xxxu: Improve TX performance of RTL8723BU on rtl8xxxu driver To: Chris Chiu , jes.sorensen@gmail.com, kvalo@codeaurora.org, davem@davemloft.net Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux@endlessm.com References: <20190529050335.72061-1-chiu@endlessm.com> From: Larry Finger Message-ID: <5f5e262d-aadb-cca0-8576-879735366a73@lwfinger.net> Date: Wed, 29 May 2019 13:22:23 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190529050335.72061-1-chiu@endlessm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > 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