From patchwork Tue Jul 18 06:47:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ryanhsu@qti.qualcomm.com X-Patchwork-Id: 9847061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6E2CF60392 for ; Tue, 18 Jul 2017 06:48:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64B54274D0 for ; Tue, 18 Jul 2017 06:48:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5951B28542; Tue, 18 Jul 2017 06:48:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C4AC7274D0 for ; Tue, 18 Jul 2017 06:48:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-ID:In-Reply-To: References:Message-ID:Date:Subject:To:From:Reply-To:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nswthpVTMmI/mI2cZJP6uWOJJjJDN1/uPhEz9PKXXv4=; b=A9PCdxgTKD8pMG cnv/tyc6Byk8vGnEPxV87xSU505sY2/7lLVTXOiNtHZoBsp3oHBLukXvWQF4D2bDZFpsaWouqLusl rj3EFK0lBZhYRkYzMAQXXnN4hIiDtaqzC80otuCAyVBfO4im4vTbQ+gjuXnMByHUYuSA9x+v0o3Ix uut9e9cu0aELhqG6loHtkAo30Ln1n2WrpX35CunwpbxvLOA9frW/XeFphrRgZHUhtLc9A7WeB5dcH qAgU0UlYgeP4SDtsSXaB8Wpe4pYDHRdzer173+UVvwrgFX/2ZpPxjvaBOX6DvntX/FF3XyLcm/5yH Di9F7U/ueK/TRTda0k3g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dXMIj-0005FF-T6; Tue, 18 Jul 2017 06:48:09 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28] helo=alexa-out-lv-02.qualcomm.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dXMIf-0005Cc-Nn for ath10k@lists.infradead.org; Tue, 18 Jul 2017 06:48:07 +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=1500360485; x=1531896485; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=QjROUhbWtcdYMyfXcehf05zo+L0zZgugo56N9gk2F+4=; b=VaWtByz0/ygVcew7R07xX+fx+QLvB3/vCuBWpVRW7gcIS7KQMRu4EErz pzJH8F3B9qu+5+c5zHQZJ9OuSBlSlOhCIUD8vr48uQoVFOQpT/u4TU4Np F23/nOWk/E6BKIvhm3UQdXLPAon0V6OC9R0bfzM6rnt6hBRerl+wLHpui g=; X-IronPort-AV: E=Sophos;i="5.40,377,1496127600"; d="scan'208";a="1225909" Received: from ironmsg02-lv.qualcomm.com ([10.47.202.183]) by alexa-out-lv-02.qualcomm.com with ESMTP; 17 Jul 2017 23:47:41 -0700 X-IronPort-AV: E=McAfee;i="5800,7501,8594"; a="37206270" X-MGA-submission: =?us-ascii?q?MDGEtZrUbC7jGvpZ0IdyN0EdhvkWGZIQ92CRO1?= =?us-ascii?q?9VBWIxLheW04h+pwwSXFzs3xpgEe/Uk5bdeWFajVAtQDluUxJmQJyC7n?= =?us-ascii?q?VEwWZB2gTNYWT5yKb254za5rR1dxckorjVDOJ+Rl3dl4DT36Wg6Plc4z?= =?us-ascii?q?63?= Received: from nalasexr01a.na.qualcomm.com ([10.49.56.21]) by ironmsg02-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 17 Jul 2017 23:47:10 -0700 Received: from NALASEXR01G.na.qualcomm.com (10.49.56.53) by nalasexr01a.na.qualcomm.com (10.49.56.21) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Mon, 17 Jul 2017 23:47:10 -0700 Received: from NALASEXR01G.na.qualcomm.com ([10.49.56.53]) by NALASEXR01G.na.qualcomm.com ([10.49.56.53]) with mapi id 15.00.1178.000; Mon, 17 Jul 2017 23:47:10 -0700 From: Ryan Hsu To: Igor Mitsyanko , Andrey Ryabinin , Ryan Hsu , Kalle Valo Subject: Re: WARN_ON_ONCE(work > weight) in napi_poll() Thread-Topic: WARN_ON_ONCE(work > weight) in napi_poll() Thread-Index: AQHS8b6NpMCVipWWhUiGN/CVCo7heKJETwQAgAnIyQCAAVBZAIAAg6CAgAnJfIA= Date: Tue, 18 Jul 2017 06:47:09 +0000 Message-ID: References: <26670dce-4dd2-f8e4-0e14-90d74257e739@virtuozzo.com> <87wp7oia6j.fsf@kamboji.qca.qualcomm.com> <952aefe1-6f6a-3978-e7e7-5e74076f26a3@virtuozzo.com> <8cb28d9b-41c9-043c-16ca-f0bea41944e9@virtuozzo.com> <3ce246b3-b110-dd50-bf29-45ee78985872@quantenna.com> In-Reply-To: <3ce246b3-b110-dd50-bf29-45ee78985872@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [199.106.107.6] Content-ID: <6713E710B7DAC04A95820880533C9685@qualcomm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170717_234805_880862_D73883D2 X-CRM114-Status: GOOD ( 12.58 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Networking , linux-wireless , LKML , "ath10k@lists.infradead.org" Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On 07/11/2017 06:19 PM, Igor Mitsyanko wrote: > On 07/11/2017 10:28 AM, Andrey Ryabinin wrote: >> >> It gave me this: >> >> [118648.825347] #1 quota too big 72 64 16 >> [118648.825351] #2 quota too big 72 64 16 >> [118648.825471] ------------[ cut here ]------------ >> [118648.825484] WARNING: CPU: 0 PID: 0 at ../net/core/dev.c:5274 net_rx_action+0x258/0x360 >> >> So this means that we didn't met the condition bellow, i.e. skb_queue_empty() returned true. >> >> ath10k_htt_txrx_compl_task(): >> >> if ((quota > ATH10K_NAPI_QUOTA_LIMIT) && >> !skb_queue_empty(&htt->rx_in_ord_compl_q)) { >> resched_napi = true; >> goto exit; >> } >> >>> Also WLAN.RM.2.0-00180-QCARMSWPZ-1 firmware is a bit old, could you also update firmware to give it a try? >>> https://github.com/kvalo/ath10k-firmware/tree/master/QCA6174/hw3.0/4.4 >>> >> >> Will try. >> > > Maybe ath10k_htt_rx_in_ord_ind() has to accept "budget_left" parameter and use it to limit number of processed MSDUs in queued AMSDU and saving rest for later (NAPI has to be rescheduled in this case). > It seems natural that this problem happens with current logic, in case AMSDU in Rx queue has more elements then left in budget. Thanks, likely in current logic, it does have chance to exceed the budget while dequeuing from the last list. Can you give it a try this one? for QCA6174 reorder is offload, so this should be good enough for your case to test, will have to check non-offload reorder case... but let me know if you're seeing something different.... --- -- diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index 398dda9..e8697a1 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -1735,7 +1735,8 @@ static void ath10k_htt_rx_delba(struct ath10k *ar, struct htt_resp *resp) } static int ath10k_htt_rx_extract_amsdu(struct sk_buff_head *list, - struct sk_buff_head *amsdu) + struct sk_buff_head *amsdu, + int budget_left) { struct sk_buff *msdu; struct htt_rx_desc *rxd; @@ -1746,8 +1747,9 @@ static int ath10k_htt_rx_extract_amsdu(struct sk_buff_head *list, if (WARN_ON(!skb_queue_empty(amsdu))) return -EINVAL; - while ((msdu = __skb_dequeue(list))) { + while ((msdu = __skb_dequeue(list)) && budget_left) { __skb_queue_tail(amsdu, msdu); + budget_left--; rxd = (void *)msdu->data - sizeof(*rxd); if (rxd->msdu_end.common.info0 & @@ -1838,7 +1840,8 @@ static int ath10k_htt_rx_h_rx_offload(struct ath10k *ar, return num_msdu; } -static int ath10k_htt_rx_in_ord_ind(struct ath10k *ar, struct sk_buff *skb) +static int ath10k_htt_rx_in_ord_ind(struct ath10k *ar, struct sk_buff *skb, + int budget_left) { struct ath10k_htt *htt = &ar->htt; struct htt_resp *resp = (void *)skb->data; @@ -1895,9 +1898,9 @@ static int ath10k_htt_rx_in_ord_ind(struct ath10k *ar, struct sk_buff *skb) if (offload) num_msdus = ath10k_htt_rx_h_rx_offload(ar, &list); - while (!skb_queue_empty(&list)) { + while (!skb_queue_empty(&list) && budget_left) { __skb_queue_head_init(&amsdu); - ret = ath10k_htt_rx_extract_amsdu(&list, &amsdu); + ret = ath10k_htt_rx_extract_amsdu(&list, &amsdu, budget_left); switch (ret) { case 0: /* Note: The in-order indication may report interleaved @@ -1907,6 +1910,7 @@ static int ath10k_htt_rx_in_ord_ind(struct ath10k *ar, struct sk_buff *skb) * should still give an idea about rx rate to the user. */ num_msdus += skb_queue_len(&amsdu); + budget_left -= skb_queue_len(&amsdu); ath10k_htt_rx_h_ppdu(ar, &amsdu, status, vdev_id); ath10k_htt_rx_h_filter(ar, &amsdu, status); ath10k_htt_rx_h_mpdu(ar, &amsdu, status); @@ -2549,7 +2553,8 @@ int ath10k_htt_txrx_compl_task(struct ath10k *ar, int budget) } spin_lock_bh(&htt->rx_ring.lock); - num_rx_msdus = ath10k_htt_rx_in_ord_ind(ar, skb); + num_rx_msdus = ath10k_htt_rx_in_ord_ind(ar, skb, + (budget - quota)); spin_unlock_bh(&htt->rx_ring.lock); if (num_rx_msdus < 0) { resched_napi = true;