summaryrefslogtreecommitdiff
path: root/net/core/dev.c
diff options
context:
space:
mode:
authorJussi Maki <joamaki@gmail.com>2021-07-31 08:57:36 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2021-08-10 00:25:15 +0300
commit689186699931313c7a42462602bd5c03eef77f9f (patch)
treee21f16c6a55ad82da50fb0d88da91de099393005 /net/core/dev.c
parentaeea1b86f9363f3feabb496534d886f082a89f21 (diff)
downloadlinux-689186699931313c7a42462602bd5c03eef77f9f.tar.xz
net, core: Allow netdev_lower_get_next_private_rcu in bh context
For the XDP bonding slave lookup to work in the NAPI poll context in which the redudant rcu_read_lock() has been removed we have to follow the same approach as in 694cea395fde ("bpf: Allow RCU-protected lookups to happen from bh context") and modify the WARN_ON to also check rcu_read_lock_bh_held(). Signed-off-by: Jussi Maki <joamaki@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Cc: Toke Høiland-Jørgensen <toke@redhat.com> Link: https://lore.kernel.org/bpf/20210731055738.16820-6-joamaki@gmail.com
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 9eb6dc9e02b3..e5045b628dec 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7615,7 +7615,7 @@ void *netdev_lower_get_next_private_rcu(struct net_device *dev,
{
struct netdev_adjacent *lower;
- WARN_ON_ONCE(!rcu_read_lock_held());
+ WARN_ON_ONCE(!rcu_read_lock_held() && !rcu_read_lock_bh_held());
lower = list_entry_rcu((*iter)->next, struct netdev_adjacent, list);