git: 23c73dbae7b2 - main - LinuxKPI: iwlwifi: rtw88: rtw89: remove budget argument from netif_napi_add()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Mon, 28 Nov 2022 18:43:59 UTC
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=23c73dbae7b2f64014b275643efbe92f449feaa2

commit 23c73dbae7b2f64014b275643efbe92f449feaa2
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-11-28 15:12:58 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-11-28 17:30:40 +0000

    LinuxKPI: iwlwifi: rtw88: rtw89: remove budget argument from netif_napi_add()
    
    In preparation for future updates remove the budget argument from the
    netif_napi_add() in drivers and update LinuxKPI to reflect that it is
    gone and only set it internally.  This required changes to the currently
    committed wireless drivers based on LinuxKPI (iwlwifi, rtw88, rtw89).
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 sys/compat/linuxkpi/common/include/linux/netdevice.h | 6 +++---
 sys/compat/linuxkpi/common/src/linux_netdev.c        | 4 ++--
 sys/contrib/dev/iwlwifi/pcie/rx.c                    | 3 +--
 sys/contrib/dev/rtw88/pci.c                          | 3 +--
 sys/contrib/dev/rtw89/core.c                         | 2 +-
 5 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/netdevice.h b/sys/compat/linuxkpi/common/include/linux/netdevice.h
index a904b7e70490..fdfd650a55e5 100644
--- a/sys/compat/linuxkpi/common/include/linux/netdevice.h
+++ b/sys/compat/linuxkpi/common/include/linux/netdevice.h
@@ -229,7 +229,7 @@ struct napi_struct {
 
 void linuxkpi_init_dummy_netdev(struct net_device *);
 void linuxkpi_netif_napi_add(struct net_device *, struct napi_struct *,
-    int(*napi_poll)(struct napi_struct *, int), int);
+    int(*napi_poll)(struct napi_struct *, int));
 void linuxkpi_netif_napi_del(struct napi_struct *);
 bool linuxkpi_napi_schedule_prep(struct napi_struct *);
 void linuxkpi___napi_schedule(struct napi_struct *);
@@ -243,8 +243,8 @@ void linuxkpi_napi_synchronize(struct napi_struct *);
 
 #define	init_dummy_netdev(_n)						\
 	linuxkpi_init_dummy_netdev(_n)
-#define	netif_napi_add(_nd, _ns, _p, _b)				\
-	linuxkpi_netif_napi_add(_nd, _ns, _p, _b)
+#define	netif_napi_add(_nd, _ns, _p)					\
+	linuxkpi_netif_napi_add(_nd, _ns, _p)
 #define	netif_napi_del(_n)						\
 	linuxkpi_netif_napi_del(_n)
 #define	napi_schedule_prep(_n)						\
diff --git a/sys/compat/linuxkpi/common/src/linux_netdev.c b/sys/compat/linuxkpi/common/src/linux_netdev.c
index 3055b9c46767..69adcff67930 100644
--- a/sys/compat/linuxkpi/common/src/linux_netdev.c
+++ b/sys/compat/linuxkpi/common/src/linux_netdev.c
@@ -326,12 +326,12 @@ lkpi_napi_task(void *ctx, int pending)
 
 void
 linuxkpi_netif_napi_add(struct net_device *ndev, struct napi_struct *napi,
-    int(*napi_poll)(struct napi_struct *, int), int budget)
+    int(*napi_poll)(struct napi_struct *, int))
 {
 
 	napi->dev = ndev;
 	napi->poll = napi_poll;
-	napi->budget = budget;
+	napi->budget = NAPI_POLL_WEIGHT;
 
 	INIT_LIST_HEAD(&napi->rx_list);
 	napi->rx_count = 0;
diff --git a/sys/contrib/dev/iwlwifi/pcie/rx.c b/sys/contrib/dev/iwlwifi/pcie/rx.c
index e91121dda102..480cc9c765d8 100644
--- a/sys/contrib/dev/iwlwifi/pcie/rx.c
+++ b/sys/contrib/dev/iwlwifi/pcie/rx.c
@@ -1113,8 +1113,7 @@ static int _iwl_pcie_rx_init(struct iwl_trans *trans)
 			if (trans_pcie->msix_enabled)
 				poll = iwl_pcie_napi_poll_msix;
 
-			netif_napi_add(&trans_pcie->napi_dev, &rxq->napi,
-				       poll, NAPI_POLL_WEIGHT);
+			netif_napi_add(&trans_pcie->napi_dev, &rxq->napi, poll);
 			napi_enable(&rxq->napi);
 		}
 
diff --git a/sys/contrib/dev/rtw88/pci.c b/sys/contrib/dev/rtw88/pci.c
index bad6dd5b5b98..151400f6f892 100644
--- a/sys/contrib/dev/rtw88/pci.c
+++ b/sys/contrib/dev/rtw88/pci.c
@@ -1801,8 +1801,7 @@ static void rtw_pci_napi_init(struct rtw_dev *rtwdev)
 	struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv;
 
 	init_dummy_netdev(&rtwpci->netdev);
-	netif_napi_add(&rtwpci->netdev, &rtwpci->napi, rtw_pci_napi_poll,
-		       NAPI_POLL_WEIGHT);
+	netif_napi_add(&rtwpci->netdev, &rtwpci->napi, rtw_pci_napi_poll);
 }
 
 static void rtw_pci_napi_deinit(struct rtw_dev *rtwdev)
diff --git a/sys/contrib/dev/rtw89/core.c b/sys/contrib/dev/rtw89/core.c
index 98f47c4daeac..25940c141f84 100644
--- a/sys/contrib/dev/rtw89/core.c
+++ b/sys/contrib/dev/rtw89/core.c
@@ -1803,7 +1803,7 @@ void rtw89_core_napi_init(struct rtw89_dev *rtwdev)
 {
 	init_dummy_netdev(&rtwdev->netdev);
 	netif_napi_add(&rtwdev->netdev, &rtwdev->napi,
-		       rtwdev->hci.ops->napi_poll, NAPI_POLL_WEIGHT);
+		       rtwdev->hci.ops->napi_poll);
 }
 EXPORT_SYMBOL(rtw89_core_napi_init);