From patchwork Fri Apr 29 17:46:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12832577 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B908C43217 for ; Fri, 29 Apr 2022 17:46:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379353AbiD2RuL (ORCPT ); Fri, 29 Apr 2022 13:50:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379338AbiD2RuK (ORCPT ); Fri, 29 Apr 2022 13:50:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C91388B0B for ; Fri, 29 Apr 2022 10:46:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DCA52623CF for ; Fri, 29 Apr 2022 17:46:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A832C385B0; Fri, 29 Apr 2022 17:46:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651254410; bh=4mwK6qWdAhd6G6Sj+v3rf9e/RqWjjC7elnY1zmzB6vE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nvlqVZx23VRqSjP1UIEma4IGq/yoTQk7Wsf8BsDP1NiZB84XNEK2am3NKKU3jcxDe awsyyNkQm0Fz4UK+OkGN+9R3p4YmknmL25XrWox6Cxw6liNTdE+XGDg9uJtEZven5N 3FjM185ekNdu/8TRw4zUG9OqrRTsUKQo4DB0eyZHtD0amTK1fHy0pxXcHCmJRIHkyz FQg7GyMkcGRs6Wkj5TCd8T5X07KNasHKV5Y7ZU3KqgC6rGjAxM5R/rPqe4F66XAlhY 1qTP0FrA2Ax2iEu8T7Wf8NXuRPTo9cVidfxTn8PXaZFfNjhq9fYZhPWKlaeamIY8cb FxCXzKPvxHJiw== From: Jakub Kicinski To: kvalo@kernel.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski , tony0620emma@gmail.com Subject: [PATCH wireless-next 1/3] wifi: rtw88: remove a copy of the NAPI_POLL_WEIGHT define Date: Fri, 29 Apr 2022 10:46:41 -0700 Message-Id: <20220429174643.196994-2-kuba@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220429174643.196994-1-kuba@kernel.org> References: <20220429174643.196994-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski --- CC: tony0620emma@gmail.com CC: kvalo@kernel.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/realtek/rtw88/main.h | 1 - drivers/net/wireless/realtek/rtw88/pci.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h index 17815af9dd4e..2019c908fd5f 100644 --- a/drivers/net/wireless/realtek/rtw88/main.h +++ b/drivers/net/wireless/realtek/rtw88/main.h @@ -17,7 +17,6 @@ #include "util.h" -#define RTW_NAPI_WEIGHT_NUM 64 #define RTW_MAX_MAC_ID_NUM 32 #define RTW_MAX_SEC_CAM_NUM 32 #define MAX_PG_CAM_BACKUP_NUM 8 diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c index a0991d3f15c0..cf7177b00092 100644 --- a/drivers/net/wireless/realtek/rtw88/pci.c +++ b/drivers/net/wireless/realtek/rtw88/pci.c @@ -1703,7 +1703,7 @@ static void rtw_pci_napi_init(struct rtw_dev *rtwdev) init_dummy_netdev(&rtwpci->netdev); netif_napi_add(&rtwpci->netdev, &rtwpci->napi, rtw_pci_napi_poll, - RTW_NAPI_WEIGHT_NUM); + NAPI_POLL_WEIGHT); } static void rtw_pci_napi_deinit(struct rtw_dev *rtwdev) From patchwork Fri Apr 29 17:46:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12832579 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 798E6C433F5 for ; Fri, 29 Apr 2022 17:46:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379752AbiD2RuN (ORCPT ); Fri, 29 Apr 2022 13:50:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379365AbiD2RuM (ORCPT ); Fri, 29 Apr 2022 13:50:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35F1822B32 for ; Fri, 29 Apr 2022 10:46:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DEDC9B8376A for ; Fri, 29 Apr 2022 17:46:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72581C385AE; Fri, 29 Apr 2022 17:46:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651254410; bh=uJDd/n2LaMKoOouIk+NOw2K/Es5hcm1dmLHd+mCx3SA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O5zoo4UuDRhlSFfaWzBK9TZ+3KZA9fq18jtSMly8mJtfaOdk3qs8lb7+QsOcaOmKU 4ivM2+QsqqAAxBsUW05STiskLbAJEH/TxiIyBe9DoHjpjNmRlptWw+9lGSOP8OlFMU WnivSzl34orqcrJLDgEPOfP0gOlENtcN/F3TGDg1Hc1vp23+4UFEpBjM+RUpKk9VVx EpvwN31L9NoW73HtIns4bISyudk8EpxGZixbbWDGQ7MoKzqW2Y1VYBc/sKLHPYROjk hqmYdIhFjoXDGlWLr68uOL9cDYT5rFVywuDvfr8skJPTI/HA2HFdM/ozVuPXZUI6hE MZK2WZc6mYeSw== From: Jakub Kicinski To: kvalo@kernel.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski , ath10k@lists.infradead.org Subject: [PATCH wireless-next 2/3] wifi: ath10k: remove a copy of the NAPI_POLL_WEIGHT define Date: Fri, 29 Apr 2022 10:46:42 -0700 Message-Id: <20220429174643.196994-3-kuba@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220429174643.196994-1-kuba@kernel.org> References: <20220429174643.196994-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Defining local versions of NAPI_POLL_WEIGHT with the same values in the drivers just makes refactoring harder. Signed-off-by: Jakub Kicinski --- CC: kvalo@kernel.org CC: ath10k@lists.infradead.org CC: linux-wireless@vger.kernel.org --- drivers/net/wireless/ath/ath10k/core.h | 3 --- drivers/net/wireless/ath/ath10k/pci.c | 2 +- drivers/net/wireless/ath/ath10k/sdio.c | 2 +- drivers/net/wireless/ath/ath10k/snoc.c | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 9f6680b3be0a..8bfabbcfdb14 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -59,9 +59,6 @@ #define ATH10K_KEEPALIVE_MAX_IDLE 3895 #define ATH10K_KEEPALIVE_MAX_UNRESPONSIVE 3900 -/* NAPI poll budget */ -#define ATH10K_NAPI_BUDGET 64 - /* SMBIOS type containing Board Data File Name Extension */ #define ATH10K_SMBIOS_BDF_EXT_TYPE 0xF8 diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 4d4e2f91e15c..bf1c938be7d0 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -3216,7 +3216,7 @@ static void ath10k_pci_free_irq(struct ath10k *ar) void ath10k_pci_init_napi(struct ath10k *ar) { netif_napi_add(&ar->napi_dev, &ar->napi, ath10k_pci_napi_poll, - ATH10K_NAPI_BUDGET); + NAPI_POLL_WEIGHT); } static int ath10k_pci_init_irq(struct ath10k *ar) diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index 73693c66cef1..24283c02a5ef 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -2532,7 +2532,7 @@ static int ath10k_sdio_probe(struct sdio_func *func, } netif_napi_add(&ar->napi_dev, &ar->napi, ath10k_sdio_napi_poll, - ATH10K_NAPI_BUDGET); + NAPI_POLL_WEIGHT); ath10k_dbg(ar, ATH10K_DBG_BOOT, "sdio new func %d vendor 0x%x device 0x%x block 0x%x/0x%x\n", diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index 8328966a0471..607e8164bf98 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -1243,7 +1243,7 @@ static int ath10k_snoc_napi_poll(struct napi_struct *ctx, int budget) static void ath10k_snoc_init_napi(struct ath10k *ar) { netif_napi_add(&ar->napi_dev, &ar->napi, ath10k_snoc_napi_poll, - ATH10K_NAPI_BUDGET); + NAPI_POLL_WEIGHT); } static int ath10k_snoc_request_irq(struct ath10k *ar) From patchwork Fri Apr 29 17:46:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12832578 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 881E9C43219 for ; Fri, 29 Apr 2022 17:46:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379775AbiD2RuN (ORCPT ); Fri, 29 Apr 2022 13:50:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379374AbiD2RuM (ORCPT ); Fri, 29 Apr 2022 13:50:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8802230F4B for ; Fri, 29 Apr 2022 10:46:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 39692B83770 for ; Fri, 29 Apr 2022 17:46:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C78A4C385B4; Fri, 29 Apr 2022 17:46:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651254411; bh=UMfk072vUSyhqlFuA6Th86TIcLdnvzSh7cVFGbUysDE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y08TARZ3KdzEZQQi1p5Vh0u8NgQbPM7nb+xOv/7oVz4zj6izoXDDBNlPJYXuLNZPO sG69KkB5SH6bjkCXdVj+fs1u85Gcn8oGphcTnKMUegTnzvWD7/lK30TUSKZRfoancz nglJSHLjnynxOLvEbDpgfsYpv04IpkC0Zc0f7Aase8NqaAOY7PfFd2c4Mtmg6hy11H zEPVS9Xl6/4kTTBBlQnHYjiHDSdiUv0TPPH4Mo4Usr7FY6R0ACCq5Equ6AEq2TAMEN 5hbEZ9eLHVkD4mgnMKV2Q0zC+xB1w7Qm5nvsCdiHWJTzV68NqaTcpiBI5a5y/tBH9b apeM8eCRfg1xw== From: Jakub Kicinski To: kvalo@kernel.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski Subject: [PATCH wireless-next 3/3] wifi: wil6210: use NAPI_POLL_WEIGHT for napi budget Date: Fri, 29 Apr 2022 10:46:43 -0700 Message-Id: <20220429174643.196994-4-kuba@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220429174643.196994-1-kuba@kernel.org> References: <20220429174643.196994-1-kuba@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The comment next to WIL6210_NAPI_BUDGET says "arbitrary". If we're picking arbitrary values let's pick the recommended default which is NAPI_POLL_WEIGHT. Signed-off-by: Jakub Kicinski --- drivers/net/wireless/ath/wil6210/netdev.c | 8 ++++---- drivers/net/wireless/ath/wil6210/wil6210.h | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/wil6210/netdev.c b/drivers/net/wireless/ath/wil6210/netdev.c index 0913f0bf60e7..390648066382 100644 --- a/drivers/net/wireless/ath/wil6210/netdev.c +++ b/drivers/net/wireless/ath/wil6210/netdev.c @@ -457,17 +457,17 @@ int wil_if_add(struct wil6210_priv *wil) if (wil->use_enhanced_dma_hw) { netif_napi_add(&wil->napi_ndev, &wil->napi_rx, wil6210_netdev_poll_rx_edma, - WIL6210_NAPI_BUDGET); + NAPI_POLL_WEIGHT); netif_tx_napi_add(&wil->napi_ndev, &wil->napi_tx, wil6210_netdev_poll_tx_edma, - WIL6210_NAPI_BUDGET); + NAPI_POLL_WEIGHT); } else { netif_napi_add(&wil->napi_ndev, &wil->napi_rx, wil6210_netdev_poll_rx, - WIL6210_NAPI_BUDGET); + NAPI_POLL_WEIGHT); netif_tx_napi_add(&wil->napi_ndev, &wil->napi_tx, wil6210_netdev_poll_tx, - WIL6210_NAPI_BUDGET); + NAPI_POLL_WEIGHT); } wil_update_net_queues_bh(wil, vif, NULL, true); diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h index 11946ecd0b99..22a6eb3e12b7 100644 --- a/drivers/net/wireless/ath/wil6210/wil6210.h +++ b/drivers/net/wireless/ath/wil6210/wil6210.h @@ -82,7 +82,6 @@ static inline u32 WIL_GET_BITS(u32 x, int b0, int b1) #define WIL6210_MAX_TX_RINGS (24) /* HW limit */ #define WIL6210_MAX_CID (20) /* max number of stations */ #define WIL6210_RX_DESC_MAX_CID (8) /* HW limit */ -#define WIL6210_NAPI_BUDGET (16) /* arbitrary */ #define WIL_MAX_AMPDU_SIZE (64 * 1024) /* FW/HW limit */ #define WIL_MAX_AGG_WSIZE (32) /* FW/HW limit */ #define WIL_MAX_AMPDU_SIZE_128 (128 * 1024) /* FW/HW limit */