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: 9111971 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@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 7BF689F30C for ; Tue, 17 May 2016 12:45:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8EBFD2025A for ; Tue, 17 May 2016 12:45:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6A6EB201BB for ; Tue, 17 May 2016 12:45:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751443AbcEQMp2 (ORCPT ); Tue, 17 May 2016 08:45:28 -0400 Received: from mail-lb0-f178.google.com ([209.85.217.178]:36598 "EHLO mail-lb0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750940AbcEQMp1 (ORCPT ); Tue, 17 May 2016 08:45:27 -0400 Received: by mail-lb0-f178.google.com with SMTP id h1so5441798lbj.3 for ; Tue, 17 May 2016 05:45:26 -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=gKJspnj2Lxz9eU44QJfAK90YCFeVztH4ATxI8ReYWw/etPEQ/UNYkr/N+jpm84Ek3R rMDvdmsCAMA7kXfOh7kunvBqPbmMFqrQt9D0ZWkaZPzuUyIkNqL5Vac3jD//g3TfXky/ MFb/mqG3qnNa0gZIM4nWDM0jEloqumUG5XMMqZ2SGKz6cx1+RB1CmJl6WMdCHNXrELZw 0wtF2t4NONK8aovWdf1Zy33kNJ6X3xd/WRWsTrMmZH9cXyh7hBhaBdlLcS53PxEPWKOX IEiwyv+6UC03FTztpiwMbQ6NcAA/0cpSVzQViXfEsW8B71XmGvNY7RcGzTuR7ibCdyZU UwbA== X-Gm-Message-State: AOPr4FWFlYb8hFYgIympZPR1OzjW2yZmMfNJTcuqTSK7L4rdVb0DJ7qMm5k4wvRsnrO0WAANbhgOVs7Be7eihOzorNvf+YZV8IQuaLI0aKWwdLhGwa/A75CI7XofXz6tzS6dkkr5LuJsbg== 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 Cc: linux-wireless@vger.kernel.org, Michal Kazior 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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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) {