Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp890482ybh; Tue, 21 Jul 2020 10:17:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcA/ehsOfYHpQnee7qF10dlNSpUO3WPIrw1svnc5G01GNqbuvSidx0DLq9NKkrMvB4xKz1 X-Received: by 2002:aa7:db11:: with SMTP id t17mr25803207eds.365.1595351822393; Tue, 21 Jul 2020 10:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595351822; cv=none; d=google.com; s=arc-20160816; b=tRSzs1URVPlKItpSVXLS9nCVz8sQu2RM6DbzFnX7utvcNF4I1wyd0I/Vd+MxolM+OZ GG06o+Pd6LbG7NTuiQ/AMVg0CjMAZ+HRIvA4oHfMGCRN1TDzLK1DvwK1wREdUzwldksJ O+242Pae4SJ032+uoFKTDn5IbJxtq0tC0H2L2WnhLXRdCu2g+NhtrlMpi/68uQH5F6dm ebWFcXHrCDGikxgJuixE5u7MIgEVdHCBfBGETb2pmJX7YnACUvcxKzF60OySyKerooW+ vJI213G7YnfWNqlWhK5cMSWpPURHRTJ9hAnzYRQgDRwSt/LY+zXi7e99Nmtkbpcc9/ud NQDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=wMU4DbU33JbajyG3cP1sY2UVCv9Nr6xvONZ479ljK6o=; b=lbcbC/Kw8x+HVo5EyAFRCPh5eXf1ZU6XMbyVBF+YRnTDqn25iQof45rnxbT7YP8rIf Qz6Pk4X+4Pg+RJt6rgi6bg26Yie/R0gxxiPLZRNu/wOnWzwZMoAWZbFniwgdE+0RSzKR w/8Tq+OYQoWin+uxzadpDN8H259ThpN8gvG4MMyvN2/2L0C9YzHmiotf7U4H7S5jjjaA XFyerwBVbZQWwjhNJW0kJ9sGok4ENOOUz/5Nr9qMwL9cnFPTv7cP1ZJdws3qIFxBpmiT +Jr/LIP4n6iJsiFS3LU1jOQGkH+hYCe/C1v+RRHu2FFRI9kWMEcE/rKyjoJ608HuQUZF Tcpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=BwJ5pO4w; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y19si13690813eje.56.2020.07.21.10.16.38; Tue, 21 Jul 2020 10:17:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=BwJ5pO4w; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730763AbgGURPB (ORCPT + 99 others); Tue, 21 Jul 2020 13:15:01 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:14780 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730716AbgGURO7 (ORCPT ); Tue, 21 Jul 2020 13:14:59 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1595351698; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=wMU4DbU33JbajyG3cP1sY2UVCv9Nr6xvONZ479ljK6o=; b=BwJ5pO4wNqTd3ENB6lQV5Ni850eFRHpfxnuLudOcpGI8Jk3l8lqhdED9s0E2R7orYbtYzTDh m/a6brb6rQrX9sCZK1iDKc6jLtRwGbwnDOzTHE+yQTwAvY3XLwmfw5p5dOmWyOCRkF6XpSZ6 bR8KzY6AJ1eOAJ4rRCutItke6tY= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 5f172292f9ca681bd08d75ca (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 21 Jul 2020 17:14:58 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 0A83DC433B1; Tue, 21 Jul 2020 17:14:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from pillair-linux.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pillair) by smtp.codeaurora.org (Postfix) with ESMTPSA id DB20FC433C6; Tue, 21 Jul 2020 17:14:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org DB20FC433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=pillair@codeaurora.org From: Rakesh Pillai To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, kvalo@codeaurora.org, johannes@sipsolutions.net, davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, dianders@chromium.org, evgreen@chromium.org, Rakesh Pillai Subject: [RFC 4/7] ath10k: Do not exhaust budget on process tx completion Date: Tue, 21 Jul 2020 22:44:23 +0530 Message-Id: <1595351666-28193-5-git-send-email-pillair@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1595351666-28193-1-git-send-email-pillair@codeaurora.org> References: <1595351666-28193-1-git-send-email-pillair@codeaurora.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Currently the entire NAPI budget is marked as exhausted if any tx completion is processed. In scenarios of bi-directional traffic, this leads to a situation where the irqs are never enabled and the NAPI is rescheuled again and again. Increase the work done quota by the number of tx completions which are processed in the NAPI context. Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.1-01040-QCAHLSWMTPLZ-1 Signed-off-by: Rakesh Pillai --- drivers/net/wireless/ath/ath10k/htt_rx.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index cac05e7..a4a6618 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -4077,21 +4077,18 @@ int ath10k_htt_txrx_compl_task(struct ath10k *ar, int budget) /* Deliver received data after processing data from hardware */ quota = ath10k_htt_rx_deliver_msdu(ar, quota, budget); - /* From NAPI documentation: - * The napi poll() function may also process TX completions, in which - * case if it processes the entire TX ring then it should count that - * work as the rest of the budget. - */ - if ((quota < budget) && !kfifo_is_empty(&htt->txdone_fifo)) - quota = budget; - /* kfifo_get: called only within txrx_tasklet so it's neatly serialized. * From kfifo_get() documentation: * Note that with only one concurrent reader and one concurrent writer, * you don't need extra locking to use these macro. */ - while (kfifo_get(&htt->txdone_fifo, &tx_done)) + while (kfifo_get(&htt->txdone_fifo, &tx_done)) { ath10k_txrx_tx_unref(htt, &tx_done); + quota++; + } + + if (quota > budget) + resched_napi = true; ath10k_mac_tx_push_pending(ar); -- 2.7.4