]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpftool: fix percpu maps updating
authorPaolo Abeni <pabeni@redhat.com>
Mon, 21 Jan 2019 11:36:12 +0000 (12:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Mar 2019 21:04:10 +0000 (14:04 -0700)
commit2af8fb0fcfdca14cf60e5a2804954b79f1f4e7a7
tree4ccc388f27d1e5cbb5244992f1b66b20ed2cf9c0
parent27c21839fc3dce64d6f71f71ee52ddb0b14a3299
bpftool: fix percpu maps updating

[ Upstream commit b0ca5ecb8e2279d706261f525f1bd0ba9e3fe800 ]

When updating a percpu map, bpftool currently copies the provided
value only into the first per CPU copy of the specified value,
all others instances are left zeroed.

This change explicitly copies the user-provided bytes to all the
per CPU instances, keeping the sub-command syntax unchanged.

v2 -> v3:
 - drop unused argument, as per Quentin's suggestion
v1 -> v2:
 - rename the helper as per Quentin's suggestion

Fixes: 71bb428fe2c1 ("tools: bpf: add bpftool")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/bpf/bpftool/map.c