aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/lib/bpf
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2023-03-16 12:28:30 -0700
committerAlexei Starovoitov <ast@kernel.org>2023-03-16 12:28:31 -0700
commitdeb9fd64d145b42c0a15193507b4fea27514a559 (patch)
treecc4daca2c7a7cb68852b288d59fc4a7e33cc4d85 /tools/lib/bpf
parentlibbpf: Ignore warnings about "inefficient alignment" (diff)
parentbpf,docs: Remove bpf_cpumask_kptr_get() from documentation (diff)
downloadwireguard-linux-deb9fd64d145b42c0a15193507b4fea27514a559.tar.xz
wireguard-linux-deb9fd64d145b42c0a15193507b4fea27514a559.zip
Merge branch 'Make struct bpf_cpumask RCU safe'
David Vernet says: ==================== The struct bpf_cpumask type is currently not RCU safe. It uses the bpf_mem_cache_{alloc,free}() APIs to allocate and release cpumasks, and those allocations may be reused before an RCU grace period has elapsed. We want to be able to enable using this pattern in BPF programs: private(MASK) static struct bpf_cpumask __kptr *global; int BPF_PROG(prog, ...) { struct bpf_cpumask *cpumask; bpf_rcu_read_lock(); cpumask = global; if (!cpumask) { bpf_rcu_read_unlock(); return -1; } bpf_cpumask_setall(cpumask); ... bpf_rcu_read_unlock(); } In other words, to be able to pass a kptr to KF_RCU bpf_cpumask kfuncs without requiring the acquisition and release of refcounts using bpf_cpumask_kptr_get(). This patchset enables this by making the struct bpf_cpumask type RCU safe, and removing the bpf_cpumask_kptr_get() function. --- v1: https://lore.kernel.org/all/20230316014122.678082-2-void@manifault.com/ Changelog: ---------- v1 -> v2: - Add doxygen comment for new @rcu field in struct bpf_cpumask. ==================== Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf')
0 files changed, 0 insertions, 0 deletions