Message ID | 20221220075215.1.Ic12e347e0d61a618124b742614e82bbd5d770173@changeid |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2833288wrn; Tue, 20 Dec 2022 00:03:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf4WQ5pe+r21PJBKKLG/wl62ZH1TWOWH+6pgCYpPXeAhCXdfj6JNe2h6I2hbd1+uXzOcKLVN X-Received: by 2002:a17:902:d551:b0:18d:6244:4676 with SMTP id z17-20020a170902d55100b0018d62444676mr46082042plf.18.1671523397977; Tue, 20 Dec 2022 00:03:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671523397; cv=none; d=google.com; s=arc-20160816; b=Ap0i2+5kdWxAeqFYUgx1mxx6jFGHZh8uUykp4cYD12Zex3c8u0ZrdwGlSWAN14qtEf BjbbeB/LTcmMQR2JxKsZAmbCcI6qUIxlPDh0mfokAXAadxZcDSlnVQNrt0WSMh7k6rk6 cjKA4/ZJEKV7394vM71rRitYaW1jo8+oxc2tTH/rEH63JLS8+gmO8FJIzArX56CZxoxI IJHGn4mPQTGnagSe6lPR59yALJ2d0p0GVEy4QBvJqDCt9IEi0GGkHLLNl81aH3EYCqTW T0turTYr66+p+glu1au6RtQTwcLLvXgA/YM7DLkWqK6XhTEVa8t5yQB4EWFhjcyrLRRv RdZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+lUH7ICleRb/CYwKzbaXCdf221Goq9bYxBGSvWpk034=; b=l9J+q/phm239QqzDuZIqx4iswwXj2B602Gmw91UmmAp1k9JeviHfYwbLKe9+U7ohQT F6eVTGuuDNXsJgWE2bhcXlSClIyG9G08t6iAV1FMl9wBTDyQDPDueOIK7c10TBvF4dQ4 vPZmcAa87A940PQiKXZfmOc3CTWZcMVud1bvLwzVsmV+/5qxCX8Y0LkcABy+rlPIQHWL My1Nc2WZl3QjU16dpWzVUZhESykeiTiahmesNjbdmtyIxHWpXdFsZZtpZVJhbYnjTg7A P+HG3c3rNn2FBaRsnCUYE3KpD05ZwU+Q6yh38MaawG6QDJqsMo/9BIgRj+3SWTdInqD6 megw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=m5nTnrA9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x8-20020a170902b40800b00189c3cb41a6si12356392plr.93.2022.12.20.00.03.04; Tue, 20 Dec 2022 00:03:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=m5nTnrA9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232918AbiLTHzy (ORCPT <rfc822;abdi.embedded@gmail.com> + 99 others); Tue, 20 Dec 2022 02:55:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbiLTHzu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 20 Dec 2022 02:55:50 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 758C53892 for <linux-kernel@vger.kernel.org>; Mon, 19 Dec 2022 23:55:48 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id 3-20020a17090a098300b00219041dcbe9so11301291pjo.3 for <linux-kernel@vger.kernel.org>; Mon, 19 Dec 2022 23:55:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+lUH7ICleRb/CYwKzbaXCdf221Goq9bYxBGSvWpk034=; b=m5nTnrA9JUKHMNfFob+CNWz9Y5A1kA/3Jg6cLD2QsBzePMwiGtry/ONhtt0M6DLHQp nDTdgG2QLz7YZjToSy+z02blQQO/SSdch1ihyHDei1Ao12BSLtsQM0JaN95eblZG12ss 2eoqXXhHY7PGgAznQJ9xkaJaha4nQFcP00W2M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+lUH7ICleRb/CYwKzbaXCdf221Goq9bYxBGSvWpk034=; b=uyAEE8HkSCRmIlqTiaVzYivYvOndO7uQnu1rLCLKkAXMiEDFr4jDBxyvhocT3WV1hP XKuOVveWTzqX/ORVoRJD7lJGOnhO6Yz90CsMBPNQjlNZSXIRpr+OUgMpQnxFNGvGUOKV 4mnRwcwc/vfV+tVnp3EuRKMMLhWqN/8iFkQysYPBDc9Ntlqc6VYE2+vbHAS5SwBRX7q0 js2R4sFfkuLKLMxUkdfo1xpzQcLQygockujg0uCNxwMk9J/1fvpnJpQcBWUV/bWeQeOK USzUZBb1NaAyi43H1iVAfJVXV6pQMEL3t3PTrE9EPqN2vlX3gtZETiWoy4VnGHYoN9lc P4Fw== X-Gm-Message-State: AFqh2kruar4X9gP4HW5/fnAXJPODQ30QDJggm9wC3LuR93g3oMeyfqb4 mJ6xIZ9tFC6OqWS+ed3ODGHsDQ== X-Received: by 2002:a05:6a20:9e05:b0:b2:18da:1515 with SMTP id ms5-20020a056a209e0500b000b218da1515mr3509202pzb.20.1671522947919; Mon, 19 Dec 2022 23:55:47 -0800 (PST) Received: from kuabhs-cdev.c.googlers.com.com (254.80.82.34.bc.googleusercontent.com. [34.82.80.254]) by smtp.gmail.com with ESMTPSA id u31-20020a63235f000000b00488b8ad57bfsm5124215pgm.54.2022.12.19.23.55.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 23:55:47 -0800 (PST) From: Abhishek Kumar <kuabhs@chromium.org> To: kvalo@kernel.org Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, kuabhs@chromium.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Subject: [PATCH] ath10k: snoc: enable threaded napi on WCN3990 Date: Tue, 20 Dec 2022 07:55:06 +0000 Message-Id: <20221220075215.1.Ic12e347e0d61a618124b742614e82bbd5d770173@changeid> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752719318689080714?= X-GMAIL-MSGID: =?utf-8?q?1752719318689080714?= |
Series |
ath10k: snoc: enable threaded napi on WCN3990
|
|
Commit Message
Abhishek Kumar
Dec. 20, 2022, 7:55 a.m. UTC
NAPI poll can be done in threaded context along with soft irq
context. Threaded context can be scheduled efficiently, thus
creating less of bottleneck during Rx processing. This patch is
to enable threaded NAPI on ath10k driver.
Based on testing, it was observed that on WCN3990, the CPU0 reaches
100% utilization when napi runs in softirq context. At the same
time the other CPUs are at low consumption percentage. This
does not allow device to reach its maximum throughput potential.
After enabling threaded napi, CPU load is balanced across all CPUs
and following improvments were observed:
- UDP_RX increase by ~22-25%
- TCP_RX increase by ~15%
Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2-00696-QCAHLSWMTPL-1
Signed-off-by: Abhishek Kumar <kuabhs@chromium.org>
---
drivers/net/wireless/ath/ath10k/core.c | 16 ++++++++++++++++
drivers/net/wireless/ath/ath10k/hw.h | 2 ++
drivers/net/wireless/ath/ath10k/snoc.c | 3 +++
3 files changed, 21 insertions(+)
Comments
On 12/20/2022 1:25 PM, Abhishek Kumar wrote: > NAPI poll can be done in threaded context along with soft irq > context. Threaded context can be scheduled efficiently, thus > creating less of bottleneck during Rx processing. This patch is > to enable threaded NAPI on ath10k driver. > > Based on testing, it was observed that on WCN3990, the CPU0 reaches > 100% utilization when napi runs in softirq context. At the same > time the other CPUs are at low consumption percentage. This > does not allow device to reach its maximum throughput potential. > After enabling threaded napi, CPU load is balanced across all CPUs > and following improvments were observed: > - UDP_RX increase by ~22-25% > - TCP_RX increase by ~15% > > Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2-00696-QCAHLSWMTPL-1 > Signed-off-by: Abhishek Kumar <kuabhs@chromium.org> > --- > > drivers/net/wireless/ath/ath10k/core.c | 16 ++++++++++++++++ > drivers/net/wireless/ath/ath10k/hw.h | 2 ++ > drivers/net/wireless/ath/ath10k/snoc.c | 3 +++ > 3 files changed, 21 insertions(+) > > diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c > index 5eb131ab916fd..ee4b6ba508c81 100644 > --- a/drivers/net/wireless/ath/ath10k/core.c > +++ b/drivers/net/wireless/ath/ath10k/core.c > @@ -100,6 +100,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA988X_HW_2_0_VERSION, > @@ -140,6 +141,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA9887_HW_1_0_VERSION, > @@ -181,6 +183,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA6174_HW_3_2_VERSION, > @@ -217,6 +220,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA6174_HW_2_1_VERSION, > @@ -257,6 +261,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA6174_HW_2_1_VERSION, > @@ -297,6 +302,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA6174_HW_3_0_VERSION, > @@ -337,6 +343,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA6174_HW_3_2_VERSION, > @@ -381,6 +388,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA99X0_HW_2_0_DEV_VERSION, > @@ -427,6 +435,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA9984_HW_1_0_DEV_VERSION, > @@ -480,6 +489,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA9888_HW_2_0_DEV_VERSION, > @@ -530,6 +540,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA9377_HW_1_0_DEV_VERSION, > @@ -570,6 +581,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA9377_HW_1_1_DEV_VERSION, > @@ -612,6 +624,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA9377_HW_1_1_DEV_VERSION, > @@ -645,6 +658,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA4019_HW_1_0_DEV_VERSION, > @@ -692,6 +706,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = WCN3990_HW_1_0_DEV_VERSION, > @@ -725,6 +740,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = true, > .use_fw_tx_credits = false, > .delay_unmap_buffer = true, > + .enable_threaded_napi = true, > }, > }; > > diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h > index 9643031a4427a..adf3076b96503 100644 > --- a/drivers/net/wireless/ath/ath10k/hw.h > +++ b/drivers/net/wireless/ath/ath10k/hw.h > @@ -639,6 +639,8 @@ struct ath10k_hw_params { > bool use_fw_tx_credits; > > bool delay_unmap_buffer; > + > + bool enable_threaded_napi; > }; > > struct htt_resp; > diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c > index cfcb759a87dea..b94150fb6ef06 100644 > --- a/drivers/net/wireless/ath/ath10k/snoc.c > +++ b/drivers/net/wireless/ath/ath10k/snoc.c > @@ -927,6 +927,9 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) > > bitmap_clear(ar_snoc->pending_ce_irqs, 0, CE_COUNT_MAX); > > + if (ar->hw_params.enable_threaded_napi) > + dev_set_threaded(&ar->napi_dev, true); > + Since this is done in the API specific to WCN3990, we do not need hw_param for this. Thanks, Manikanta
I am always interested in flent.org tcp_nup, tcp_ndown, and rrul_be tests on wifi hardware. In AP mode, especially, against a few clients in rtt_fair on the "ending the anomaly" test suite at the bottom of this link: https://www.cs.kau.se/tohojo/airtime-fairness/ . Of these, it's trying to optimize bandwidth more fairly and keep latencies low when 4 or more stations are trying to transmit (in a world with 16 or more stations online), that increasingly bothers me the most. I'm seeing 5+ seconds on some rtt_fair-like tests nowadays. I was also seeing huge simultaneous upload vs download disparities on the latest kernels, on various threads over here: https://forum.openwrt.org/t/aql-and-the-ath10k-is-lovely/59002 and more recently here: https://forum.openwrt.org/t/reducing-multiplexing-latencies-still-further-in-wifi/133605 I don't understand why napi with the default budget (64) is even needed on the ath10k, as a single txop takes a minimum of ~200us, but perhaps your patch will help. Still, measuring the TCP statistics in-band would be nice to see. Some new tools are appearing that can do this, Apple's goresponsiveness, crusader... that are simpler to use than flent. On Tue, Dec 20, 2022 at 12:17 AM Abhishek Kumar <kuabhs@chromium.org> wrote: > > NAPI poll can be done in threaded context along with soft irq > context. Threaded context can be scheduled efficiently, thus > creating less of bottleneck during Rx processing. This patch is > to enable threaded NAPI on ath10k driver. > > Based on testing, it was observed that on WCN3990, the CPU0 reaches > 100% utilization when napi runs in softirq context. At the same > time the other CPUs are at low consumption percentage. This > does not allow device to reach its maximum throughput potential. > After enabling threaded napi, CPU load is balanced across all CPUs > and following improvments were observed: > - UDP_RX increase by ~22-25% > - TCP_RX increase by ~15% > > Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2-00696-QCAHLSWMTPL-1 > Signed-off-by: Abhishek Kumar <kuabhs@chromium.org> > --- > > drivers/net/wireless/ath/ath10k/core.c | 16 ++++++++++++++++ > drivers/net/wireless/ath/ath10k/hw.h | 2 ++ > drivers/net/wireless/ath/ath10k/snoc.c | 3 +++ > 3 files changed, 21 insertions(+) > > diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c > index 5eb131ab916fd..ee4b6ba508c81 100644 > --- a/drivers/net/wireless/ath/ath10k/core.c > +++ b/drivers/net/wireless/ath/ath10k/core.c > @@ -100,6 +100,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA988X_HW_2_0_VERSION, > @@ -140,6 +141,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA9887_HW_1_0_VERSION, > @@ -181,6 +183,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA6174_HW_3_2_VERSION, > @@ -217,6 +220,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA6174_HW_2_1_VERSION, > @@ -257,6 +261,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA6174_HW_2_1_VERSION, > @@ -297,6 +302,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA6174_HW_3_0_VERSION, > @@ -337,6 +343,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA6174_HW_3_2_VERSION, > @@ -381,6 +388,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA99X0_HW_2_0_DEV_VERSION, > @@ -427,6 +435,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA9984_HW_1_0_DEV_VERSION, > @@ -480,6 +489,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA9888_HW_2_0_DEV_VERSION, > @@ -530,6 +540,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA9377_HW_1_0_DEV_VERSION, > @@ -570,6 +581,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA9377_HW_1_1_DEV_VERSION, > @@ -612,6 +624,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA9377_HW_1_1_DEV_VERSION, > @@ -645,6 +658,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = QCA4019_HW_1_0_DEV_VERSION, > @@ -692,6 +706,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = false, > .use_fw_tx_credits = true, > .delay_unmap_buffer = false, > + .enable_threaded_napi = false, > }, > { > .id = WCN3990_HW_1_0_DEV_VERSION, > @@ -725,6 +740,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > .hw_restart_disconnect = true, > .use_fw_tx_credits = false, > .delay_unmap_buffer = true, > + .enable_threaded_napi = true, > }, > }; > > diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h > index 9643031a4427a..adf3076b96503 100644 > --- a/drivers/net/wireless/ath/ath10k/hw.h > +++ b/drivers/net/wireless/ath/ath10k/hw.h > @@ -639,6 +639,8 @@ struct ath10k_hw_params { > bool use_fw_tx_credits; > > bool delay_unmap_buffer; > + > + bool enable_threaded_napi; > }; > > struct htt_resp; > diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c > index cfcb759a87dea..b94150fb6ef06 100644 > --- a/drivers/net/wireless/ath/ath10k/snoc.c > +++ b/drivers/net/wireless/ath/ath10k/snoc.c > @@ -927,6 +927,9 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) > > bitmap_clear(ar_snoc->pending_ce_irqs, 0, CE_COUNT_MAX); > > + if (ar->hw_params.enable_threaded_napi) > + dev_set_threaded(&ar->napi_dev, true); > + > ath10k_core_napi_enable(ar); > ath10k_snoc_irq_enable(ar); > ath10k_snoc_rx_post(ar); > -- > 2.39.0.314.g84b9a713c41-goog >
Apologies for the late reply, Thanks Dave for your comment. My answer is inline. On Tue, Dec 20, 2022 at 7:10 AM Dave Taht <dave.taht@gmail.com> wrote: > > I am always interested in flent.org tcp_nup, tcp_ndown, and rrul_be > tests on wifi hardware. In AP mode, especially, against a few clients > in rtt_fair on the "ending the anomaly" test suite at the bottom of > this link: https://www.cs.kau.se/tohojo/airtime-fairness/ . Of these, > it's trying to optimize bandwidth more fairly and keep latencies low > when 4 or more stations are trying to transmit (in a world with 16 or > more stations online), that increasingly bothers me the most. I'm > seeing 5+ seconds on some rtt_fair-like tests nowadays. I used testing using iperf and conductive setup and fetched the throughput data(mentioned below). > > I was also seeing huge simultaneous upload vs download disparities on > the latest kernels, on various threads over here: > https://forum.openwrt.org/t/aql-and-the-ath10k-is-lovely/59002 and > more recently here: > https://forum.openwrt.org/t/reducing-multiplexing-latencies-still-further-in-wifi/133605 Interesting, thanks for the pointer and probably the Qualcomm team is aware of it. > > I don't understand why napi with the default budget (64) is even > needed on the ath10k, as a single txop takes a minimum of ~200us, but > perhaps your patch will help. Still, measuring the TCP statistics > in-band would be nice to see. Some new tools are appearing that can do > this, Apple's goresponsiveness, crusader... that are simpler to use > than flent. Here are some of the additional raw data with and without threaded napi: ================================================== udp_rx(Without threaded NAPI) 435.98+-5.16 : Channel 44 439.06+-0.66 : Channel 157 udp_rx(With threaded NAPI) 509.73+-41.03 : Channel 44 549.97+-7.62 : Channel 157 =================================================== udp_tx(Without threaded NAPI) 461.31+-0.69 : Channel 44 461.46+-0.78 : Channel 157 udp_tx(With threaded NAPI) 459.20+-0.77 : Channel 44 459.78+-1.08 : Channel 157 =================================================== tcp_rx(Without threaded NAPI) 472.63+-2.35 : Channel 44 469.29+-6.31 : Channel 157 tcp_rx(With threaded NAPI) 498.49+-2.44 : Channel 44 541.14+-40.65 : Channel 157 =================================================== tcp_tx(Without threaded NAPI) 317.34+-2.37 : Channel 44 317.01+-2.56 : Channel 157 tcp_tx(With threaded NAPI) 371.34+-2.36 : Channel 44 376.95+-9.40 : Channel 157 ==================================================== > > On Tue, Dec 20, 2022 at 12:17 AM Abhishek Kumar <kuabhs@chromium.org> wrote: > > > > NAPI poll can be done in threaded context along with soft irq > > context. Threaded context can be scheduled efficiently, thus > > creating less of bottleneck during Rx processing. This patch is > > to enable threaded NAPI on ath10k driver. > > > > Based on testing, it was observed that on WCN3990, the CPU0 reaches > > 100% utilization when napi runs in softirq context. At the same > > time the other CPUs are at low consumption percentage. This > > does not allow device to reach its maximum throughput potential. > > After enabling threaded napi, CPU load is balanced across all CPUs > > and following improvments were observed: > > - UDP_RX increase by ~22-25% > > - TCP_RX increase by ~15% > > > > Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2-00696-QCAHLSWMTPL-1 > > Signed-off-by: Abhishek Kumar <kuabhs@chromium.org> > > --- > > > > drivers/net/wireless/ath/ath10k/core.c | 16 ++++++++++++++++ > > drivers/net/wireless/ath/ath10k/hw.h | 2 ++ > > drivers/net/wireless/ath/ath10k/snoc.c | 3 +++ > > 3 files changed, 21 insertions(+) > > > > diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c > > index 5eb131ab916fd..ee4b6ba508c81 100644 > > --- a/drivers/net/wireless/ath/ath10k/core.c > > +++ b/drivers/net/wireless/ath/ath10k/core.c > > @@ -100,6 +100,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA988X_HW_2_0_VERSION, > > @@ -140,6 +141,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA9887_HW_1_0_VERSION, > > @@ -181,6 +183,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA6174_HW_3_2_VERSION, > > @@ -217,6 +220,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA6174_HW_2_1_VERSION, > > @@ -257,6 +261,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA6174_HW_2_1_VERSION, > > @@ -297,6 +302,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA6174_HW_3_0_VERSION, > > @@ -337,6 +343,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA6174_HW_3_2_VERSION, > > @@ -381,6 +388,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA99X0_HW_2_0_DEV_VERSION, > > @@ -427,6 +435,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA9984_HW_1_0_DEV_VERSION, > > @@ -480,6 +489,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA9888_HW_2_0_DEV_VERSION, > > @@ -530,6 +540,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA9377_HW_1_0_DEV_VERSION, > > @@ -570,6 +581,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA9377_HW_1_1_DEV_VERSION, > > @@ -612,6 +624,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA9377_HW_1_1_DEV_VERSION, > > @@ -645,6 +658,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA4019_HW_1_0_DEV_VERSION, > > @@ -692,6 +706,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = WCN3990_HW_1_0_DEV_VERSION, > > @@ -725,6 +740,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = true, > > .use_fw_tx_credits = false, > > .delay_unmap_buffer = true, > > + .enable_threaded_napi = true, > > }, > > }; > > > > diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h > > index 9643031a4427a..adf3076b96503 100644 > > --- a/drivers/net/wireless/ath/ath10k/hw.h > > +++ b/drivers/net/wireless/ath/ath10k/hw.h > > @@ -639,6 +639,8 @@ struct ath10k_hw_params { > > bool use_fw_tx_credits; > > > > bool delay_unmap_buffer; > > + > > + bool enable_threaded_napi; > > }; > > > > struct htt_resp; > > diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c > > index cfcb759a87dea..b94150fb6ef06 100644 > > --- a/drivers/net/wireless/ath/ath10k/snoc.c > > +++ b/drivers/net/wireless/ath/ath10k/snoc.c > > @@ -927,6 +927,9 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) > > > > bitmap_clear(ar_snoc->pending_ce_irqs, 0, CE_COUNT_MAX); > > > > + if (ar->hw_params.enable_threaded_napi) > > + dev_set_threaded(&ar->napi_dev, true); > > + > > ath10k_core_napi_enable(ar); > > ath10k_snoc_irq_enable(ar); > > ath10k_snoc_rx_post(ar); > > -- > > 2.39.0.314.g84b9a713c41-goog > > > > > -- > This song goes out to all the folk that thought Stadia would work: > https://www.linkedin.com/posts/dtaht_the-mushroom-song-activity-6981366665607352320-FXtz > Dave Täht CEO, TekLibre, LLC
Apologies for the late reply. Please see my response inline. On Tue, Dec 20, 2022 at 4:14 AM Manikanta Pubbisetty <quic_mpubbise@quicinc.com> wrote: > > On 12/20/2022 1:25 PM, Abhishek Kumar wrote: > > NAPI poll can be done in threaded context along with soft irq > > context. Threaded context can be scheduled efficiently, thus > > creating less of bottleneck during Rx processing. This patch is > > to enable threaded NAPI on ath10k driver. > > > > Based on testing, it was observed that on WCN3990, the CPU0 reaches > > 100% utilization when napi runs in softirq context. At the same > > time the other CPUs are at low consumption percentage. This > > does not allow device to reach its maximum throughput potential. > > After enabling threaded napi, CPU load is balanced across all CPUs > > and following improvments were observed: > > - UDP_RX increase by ~22-25% > > - TCP_RX increase by ~15% > > > > Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2-00696-QCAHLSWMTPL-1 > > Signed-off-by: Abhishek Kumar <kuabhs@chromium.org> > > --- > > > > drivers/net/wireless/ath/ath10k/core.c | 16 ++++++++++++++++ > > drivers/net/wireless/ath/ath10k/hw.h | 2 ++ > > drivers/net/wireless/ath/ath10k/snoc.c | 3 +++ > > 3 files changed, 21 insertions(+) > > > > diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c > > index 5eb131ab916fd..ee4b6ba508c81 100644 > > --- a/drivers/net/wireless/ath/ath10k/core.c > > +++ b/drivers/net/wireless/ath/ath10k/core.c > > @@ -100,6 +100,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA988X_HW_2_0_VERSION, > > @@ -140,6 +141,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA9887_HW_1_0_VERSION, > > @@ -181,6 +183,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA6174_HW_3_2_VERSION, > > @@ -217,6 +220,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA6174_HW_2_1_VERSION, > > @@ -257,6 +261,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA6174_HW_2_1_VERSION, > > @@ -297,6 +302,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA6174_HW_3_0_VERSION, > > @@ -337,6 +343,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA6174_HW_3_2_VERSION, > > @@ -381,6 +388,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA99X0_HW_2_0_DEV_VERSION, > > @@ -427,6 +435,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA9984_HW_1_0_DEV_VERSION, > > @@ -480,6 +489,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA9888_HW_2_0_DEV_VERSION, > > @@ -530,6 +540,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA9377_HW_1_0_DEV_VERSION, > > @@ -570,6 +581,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA9377_HW_1_1_DEV_VERSION, > > @@ -612,6 +624,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA9377_HW_1_1_DEV_VERSION, > > @@ -645,6 +658,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = QCA4019_HW_1_0_DEV_VERSION, > > @@ -692,6 +706,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = false, > > .use_fw_tx_credits = true, > > .delay_unmap_buffer = false, > > + .enable_threaded_napi = false, > > }, > > { > > .id = WCN3990_HW_1_0_DEV_VERSION, > > @@ -725,6 +740,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > .hw_restart_disconnect = true, > > .use_fw_tx_credits = false, > > .delay_unmap_buffer = true, > > + .enable_threaded_napi = true, > > }, > > }; > > > > diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h > > index 9643031a4427a..adf3076b96503 100644 > > --- a/drivers/net/wireless/ath/ath10k/hw.h > > +++ b/drivers/net/wireless/ath/ath10k/hw.h > > @@ -639,6 +639,8 @@ struct ath10k_hw_params { > > bool use_fw_tx_credits; > > > > bool delay_unmap_buffer; > > + > > + bool enable_threaded_napi; > > }; > > > > struct htt_resp; > > diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c > > index cfcb759a87dea..b94150fb6ef06 100644 > > --- a/drivers/net/wireless/ath/ath10k/snoc.c > > +++ b/drivers/net/wireless/ath/ath10k/snoc.c > > @@ -927,6 +927,9 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) > > > > bitmap_clear(ar_snoc->pending_ce_irqs, 0, CE_COUNT_MAX); > > > > + if (ar->hw_params.enable_threaded_napi) > > + dev_set_threaded(&ar->napi_dev, true); > > + > > Since this is done in the API specific to WCN3990, we do not need > hw_param for this. Just so that I am clear, are you suggesting to enable this by default in snoc.c, similar to what you did in https://lore.kernel.org/all/20220905071805.31625-2-quic_mpubbise@quicinc.com/ . If my understanding is correct and there is no objection, I can remove hw_param and enable it by default on snoc.c . I used hw_param because, as I see it, threaded NAPI can have some adverse effect on the cache utilization and power. Thanks Abhishek > > Thanks, > Manikanta
On Wed, Dec 28, 2022 at 3:53 PM Abhishek Kumar <kuabhs@chromium.org> wrote: > > Apologies for the late reply, Thanks Dave for your comment. My answer is inline. > > On Tue, Dec 20, 2022 at 7:10 AM Dave Taht <dave.taht@gmail.com> wrote: > > > > I am always interested in flent.org tcp_nup, tcp_ndown, and rrul_be > > tests on wifi hardware. In AP mode, especially, against a few clients > > in rtt_fair on the "ending the anomaly" test suite at the bottom of > > this link: https://www.cs.kau.se/tohojo/airtime-fairness/ . Of these, > > it's trying to optimize bandwidth more fairly and keep latencies low > > when 4 or more stations are trying to transmit (in a world with 16 or > > more stations online), that increasingly bothers me the most. I'm > > seeing 5+ seconds on some rtt_fair-like tests nowadays. > I used testing using iperf and conductive setup and fetched the > throughput data(mentioned below). > > > > I was also seeing huge simultaneous upload vs download disparities on > > the latest kernels, on various threads over here: > > https://forum.openwrt.org/t/aql-and-the-ath10k-is-lovely/59002 and > > more recently here: > > https://forum.openwrt.org/t/reducing-multiplexing-latencies-still-further-in-wifi/133605 > Interesting, thanks for the pointer and probably the Qualcomm team is > aware of it. > > > > I don't understand why napi with the default budget (64) is even > > needed on the ath10k, as a single txop takes a minimum of ~200us, but > > perhaps your patch will help. Still, measuring the TCP statistics > > in-band would be nice to see. Some new tools are appearing that can do > > this, Apple's goresponsiveness, crusader... that are simpler to use > > than flent. > Here are some of the additional raw data with and without threaded napi: > ================================================== > udp_rx(Without threaded NAPI) > 435.98+-5.16 : Channel 44 > 439.06+-0.66 : Channel 157 > > udp_rx(With threaded NAPI) > 509.73+-41.03 : Channel 44 > 549.97+-7.62 : Channel 157 > =================================================== > udp_tx(Without threaded NAPI) > 461.31+-0.69 : Channel 44 > 461.46+-0.78 : Channel 157 > > udp_tx(With threaded NAPI) > 459.20+-0.77 : Channel 44 > 459.78+-1.08 : Channel 157 > =================================================== > tcp_rx(Without threaded NAPI) > 472.63+-2.35 : Channel 44 > 469.29+-6.31 : Channel 157 > > tcp_rx(With threaded NAPI) > 498.49+-2.44 : Channel 44 > 541.14+-40.65 : Channel 157 > =================================================== > tcp_tx(Without threaded NAPI) > 317.34+-2.37 : Channel 44 > 317.01+-2.56 : Channel 157 > > tcp_tx(With threaded NAPI) > 371.34+-2.36 : Channel 44 > 376.95+-9.40 : Channel 157 My concern is primarily with the induced tcp latency on this test. A way to check that is to run wireshark on your test client driving the test, capture the iperf traffic, and then plot the "Statistics->TCP stream statistics for both throughput and rtt. Would it be possible for you to do that and put up those plots somewhere? The worst case test is a tcp bidirectional test which I don't know if older iperfs can do. (iperf2 has new bounceback and bidir tests) Ideally stuff going in either direction, would not look as horrible, as it did, back in 2016, documented in this linuxplumbers presentation here: https://blog.linuxplumbersconf.org/2016/ocw/system/presentations/3963/original/linuxplumbers_wifi_latency-3Nov.pdf and discussed on lwn, here: https://lwn.net/Articles/705884/ I worry about folk achieving slightly better tcp throughput at the expense of clobbering in-tcp-stream latency. Back then we were shooting for no more than 40ms extra latency under load on this chip, down from (unusable) seconds. Presently elsewhere, on other chips, we're getting 8ms with stuff that's not in tree for the ath10k, there is a slight cost in single stream throughput but when multiple streams are in use, on multiple stations, things like web pages fly, irrespective of load. > ==================================================== > > > > > On Tue, Dec 20, 2022 at 12:17 AM Abhishek Kumar <kuabhs@chromium.org> wrote: > > > > > > NAPI poll can be done in threaded context along with soft irq > > > context. Threaded context can be scheduled efficiently, thus > > > creating less of bottleneck during Rx processing. This patch is > > > to enable threaded NAPI on ath10k driver. > > > > > > Based on testing, it was observed that on WCN3990, the CPU0 reaches > > > 100% utilization when napi runs in softirq context. At the same > > > time the other CPUs are at low consumption percentage. This > > > does not allow device to reach its maximum throughput potential. > > > After enabling threaded napi, CPU load is balanced across all CPUs > > > and following improvments were observed: > > > - UDP_RX increase by ~22-25% > > > - TCP_RX increase by ~15% > > > > > > Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2-00696-QCAHLSWMTPL-1 > > > Signed-off-by: Abhishek Kumar <kuabhs@chromium.org> > > > --- > > > > > > drivers/net/wireless/ath/ath10k/core.c | 16 ++++++++++++++++ > > > drivers/net/wireless/ath/ath10k/hw.h | 2 ++ > > > drivers/net/wireless/ath/ath10k/snoc.c | 3 +++ > > > 3 files changed, 21 insertions(+) > > > > > > diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c > > > index 5eb131ab916fd..ee4b6ba508c81 100644 > > > --- a/drivers/net/wireless/ath/ath10k/core.c > > > +++ b/drivers/net/wireless/ath/ath10k/core.c > > > @@ -100,6 +100,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = QCA988X_HW_2_0_VERSION, > > > @@ -140,6 +141,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = QCA9887_HW_1_0_VERSION, > > > @@ -181,6 +183,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = QCA6174_HW_3_2_VERSION, > > > @@ -217,6 +220,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = QCA6174_HW_2_1_VERSION, > > > @@ -257,6 +261,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = QCA6174_HW_2_1_VERSION, > > > @@ -297,6 +302,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = QCA6174_HW_3_0_VERSION, > > > @@ -337,6 +343,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = QCA6174_HW_3_2_VERSION, > > > @@ -381,6 +388,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = QCA99X0_HW_2_0_DEV_VERSION, > > > @@ -427,6 +435,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = QCA9984_HW_1_0_DEV_VERSION, > > > @@ -480,6 +489,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = QCA9888_HW_2_0_DEV_VERSION, > > > @@ -530,6 +540,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = QCA9377_HW_1_0_DEV_VERSION, > > > @@ -570,6 +581,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = QCA9377_HW_1_1_DEV_VERSION, > > > @@ -612,6 +624,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = QCA9377_HW_1_1_DEV_VERSION, > > > @@ -645,6 +658,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = QCA4019_HW_1_0_DEV_VERSION, > > > @@ -692,6 +706,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = false, > > > .use_fw_tx_credits = true, > > > .delay_unmap_buffer = false, > > > + .enable_threaded_napi = false, > > > }, > > > { > > > .id = WCN3990_HW_1_0_DEV_VERSION, > > > @@ -725,6 +740,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { > > > .hw_restart_disconnect = true, > > > .use_fw_tx_credits = false, > > > .delay_unmap_buffer = true, > > > + .enable_threaded_napi = true, > > > }, > > > }; > > > > > > diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h > > > index 9643031a4427a..adf3076b96503 100644 > > > --- a/drivers/net/wireless/ath/ath10k/hw.h > > > +++ b/drivers/net/wireless/ath/ath10k/hw.h > > > @@ -639,6 +639,8 @@ struct ath10k_hw_params { > > > bool use_fw_tx_credits; > > > > > > bool delay_unmap_buffer; > > > + > > > + bool enable_threaded_napi; > > > }; > > > > > > struct htt_resp; > > > diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c > > > index cfcb759a87dea..b94150fb6ef06 100644 > > > --- a/drivers/net/wireless/ath/ath10k/snoc.c > > > +++ b/drivers/net/wireless/ath/ath10k/snoc.c > > > @@ -927,6 +927,9 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) > > > > > > bitmap_clear(ar_snoc->pending_ce_irqs, 0, CE_COUNT_MAX); > > > > > > + if (ar->hw_params.enable_threaded_napi) > > > + dev_set_threaded(&ar->napi_dev, true); > > > + > > > ath10k_core_napi_enable(ar); > > > ath10k_snoc_irq_enable(ar); > > > ath10k_snoc_rx_post(ar); > > > -- > > > 2.39.0.314.g84b9a713c41-goog > > > > > > > > > -- > > This song goes out to all the folk that thought Stadia would work: > > https://www.linkedin.com/posts/dtaht_the-mushroom-song-activity-6981366665607352320-FXtz > > Dave Täht CEO, TekLibre, LLC
thx for leaning in bob! (for those of you that don't know, he's the iperf2 maintainer, and if you haven't updated your distro/os/test environment to 2.1.8 that came out in august, yet there's all kinds of nifty new stuff in there: https://sourceforge.net/projects/iperf2 - too much to list, and the -i 1 -e option is just the start of it.... Iperf2's principal flaw is that people think iperf3 is the successor to it, and no, they are very different codebases, with very different features. iperf = iperf2, for most, but not all. On Wed, Dec 28, 2022 at 9:54 PM Bob McMahon <bob.mcmahon@broadcom.com> wrote: > > A bit of a tangent but iperf 2's enhanced option provides sampled RTT and CWND in the interval output. I requires -e. It also provide the connect time, the icwnd, irtt and the mss per the connect. > > [rjmcmahon@rjm-nas ~]$ iperf -c 192.168.1.85 -i 1 -e > ------------------------------------------------------------ > Client connecting to 192.168.1.85, TCP port 5001 with pid 20041 (1 flows) > Write buffer size: 131072 Byte > TOS set to 0x0 (Nagle on) > TCP window size: 16.0 KByte (default) > ------------------------------------------------------------ > [ 1] local 192.168.1.73%eno1 port 38822 connected with 192.168.1.85 port 5001 (sock=3) (icwnd/mss/irtt=14/1448/246) (ct=0.32 ms) on 2022-12-28 21:51:13 (PST) > [ ID] Interval Transfer Bandwidth Write/Err Rtry Cwnd/RTT(var) NetPwr > [ 1] 0.00-1.00 sec 114 MBytes 952 Mbits/sec 908/0 3 353K/1901(59) us 62606 > [ 1] 1.00-2.00 sec 111 MBytes 932 Mbits/sec 889/0 0 354K/2029(115) us 57429 > [ 1] 2.00-3.00 sec 112 MBytes 937 Mbits/sec 894/0 3 354K/2061(84) us 56855 > [ 1] 3.00-4.00 sec 112 MBytes 938 Mbits/sec 895/0 3 354K/2027(115) us 57873 > [ 1] 4.00-5.00 sec 112 MBytes 938 Mbits/sec 895/0 6 354K/2046(68) us 57336 > [ 1] 5.00-6.00 sec 112 MBytes 937 Mbits/sec 894/0 0 374K/2160(109) us 54249 > [ 1] 6.00-7.00 sec 111 MBytes 933 Mbits/sec 890/0 2 374K/2155(115) us 54132 > [ 1] 7.00-8.00 sec 111 MBytes 934 Mbits/sec 891/0 2 374K/2139(120) us 54598 > [ 1] 8.00-9.00 sec 112 MBytes 938 Mbits/sec 895/0 0 374K/2129(126) us 55101 > [ 1] 9.00-10.00 sec 112 MBytes 935 Mbits/sec 892/0 1 374K/2200(102) us 53144 > [ 1] 0.00-10.03 sec 1.09 GBytes 935 Mbits/sec 8944/0 20 374K/4082(4010) us 28632 This is a wonderful new feature, much simpler than relying on packet captures. However! this test result above is on a decent, ethernet, network, where on wifi, or anything bufferbloated, you would see the cwnd and rtt inflate and/or bounce around horribly. > > > Bob > > On Wed, Dec 28, 2022 at 4:49 PM Dave Taht via Make-wifi-fast <make-wifi-fast@lists.bufferbloat.net> wrote: >> >> On Wed, Dec 28, 2022 at 3:53 PM Abhishek Kumar <kuabhs@chromium.org> wrote: >> > >> > Apologies for the late reply, Thanks Dave for your comment. My answer is inline. >> > >> > On Tue, Dec 20, 2022 at 7:10 AM Dave Taht <dave.taht@gmail.com> wrote: >> > > >> > > I am always interested in flent.org tcp_nup, tcp_ndown, and rrul_be >> > > tests on wifi hardware. In AP mode, especially, against a few clients >> > > in rtt_fair on the "ending the anomaly" test suite at the bottom of >> > > this link: https://www.cs.kau.se/tohojo/airtime-fairness/ . Of these, >> > > it's trying to optimize bandwidth more fairly and keep latencies low >> > > when 4 or more stations are trying to transmit (in a world with 16 or >> > > more stations online), that increasingly bothers me the most. I'm >> > > seeing 5+ seconds on some rtt_fair-like tests nowadays. >> > I used testing using iperf and conductive setup and fetched the >> > throughput data(mentioned below). >> > > >> > > I was also seeing huge simultaneous upload vs download disparities on >> > > the latest kernels, on various threads over here: >> > > https://forum.openwrt.org/t/aql-and-the-ath10k-is-lovely/59002 and >> > > more recently here: >> > > https://forum.openwrt.org/t/reducing-multiplexing-latencies-still-further-in-wifi/133605 >> > Interesting, thanks for the pointer and probably the Qualcomm team is >> > aware of it. >> > > >> > > I don't understand why napi with the default budget (64) is even >> > > needed on the ath10k, as a single txop takes a minimum of ~200us, but >> > > perhaps your patch will help. Still, measuring the TCP statistics >> > > in-band would be nice to see. Some new tools are appearing that can do >> > > this, Apple's goresponsiveness, crusader... that are simpler to use >> > > than flent. >> > Here are some of the additional raw data with and without threaded napi: >> > ================================================== >> > udp_rx(Without threaded NAPI) >> > 435.98+-5.16 : Channel 44 >> > 439.06+-0.66 : Channel 157 >> > >> > udp_rx(With threaded NAPI) >> > 509.73+-41.03 : Channel 44 >> > 549.97+-7.62 : Channel 157 >> > =================================================== >> > udp_tx(Without threaded NAPI) >> > 461.31+-0.69 : Channel 44 >> > 461.46+-0.78 : Channel 157 >> > >> > udp_tx(With threaded NAPI) >> > 459.20+-0.77 : Channel 44 >> > 459.78+-1.08 : Channel 157 >> > =================================================== >> > tcp_rx(Without threaded NAPI) >> > 472.63+-2.35 : Channel 44 >> > 469.29+-6.31 : Channel 157 >> > >> > tcp_rx(With threaded NAPI) >> > 498.49+-2.44 : Channel 44 >> > 541.14+-40.65 : Channel 157 >> > =================================================== >> > tcp_tx(Without threaded NAPI) >> > 317.34+-2.37 : Channel 44 >> > 317.01+-2.56 : Channel 157 >> > >> > tcp_tx(With threaded NAPI) >> > 371.34+-2.36 : Channel 44 >> > 376.95+-9.40 : Channel 157 >> >> My concern is primarily with the induced tcp latency on this test. A >> way to check that is to run wireshark on your test client driving the >> test, capture the iperf traffic, and then plot the "Statistics->TCP >> stream statistics for both throughput and rtt. Would it be possible >> for you to do that and put up those plots somewhere? >> >> The worst case test is a tcp bidirectional test which I don't know if >> older iperfs can do. (iperf2 has new bounceback and bidir tests) >> >> Ideally stuff going in either direction, would not look as horrible, >> as it did, back in 2016, documented in this linuxplumbers presentation >> here: https://blog.linuxplumbersconf.org/2016/ocw/system/presentations/3963/original/linuxplumbers_wifi_latency-3Nov.pdf >> and discussed on lwn, here: https://lwn.net/Articles/705884/ >> >> I worry about folk achieving slightly better tcp throughput at the >> expense of clobbering in-tcp-stream latency. Back then we were >> shooting for no more than 40ms extra latency under load on this chip, >> down from (unusable) seconds. Presently elsewhere, on other chips, >> we're getting 8ms with stuff that's not in tree for the ath10k, there >> is a slight cost in single stream throughput but when multiple streams >> are in use, on multiple stations, things like web pages fly, >> irrespective of load. >> >> >> > ==================================================== >> > >> > > >> > > On Tue, Dec 20, 2022 at 12:17 AM Abhishek Kumar <kuabhs@chromium.org> wrote: >> > > > >> > > > NAPI poll can be done in threaded context along with soft irq >> > > > context. Threaded context can be scheduled efficiently, thus >> > > > creating less of bottleneck during Rx processing. This patch is >> > > > to enable threaded NAPI on ath10k driver. >> > > > >> > > > Based on testing, it was observed that on WCN3990, the CPU0 reaches >> > > > 100% utilization when napi runs in softirq context. At the same >> > > > time the other CPUs are at low consumption percentage. This >> > > > does not allow device to reach its maximum throughput potential. >> > > > After enabling threaded napi, CPU load is balanced across all CPUs >> > > > and following improvments were observed: >> > > > - UDP_RX increase by ~22-25% >> > > > - TCP_RX increase by ~15% >> > > > >> > > > Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2-00696-QCAHLSWMTPL-1 >> > > > Signed-off-by: Abhishek Kumar <kuabhs@chromium.org> >> > > > --- >> > > > >> > > > drivers/net/wireless/ath/ath10k/core.c | 16 ++++++++++++++++ >> > > > drivers/net/wireless/ath/ath10k/hw.h | 2 ++ >> > > > drivers/net/wireless/ath/ath10k/snoc.c | 3 +++ >> > > > 3 files changed, 21 insertions(+) >> > > > >> > > > diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c >> > > > index 5eb131ab916fd..ee4b6ba508c81 100644 >> > > > --- a/drivers/net/wireless/ath/ath10k/core.c >> > > > +++ b/drivers/net/wireless/ath/ath10k/core.c >> > > > @@ -100,6 +100,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = QCA988X_HW_2_0_VERSION, >> > > > @@ -140,6 +141,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = QCA9887_HW_1_0_VERSION, >> > > > @@ -181,6 +183,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = QCA6174_HW_3_2_VERSION, >> > > > @@ -217,6 +220,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = QCA6174_HW_2_1_VERSION, >> > > > @@ -257,6 +261,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = QCA6174_HW_2_1_VERSION, >> > > > @@ -297,6 +302,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = QCA6174_HW_3_0_VERSION, >> > > > @@ -337,6 +343,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = QCA6174_HW_3_2_VERSION, >> > > > @@ -381,6 +388,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = QCA99X0_HW_2_0_DEV_VERSION, >> > > > @@ -427,6 +435,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = QCA9984_HW_1_0_DEV_VERSION, >> > > > @@ -480,6 +489,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = QCA9888_HW_2_0_DEV_VERSION, >> > > > @@ -530,6 +540,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = QCA9377_HW_1_0_DEV_VERSION, >> > > > @@ -570,6 +581,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = QCA9377_HW_1_1_DEV_VERSION, >> > > > @@ -612,6 +624,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = QCA9377_HW_1_1_DEV_VERSION, >> > > > @@ -645,6 +658,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = QCA4019_HW_1_0_DEV_VERSION, >> > > > @@ -692,6 +706,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = false, >> > > > .use_fw_tx_credits = true, >> > > > .delay_unmap_buffer = false, >> > > > + .enable_threaded_napi = false, >> > > > }, >> > > > { >> > > > .id = WCN3990_HW_1_0_DEV_VERSION, >> > > > @@ -725,6 +740,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { >> > > > .hw_restart_disconnect = true, >> > > > .use_fw_tx_credits = false, >> > > > .delay_unmap_buffer = true, >> > > > + .enable_threaded_napi = true, >> > > > }, >> > > > }; >> > > > >> > > > diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h >> > > > index 9643031a4427a..adf3076b96503 100644 >> > > > --- a/drivers/net/wireless/ath/ath10k/hw.h >> > > > +++ b/drivers/net/wireless/ath/ath10k/hw.h >> > > > @@ -639,6 +639,8 @@ struct ath10k_hw_params { >> > > > bool use_fw_tx_credits; >> > > > >> > > > bool delay_unmap_buffer; >> > > > + >> > > > + bool enable_threaded_napi; >> > > > }; >> > > > >> > > > struct htt_resp; >> > > > diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c >> > > > index cfcb759a87dea..b94150fb6ef06 100644 >> > > > --- a/drivers/net/wireless/ath/ath10k/snoc.c >> > > > +++ b/drivers/net/wireless/ath/ath10k/snoc.c >> > > > @@ -927,6 +927,9 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) >> > > > >> > > > bitmap_clear(ar_snoc->pending_ce_irqs, 0, CE_COUNT_MAX); >> > > > >> > > > + if (ar->hw_params.enable_threaded_napi) >> > > > + dev_set_threaded(&ar->napi_dev, true); >> > > > + >> > > > ath10k_core_napi_enable(ar); >> > > > ath10k_snoc_irq_enable(ar); >> > > > ath10k_snoc_rx_post(ar); >> > > > -- >> > > > 2.39.0.314.g84b9a713c41-goog >> > > > >> > > >> > > >> > > -- >> > > This song goes out to all the folk that thought Stadia would work: >> > > https://www.linkedin.com/posts/dtaht_the-mushroom-song-activity-6981366665607352320-FXtz >> > > Dave Täht CEO, TekLibre, LLC >> >> >> >> -- >> This song goes out to all the folk that thought Stadia would work: >> https://www.linkedin.com/posts/dtaht_the-mushroom-song-activity-6981366665607352320-FXtz >> Dave Täht CEO, TekLibre, LLC >> _______________________________________________ >> Make-wifi-fast mailing list >> Make-wifi-fast@lists.bufferbloat.net >> https://lists.bufferbloat.net/listinfo/make-wifi-fast > > > This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.
Abhishek Kumar <kuabhs@chromium.org> writes: >> > --- a/drivers/net/wireless/ath/ath10k/snoc.c >> > +++ b/drivers/net/wireless/ath/ath10k/snoc.c >> > @@ -927,6 +927,9 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) >> > >> > bitmap_clear(ar_snoc->pending_ce_irqs, 0, CE_COUNT_MAX); >> > >> > + if (ar->hw_params.enable_threaded_napi) >> > + dev_set_threaded(&ar->napi_dev, true); >> > + >> >> Since this is done in the API specific to WCN3990, we do not need >> hw_param for this. > > Just so that I am clear, are you suggesting to enable this by default > in snoc.c, similar to what you did in > > https://lore.kernel.org/all/20220905071805.31625-2-quic_mpubbise@quicinc.com/ > > If my understanding is correct and there is no objection, I can remove > hw_param and enable it by default on snoc.c . I used hw_param because, > as I see it, threaded NAPI can have some adverse effect on the cache > utilization and power. WCN3990 is the only device using SNOC bus so the hw_param is not needed. It's safe to call dev_set_threaded() in ath10k_snoc_hif_start() unconditionally as it only affects WCN3990.
Thanks for all the comments. I will call dev_set_threaded() directly without HW params and rollout a v2 soon. On Thu, Jan 12, 2023 at 2:15 AM Kalle Valo <kvalo@kernel.org> wrote: > > Abhishek Kumar <kuabhs@chromium.org> writes: > > >> > --- a/drivers/net/wireless/ath/ath10k/snoc.c > >> > +++ b/drivers/net/wireless/ath/ath10k/snoc.c > >> > @@ -927,6 +927,9 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) > >> > > >> > bitmap_clear(ar_snoc->pending_ce_irqs, 0, CE_COUNT_MAX); > >> > > >> > + if (ar->hw_params.enable_threaded_napi) > >> > + dev_set_threaded(&ar->napi_dev, true); > >> > + > >> > >> Since this is done in the API specific to WCN3990, we do not need > >> hw_param for this. > > > > Just so that I am clear, are you suggesting to enable this by default > > in snoc.c, similar to what you did in > > > > https://lore.kernel.org/all/20220905071805.31625-2-quic_mpubbise@quicinc.com/ > > > > If my understanding is correct and there is no objection, I can remove > > hw_param and enable it by default on snoc.c . I used hw_param because, > > as I see it, threaded NAPI can have some adverse effect on the cache > > utilization and power. > > WCN3990 is the only device using SNOC bus so the hw_param is not needed. > It's safe to call dev_set_threaded() in ath10k_snoc_hif_start() > unconditionally as it only affects WCN3990. > > -- > https://patchwork.kernel.org/project/linux-wireless/list/ > > https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 5eb131ab916fd..ee4b6ba508c81 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -100,6 +100,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = QCA988X_HW_2_0_VERSION, @@ -140,6 +141,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = QCA9887_HW_1_0_VERSION, @@ -181,6 +183,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = QCA6174_HW_3_2_VERSION, @@ -217,6 +220,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = QCA6174_HW_2_1_VERSION, @@ -257,6 +261,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = QCA6174_HW_2_1_VERSION, @@ -297,6 +302,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = QCA6174_HW_3_0_VERSION, @@ -337,6 +343,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = QCA6174_HW_3_2_VERSION, @@ -381,6 +388,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = QCA99X0_HW_2_0_DEV_VERSION, @@ -427,6 +435,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = QCA9984_HW_1_0_DEV_VERSION, @@ -480,6 +489,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = QCA9888_HW_2_0_DEV_VERSION, @@ -530,6 +540,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = QCA9377_HW_1_0_DEV_VERSION, @@ -570,6 +581,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = QCA9377_HW_1_1_DEV_VERSION, @@ -612,6 +624,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = QCA9377_HW_1_1_DEV_VERSION, @@ -645,6 +658,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = QCA4019_HW_1_0_DEV_VERSION, @@ -692,6 +706,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = false, .use_fw_tx_credits = true, .delay_unmap_buffer = false, + .enable_threaded_napi = false, }, { .id = WCN3990_HW_1_0_DEV_VERSION, @@ -725,6 +740,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { .hw_restart_disconnect = true, .use_fw_tx_credits = false, .delay_unmap_buffer = true, + .enable_threaded_napi = true, }, }; diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h index 9643031a4427a..adf3076b96503 100644 --- a/drivers/net/wireless/ath/ath10k/hw.h +++ b/drivers/net/wireless/ath/ath10k/hw.h @@ -639,6 +639,8 @@ struct ath10k_hw_params { bool use_fw_tx_credits; bool delay_unmap_buffer; + + bool enable_threaded_napi; }; struct htt_resp; diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index cfcb759a87dea..b94150fb6ef06 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -927,6 +927,9 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) bitmap_clear(ar_snoc->pending_ce_irqs, 0, CE_COUNT_MAX); + if (ar->hw_params.enable_threaded_napi) + dev_set_threaded(&ar->napi_dev, true); + ath10k_core_napi_enable(ar); ath10k_snoc_irq_enable(ar); ath10k_snoc_rx_post(ar);