netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel T. Lee" <danieltimlee@gmail.com>
To: "Daniel Borkmann" <daniel@iogearbox.net>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Andrii Nakryiko" <andrii@kernel.org>, brakmo <brakmo@fb.com>,
	"Jesper Dangaard Brouer" <brouer@redhat.com>,
	"Andrii Nakryiko" <andrii.nakryiko@gmail.com>,
	"Lorenzo Bianconi" <lorenzo@kernel.org>,
	"David Ahern" <dsa@cumulusnetworks.com>,
	"Yonghong Song" <yhs@fb.com>,
	"Toke Høiland-Jørgensen" <toke@redhat.com>,
	"Ira Weiny" <ira.weiny@intel.com>, "Thomas Graf" <tgraf@suug.ch>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Martin KaFai Lau" <kafai@fb.com>,
	"John Fastabend" <john.fastabend@gmail.com>
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org,
	Xdp <xdp-newbies@vger.kernel.org>
Subject: [PATCH bpf-next v2 6/7] samples: bpf: fix lwt_len_hist reusing previous BPF map
Date: Thu, 19 Nov 2020 15:06:16 +0000	[thread overview]
Message-ID: <20201119150617.92010-7-danieltimlee@gmail.com> (raw)
In-Reply-To: <20201119150617.92010-1-danieltimlee@gmail.com>

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>
---
 samples/bpf/lwt_len_hist.sh | 2 ++
 samples/bpf/test_lwt_bpf.sh | 0
 2 files changed, 2 insertions(+)
 mode change 100644 => 100755 samples/bpf/lwt_len_hist.sh
 mode change 100644 => 100755 samples/bpf/test_lwt_bpf.sh

diff --git a/samples/bpf/lwt_len_hist.sh b/samples/bpf/lwt_len_hist.sh
old mode 100644
new mode 100755
index 090b96eaf7f7..0eda9754f50b
--- 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
old mode 100644
new mode 100755
-- 
2.25.1


  parent reply	other threads:[~2020-11-19 15:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-19 15:06 [PATCH bpf-next v2 0/7] bpf: remove bpf_load loader completely Daniel T. Lee
2020-11-19 15:06 ` [PATCH bpf-next v2 1/7] samples: bpf: refactor hbm program with libbpf Daniel T. Lee
2020-11-21  2:34   ` Martin KaFai Lau
2020-11-21  2:42     ` Martin KaFai Lau
2020-11-24  8:50     ` Daniel T. Lee
2020-11-19 15:06 ` [PATCH bpf-next v2 2/7] samples: bpf: refactor test_cgrp2_sock2 " Daniel T. Lee
2020-11-19 15:06 ` [PATCH bpf-next v2 3/7] samples: bpf: refactor task_fd_query " Daniel T. Lee
2020-11-19 15:06 ` [PATCH bpf-next v2 4/7] samples: bpf: refactor ibumad " Daniel T. Lee
2020-11-19 15:06 ` [PATCH bpf-next v2 5/7] samples: bpf: refactor test_overhead " Daniel T. Lee
2020-11-19 15:06 ` Daniel T. Lee [this message]
2020-11-19 15:06 ` [PATCH bpf-next v2 7/7] samples: bpf: remove bpf_load loader completely Daniel T. Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201119150617.92010-7-danieltimlee@gmail.com \
    --to=danieltimlee@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brakmo@fb.com \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=ira.weiny@intel.com \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kuba@kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    --cc=toke@redhat.com \
    --cc=xdp-newbies@vger.kernel.org \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).