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: 9204995 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 09796607D8 for ; Wed, 29 Jun 2016 11:50:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEB3928634 for ; Wed, 29 Jun 2016 11:50:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E345E28655; Wed, 29 Jun 2016 11:50:50 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A19128634 for ; Wed, 29 Jun 2016 11:50:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752088AbcF2Lus (ORCPT ); Wed, 29 Jun 2016 07:50:48 -0400 Received: from mail-lf0-f41.google.com ([209.85.215.41]:34922 "EHLO mail-lf0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751993AbcF2Lur (ORCPT ); Wed, 29 Jun 2016 07:50:47 -0400 Received: by mail-lf0-f41.google.com with SMTP id l188so31607177lfe.2 for ; Wed, 29 Jun 2016 04:50:46 -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=dCV0quYtWKXSvCw+0vaj03ouGg5/NrQMFL9BSXa83p9aLMQeIbmnIgEJK+2XXlNY6Q SrygnRID8n9MQnulTfE0Qsv7ngFGh6ZmSbZbaL4BaRjDnJpOfufoS5m7+0G5Ko7sfJyi 4zQCXIfCWuW8cjNU8k0j0BiVG9+GWqmfBqrqPsoiOfN6jPmwx74qiWpTTL8NRRRxB5iF EUp/9Oy3ZjHs2PIytvwibTXG+OZ54HYPw0CpgFD9jJepsghuX46eWj2eJC1I/CxXABso hAVq1a/1cjHsAJJU6sfz5RUmzOUQzpXAG8PVjbBiDIJugwykWRgNILhfNWUZQMxvgxio JNbg== X-Gm-Message-State: ALyK8tKb0y24c+G8tbOcIeu5KSf0M2YCnG+yHav6B2MkclK6yJe5hAPzz3nVfTNn3D5semXy0GF4HN1Wi0wfp7geRPj9+ePCyISQ98afpkzX0ta6bgOLC2HfHWAA5q953Ulv3C9w9QYNJQ== 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 Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, Michal Kazior 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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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) {