Loading include/linux/netdevice.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -1951,6 +1951,7 @@ enum netdev_ml_priv_type { * * * @dev_addr_shadow: Copy of @dev_addr to catch direct writes. * @dev_addr_shadow: Copy of @dev_addr to catch direct writes. * @linkwatch_dev_tracker: refcount tracker used by linkwatch. * @linkwatch_dev_tracker: refcount tracker used by linkwatch. * @watchdog_dev_tracker: refcount tracker used by watchdog. * * * FIXME: cleanup struct net_device such that network protocol info * FIXME: cleanup struct net_device such that network protocol info * moves out. * moves out. Loading Loading @@ -2282,6 +2283,7 @@ struct net_device { u8 dev_addr_shadow[MAX_ADDR_LEN]; u8 dev_addr_shadow[MAX_ADDR_LEN]; netdevice_tracker linkwatch_dev_tracker; netdevice_tracker linkwatch_dev_tracker; netdevice_tracker watchdog_dev_tracker; }; }; #define to_net_dev(d) container_of(d, struct net_device, dev) #define to_net_dev(d) container_of(d, struct net_device, dev) Loading net/sched/sch_generic.c +6 −4 Original line number Original line Diff line number Diff line Loading @@ -499,6 +499,7 @@ EXPORT_SYMBOL(netif_tx_unlock); static void dev_watchdog(struct timer_list *t) static void dev_watchdog(struct timer_list *t) { { struct net_device *dev = from_timer(dev, t, watchdog_timer); struct net_device *dev = from_timer(dev, t, watchdog_timer); bool release = true; spin_lock(&dev->tx_global_lock); spin_lock(&dev->tx_global_lock); if (!qdisc_tx_is_noop(dev)) { if (!qdisc_tx_is_noop(dev)) { Loading Loading @@ -534,12 +535,13 @@ static void dev_watchdog(struct timer_list *t) if (!mod_timer(&dev->watchdog_timer, if (!mod_timer(&dev->watchdog_timer, round_jiffies(jiffies + round_jiffies(jiffies + dev->watchdog_timeo))) dev->watchdog_timeo))) dev_hold(dev); release = false; } } } } spin_unlock(&dev->tx_global_lock); spin_unlock(&dev->tx_global_lock); dev_put(dev); if (release) dev_put_track(dev, &dev->watchdog_dev_tracker); } } void __netdev_watchdog_up(struct net_device *dev) void __netdev_watchdog_up(struct net_device *dev) Loading @@ -549,7 +551,7 @@ void __netdev_watchdog_up(struct net_device *dev) dev->watchdog_timeo = 5*HZ; dev->watchdog_timeo = 5*HZ; if (!mod_timer(&dev->watchdog_timer, if (!mod_timer(&dev->watchdog_timer, round_jiffies(jiffies + dev->watchdog_timeo))) round_jiffies(jiffies + dev->watchdog_timeo))) dev_hold(dev); dev_hold_track(dev, &dev->watchdog_dev_tracker, GFP_ATOMIC); } } } } EXPORT_SYMBOL_GPL(__netdev_watchdog_up); EXPORT_SYMBOL_GPL(__netdev_watchdog_up); Loading @@ -563,7 +565,7 @@ static void dev_watchdog_down(struct net_device *dev) { { netif_tx_lock_bh(dev); netif_tx_lock_bh(dev); if (del_timer(&dev->watchdog_timer)) if (del_timer(&dev->watchdog_timer)) dev_put(dev); dev_put_track(dev, &dev->watchdog_dev_tracker); netif_tx_unlock_bh(dev); netif_tx_unlock_bh(dev); } } Loading Loading
include/linux/netdevice.h +2 −0 Original line number Original line Diff line number Diff line Loading @@ -1951,6 +1951,7 @@ enum netdev_ml_priv_type { * * * @dev_addr_shadow: Copy of @dev_addr to catch direct writes. * @dev_addr_shadow: Copy of @dev_addr to catch direct writes. * @linkwatch_dev_tracker: refcount tracker used by linkwatch. * @linkwatch_dev_tracker: refcount tracker used by linkwatch. * @watchdog_dev_tracker: refcount tracker used by watchdog. * * * FIXME: cleanup struct net_device such that network protocol info * FIXME: cleanup struct net_device such that network protocol info * moves out. * moves out. Loading Loading @@ -2282,6 +2283,7 @@ struct net_device { u8 dev_addr_shadow[MAX_ADDR_LEN]; u8 dev_addr_shadow[MAX_ADDR_LEN]; netdevice_tracker linkwatch_dev_tracker; netdevice_tracker linkwatch_dev_tracker; netdevice_tracker watchdog_dev_tracker; }; }; #define to_net_dev(d) container_of(d, struct net_device, dev) #define to_net_dev(d) container_of(d, struct net_device, dev) Loading
net/sched/sch_generic.c +6 −4 Original line number Original line Diff line number Diff line Loading @@ -499,6 +499,7 @@ EXPORT_SYMBOL(netif_tx_unlock); static void dev_watchdog(struct timer_list *t) static void dev_watchdog(struct timer_list *t) { { struct net_device *dev = from_timer(dev, t, watchdog_timer); struct net_device *dev = from_timer(dev, t, watchdog_timer); bool release = true; spin_lock(&dev->tx_global_lock); spin_lock(&dev->tx_global_lock); if (!qdisc_tx_is_noop(dev)) { if (!qdisc_tx_is_noop(dev)) { Loading Loading @@ -534,12 +535,13 @@ static void dev_watchdog(struct timer_list *t) if (!mod_timer(&dev->watchdog_timer, if (!mod_timer(&dev->watchdog_timer, round_jiffies(jiffies + round_jiffies(jiffies + dev->watchdog_timeo))) dev->watchdog_timeo))) dev_hold(dev); release = false; } } } } spin_unlock(&dev->tx_global_lock); spin_unlock(&dev->tx_global_lock); dev_put(dev); if (release) dev_put_track(dev, &dev->watchdog_dev_tracker); } } void __netdev_watchdog_up(struct net_device *dev) void __netdev_watchdog_up(struct net_device *dev) Loading @@ -549,7 +551,7 @@ void __netdev_watchdog_up(struct net_device *dev) dev->watchdog_timeo = 5*HZ; dev->watchdog_timeo = 5*HZ; if (!mod_timer(&dev->watchdog_timer, if (!mod_timer(&dev->watchdog_timer, round_jiffies(jiffies + dev->watchdog_timeo))) round_jiffies(jiffies + dev->watchdog_timeo))) dev_hold(dev); dev_hold_track(dev, &dev->watchdog_dev_tracker, GFP_ATOMIC); } } } } EXPORT_SYMBOL_GPL(__netdev_watchdog_up); EXPORT_SYMBOL_GPL(__netdev_watchdog_up); Loading @@ -563,7 +565,7 @@ static void dev_watchdog_down(struct net_device *dev) { { netif_tx_lock_bh(dev); netif_tx_lock_bh(dev); if (del_timer(&dev->watchdog_timer)) if (del_timer(&dev->watchdog_timer)) dev_put(dev); dev_put_track(dev, &dev->watchdog_dev_tracker); netif_tx_unlock_bh(dev); netif_tx_unlock_bh(dev); } } Loading