Commit 312e6f76 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'net-netpoll-remove-dead-code-and-speed-up-rtnl-locked-region'

Breno Leitao says:

====================
net: netpoll: remove dead code and speed up rtnl-locked region

This patchset introduces two minor modernizations to the netpoll
infrastructure:

The first patch removes the unused netpoll pointer from the netpoll_info
structure. This member is redundant and its presence does not benefit
multi-instance setups, as reported by Jay Vosburgh. Eliminating it cleans up
the structure and removes unnecessary code.

The second patch updates the netpoll resource cleanup routine to use
synchronize_net() instead of synchronize_rcu(). As __netpoll_free() is always
called under the RTNL lock, using synchronize_net() leverages the more
efficient synchronize_rcu_expedited() in these contexts, reducing time spent in
critical sections and improving performance.

Both changes simplify maintenance and enhance efficiency without altering
netpoll behavior.
====================

Link: https://patch.msgid.link/20250918-netpoll_jv-v1-0-67d50eeb2c26@debian.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 4d3c5db4 614accf5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -55,7 +55,6 @@ struct netpoll_info {

	struct delayed_work tx_work;

	struct netpoll *netpoll;
	struct rcu_head rcu;
};

+1 −2
Original line number Diff line number Diff line
@@ -591,7 +591,6 @@ int __netpoll_setup(struct netpoll *np, struct net_device *ndev)

	np->dev = ndev;
	strscpy(np->dev_name, ndev->name, IFNAMSIZ);
	npinfo->netpoll = np;

	/* fill up the skb queue */
	refill_skbs(np);
@@ -835,7 +834,7 @@ void __netpoll_free(struct netpoll *np)
	ASSERT_RTNL();

	/* Wait for transmitting packets to finish before freeing. */
	synchronize_rcu();
	synchronize_net();
	__netpoll_cleanup(np);
	kfree(np);
}