mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 12:44:11 +08:00
netpoll: add net device refcount tracker to struct netpoll
Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
42120a8643
commit
5fa5ae6058
@ -721,7 +721,7 @@ restart:
|
||||
__netpoll_cleanup(&nt->np);
|
||||
|
||||
spin_lock_irqsave(&target_list_lock, flags);
|
||||
dev_put(nt->np.dev);
|
||||
dev_put_track(nt->np.dev, &nt->np.dev_tracker);
|
||||
nt->np.dev = NULL;
|
||||
nt->enabled = false;
|
||||
stopped = true;
|
||||
|
@ -24,6 +24,7 @@ union inet_addr {
|
||||
|
||||
struct netpoll {
|
||||
struct net_device *dev;
|
||||
netdevice_tracker dev_tracker;
|
||||
char dev_name[IFNAMSIZ];
|
||||
const char *name;
|
||||
|
||||
|
@ -776,7 +776,7 @@ put_noaddr:
|
||||
err = __netpoll_setup(np, ndev);
|
||||
if (err)
|
||||
goto put;
|
||||
|
||||
netdev_tracker_alloc(ndev, &np->dev_tracker, GFP_KERNEL);
|
||||
rtnl_unlock();
|
||||
return 0;
|
||||
|
||||
@ -853,7 +853,7 @@ void netpoll_cleanup(struct netpoll *np)
|
||||
if (!np->dev)
|
||||
goto out;
|
||||
__netpoll_cleanup(np);
|
||||
dev_put(np->dev);
|
||||
dev_put_track(np->dev, &np->dev_tracker);
|
||||
np->dev = NULL;
|
||||
out:
|
||||
rtnl_unlock();
|
||||
|
Loading…
Reference in New Issue
Block a user