From patchwork Fri Feb 12 06:10:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajkumar Manoharan X-Patchwork-Id: 8287761 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 8F4B3BEEE5 for ; Fri, 12 Feb 2016 06:11:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9282C203B0 for ; Fri, 12 Feb 2016 06:11: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 AD431203AE for ; Fri, 12 Feb 2016 06:11: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 1aU6xJ-0004MG-PL; Fri, 12 Feb 2016 06:11:49 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aU6xH-0004EJ-LK for ath10k@lists.infradead.org; Fri, 12 Feb 2016 06:11:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1455257507; x=1486793507; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=aOCVnyh9h68+O0cvtO/3uOcUiXQ3K8FYidZSJMzVEgM=; b=kPMvgitFl4DE1q6ZaSPqIHqdtW7ZaG7qEKlNBG7HFuxvudS8go4lJ6NN KS7m7XZTSRIlPtQPYAzZiudRwx3o1zzHpOewH5EZSC4mU3hfR48Z+VFlE X+1uyzOStgPT41HcgKvTYrRMLOfju0++QXNVLH0uKpvAhMhQ/oGRRfDPg Y=; X-IronPort-AV: E=Sophos;i="5.22,435,1449561600"; d="scan'208";a="168382929" Received: from ironmsg03-r-new.qualcomm.com (HELO Ironmsg03-R.qualcomm.com) ([10.53.140.107]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Feb 2016 22:11:26 -0800 X-IronPort-AV: E=McAfee;i="5700,7163,8072"; a="1084279774" Received: from nasanexm01f.na.qualcomm.com ([10.85.0.32]) by Ironmsg03-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 11 Feb 2016 22:11:26 -0800 Received: from APSANEXR01B.ap.qualcomm.com (10.85.0.37) by NASANEXM01F.na.qualcomm.com (10.85.0.32) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 11 Feb 2016 22:11:26 -0800 Received: from qcmail1.qualcomm.com (10.80.80.8) by APSANEXR01B.ap.qualcomm.com (10.85.0.37) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 11 Feb 2016 22:11:20 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Fri, 12 Feb 2016 11:41:14 +0530 From: Rajkumar Manoharan To: Subject: [PATCH 2/2] ath10k: process htt rx indication as batch mode Date: Fri, 12 Feb 2016 11:40:59 +0530 Message-ID: <1455257459-13343-2-git-send-email-rmanohar@qti.qualcomm.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455257459-13343-1-git-send-email-rmanohar@qti.qualcomm.com> References: <1455257459-13343-1-git-send-email-rmanohar@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01F.na.qualcomm.com (10.85.0.32) To APSANEXR01B.ap.qualcomm.com (10.85.0.37) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160211_221147_772359_F6D76BEF X-CRM114-Status: UNSURE ( 8.73 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.3 (-------) 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, Rajkumar Manoharan Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 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 On multicore systems, it is possible that txrx tasket can run in parallel with pci tasklet (i.e smp affinity of ath10k irq is assigned to multiple CPUs). Feeding and consuming from the same rx completion list leads to txrx tasklet runs for longer period. Prevent this by processing a snapshot of rx queue by moving list into temporary list. Consecutive received frames will be processed in next batch. Signed-off-by: Rajkumar Manoharan --- drivers/net/wireless/ath/ath10k/htt_rx.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index bedd8c3..61d9507 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2155,22 +2155,34 @@ static void ath10k_htt_txrx_compl_task(unsigned long ptr) struct ath10k_htt *htt = (struct ath10k_htt *)ptr; struct ath10k *ar = htt->ar; struct sk_buff_head tx_q; + struct sk_buff_head rx_q; + struct sk_buff_head rx_ind_q; struct htt_resp *resp; struct sk_buff *skb; unsigned long flags; __skb_queue_head_init(&tx_q); + __skb_queue_head_init(&rx_q); + __skb_queue_head_init(&rx_ind_q); spin_lock_irqsave(&htt->tx_compl_q.lock, flags); skb_queue_splice_init(&htt->tx_compl_q, &tx_q); spin_unlock_irqrestore(&htt->tx_compl_q.lock, flags); + spin_lock_irqsave(&htt->rx_compl_q.lock, flags); + skb_queue_splice_init(&htt->rx_compl_q, &rx_q); + spin_unlock_irqrestore(&htt->rx_compl_q.lock, flags); + + spin_lock_irqsave(&htt->rx_in_ord_compl_q.lock, flags); + skb_queue_splice_init(&htt->rx_in_ord_compl_q, &rx_ind_q); + spin_unlock_irqrestore(&htt->rx_in_ord_compl_q.lock, flags); + while ((skb = __skb_dequeue(&tx_q))) { ath10k_htt_rx_frm_tx_compl(htt->ar, skb); dev_kfree_skb_any(skb); } - while ((skb = skb_dequeue(&htt->rx_compl_q))) { + while ((skb = __skb_dequeue(&rx_q))) { resp = (struct htt_resp *)skb->data; spin_lock_bh(&htt->rx_ring.lock); ath10k_htt_rx_handler(htt, &resp->rx_ind); @@ -2178,7 +2190,7 @@ static void ath10k_htt_txrx_compl_task(unsigned long ptr) dev_kfree_skb_any(skb); } - while ((skb = skb_dequeue(&htt->rx_in_ord_compl_q))) { + while ((skb = __skb_dequeue(&rx_ind_q))) { spin_lock_bh(&htt->rx_ring.lock); ath10k_htt_rx_in_ord_ind(ar, skb); spin_unlock_bh(&htt->rx_ring.lock);