Skip to content
Commit 6127fb29 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Paul Gortmaker
Browse files

samples/bpf: xdp_redirect_cpu: Set MAX_CPUS according to NR_CPUS



commit 6a098154 upstream.

xdp_redirect_cpu is currently failing in bpf_prog_load_xattr()
allocating cpu_map map if CONFIG_NR_CPUS is less than 64 since
cpu_map_alloc() requires max_entries to be less than NR_CPUS.
Set cpu_map max_entries according to NR_CPUS in xdp_redirect_cpu_kern.c
and get currently running cpus in xdp_redirect_cpu_user.c

Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/374472755001c260158c4e4b22f193bdd3c56fb7.1589300442.git.lorenzo@kernel.org


Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent 60552e4f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment