From patchwork Wed Jan 13 13:52:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 8025711 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@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 58F24BEEE5 for ; Wed, 13 Jan 2016 13:52:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D36E20503 for ; Wed, 13 Jan 2016 13:52:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B7B85204AD for ; Wed, 13 Jan 2016 13:52:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756122AbcAMNv6 (ORCPT ); Wed, 13 Jan 2016 08:51:58 -0500 Received: from mail-lf0-f45.google.com ([209.85.215.45]:35550 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755429AbcAMNv5 (ORCPT ); Wed, 13 Jan 2016 08:51:57 -0500 Received: by mail-lf0-f45.google.com with SMTP id c192so255743217lfe.2 for ; Wed, 13 Jan 2016 05:51:56 -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; bh=nZ8os7B7hGz10nApXIJ/xtJDkAy73dsmjOskpxUr6Vo=; b=5qhoBPMgEne5hfkcs/NPDrs1Pwzn5DRbehlcfdU/eoF5gtedEp3dJZIIoJE2Qp4UCH cRIDZ6S1xMQizHYm5orGCgPskxirsiUYrKjwyHqt2xXjoMAR5UsthnWDtebgtB32t37U +8UJb/ACjl1frJCgo17a9rggoiIP5sltUMK+M= 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=nZ8os7B7hGz10nApXIJ/xtJDkAy73dsmjOskpxUr6Vo=; b=Bz261fYSYzhx4ABKsPMQ3e4f3dM4QNHC22DO1aCQ/l9QYGVJAwVc58oihfjL7LeK6C sK7M2pwXKjNgKS6egOF58meh7cgKwWcwH2CWWcj5aSYzMWW+wFGA50/3TPiIzmL+AlOo L1/7vGlz/V30Yx0Kc1Bg8DJgva2xR64MDqB9GUE6evzXFrxrs/mRgyJQElW0/VqTGV8q TuPojEB4toOcodvDzQ73vzRu//RvhNz9TuMMEjd3l9pImgIy6x5GDUrClOj15H15DMpn UcNlJngZS+OSZutfXVGKoXd0+Bals6/muywBhTjOhNHtxnWuANmAfZBDu+oIrqfk3HD5 qK+g== X-Gm-Message-State: ALoCoQkRsAMoYlZDWXROyUPEHxpybebX1LkTtFqM+RmlOPj3oVyTI4R8TgMPGEEEgOOswwcpWIknrTZl9HE46OlVLyKjBO8d7E16psQ6GP2PXestQVNo/NC9/1cvSit2SzvuzCqALdS8Dg2GnjUq2pDB59+0xUJT/A== X-Received: by 10.25.24.195 with SMTP id 64mr29480310lfy.156.1452693116001; Wed, 13 Jan 2016 05:51:56 -0800 (PST) Received: from localhost.localdomain ([91.198.246.10]) by smtp.gmail.com with ESMTPSA id px9sm203434lbb.4.2016.01.13.05.51.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Jan 2016 05:51:55 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH] ath10k: prevent txrx running for too long Date: Wed, 13 Jan 2016 14:52:52 +0100 Message-Id: <1452693172-28340-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=-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 On multicore systems it was possible for the txrx tasklet to keep on running for long periods of time on a single CPU due to tx completion processing. Another CPU could feed the running tasklet for an indefinite amount of time. The tasklet is now guaranteed to run a finite amount of time and is limited by HTT CE Rx ring depth. This improves behavior when RPS is used on target system and might improve TCP handling as well. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/htt_rx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 91afa3ae414c..3079434b5d9b 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -2156,10 +2156,18 @@ 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 htt_resp *resp; struct sk_buff *skb; + unsigned long flags; - while ((skb = skb_dequeue(&htt->tx_compl_q))) { + __skb_queue_head_init(&tx_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); + + while ((skb = __skb_dequeue(&tx_q))) { ath10k_htt_rx_frm_tx_compl(htt->ar, skb); dev_kfree_skb_any(skb); }