mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
net: dst: add net device refcount tracking to dst_entry
We want to track all dev_hold()/dev_put() to ease leak hunting. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
4dbd24f65c
commit
9038c32000
@@ -3883,6 +3883,23 @@ static inline void dev_put_track(struct net_device *dev,
|
||||
}
|
||||
}
|
||||
|
||||
static inline void dev_replace_track(struct net_device *odev,
|
||||
struct net_device *ndev,
|
||||
netdevice_tracker *tracker,
|
||||
gfp_t gfp)
|
||||
{
|
||||
#ifdef CONFIG_NET_DEV_REFCNT_TRACKER
|
||||
if (odev)
|
||||
ref_tracker_free(&odev->refcnt_tracker, tracker);
|
||||
#endif
|
||||
dev_hold(ndev);
|
||||
dev_put(odev);
|
||||
#ifdef CONFIG_NET_DEV_REFCNT_TRACKER
|
||||
if (ndev)
|
||||
ref_tracker_alloc(&ndev->refcnt_tracker, tracker, gfp);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Carrier loss detection, dial on demand. The functions netif_carrier_on
|
||||
* and _off may be called from IRQ context, but it is caller
|
||||
* who is responsible for serialization of these calls.
|
||||
|
||||
Reference in New Issue
Block a user