diff options
author | Toke Høiland-Jørgensen <toke@redhat.com> | 2021-06-24 18:05:54 +0200 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2021-06-24 19:41:15 +0200 |
commit | 694cea395fded425008e93cd90cfdf7a451674af (patch) | |
tree | be068946c3b7fd801c7d8854947c4d090de9896b /include/linux/filter.h | |
parent | e74c74f9e51deb725e72d129084ba8252d47222d (diff) |
bpf: Allow RCU-protected lookups to happen from bh context
XDP programs are called from a NAPI poll context, which means the RCU
reference liveness is ensured by local_bh_disable(). Add
rcu_read_lock_bh_held() as a condition to the RCU checks for map lookups so
lockdep understands that the dereferences are safe from inside *either* an
rcu_read_lock() section *or* a local_bh_disable() section. While both
bh_disabled and rcu_read_lock() provide RCU protection, they are
semantically distinct, so we need both conditions to prevent lockdep
complaints.
This change is done in preparation for removing the redundant
rcu_read_lock()s from drivers.
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20210624160609.292325-5-toke@redhat.com
Diffstat (limited to 'include/linux/filter.h')
0 files changed, 0 insertions, 0 deletions