Message ID | 20230203000116.v2.1.I5bb9c164a2d2025655dee810b983e01ecd81c14e@changeid |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp546189wrn; Thu, 2 Feb 2023 16:07:05 -0800 (PST) X-Google-Smtp-Source: AK7set9g/HJhJfM68xMtLIk5oN4Lskf7uXjCm5FsKV8z8+ow46X5ESHxRY0usNLtp3BOzgnCKsB0 X-Received: by 2002:a17:906:7955:b0:878:5d34:3c41 with SMTP id l21-20020a170906795500b008785d343c41mr11164421ejo.71.1675382825527; Thu, 02 Feb 2023 16:07:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675382825; cv=none; d=google.com; s=arc-20160816; b=bsX99+9Tage1BX+8tt7wvr42CyhpOk7A8jOdFbISBVJ9pYGc7RRHEHLahtu/ICM3gI A0Qb07RrzHfdNVH2N2+rxonu0cKz5RCz5T1MKFNpGphm/JG+pZtMow47nC5wrt4/dFXc P0NPMXcQrjIv+zfOD55IbW4IvkT8bTwPjgBmuPa3FHPyTHGQ1tZB0CoOFuXoMNJJHkOG UMVbYhzGDJ1ZJqtLKW/n6E+sAs43Gp0NxvpLNe+hzxl+XSiI++zMZnn2p8HRhtn7FPmA Daat5UanywXzDpW3PawlpDT6QYyCyxX//I7E3s9JBjTkjp3Gvtt/fYnjZm2DCIxg3T62 pybA== 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=v/uoZPK/zWO0yibS8CdCNbFUWtgKpQlxSjVcWvpZrkc=; b=e12nY8vffBew24c3Rdv+u9EF9LB35p5C5JOExS0xlX7z/YxEyy1t79OwlAZekj/0bB aJNjEwOkUkOurzzadgNxGBCeBM3Bu+xPS7VA+u137CF+Tyifgr0n9ip41ZZ7eVBOA7d3 N39eK+HyeXRY4TgeVdTCNQdp27luKe9GjC54u3NBzeow4zIqHRiuJWYVkEjzcRmZ+p7H 0ua6VJuik6C47dZRn/ePPwWL3+GDPfllBqpXl/LlZh9B7ggmxlHWhIcr6yC+fCQK6vA1 llGPTo2beZxh3PY2CRXHmM1FfCboyLP2hnZk+UVu7DlBO4iaJb+DCpyhdszrMvv0Iqd0 23nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Nu8867/F"; 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 we5-20020a170907234500b00870c5d344easi1025865ejb.727.2023.02.02.16.06.41; Thu, 02 Feb 2023 16:07:05 -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="Nu8867/F"; 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 S233314AbjBCACk (ORCPT <rfc822;il.mystafa@gmail.com> + 99 others); Thu, 2 Feb 2023 19:02:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233160AbjBCAC1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 2 Feb 2023 19:02:27 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCC6A83275 for <linux-kernel@vger.kernel.org>; Thu, 2 Feb 2023 16:02:26 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id bx22so531176pjb.3 for <linux-kernel@vger.kernel.org>; Thu, 02 Feb 2023 16:02:26 -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=v/uoZPK/zWO0yibS8CdCNbFUWtgKpQlxSjVcWvpZrkc=; b=Nu8867/F4vDAB9fNuH6rMWSRYVKaUfSWT7KA3ap7k5g623WXFwtXGy5XWgnXj9MVup qHN/p3SbK0kn5xI7zocwHsFxgZdMZ6ZccPIZ03bCNv9C4/GUYhEe6vVQK8yifNI1P9UD UDHR6pTZUh4ExAFbkqj0Y+ln4pfa8RTMBPRhs= 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=v/uoZPK/zWO0yibS8CdCNbFUWtgKpQlxSjVcWvpZrkc=; b=ncCDqkm1i5r2+zR1cbGa/FzNCDWwyDTWBUzdZl6x/1JY5qctRogvMXiN35LadafUTi JuIHS3QbihysYbW0HvDDzfPkNrhM3Lg3FJsOInyral18nbgBqPpI6PWmM3o5Qak/15RS a4SUQQbTtpd91zel17bwyuvTfLv1Z/Np6M0mpKjWAUy9iqxQ3vgS0IbD/pWzRT9mw+jf Jq0IXBe5XOxS38XHIAZCpxY9N/tD4b2gxkl/zA6ZzV6bO6Z5q5p+WEEZojh+iDJYJMU9 G9JmxRU0HuIb7qMukZ6cjiL2LFzUyMAhN8ZrPjM+OpTki8IjHoS4AX70U/rx2IBnyyu2 NetQ== X-Gm-Message-State: AO0yUKV7Otnw0GMAg2GcTik6AHLpGiRcAm63zwtiCJ8GrYFhQ5cXDpo2 pQZHaqlE1qY1dJroWg9r+3FIXw== X-Received: by 2002:a17:90b:4d84:b0:22b:e7a8:d4d0 with SMTP id oj4-20020a17090b4d8400b0022be7a8d4d0mr8470470pjb.25.1675382546272; Thu, 02 Feb 2023 16:02:26 -0800 (PST) Received: from kuabhs-cdev.c.googlers.com.com (252.157.168.34.bc.googleusercontent.com. [34.168.157.252]) by smtp.gmail.com with ESMTPSA id u11-20020a17090ae00b00b00227223c58ecsm414601pjy.42.2023.02.02.16.02.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 16:02:25 -0800 (PST) From: Abhishek Kumar <kuabhs@chromium.org> To: kvalo@kernel.org Cc: kuabhs@chromium.org, davem@davemloft.net, ath10k@lists.infradead.org, quic_mpubbise@quicinc.com, netdev@vger.kernel.org, kuba@kernel.org, linux-wireless@vger.kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org, Eric Dumazet <edumazet@google.com> Subject: [PATCH v2] ath10k: snoc: enable threaded napi on WCN3990 Date: Fri, 3 Feb 2023 00:01:40 +0000 Message-Id: <20230203000116.v2.1.I5bb9c164a2d2025655dee810b983e01ecd81c14e@changeid> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-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=ham 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?1756766222101883734?= X-GMAIL-MSGID: =?utf-8?q?1756766222101883734?= |
Series |
[v2] ath10k: snoc: enable threaded napi on WCN3990
|
|
Commit Message
Abhishek Kumar
Feb. 3, 2023, 12:01 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%
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
===================================================
Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2-00696-QCAHLSWMTPL-1
Signed-off-by: Abhishek Kumar <kuabhs@chromium.org>
---
Changes in v2:
- Removed the hw param checks to add dev_set_threaded() to snoc.c
- Added some more test data in the commit message.
drivers/net/wireless/ath/ath10k/snoc.c | 1 +
1 file changed, 1 insertion(+)
Comments
Hi Kale, Gentle reminder for your comments. Thanks Abhishek On Thu, Feb 2, 2023 at 4:02 PM 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% > > 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 > =================================================== > > Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2-00696-QCAHLSWMTPL-1 > Signed-off-by: Abhishek Kumar <kuabhs@chromium.org> > --- > > Changes in v2: > - Removed the hw param checks to add dev_set_threaded() to snoc.c > - Added some more test data in the commit message. > > drivers/net/wireless/ath/ath10k/snoc.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c > index cfcb759a87de..0f6d2f67ff6b 100644 > --- a/drivers/net/wireless/ath/ath10k/snoc.c > +++ b/drivers/net/wireless/ath/ath10k/snoc.c > @@ -927,6 +927,7 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) > > bitmap_clear(ar_snoc->pending_ce_irqs, 0, CE_COUNT_MAX); > > + dev_set_threaded(&ar->napi_dev, true); > ath10k_core_napi_enable(ar); > ath10k_snoc_irq_enable(ar); > ath10k_snoc_rx_post(ar); > -- > 2.39.1.519.gcb327c4b5f-goog >
Abhishek Kumar <kuabhs@chromium.org> writes:
> Gentle reminder for your comments.
A gentle reminder to avoid sending gentle reminders :) For example, I
currently have 103 patches in patchwork and if everyone send gentle
reminders that's a lot of unnecessary email. So please avoid sending
unnecessary emails. "gentle reminders" don't help, quite the opposite.
Unfortunately sometimes it takes time before I'm able to look at
patches, but if the patch is in patchwork in an active state I will look
at them eventually. More info here:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#checking_state_of_patches_from_patchwork
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% > > 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 > =================================================== > > Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2-00696-QCAHLSWMTPL-1 > Signed-off-by: Abhishek Kumar <kuabhs@chromium.org> > Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com> Patch applied to ath-next branch of ath.git, thanks. 8c68fe00344c wifi: ath10k: snoc: enable threaded napi on WCN3990
diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index cfcb759a87de..0f6d2f67ff6b 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -927,6 +927,7 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) bitmap_clear(ar_snoc->pending_ce_irqs, 0, CE_COUNT_MAX); + dev_set_threaded(&ar->napi_dev, true); ath10k_core_napi_enable(ar); ath10k_snoc_irq_enable(ar); ath10k_snoc_rx_post(ar);