From patchwork Tue Aug 25 08:49:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 248245 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp3237611ils; Tue, 25 Aug 2020 01:43:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYDNG2qMF5MTxVLXkzZwS8/kO4WO2rYMVypgjT3RLUaF8M4O4zr1VBFkPJB3QjZfWgF1Zm X-Received: by 2002:a17:907:2105:: with SMTP id qn5mr9088457ejb.219.1598345016973; Tue, 25 Aug 2020 01:43:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598345016; cv=none; d=google.com; s=arc-20160816; b=ALHAPDnMaDeZ0YgWuTvoZMUM/jrqrQzTjCDE8UJN25P8ObNJWNqZjB9nYfKG9K75sO D1sd527j1E+jL9uUpTTEFoMY0maVlzytcgFyBt4Q56jzo+Nps44UWOyNsFO7qHCZZ6w2 o9MraKWOodeRogUgYAvG5uO8Iop4x5YjqDeEokYCPT9HrNIAQcAEWkQU6ipMp1iibPQN GFQMdvkROTDlj7Jxcy7/FhbJz7vWJfBcebspJw2leZ0WvwcHsLT9Hm/29XnprzZblsUJ mYcSykHHSt0wLmvT3iSfehQZCX3iJnzUpz2Ens09q2ZlFHBGnHf419NTnpR8cxk9Uwzz kVnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=eJIrPqYjE0dAhcP4ZkZrj1aYUysa9b1OXixWXQw7McY=; b=awrZTn/v5s2BsPcMwIe+aO1VmglRV6egpDAgnEWh3OSKvruziuOI4malpgITlg91R0 sM0ICBlrAleeiJFrV65zPXMCaMv1hsg7HHcSYf/wljpDB42By03dn+tFmUIZVdK5GPOp 4GHDRA0xEcSU0cnockK9MIFdtADSjgNwYuWf0bT26JTBaw5AfvRXHhlzoUutnEVDbUyK LBfnl3pLvhGfKh8b3e0oRjWyoy7sfiR07LMHg7TvefGd4uUNIkp9EePakua9onNf7LJt BZXCUIcxKvTwlOgoryBpEe7oaFM/g83WPIxCK0ZrwMuEpqhNeJ1l89zieCwOSzGahd50 TY8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="vc/EOs2X"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si3483180edy.7.2020.08.25.01.43.36; Tue, 25 Aug 2020 01:43:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="vc/EOs2X"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726149AbgHYInf (ORCPT + 2 others); Tue, 25 Aug 2020 04:43:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726531AbgHYIne (ORCPT ); Tue, 25 Aug 2020 04:43:34 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B007C061574 for ; Tue, 25 Aug 2020 01:43:33 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id g75so1341108wme.4 for ; Tue, 25 Aug 2020 01:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=eJIrPqYjE0dAhcP4ZkZrj1aYUysa9b1OXixWXQw7McY=; b=vc/EOs2XvrKCpyBoB+0CqxZSDDrqZOwL9j+1S1VdFeqsiDRB3vzpHZaViBORnZ0htc eyjxEUBaZBZzZvmys9xebuxUl6lt76GxgDrpnssWp5OQkpRD8zbdA4jIACSe66TWNW9+ zepPS5hRMlZ3GsTUecYthvOP+5zchQqgB6Jt02u/0jssKrxGw5kr6kflMN42Eo/mRp1A HO5WrF5HZAXfStyveN6y5/2xzf4s13Oann37ZW7+O96e81MwDbwmWRGqr3y1j8Vsf/Nj NN1wsab9XTOHgVNiiC69qxQG65g9WhXROb1W+ZEXjIRKdSUbHDRQ9BscGPYzLbwc0oDz ba5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=eJIrPqYjE0dAhcP4ZkZrj1aYUysa9b1OXixWXQw7McY=; b=LVS/d/aXEXZ/xrM9hDBqNBKyeIxLYZMcVagTyRBjPFKKeWQ7vdBhncXsexhSiv5Y8h GaxV8AgS/476+RieEzInvb1XTZftozPbFKu4nidOm7nThqfn+mYhpELUYKZXdz0I0wFh wjR/8yxoUkkSUvOP3yxieZ5lKIEgh2sA9JZTPeAkgDeZYFUjzBQ4RGVwkzqIaVpr2HUv 5dFmr4fxbDiMs1Kqb5RAVhCA5/ECvNxxUg8HjefgJK9l5di5em8dyYavq/L9VgKA1Fyz cEM7X8d3+6dErbXa2xA/me7Xc+9BWTcbpRxhC6Y/eUBZMyTFYGkiWy2kOcmf9f3PBzj5 STug== X-Gm-Message-State: AOAM533jqX1+fQT2rjSpPy1UjAmFsh+Otbt39rOY8wqDnZz01WHykTNG eLrda02HmGztB7AcHm+R9W8VMA== X-Received: by 2002:a1c:ed15:: with SMTP id l21mr1012476wmh.56.1598345011082; Tue, 25 Aug 2020 01:43:31 -0700 (PDT) Received: from localhost.localdomain ([88.122.66.28]) by smtp.gmail.com with ESMTPSA id u13sm4349613wmm.20.2020.08.25.01.43.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Aug 2020 01:43:30 -0700 (PDT) From: Loic Poulain To: kvalo@codeaurora.org Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org, bryan.odonoghue@linaro.org, Loic Poulain Subject: [PATCH] wcn36xx: Setup starting bitrate to MCS-5 Date: Tue, 25 Aug 2020 10:49:01 +0200 Message-Id: <1598345341-4505-1-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org By default, after associated to an AP, the wcn36xx bitrate adjustment algorithm starts sending data at 1Mbps, and increases the rate slowly (1Mbps, 2Mbps, 6Mbps...) over the further TX packets. Starting at 1Mbps usually causes the initial throughput to be really low and the maximum possible bitrate to be reached after about hundreed of TX packets. That can be improved by setting a different initial bitrate for data packets via the ENABLE_DYNAMIC_RA_START_RATE configuration value, this value can be a legacy or MCS rate. This patch sets the starting bitrate value to MCS-5, which seems to be a good compromise given it can be quickly adjusted low or up if necessary. (and based on what I observed in the wild with some mobile devices) Signed-off-by: Loic Poulain --- drivers/net/wireless/ath/wcn36xx/hal.h | 8 ++++++++ drivers/net/wireless/ath/wcn36xx/smd.c | 1 + 2 files changed, 9 insertions(+) -- 2.7.4 diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h index 6ba0fd5..88e1ed5 100644 --- a/drivers/net/wireless/ath/wcn36xx/hal.h +++ b/drivers/net/wireless/ath/wcn36xx/hal.h @@ -728,6 +728,14 @@ enum pe_stats_mask { #define WCN36XX_HAL_CFG_ENABLE_TDLS_OXYGEN_MODE 104 #define WCN36XX_HAL_CFG_MAX_PARAMS 105 +/* Specify the starting bitrate, 11B and 11A/G rates can be specified in + * multiples of 0.5 So for 5.5 mbps => 11. for MCS 0 - 7 rates, Bit 7 should + * set to 1 and Bit 0-6 represent the MCS index. so for MCS2 => 130. + * Any invalid non-zero value or unsupported rate will set the start rate + * to 6 mbps. + */ +#define WCN36XX_HAL_CFG_ENABLE_DYNAMIC_RA_START_RATE 210 + /* Message definitons - All the messages below need to be packed */ /* Definition for HAL API Version. */ diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c index 9864c6f..83247d3 100644 --- a/drivers/net/wireless/ath/wcn36xx/smd.c +++ b/drivers/net/wireless/ath/wcn36xx/smd.c @@ -77,6 +77,7 @@ static struct wcn36xx_cfg_val wcn36xx_cfg_vals[] = { WCN36XX_CFG_VAL(BTC_STATIC_LEN_LE_WLAN, 30000), WCN36XX_CFG_VAL(MAX_ASSOC_LIMIT, 10), WCN36XX_CFG_VAL(ENABLE_MCC_ADAPTIVE_SCHEDULER, 0), + WCN36XX_CFG_VAL(ENABLE_DYNAMIC_RA_START_RATE, 133), /* MCS 5 */ }; static int put_cfg_tlv_u32(struct wcn36xx *wcn, size_t *len, u32 id, u32 value)