From d37cf6cec86fda9881accf90951feda223f858ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Wei=C3=9F?= Date: Tue, 21 Oct 2025 16:56:03 +0200 Subject: [PATCH 1/3] kmod: igb_main: Add a parameter to report whether notification was sent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a partial backport of following mainline commit in v6.13: commit 4b42fbc6bd8f73d9ded535d8c61ccaa837ff3bd4 Author: Petr Machata Date: Thu Nov 14 15:09:53 2024 +0100 ndo_fdb_add: Add a parameter to report whether notification was sent Currently when FDB entries are added to or deleted from a VXLAN netdevice, the VXLAN driver emits one notification, including the VXLAN-specific attributes. The core however always sends a notification as well, a generic one. Thus two notifications are unnecessarily sent for these operations. A similar situation comes up with bridge driver, which also emits notifications on its own: # ip link add name vx type vxlan id 1000 dstport 4789 # bridge monitor fdb & [1] 1981693 # bridge fdb add de:ad:be:ef:13:37 dev vx self dst 192.0.2.1 de:ad:be:ef:13:37 dev vx dst 192.0.2.1 self permanent de:ad:be:ef:13:37 dev vx self permanent In order to prevent this duplicity, add a paremeter to ndo_fdb_add, bool *notified. The flag is primed to false, and if the callee sends a notification on its own, it sets it to true, thus informing the core that it should not generate another notification. Signed-off-by: Petr Machata Reviewed-by: Amit Cohen Reviewed-by: Nikolay Aleksandrov Link: https://patch.msgid.link/cbf6ae8195e85cbf922f8058ce4eba770f3b71ed.1731589511.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Michael Weiß --- kmod/igb_main.c | 3 +++ kmod/kcompat.h | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/kmod/igb_main.c b/kmod/igb_main.c index 589607b..66763af 100755 --- a/kmod/igb_main.c +++ b/kmod/igb_main.c @@ -2215,6 +2215,9 @@ static int igb_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], u16 vid, #endif u16 flags +#ifdef HAVE_NDO_FDB_ADD_NOTIFIED + , bool *notified +#endif #ifdef HAVE_NDO_FDB_ADD_EXT_ACK , struct netlink_ext_ack *extack #endif diff --git a/kmod/kcompat.h b/kmod/kcompat.h index 63786dc..24dc394 100644 --- a/kmod/kcompat.h +++ b/kmod/kcompat.h @@ -4809,4 +4809,9 @@ static inline void skb_frag_off_add(skb_frag_t *frag, int delta) #define HAVE_FS_NO_LLSEEK #endif /* 6.12.0 */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,13,0)) +#define HAVE_NDO_FDB_ADD_NOTIFIED +#endif /* 6.13.0 */ + + #endif /* _KCOMPAT_H_ */ From 5d242c60a062403794f7d1059c163348e61bf110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Wei=C3=9F?= Date: Tue, 21 Oct 2025 16:42:54 +0200 Subject: [PATCH 2/3] kmod: igb_main: Switch/rename to timer_delete[_sync]() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since mainline commit (8fa7292fee5c) in v6.15 timer_delete[_sync]() replaces del_timer[_sync](). Thus, we need to do this in igb_main.c, too. treewide: Switch/rename to timer_delete[_sync]() timer_delete[_sync]() replaces del_timer[_sync](). Convert the whole tree over and remove the historical wrapper inlines. Conversion was done with coccinelle plus manual fixups where necessary. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Signed-off-by: Michael Weiß --- kmod/igb_main.c | 12 ++++++------ kmod/kcompat.h | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/kmod/igb_main.c b/kmod/igb_main.c index 66763af..b8f429e 100755 --- a/kmod/igb_main.c +++ b/kmod/igb_main.c @@ -1915,7 +1915,7 @@ void igb_down(struct igb_adapter *adapter) and watchdog - performing required actions before altering the adapter state and registers */ - del_timer_sync(&adapter->watchdog_timer); + timer_delete_sync(&adapter->watchdog_timer); cancel_work_sync(&adapter->watchdog_task); /* signal that we're down so the interrupt handler does not @@ -1947,8 +1947,8 @@ void igb_down(struct igb_adapter *adapter) adapter->flags &= ~IGB_FLAG_NEED_LINK_UPDATE; if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA) - del_timer_sync(&adapter->dma_err_timer); - del_timer_sync(&adapter->phy_info_timer); + timer_delete_sync(&adapter->dma_err_timer); + timer_delete_sync(&adapter->phy_info_timer); /* record the stats before reset*/ igb_update_stats(adapter); @@ -3263,10 +3263,10 @@ static void igb_remove(struct pci_dev *pdev) * disable watchdog from being rescheduled. */ set_bit(__IGB_DOWN, &adapter->state); - del_timer_sync(&adapter->watchdog_timer); + timer_delete_sync(&adapter->watchdog_timer); if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA) - del_timer_sync(&adapter->dma_err_timer); - del_timer_sync(&adapter->phy_info_timer); + timer_delete_sync(&adapter->dma_err_timer); + timer_delete_sync(&adapter->phy_info_timer); cancel_work_sync(&adapter->reset_task); if (adapter->flags & IGB_FLAG_DETECT_BAD_DMA) diff --git a/kmod/kcompat.h b/kmod/kcompat.h index 24dc394..ca2bc2a 100644 --- a/kmod/kcompat.h +++ b/kmod/kcompat.h @@ -4813,5 +4813,9 @@ static inline void skb_frag_off_add(skb_frag_t *frag, int delta) #define HAVE_NDO_FDB_ADD_NOTIFIED #endif /* 6.13.0 */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,15,0)) +#define timer_delete_sync(timer) del_timer_sync(timer) +#endif /* 6.15.0 */ + #endif /* _KCOMPAT_H_ */ From 8bef55e042846e0e173381e354403de5a07ccc56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Wei=C3=9F?= Date: Wed, 22 Oct 2025 08:42:54 +0200 Subject: [PATCH 3/3] kmod: igb_ptp: Fix the lie that struct cyclecounter is const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a backport of following mainline commit in v6.17: commit e78f70bad29c5ae1e1076698b690b15794e9b81e (HEAD) Author: Greg Kroah-Hartman Date: Tue Jul 1 14:32:25 2025 +0200 time/timecounter: Fix the lie that struct cyclecounter is const In both the read callback for struct cyclecounter, and in struct timecounter, struct cyclecounter is declared as a const pointer. Unfortunatly, a number of users of this pointer treat it as a non-const pointer as it is burried in a larger structure that is heavily modified by the callback function when accessed. This lie had been hidden by the fact that container_of() "casts away" a const attribute of a pointer without any compiler warning happening at all. Fix this all up by removing the const attribute in the needed places so that everyone can see that the structure really isn't const, but can, and is, modified by the users of it. Signed-off-by: Greg Kroah-Hartman Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/2025070124-backyard-hurt-783a@gregkh Signed-off-by: Michael Weiß --- kmod/igb_ptp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kmod/igb_ptp.c b/kmod/igb_ptp.c index be7f5a2..e7bf60c 100644 --- a/kmod/igb_ptp.c +++ b/kmod/igb_ptp.c @@ -93,7 +93,11 @@ * SYSTIM read access for the 82576 */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0) +static u64 igb_ptp_read_82576(struct cyclecounter *cc) +#else static cycle_t igb_ptp_read_82576(const struct cyclecounter *cc) +#endif { struct igb_adapter *igb = container_of(cc, struct igb_adapter, cc); struct e1000_hw *hw = &igb->hw; @@ -113,7 +117,11 @@ static cycle_t igb_ptp_read_82576(const struct cyclecounter *cc) * SYSTIM read access for the 82580 */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0) +static u64 igb_ptp_read_82580(struct cyclecounter *cc) +#else static cycle_t igb_ptp_read_82580(const struct cyclecounter *cc) +#endif { struct igb_adapter *igb = container_of(cc, struct igb_adapter, cc); struct e1000_hw *hw = &igb->hw;