Skip to content

Commit

Permalink
samples: bpf: Fix lwt_len_hist reusing previous BPF map
Browse files Browse the repository at this point in the history
[ Upstream commit 0afe0a9 ]

Currently, lwt_len_hist's map lwt_len_hist_map is uses pinning, and the
map isn't cleared on test end. This leds to reuse of that map for
each test, which prevents the results of the test from being accurate.

This commit fixes the problem by removing of pinned map from bpffs.
Also, this commit add the executable permission to shell script
files.

Fixes: f74599f ("bpf: Add tests and samples for LWT-BPF")
Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20201124090310.24374-7-danieltimlee@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
DanielTimLee authored and gregkh committed Dec 30, 2020
1 parent 4dc1360 commit ceff135
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions samples/bpf/lwt_len_hist.sh 100644 → 100755
Expand Up @@ -8,6 +8,8 @@ VETH1=tst_lwt1b
TRACE_ROOT=/sys/kernel/debug/tracing

function cleanup {
# To reset saved histogram, remove pinned map
rm /sys/fs/bpf/tc/globals/lwt_len_hist_map
ip route del 192.168.253.2/32 dev $VETH0 2> /dev/null
ip link del $VETH0 2> /dev/null
ip link del $VETH1 2> /dev/null
Expand Down
Empty file modified samples/bpf/test_lwt_bpf.sh 100644 → 100755
Empty file.

0 comments on commit ceff135

Please sign in to comment.