[PATCH net-next 1/6] net: add netif_rx_mode_schedule_fresh()
From: Satish Kharat <satishkh@cisco.com>
Date: 2026-09-21 20:01:29
Also in:
lkml
Subsystem:
networking drivers, networking [general], the rest · Maintainers:
Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds
Add a receive-mode scheduling helper for callers that need to replay the complete configuration after a state transition. Cancel a pending retry before queueing the immediate update so stale retry timers cannot consume the new operation's retry budget. Resetting the backoff also gives the fresh replay its full bounded retry sequence. Assisted-by: LLM Signed-off-by: Satish Kharat <satishkh@cisco.com> --- include/linux/netdevice.h | 1 + net/core/dev_addr_lists.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5d16737167ee..2246be72d811 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h@@ -5197,6 +5197,7 @@ static inline void __dev_mc_unsync(struct net_device *dev, /* Functions used for secondary unicast and multicast support */ void dev_set_rx_mode(struct net_device *dev); +void netif_rx_mode_schedule_fresh(struct net_device *dev); void netif_rx_mode_schedule_retry(struct net_device *dev); int netif_set_promiscuity(struct net_device *dev, int inc); int dev_set_promiscuity(struct net_device *dev, int inc);
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index 08528ca0a8b3..4ae0510ce91f 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c@@ -1337,6 +1337,27 @@ static void netif_rx_mode_queue(struct net_device *dev) __netdev_work_core_sched(dev, NETDEV_WORK_RX_MODE); } +/** + * netif_rx_mode_schedule_fresh() - schedule a fresh receive-mode update + * @dev: network device + * + * Cancel any pending retry and reset its backoff budget before scheduling an + * immediate receive-mode update. Callers use this after a state transition + * which requires the complete receive configuration to be replayed, rather + * than after a failed update (which uses netif_rx_mode_schedule_retry()). + * + * Context: sleepable. The caller must hold the device operations lock, or + * RTNL for a device which still uses RTNL-compatible operations. + */ +void netif_rx_mode_schedule_fresh(struct net_device *dev) +{ + might_sleep(); + netdev_assert_locked_ops_compat(dev); + netif_rx_mode_cancel_retry(dev); + netif_rx_mode_queue(dev); +} +EXPORT_SYMBOL_GPL(netif_rx_mode_schedule_fresh); + static void netif_rx_mode_retry(struct timer_list *t) { struct net_device *dev =
--
2.43.0