From patchwork Tue Mar 1 10:32:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 8464081 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 30EB1C0553 for ; Tue, 1 Mar 2016 10:32:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5CA052012D for ; Tue, 1 Mar 2016 10:32:53 +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 89521201BC for ; Tue, 1 Mar 2016 10:32:52 +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 1aahbk-0000nn-W3; Tue, 01 Mar 2016 10:32:49 +0000 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aahbd-0000Tk-3B for ath10k@lists.infradead.org; Tue, 01 Mar 2016 10:32:45 +0000 Received: by mail-lf0-x22f.google.com with SMTP id l83so62922270lfd.3 for ; Tue, 01 Mar 2016 02:32:23 -0800 (PST) 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=2U03irJLNg1F3PY6iiibuOF/Bs3ccN0nnpRxR8GfYzE=; b=Sq7+UZdz+nRSPWlQs0to10qs3nh75iP8dMsvvafDr4helPaZGVGR67nDTO7ntE7ajT AfJ3eiVKmMjIL+QI1F1cIO31poLYTig3aV+DTmcH7keppIB15FUS/niVagWsNxyQsjcY XDJjraDTPpcLAgnSZHA1ECIxHwhUWdFG9sU64= 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=2U03irJLNg1F3PY6iiibuOF/Bs3ccN0nnpRxR8GfYzE=; b=kU3Cci+DbTWnnp+hf5q9LuWn7P3qQm3PzptMcB+DHATlpwqz4disHkRWPThQYZP8ds 329uIfdVcCKfB6+vZbQb2TKVVXNOPppKcwj/YudRodeRh26K8mzNIC8k0YaTtQrFoptB Jb1Acmv2ZmAfPbVIQCwVKcnk+m4oCgXL6rZ4wVNw4vxtbG6HF8tsm3hJk/jShnpv1Pwq ENOdZ7zqvH7WDCSs2QPwtVA9AwBoB/awbxfVd4WhlfUs2Zchci4Wiaf1E7P6dmQNf5os aZmi1wNYpyOwua2/17fmVfc+jIVZVK6AAeUWUqMPTRuW/GHkvWG7oxjUj5Kly3Pt+OFz kQNw== X-Gm-Message-State: AD7BkJLcU+kCffpFN/gPQ49fRuIrK9gCEl6JfrrQCk5/Y+lsnU1LY7NKdQQ3odaoOh+s9eVl+QdixKch0Zw1ixearta87jz9nake5KSMVtzuP7hp6+K8YOKtxjDC2bqjxE+gMG1DwSOh3FGEWRSBf01dc77XghczZ+eUg1svok+SVtJtd73gz3A68LfPnxDcmQ== X-Received: by 10.25.168.67 with SMTP id r64mr6031998lfe.104.1456828342160; Tue, 01 Mar 2016 02:32:22 -0800 (PST) Received: from localhost.localdomain ([91.198.246.10]) by smtp.gmail.com with ESMTPSA id i2sm4644857lfd.43.2016.03.01.02.32.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Mar 2016 02:32:21 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH v2 10/11] ath10k: keep track of queue depth per txq Date: Tue, 1 Mar 2016 11:32:55 +0100 Message-Id: <1456828376-2795-11-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456828376-2795-1-git-send-email-michal.kazior@tieto.com> References: <1453384006-31907-1-git-send-email-michal.kazior@tieto.com> <1456828376-2795-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-20160301_023241_464839_3042D5D6 X-CRM114-Status: GOOD ( 11.19 ) 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=-4.1 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 This will be necessary for later. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/mac.c | 5 +++++ drivers/net/wireless/ath/ath10k/txrx.c | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 89f789f3e5b4..926ecb2244a5 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -311,6 +311,7 @@ struct ath10k_peer { struct ath10k_txq { struct list_head list; + unsigned long num_fw_queued; }; struct ath10k_sta { diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 8d02d53fdc2c..5bf614f1f75a 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3669,6 +3669,7 @@ static int ath10k_mac_tx_push_txq(struct ieee80211_hw *hw, const bool is_presp = false; struct ath10k *ar = hw->priv; struct ath10k_htt *htt = &ar->htt; + struct ath10k_txq *artxq = (void *)txq->drv_priv; struct ieee80211_vif *vif = txq->vif; struct ieee80211_sta *sta = txq->sta; enum ath10k_hw_txrx_mode txmode; @@ -3708,6 +3709,10 @@ static int ath10k_mac_tx_push_txq(struct ieee80211_hw *hw, return ret; } + spin_lock_bh(&ar->htt.tx_lock); + artxq->num_fw_queued++; + spin_unlock_bh(&ar->htt.tx_lock); + return 0; } diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index 202e5192235b..ea4d3000c8c3 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -55,7 +55,9 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt, struct ath10k *ar = htt->ar; struct device *dev = ar->dev; struct ieee80211_tx_info *info; + struct ieee80211_txq *txq; struct ath10k_skb_cb *skb_cb; + struct ath10k_txq *artxq; struct sk_buff *msdu; bool limit_mgmt_desc = false; @@ -80,11 +82,16 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt, } skb_cb = ATH10K_SKB_CB(msdu); + txq = skb_cb->txq; + artxq = (void *)txq->drv_priv; if (unlikely(skb_cb->flags & ATH10K_SKB_F_MGMT) && ar->hw_params.max_probe_resp_desc_thres) limit_mgmt_desc = true; + if (txq) + artxq->num_fw_queued--; + ath10k_htt_tx_free_msdu_id(htt, tx_done->msdu_id); ath10k_htt_tx_dec_pending(htt, limit_mgmt_desc); if (htt->num_pending_tx == 0)