From patchwork Wed Sep 18 12:43:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 2906381 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3ED9A9F1E3 for ; Wed, 18 Sep 2013 12:43:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 32B7A20364 for ; Wed, 18 Sep 2013 12:43:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C406420378 for ; Wed, 18 Sep 2013 12:43:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751967Ab3IRMnd (ORCPT ); Wed, 18 Sep 2013 08:43:33 -0400 Received: from ebb06.tieto.com ([131.207.168.38]:46192 "EHLO ebb06.tieto.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751639Ab3IRMnb (ORCPT ); Wed, 18 Sep 2013 08:43:31 -0400 X-AuditID: 83cfa826-b7f408e000003a47-68-52399ff1e75a Received: from FIHGA-EXHUB01.eu.tieto.com ( [131.207.136.34]) by ebb06.tieto.com (SMTP Mailer) with SMTP id 91.8A.14919.1FF99325; Wed, 18 Sep 2013 15:43:29 +0300 (EEST) Received: from uw001058.eu.tieto.com (10.28.19.57) by inbound.tieto.com (131.207.136.49) with Microsoft SMTP Server id 8.3.298.1; Wed, 18 Sep 2013 15:43:28 +0300 From: Michal Kazior To: CC: , Michal Kazior Subject: [PATCH 1/5] ath10k: use num_pending_tx instead of msdu id bitmap Date: Wed, 18 Sep 2013 14:43:18 +0200 Message-ID: <1379508202-9660-2-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1379508202-9660-1-git-send-email-michal.kazior@tieto.com> References: <1379508202-9660-1-git-send-email-michal.kazior@tieto.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBIsWRmVeSWpSXmKPExsXSfL5DSffjfMsgg+mbVCweXTrGbPFmxR12 i29bH7A5MHt8nnmXzWPzknqPz5vkApijuGxSUnMyy1KL9O0SuDI2XD3EWPCau2LpzHa2BsbJ XF2MnBwSAiYSp7++YYewxSQu3FvP1sXIxSEksIpR4uWvr4wQzlJGiUVnn7CAVLEJ6Eq8ajzL CmKLCChI/Jr0kQ3EZhbwlXj2ZBkTiC0s4CnxsP8fWJxFQFWita+RGcTmFXCT2LdqMdAcDqBt ChJzJtmAmJwC7hKLVoaBVAgBVWz79p0FolpQ4uRMiK3MAhISB1+8YIaoUZE4uH4/8wRGgVlI ymYhKVvAyLSKkT81KcnATK8kM7UkXy85P3cTIzgAV6jtYHz2QOoQowAHoxIPb2ONRZAQa2JZ cWXuIUZJDiYlUd6aOZZBQnxJ+SmVGYnFGfFFpTmpxYcYJTiYlUR4i2cD5XhTEiurUovyYVLS HCxK4rwfYoAmCaQnlqRmp6YWpBbBZGU4OJQkeN3nATUKFqWmp1akZeaUIKSZODhBhvMADS8A qeEtLkjMLc5Mh8ifYlSUEudNBkkIgCQySvPgemEJ4hWjONArwrzeIFU8wOQC1/0KaDAT0OD3 S8xABpckIqSkGhjLlE3Uv5c2b+9dbHhqvnndDqtZoRmTnz86sjvC+WCXvWLQVPMl8gcsJr3Y mhFSrlQzOyncoeXgs8daL0vPfCyuOmjF4VrQ0HFw50PhZqcJm0Q/hB6qlihcmpe85uDmdSsf LZ9+NE/h/UX/MP0Jx4ozPPlVHTe5dfzd6KR9UvPEGy/RJ+v47bOVWIozEg21mIuKEwGJhIgo 6wIAAA== Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 It's more efficient to simply check num_pending_tx value instead of traversing whole bitmap of msdu ids. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 3 +-- drivers/net/wireless/ath/ath10k/txrx.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 11aa13e..5a56833 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -2853,8 +2853,7 @@ static void ath10k_flush(struct ieee80211_hw *hw, u32 queues, bool drop) bool empty; spin_lock_bh(&ar->htt.tx_lock); - empty = bitmap_empty(ar->htt.used_msdu_ids, - ar->htt.max_num_pending_tx); + empty = (ar->htt.num_pending_tx == 0); spin_unlock_bh(&ar->htt.tx_lock); skip = (ar->state == ATH10K_STATE_WEDGED); diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index 68b6fae..37b8196 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -96,7 +96,7 @@ exit: htt->pending_tx[ATH10K_SKB_CB(txdesc)->htt.msdu_id] = NULL; ath10k_htt_tx_free_msdu_id(htt, ATH10K_SKB_CB(txdesc)->htt.msdu_id); __ath10k_htt_tx_dec_pending(htt); - if (bitmap_empty(htt->used_msdu_ids, htt->max_num_pending_tx)) + if (htt->num_pending_tx == 0) wake_up(&htt->empty_tx_wq); spin_unlock_bh(&htt->tx_lock);