Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp305296ybi; Wed, 29 May 2019 21:53:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHsMJCEnnRQzEV6oezVx6zlYF357+BpuLCACIHz57YZbaSgW4KRI90Ssf1SqeFf6qhS88i X-Received: by 2002:a17:90a:cd03:: with SMTP id d3mr1639193pju.127.1559191993917; Wed, 29 May 2019 21:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559191993; cv=none; d=google.com; s=arc-20160816; b=CUKPAwiSYg/LYDnTpI00sVYi7Y1tS3wfMpwgtGmfWzLSC6sDoFdPY5v1omRLa1dxc4 Elwz4G2NLISn0BF1tMC42KAdeZqCwx2+0EfD09VObOBVXq1USv+CHSHTbl+FXBq5rm/x m/J1hT3KaVtoKtfYQwXPxuIX1oHMXCCSZPe2y8t34Vd4wtsMhRaH3m386Q+JmSFGcWyJ XtLL00REcRYK7UDZCAMbTV2cn+PGhnb4H8ah/FbJR91jeMtWjp0kFotfKwCzGTSJ0apF Cm+BwryhG6/cOgOBSFWPo1plggr9PpEWnZtPQR0vKZyyW1LfFt1iKk5taVKB+Tw0ZVLT P2TQ== 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=sHOf1/WDs1TjZmoF3swY2gMBdaFm4kQJB8zDdbqYUtY=; b=ZXt2dYeO/x0EokXKG4oK/MCE91sh4DEHMQBf6wQ2tFNEcHCIN7M3+6a6s3JpGeJx5a ATraGNmpY96YiLA2BtQQnFUmBrQiSQq46YlnZ9QgGeKJ+I+xvc+VnN1GllMqHaGluxgW vFt06rPFmOwZD4h+PnA3iBKrdoIk4EFqr1j9HpOZzWvHQvVt2a8MRbP/MlqraPnv8u0b jY4GzhUhmADNTw2Gevu3EnHO9pbkcvi8bhxtqfRhSOOVx4gGJJm9Jl0KzOle0R6GeOyI YQEmCG/jap92LeVrQDTwFZV74JVlLaHYmLwNcIGvi7RsKP7grfAx48EP92ib+GgsJx2h EZ4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b=f825F3Se; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 ca10si2035935plb.172.2019.05.29.21.52.46; Wed, 29 May 2019 21:53:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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=f825F3Se; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728615AbfE3EwA (ORCPT + 99 others); Thu, 30 May 2019 00:52:00 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:39247 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728436AbfE3EwA (ORCPT ); Thu, 30 May 2019 00:52:00 -0400 Received: by mail-qk1-f193.google.com with SMTP id i125so3033167qkd.6 for ; Wed, 29 May 2019 21:51:59 -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=sHOf1/WDs1TjZmoF3swY2gMBdaFm4kQJB8zDdbqYUtY=; b=f825F3Seg4ieVRUakmG+2nGqhhygBqwqBaEc1iOc0MaaO0sTSgNmD0hr/deWGkkk8D oSBHHzB7EF7mqP05QR1/t5lDvwyi/eGEyhi4RZ0QM2XtWegAbglgw2jrHuJxJtGEE+U9 VnJmOLG9LhCt2JYLoUxhPWPUkW3FUk81O7cn3GOxPEAw18lba1Uv+HZVT2yS5fqk0gPm jFk18XIsCuviYZzfzpUXg5AH9TqFYqgcps9uvKOir++7jxxwIY/nuYgf5ONNA4hBYvl3 1KlZphriIqtMRf/ZEXrcrdiDzkzZi/lXz4lIkn2ZlRqLkse/MEEdkcMY3XsfRpUhX9bW 0tjA== 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=sHOf1/WDs1TjZmoF3swY2gMBdaFm4kQJB8zDdbqYUtY=; b=cNe/OVL+aXaXIw5OAHzMs3u9N1R5XcKlU1RiV7foW0OegSlxg2qJOTIMQaPUUsGjV/ 4M/acVoYXwuSYrz5tcuyzbKhW7AUcFrCdANrdsLFDIK8aSPg0RzPEMu7mlL9joWdsaBi sF+nRy92+vWSpV7cnwI9IE0MdFWND7ZK2hbMl1ZUOwgtjabOAkn78fxXORPUBv1E7pTX Jmf2oUUFQBRh0HXl5tPq6Gg6lzWIfGXuVrYLtcpeeZ8QhN4mYWMGSTGOrpSQ8vCYLvuF 8XScyTroItGldFBjsg1iQsGmP1NI7g9gX4d6YV/vQpHMGvGkqOVAXN1DYgT9/TQtIObY euhQ== X-Gm-Message-State: APjAAAWFFi6NXDPV2gIFbyZMsWzDt2U4uAeIP+CrhcJ6aZIdTIat+vTC MCTTy7hIrpUBg2ZhG/06B4pmKgIWfZWFkr0hoUf5ZQ== X-Received: by 2002:a37:48c4:: with SMTP id v187mr1318465qka.314.1559191919082; Wed, 29 May 2019 21:51:59 -0700 (PDT) MIME-Version: 1.0 References: <20190529050335.72061-1-chiu@endlessm.com> In-Reply-To: From: Chris Chiu Date: Thu, 30 May 2019 12:51:47 +0800 Message-ID: Subject: Re: [RFC PATCH v3] rtl8xxxu: Improve TX performance of RTL8723BU on rtl8xxxu driver To: Daniel Drake Cc: Jes Sorensen , Kalle Valo , David Miller , linux-wireless , netdev , Linux Kernel , Linux Upstreaming Team Content-Type: text/plain; charset="UTF-8" Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Thu, May 30, 2019 at 2:12 AM Daniel Drake wrote: > > Hi Chris, > > On Tue, May 28, 2019 at 11:03 PM Chris Chiu wrote: > > + /* > > + * Single virtual interface permitted since the driver supports STATION > > + * mode only. > > I think you can be a bit more explicit by saying e.g.: > > Only one virtual interface permitted because only STA mode is > supported and no iface_combinations are provided. > > > diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c > > index 039e5ca9d2e4..2d612c2df5b2 100644 > > --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c > > +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c > > @@ -4345,7 +4345,7 @@ void rtl8xxxu_gen2_update_rate_mask(struct rtl8xxxu_priv *priv, > > h2c.b_macid_cfg.ramask3 = (ramask >> 24) & 0xff; > > > > h2c.ramask.arg = 0x80; > > - h2c.b_macid_cfg.data1 = 0; > > + h2c.b_macid_cfg.data1 = priv->ratr_index; > > I think ratr_index can be moved to be a function parameter of the > update_rate_mask function. It looks like all callsites already know > which value they want to set. Then you don't have to store it in the > priv structure. > You mean moving the ratr_index to be the 4th function parameter of update_rate_mask which has 2 candidates rtl8xxxu_update_rate_mask and rtl8xxxu_gen2_update_rate_mask? I was planning to keep the rtl8xxxu_update_rate_mask the same because old chips seems don't need the rate index when invoking H2C command to change rate mask. And rate index is not a common phrase/term for rate adaptive. Theoretically we just need packet error rate, sgi and other factors to determine the rate mask. This rate index seems to be only specific to newer Realtek drivers or firmware for rate adaptive algorithm. I'd like to keep this for gen2 but I admit it's ugly to put it in the priv structure. Any suggestion is appreciated. Thanks > > @@ -5471,6 +5509,10 @@ static int rtl8xxxu_add_interface(struct ieee80211_hw *hw, > > > > switch (vif->type) { > > case NL80211_IFTYPE_STATION: > > + if (!priv->vif) > > + priv->vif = vif; > > + else > > + return -EOPNOTSUPP; > > rtl8xxxu_stop_tx_beacon(priv); > > rtl8xxxu_remove_interface should also set priv->vif back to NULL. > > > @@ -6183,6 +6259,8 @@ static void rtl8xxxu_disconnect(struct usb_interface *interface) > > mutex_destroy(&priv->usb_buf_mutex); > > mutex_destroy(&priv->h2c_mutex); > > > > + cancel_delayed_work_sync(&priv->ra_watchdog); > > Given that the work was started in rtl8xxxu_start, I think it should > be cancelled in rtl8xxxu_stop() instead. > > Daniel