summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorDaniel T. Lee <danieltimlee@gmail.com>2020-11-24 09:03:09 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-12-30 11:25:57 +0100
commit5f73062a69ecd13eb1940c990958123e9e186309 (patch)
treee42e969796634bcf28f2ca574b18dd4962ab39df /samples
parent21975cc933d6a4563e40ec06b3b01997c6ecdf57 (diff)
downloadlinux-stable-5f73062a69ecd13eb1940c990958123e9e186309.tar.gz
linux-stable-5f73062a69ecd13eb1940c990958123e9e186309.tar.bz2
linux-stable-5f73062a69ecd13eb1940c990958123e9e186309.zip
samples: bpf: Fix lwt_len_hist reusing previous BPF map
[ Upstream commit 0afe0a998c40085a6342e1aeb4c510cccba46caf ] 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: f74599f7c5309 ("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>
Diffstat (limited to 'samples')
-rwxr-xr-x[-rw-r--r--]samples/bpf/lwt_len_hist.sh2
-rwxr-xr-x[-rw-r--r--]samples/bpf/test_lwt_bpf.sh0
2 files changed, 2 insertions, 0 deletions
diff --git a/samples/bpf/lwt_len_hist.sh b/samples/bpf/lwt_len_hist.sh
index 090b96eaf7f7..0eda9754f50b 100644..100755
--- a/samples/bpf/lwt_len_hist.sh
+++ b/samples/bpf/lwt_len_hist.sh
@@ -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
diff --git a/samples/bpf/test_lwt_bpf.sh b/samples/bpf/test_lwt_bpf.sh
index 65a976058dd3..65a976058dd3 100644..100755
--- a/samples/bpf/test_lwt_bpf.sh
+++ b/samples/bpf/test_lwt_bpf.sh