]> git.baikalelectronics.ru Git - kernel.git/commit
net: add CONFIG_PCPU_DEV_REFCNT
authorEric Dumazet <edumazet@google.com>
Fri, 19 Mar 2021 17:39:33 +0000 (10:39 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 19 Mar 2021 20:38:46 +0000 (13:38 -0700)
commit77c96cc3379719d79b347aa8158e83e500a047b5
treef8f639053de5df86f213fffa61268e75df05c07d
parent30a045a673d1c470543053bc20f654c783e514a4
net: add CONFIG_PCPU_DEV_REFCNT

I was working on a syzbot issue, claiming one device could not be
dismantled because its refcount was -1

unregister_netdevice: waiting for sit0 to become free. Usage count = -1

It would be nice if syzbot could trigger a warning at the time
this reference count became negative.

This patch adds CONFIG_PCPU_DEV_REFCNT options which defaults
to per cpu variables (as before this patch) on SMP builds.

v2: free_dev label in alloc_netdev_mqs() is moved to avoid
    a compiler warning (-Wunused-label), as reported
    by kernel test robot <lkp@intel.com>

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
net/Kconfig
net/core/dev.c