Skip to content

Add new bpf_cpumask_weight() kfunc

David Vernet bpf lkml 1 version Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2bpf: Add bpf_cpumask_weight() kfuncDocumentation/bpf/cpumasks.rst kernel/bpf/cpumask.c+13 -11 replyApplied
2/2selftests/bpf: Add test for bpf_cpumask_weight() kfunctools/testing/selftests/bpf/prog_tests/cpumask.c tools/testing/selftests/bpf/progs/cpumask_common.h tools/testing/selftests/bpf/progs/cpumask_success.c+45 -01 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchYonghong Song
1/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH bpf-next 0/2] Add new bpf_cpumask_weight() kfunc

It can be useful to query how many bits are set in a cpumask. For example, if you want to perform special logic for the last remaining core that's set in a mask. This logic is already exposed through the main kernel's cpumask header as cpumask_weight(), so it would be useful to add a new bpf_cpumask_weight() kfunc which wraps it and does the same.

This patch series was built and tested on top of commit 2146f7fe6e02 ("Merge branch 'allocate-bpf-trampoline-on-bpf_prog_pack'").

David Vernet (2):
bpf: Add bpf_cpumask_weight() kfunc selftests/bpf: Add test for bpf_cpumask_weight() kfunc

 Documentation/bpf/cpumasks.rst                |  2 +-
 kernel/bpf/cpumask.c                          | 12 ++++++
 .../selftests/bpf/prog_tests/cpumask.c        |  1 +
 .../selftests/bpf/progs/cpumask_common.h      |  1 +
 .../selftests/bpf/progs/cpumask_success.c     | 43 +++++++++++++++++++
 5 files changed, 58 insertions(+), 1 deletion(-)
Signature · 1 line
2.42.1