From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
andrew+netdev@lunn.ch, horms@kernel.org,
dan.carpenter@linaro.org, Jakub Kicinski <kuba@kernel.org>,
rain.1986.08.12@gmail.com, zyjzyj2000@gmail.com
Subject: [PATCH net-next 2/7] eth: forcedeth: remove local wrappers for napi enable/disable
Date: Tue, 21 Jan 2025 14:15:14 -0800 [thread overview]
Message-ID: <20250121221519.392014-3-kuba@kernel.org> (raw)
In-Reply-To: <20250121221519.392014-1-kuba@kernel.org>
The local helpers for calling napi_enable() and napi_disable()
don't serve much purpose and they will complicate the fix in
the subsequent patch. Remove them, call the core functions
directly.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: rain.1986.08.12@gmail.com
CC: zyjzyj2000@gmail.com
---
drivers/net/ethernet/nvidia/forcedeth.c | 30 +++++++------------------
1 file changed, 8 insertions(+), 22 deletions(-)
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 720f577929db..b00df57f2ca3 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -1120,20 +1120,6 @@ static void nv_disable_hw_interrupts(struct net_device *dev, u32 mask)
}
}
-static void nv_napi_enable(struct net_device *dev)
-{
- struct fe_priv *np = get_nvpriv(dev);
-
- napi_enable(&np->napi);
-}
-
-static void nv_napi_disable(struct net_device *dev)
-{
- struct fe_priv *np = get_nvpriv(dev);
-
- napi_disable(&np->napi);
-}
-
#define MII_READ (-1)
/* mii_rw: read/write a register on the PHY.
*
@@ -3114,7 +3100,7 @@ static int nv_change_mtu(struct net_device *dev, int new_mtu)
* Changing the MTU is a rare event, it shouldn't matter.
*/
nv_disable_irq(dev);
- nv_napi_disable(dev);
+ napi_disable(&np->napi);
netif_tx_lock_bh(dev);
netif_addr_lock(dev);
spin_lock(&np->lock);
@@ -3143,7 +3129,7 @@ static int nv_change_mtu(struct net_device *dev, int new_mtu)
spin_unlock(&np->lock);
netif_addr_unlock(dev);
netif_tx_unlock_bh(dev);
- nv_napi_enable(dev);
+ napi_enable(&np->napi);
nv_enable_irq(dev);
}
return 0;
@@ -4731,7 +4717,7 @@ static int nv_set_ringparam(struct net_device *dev,
if (netif_running(dev)) {
nv_disable_irq(dev);
- nv_napi_disable(dev);
+ napi_disable(&np->napi);
netif_tx_lock_bh(dev);
netif_addr_lock(dev);
spin_lock(&np->lock);
@@ -4784,7 +4770,7 @@ static int nv_set_ringparam(struct net_device *dev,
spin_unlock(&np->lock);
netif_addr_unlock(dev);
netif_tx_unlock_bh(dev);
- nv_napi_enable(dev);
+ napi_enable(&np->napi);
nv_enable_irq(dev);
}
return 0;
@@ -5277,7 +5263,7 @@ static void nv_self_test(struct net_device *dev, struct ethtool_test *test, u64
if (test->flags & ETH_TEST_FL_OFFLINE) {
if (netif_running(dev)) {
netif_stop_queue(dev);
- nv_napi_disable(dev);
+ napi_disable(&np->napi);
netif_tx_lock_bh(dev);
netif_addr_lock(dev);
spin_lock_irq(&np->lock);
@@ -5334,7 +5320,7 @@ static void nv_self_test(struct net_device *dev, struct ethtool_test *test, u64
/* restart rx engine */
nv_start_rxtx(dev);
netif_start_queue(dev);
- nv_napi_enable(dev);
+ napi_enable(&np->napi);
nv_enable_hw_interrupts(dev, np->irqmask);
}
}
@@ -5594,7 +5580,7 @@ static int nv_open(struct net_device *dev)
ret = nv_update_linkspeed(dev);
nv_start_rxtx(dev);
netif_start_queue(dev);
- nv_napi_enable(dev);
+ napi_enable(&np->napi);
if (ret) {
netif_carrier_on(dev);
@@ -5632,7 +5618,7 @@ static int nv_close(struct net_device *dev)
spin_lock_irq(&np->lock);
np->in_shutdown = 1;
spin_unlock_irq(&np->lock);
- nv_napi_disable(dev);
+ napi_disable(&np->napi);
synchronize_irq(np->pci_dev->irq);
del_timer_sync(&np->oom_kick);
--
2.48.1
next prev parent reply other threads:[~2025-01-21 22:15 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-21 22:15 [PATCH net-next 0/7] eth: fix calling napi_enable() in atomic context Jakub Kicinski
2025-01-21 22:15 ` [PATCH net-next 1/7] eth: tg3: " Jakub Kicinski
2025-01-21 23:06 ` Michael Chan
2025-01-21 23:49 ` Jakub Kicinski
2025-01-22 7:41 ` Michael Chan
2025-01-22 14:27 ` Jakub Kicinski
2025-01-22 23:48 ` Jakub Kicinski
2025-01-23 10:48 ` Simon Horman
2025-01-22 14:10 ` Eric Dumazet
2025-01-21 22:15 ` Jakub Kicinski [this message]
2025-01-22 8:40 ` [PATCH net-next 2/7] eth: forcedeth: remove local wrappers for napi enable/disable Zhu Logan
2025-01-22 13:46 ` Eric Dumazet
2025-01-21 22:15 ` [PATCH net-next 3/7] eth: forcedeth: fix calling napi_enable() in atomic context Jakub Kicinski
2025-01-22 8:42 ` Zhu Logan
2025-01-22 13:44 ` Eric Dumazet
2025-01-21 22:15 ` [PATCH net-next 4/7] eth: 8139too: " Jakub Kicinski
2025-01-22 14:12 ` Eric Dumazet
2025-01-21 22:15 ` [PATCH net-next 5/7] eth: niu: " Jakub Kicinski
2025-01-22 14:15 ` Eric Dumazet
2025-01-21 22:15 ` [PATCH net-next 6/7] eth: via-rhine: " Jakub Kicinski
2025-01-22 14:20 ` Eric Dumazet
2025-01-21 22:15 ` [PATCH net-next 7/7] wifi: mt76: move napi_enable() from under BH Jakub Kicinski
2025-01-22 14:25 ` Eric Dumazet
2025-01-22 14:36 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250121221519.392014-3-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rain.1986.08.12@gmail.com \
--cc=zyjzyj2000@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).