From patchwork Tue May 17 12:47:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 9111981 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6169E9F30C for ; Tue, 17 May 2016 12:45:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 862852025A for ; Tue, 17 May 2016 12:45:57 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id B5B4F201BB for ; Tue, 17 May 2016 12:45:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b2eNh-0002J4-Km; Tue, 17 May 2016 12:45:49 +0000 Received: from mail-lb0-x230.google.com ([2a00:1450:4010:c04::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b2eNf-0001iQ-OI for ath10k@lists.infradead.org; Tue, 17 May 2016 12:45:48 +0000 Received: by mail-lb0-x230.google.com with SMTP id h1so5441800lbj.3 for ; Tue, 17 May 2016 05:45:27 -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; bh=AEllk0jHAwG04EOjSYO5IL3/72hAY+xhVZLGJJpXvEY=; b=e6TyoopOWj9GHCJ2Z3AU1njHWxB2n81TLdTrgc0uwd940xLpCV0c7lvQA+IpNhcDny 7GLb0MEHI/GlQ4zmJEjgJtvwe5ifWh2getnEwSMGJP1pVBMx+tNIYcVPSEvJT7Xgc7GX HmpjsviwV3YpLvZr3R1U8q9Wr/wFnoPUlw/is= 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; bh=AEllk0jHAwG04EOjSYO5IL3/72hAY+xhVZLGJJpXvEY=; b=TpTPM8B2bd7PbtJWubnI9U1/ne7fRe1ZS7IbfS6q/pMjUngURAKJTa1Xf1ioZvhGpV g89NeKB+LunToiHnMU9XL5emSiCXldzmtfUwbaT3+uOkizLaFRe6c2MSghp7krSUV7Jn aI9hHnxNMZiYxhwH5zWy2cY8KptlHtgPInHdiPnoNp6pAg9Vwj6t9n55VHVpAvlF3XeG c/7mhnWBsWlokJYLLfEwcHhF0ZPQP4hS5HdCNkXvVTA8bqglwKtXbe68ndDog3uHcPHE 02Jv30n8i7yzXUK+pQlSXL2RuppV1+ZR1ctaB26Gy5YrA5sf9gRNPQZURCC0gXi5y8J8 j/uA== X-Gm-Message-State: AOPr4FVUQyWO8bAyz3xFN0m2QPA6o5P0fx6Bq+7NFZ8KFRgGiTuTk0BLIVlvkVtPs9V4wFm6Qs0idqkwHVL1Mq55y9a12yqRQVH7w+4rDjuxRSlWXTDH9NMbluqV5yO8c5Sjy2NTqTai2wZraUhuq2E3z2ntC8dQ8B9KALzGm5sAH0HPQfRdtvF5zpthDQypJg== X-Received: by 10.112.150.165 with SMTP id uj5mr451296lbb.95.1463489125869; Tue, 17 May 2016 05:45:25 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.10]) by smtp.gmail.com with ESMTPSA id a8sm472661lbb.48.2016.05.17.05.45.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 May 2016 05:45:24 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org, leroi.lists@gmail.com Subject: [RFC/RFT] ath10k: disable wake_tx_queue for older devices Date: Tue, 17 May 2016 14:47:01 +0200 Message-Id: <1463489221-24989-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160517_054547_991675_E39AEC1C X-CRM114-Status: GOOD ( 14.38 ) X-Spam-Score: -2.7 (--) 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 MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some setups suffer performance regressions with current wake_tx_queue implementation. Signed-off-by: Michal Kazior --- Hi Roman, Can you give this patch a try and see if it helps with your performance problems, please? 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 1379054000f9..44e7c2cd2e9b 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -657,6 +657,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 0e24f9ee8bff..5fa3888afa41 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -7396,21 +7396,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[] = { @@ -7838,6 +7849,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) {