Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5269373rwl; Wed, 28 Dec 2022 16:06:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXu7aovw+r9rvmwTl4Sy3kIKSuBLRxXHnWvE/RH9QqFo0DWdwxKqmvp6wsm/MrFpr4NDBFLf X-Received: by 2002:a05:6a00:1346:b0:581:c216:1390 with SMTP id k6-20020a056a00134600b00581c2161390mr1224003pfu.34.1672272378544; Wed, 28 Dec 2022 16:06:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672272378; cv=none; d=google.com; s=arc-20160816; b=ap3yqWdnlGb06Wlk3uigdW3nOrB9wqHc36Hc+SrS4T+D5FcojSjCRNLtedg7vK+9TA iccD7FVip2l2uz5SXZeQCXUyv8faQ7JWNPr37zP+Mhiox6YDiMxvomPmQJ5iVAwxpHVT VNcwwJBAtZ4cTVgoeN0cnUKZSZy6pMEQ2uA8nfzckU6cLCGFS+ypCQzUMw2Q7WhTEdzN J3R/Cj+N5keOl3aXGIl9iGeIZaxC2zzQKdeufwX/0nzuEtO+0JdFzNlF06kSKNIfLvDx xabZDkkShhYT9qCbw6uNxWjP1ZiCV2CzNDhJ3w25dcKKsvmXVvulh7r7O/7evAItc21Y Cwjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=aSCl4VrRDtic4wbVqLsduJfQEHBf/GmAw6cZg1rPlfk=; b=zB+fsjhHPPMN0RoTV4Lmp9tVTihTtDXGt67fVFUz+nDUYyeCUvyVkMVKC/CHgY/dJ5 dC/UHpEXeBsKdHjOc7kAifZnMMy4LzgvpnRYpZUzCokyU69dBidGf8qfFLt4qqebas5q nLoQz4x93/CGK7lzqSeC6N4hzKqidFqwIWfHZu7RXCpPSYXvcroI7r584+Tw0dcd8q+1 Y9g5XS4REOM6TVrA9iDx3AkyYWgQ4C58cKKhxb0dqr4CzCDJ9min6fJSpSEE+ltNZQF6 TiGH0DrMju6hgiARSif/nvHTv8+drHtAx8n1pFDNxjeZw24H7Ux7fGP2DCacF+9zBNFB 1JEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OgHoTU5l; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h3-20020a056a00218300b0056ee105315fsi18954181pfi.178.2022.12.28.16.06.09; Wed, 28 Dec 2022 16:06:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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=OgHoTU5l; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 S232390AbiL2ACD (ORCPT + 67 others); Wed, 28 Dec 2022 19:02:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232066AbiL2ABy (ORCPT ); Wed, 28 Dec 2022 19:01:54 -0500 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0418710540 for ; Wed, 28 Dec 2022 16:01:49 -0800 (PST) Received: by mail-io1-xd35.google.com with SMTP id b192so9044999iof.8 for ; Wed, 28 Dec 2022 16:01:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=aSCl4VrRDtic4wbVqLsduJfQEHBf/GmAw6cZg1rPlfk=; b=OgHoTU5lLCaBSd9Lo4WB0oc7VYxKwSUFSfRaeVBEZ+3yXqG1xfrkcdMFi7hn1Uu7qF 4z9Zh63T9AYWOhg4cBYNavlyR1nu4sprmAwGAtsIR/Mp/i9ZUN5/wMjwhjQ9s9xSLhUt G5ffj0yZtraSD0g3TBkIhVNkeQrilDBDw3lW0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aSCl4VrRDtic4wbVqLsduJfQEHBf/GmAw6cZg1rPlfk=; b=cPYEuya4TwItFqpB+aGvg+zQzuzE8xXXFpwGSIkiwg2hVBbHQKuSRK96HYCvh2K53Y g5LO3gNq2m5XE36KPcRbJNkQK8ataA76HOt0Pm3xByqq8p00kjr6xsAyyT9jk/hComr4 G15jqG5nEd+dL9WXIucYhjuyqz1lfuhf6Zi1Scx53sV9nggMhS2dfyF6aGjoTKARfr33 nTyk2e4Yb4jaCq/NCGAxzAsd5ehs4x/y2JHrYp0aFFiwmrt/i3u4vqKXvJiTVVlZJPxf Cb92tCGGguZ2yd5mJAPH33TpoCZnWM/9BTDqj5MIsuSd2OzI3Oy9EgfmYmz+a4PazDf1 fdEA== X-Gm-Message-State: AFqh2kolX6FaXU4aPb+CSCV1DqANYo4QmZ57iL3r7sDA2JaRc4oVBRHI 4Nl+5MVpYMkxwLVmf0ZfnuPhajwosEmh8DuTKYaV8w== X-Received: by 2002:a02:a696:0:b0:38a:5811:1174 with SMTP id j22-20020a02a696000000b0038a58111174mr2036475jam.85.1672272108317; Wed, 28 Dec 2022 16:01:48 -0800 (PST) MIME-Version: 1.0 References: <20221220075215.1.Ic12e347e0d61a618124b742614e82bbd5d770173@changeid> <56d4941a-ad35-37ca-48ca-5f1bf7a86d25@quicinc.com> In-Reply-To: <56d4941a-ad35-37ca-48ca-5f1bf7a86d25@quicinc.com> From: Abhishek Kumar Date: Wed, 28 Dec 2022 16:01:38 -0800 Message-ID: Subject: Re: [PATCH] ath10k: snoc: enable threaded napi on WCN3990 To: Manikanta Pubbisetty Cc: kvalo@kernel.org, ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Content-Type: text/plain; charset="UTF-8" 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: X-Mailing-List: linux-wireless@vger.kernel.org Apologies for the late reply. Please see my response inline. On Tue, Dec 20, 2022 at 4:14 AM Manikanta Pubbisetty 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 > > --- > > > > 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