From patchwork Wed Jun 29 11:52:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 9204997 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7F30D607D8 for ; Wed, 29 Jun 2016 11:51:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D94428634 for ; Wed, 29 Jun 2016 11:51:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5ECB228655; Wed, 29 Jun 2016 11:51:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1813328634 for ; Wed, 29 Jun 2016 11:51:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIE1R-0007qq-Vo; Wed, 29 Jun 2016 11:51:14 +0000 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bIE1P-0007pZ-E7 for ath10k@lists.infradead.org; Wed, 29 Jun 2016 11:51:12 +0000 Received: by mail-lf0-x22c.google.com with SMTP id f6so31648590lfg.0 for ; Wed, 29 Jun 2016 04:50:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SSOwa+Btb7+NKCtx7uk8bkcXugX5jnJ38rd0e+Cukc4=; b=yF+1IIK+1Z0DyfTv25BuYja9ahaioUWKN8r8bm1Jg5IUjUEf6kww6gSLd1PCVPf+vc ewJzt9hynuwyzTZUVW4HjPNgFkA9B6rTckSoFNaaHsnTczXoAFqXWCY8YCrDLmYcwiNc ZFoizG5fX8D3WiiqceXBcoNv6750FFw1nL5FI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SSOwa+Btb7+NKCtx7uk8bkcXugX5jnJ38rd0e+Cukc4=; b=HhAhgtwhmr/AX4+cCycoI7fxMXHc0BYt2D18gPS6qdnJ4nNXJunOer7b4+ilDmCUMg 00mdT3FPXAYvz1LS9q7CVvkUtHnhk1aqtmpmVj5Q63AlVu1kkjWywi8TiKxU9NXfQjKS Fh2b9bJbeQcMKUoPqszJvzXYw7cuCuQtAmTgkighkbkB5BArXMbBmBYlGgbFL+UYRlp2 77BWZyk4sevG1FU2kPXEnwI/RlrAb6PstwHKB/0huqI60vtsXy14FZdtLdZtY6ndEitc gJWYPWf+qg9PL0yh0vsJbTa4W6MahroXg8+Wnvn2FkW5cwnJj6Jd35jWJjslgmTBhEtn 10TA== X-Gm-Message-State: ALyK8tL8lpQvXSLZY+gOJ2bUkDDhiH+7nMUdbj7vqwb2s7gmjSTd0Hv2d7X98Ph5lKaPfCijXEMDyqaMm4DgnaxHi14A256DDvcdW+NPf5vx0OA7ZV4rMlDGnQ/K/QBn37CqA+cR X-Received: by 10.25.215.196 with SMTP id q65mr2488961lfi.98.1467201045571; Wed, 29 Jun 2016 04:50:45 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by smtp.gmail.com with ESMTPSA id 193sm570327ljj.49.2016.06.29.04.50.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Jun 2016 04:50:44 -0700 (PDT) From: Michal Kazior To: kvalo@qca.qualcomm.com Subject: [PATCH] ath10k: disable wake_tx_queue for older devices Date: Wed, 29 Jun 2016 13:52:26 +0200 Message-Id: <1467201146-6844-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1463489221-24989-1-git-send-email-michal.kazior@tieto.com> References: <1463489221-24989-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160629_045111_699124_A4B83895 X-CRM114-Status: GOOD ( 15.18 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Michal Kazior , ath10k@lists.infradead.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Ideally wake_tx_queue should be used regardless as it is a requirement for reducing bufferbloat and implementing airtime fairness in the future. However some setups (typically low-end platforms hosting QCA988X) suffer performance regressions with the current wake_tx_queue implementation. Therefore disable it unless it is really beneficial with current codebase (which is when firmware supports smart pull-push tx scheduling). Signed-off-by: Michal Kazior --- Notes: v1: - improve commit log drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/mac.c | 24 ++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 3da18c9dbd7a..de580af2e5ef 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -667,6 +667,7 @@ struct ath10k_fw_components { struct ath10k { struct ath_common ath_common; struct ieee80211_hw *hw; + struct ieee80211_ops *ops; struct device *dev; u8 mac_addr[ETH_ALEN]; diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index d4b7a168f7c0..958bc6c91aac 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -7471,21 +7471,32 @@ static const struct ieee80211_channel ath10k_5ghz_channels[] = { struct ath10k *ath10k_mac_create(size_t priv_size) { struct ieee80211_hw *hw; + struct ieee80211_ops *ops; struct ath10k *ar; - hw = ieee80211_alloc_hw(sizeof(struct ath10k) + priv_size, &ath10k_ops); - if (!hw) + ops = kmemdup(&ath10k_ops, sizeof(ath10k_ops), GFP_KERNEL); + if (!ops) return NULL; + hw = ieee80211_alloc_hw(sizeof(struct ath10k) + priv_size, ops); + if (!hw) { + kfree(ops); + return NULL; + } + ar = hw->priv; ar->hw = hw; + ar->ops = ops; return ar; } void ath10k_mac_destroy(struct ath10k *ar) { + struct ieee80211_ops *ops = ar->ops; + ieee80211_free_hw(ar->hw); + kfree(ops); } static const struct ieee80211_iface_limit ath10k_if_limits[] = { @@ -7919,6 +7930,15 @@ int ath10k_mac_register(struct ath10k *ar) ath10k_warn(ar, "failed to initialise DFS pattern detector\n"); } + /* Current wake_tx_queue implementation imposes a significant + * performance penalty in some setups. The tx scheduling code needs + * more work anyway so disable the wake_tx_queue unless firmware + * supports the pull-push mechanism. + */ + if (!test_bit(ATH10K_FW_FEATURE_PEER_FLOW_CONTROL, + ar->running_fw->fw_file.fw_features)) + ar->ops->wake_tx_queue = NULL; + ret = ath_regd_init(&ar->ath_common.regulatory, ar->hw->wiphy, ath10k_reg_notifier); if (ret) {