Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: linkwatch: add net device refcount tracker

Add a netdevice_tracker inside struct net_device, to track
the self reference when a device is in lweventlist.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Eric Dumazet and committed by
Jakub Kicinski
63f13937 606509f2

+4 -2
+2
include/linux/netdevice.h
··· 1950 1950 * keep a list of interfaces to be deleted. 1951 1951 * 1952 1952 * @dev_addr_shadow: Copy of @dev_addr to catch direct writes. 1953 + * @linkwatch_dev_tracker: refcount tracker used by linkwatch. 1953 1954 * 1954 1955 * FIXME: cleanup struct net_device such that network protocol info 1955 1956 * moves out. ··· 2281 2280 struct bpf_xdp_entity xdp_state[__MAX_XDP_MODE]; 2282 2281 2283 2282 u8 dev_addr_shadow[MAX_ADDR_LEN]; 2283 + netdevice_tracker linkwatch_dev_tracker; 2284 2284 }; 2285 2285 #define to_net_dev(d) container_of(d, struct net_device, dev) 2286 2286