From patchwork Thu Jan 21 13:46:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 8081221 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 6E98D9F440 for ; Thu, 21 Jan 2016 13:46:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 912422050E for ; Thu, 21 Jan 2016 13:46:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF26220502 for ; Thu, 21 Jan 2016 13:46:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965334AbcAUNqA (ORCPT ); Thu, 21 Jan 2016 08:46:00 -0500 Received: from mail-lb0-f174.google.com ([209.85.217.174]:34903 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965321AbcAUNpx (ORCPT ); Thu, 21 Jan 2016 08:45:53 -0500 Received: by mail-lb0-f174.google.com with SMTP id bc4so23436227lbc.2 for ; Thu, 21 Jan 2016 05:45:52 -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=azqyCbRdvaRMBgfAY57qwL0qZ79wJ2jS6h7IyQHaeGo=; b=SSoLxQEbZi1tpa2SycXYG9mG8JLj0zG7N+hl6OwDgBXI5tFq8w9QblFMthvd66NF9B u84cwUkR5r6VTXhaVpHsZENEQGSjmB3QluoWTpAgHTTVGtbxALiKJ0cwZeqWhMAFP247 XHOWSQ3Qkel1dSB34S3aHoklpTr/b5X868pIM= 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=azqyCbRdvaRMBgfAY57qwL0qZ79wJ2jS6h7IyQHaeGo=; b=E62Huba9B+lzO6sA36tJHitWsFg6EWtMYE/lHOnMNXNKiuqzsZ6KfuAOt344yNVwiJ rYw0anMHNbD/Isoe6P+nlb9BBX8LtAs9MzcWmxsW/XbxOoMQLdAiEOjFCH+zc3UTsGW3 RTM/d/7S97V1s/Wu9oYooP4btNkfupZBcIBXh6gzV/KjhnoXglgU1viv+WPnwme9d1Wj kVaZJWzewhJXMHAOvCQpYbwz10nLBP7cHgWPEvXQQBw+PwLh6Xtkxbokq2mNu9Fyaych eiP84JfffCL4VYd9i9Hwk9z3KVACkz2U4WH4ljpQS2YxgpPw+k6gJWrgX++9FLK8+EAV RhPg== X-Gm-Message-State: ALoCoQl5duSf7zndrYA9fWbvwDFK9peKRZTqxz7nxRQZ1LkOyU0j//2ezThlcMWKGfOhid0x2juXvuvD3Jux9M6kpk13R2C18J88kPaGjqb2Jm+ITo0esnYH82ROoBHL+TZRXgmVAfhtZZEeSfSQBOpQElsDuU4+QA== X-Received: by 10.112.211.168 with SMTP id nd8mr15297592lbc.116.1453383952173; Thu, 21 Jan 2016 05:45:52 -0800 (PST) Received: from localhost.localdomain ([91.198.246.10]) by smtp.gmail.com with ESMTPSA id c192sm207382lfb.16.2016.01.21.05.45.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Jan 2016 05:45:51 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH 12/13] ath10k: keep track of queue depth per txq Date: Thu, 21 Jan 2016 14:46:45 +0100 Message-Id: <1453384006-31907-13-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1453384006-31907-1-git-send-email-michal.kazior@tieto.com> References: <1453384006-31907-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-Spam-Status: No, score=-6.8 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 This will be necessary for later. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/core.h | 2 +- drivers/net/wireless/ath/ath10k/mac.c | 5 +++++ drivers/net/wireless/ath/ath10k/txrx.c | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 5be56a8343bd..f51887c6be74 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -306,7 +306,7 @@ struct ath10k_peer { }; struct ath10k_txq { - /* TBD */ + 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 639da03572e0..0dc16de1d9fb 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3639,6 +3639,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; @@ -3678,6 +3679,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)