From: Ciara Loftus <ciara.loftus@intel.com>
To: netdev@vger.kernel.org, bpf@vger.kernel.org,
magnus.karlsson@intel.com, bjorn@kernel.org,
weqaar.a.janjua@intel.com
Cc: daniel@iogearbox.net, song@kernel.org,
Ciara Loftus <ciara.loftus@intel.com>
Subject: [PATCH bpf-next v5 2/6] selftests/bpf: restructure setting the packet count
Date: Mon, 8 Feb 2021 09:05:26 +0000 [thread overview]
Message-ID: <20210208090530.5032-3-ciara.loftus@intel.com> (raw)
In-Reply-To: <20210208090530.5032-1-ciara.loftus@intel.com>
Prior to this, the packet count was fixed at 10000 for every test.
Future tracing tests need to modify the count in order to ensure
the trace buffer does not become full. So, make it possible to set
the count from test_xsk.h using the -C opt.
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
tools/testing/selftests/bpf/test_xsk.sh | 17 +++++++++--------
tools/testing/selftests/bpf/xsk_prereqs.sh | 3 +--
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_xsk.sh b/tools/testing/selftests/bpf/test_xsk.sh
index 88a7483eaae4..2b4a4f42b220 100755
--- a/tools/testing/selftests/bpf/test_xsk.sh
+++ b/tools/testing/selftests/bpf/test_xsk.sh
@@ -82,6 +82,7 @@ do
done
TEST_NAME="PREREQUISITES"
+DEFAULTPKTS=10000
URANDOM=/dev/urandom
[ ! -e "${URANDOM}" ] && { echo "${URANDOM} not found. Skipping tests."; test_exit 1 1; }
@@ -154,7 +155,7 @@ TEST_NAME="SKB NOPOLL"
vethXDPgeneric ${VETH0} ${VETH1} ${NS1}
-params=("-S")
+params=("-S" "-C" "${DEFAULTPKTS}")
execxdpxceiver params
retval=$?
@@ -166,7 +167,7 @@ TEST_NAME="SKB POLL"
vethXDPgeneric ${VETH0} ${VETH1} ${NS1}
-params=("-S" "-p")
+params=("-S" "-p" "-C" "${DEFAULTPKTS}")
execxdpxceiver params
retval=$?
@@ -178,7 +179,7 @@ TEST_NAME="DRV NOPOLL"
vethXDPnative ${VETH0} ${VETH1} ${NS1}
-params=("-N")
+params=("-N" "-C" "${DEFAULTPKTS}")
execxdpxceiver params
retval=$?
@@ -190,7 +191,7 @@ TEST_NAME="DRV POLL"
vethXDPnative ${VETH0} ${VETH1} ${NS1}
-params=("-N" "-p")
+params=("-N" "-p" "-C" "${DEFAULTPKTS}")
execxdpxceiver params
retval=$?
@@ -202,7 +203,7 @@ TEST_NAME="SKB SOCKET TEARDOWN"
vethXDPgeneric ${VETH0} ${VETH1} ${NS1}
-params=("-S" "-T")
+params=("-S" "-T" "-C" "${DEFAULTPKTS}")
execxdpxceiver params
retval=$?
@@ -214,7 +215,7 @@ TEST_NAME="DRV SOCKET TEARDOWN"
vethXDPnative ${VETH0} ${VETH1} ${NS1}
-params=("-N" "-T")
+params=("-N" "-T" "-C" "${DEFAULTPKTS}")
execxdpxceiver params
retval=$?
@@ -226,7 +227,7 @@ TEST_NAME="SKB BIDIRECTIONAL SOCKETS"
vethXDPgeneric ${VETH0} ${VETH1} ${NS1}
-params=("-S" "-B")
+params=("-S" "-B" "-C" "${DEFAULTPKTS}")
execxdpxceiver params
retval=$?
@@ -238,7 +239,7 @@ TEST_NAME="DRV BIDIRECTIONAL SOCKETS"
vethXDPnative ${VETH0} ${VETH1} ${NS1}
-params=("-N" "-B")
+params=("-N" "-B" "-C" "${DEFAULTPKTS}")
execxdpxceiver params
retval=$?
diff --git a/tools/testing/selftests/bpf/xsk_prereqs.sh b/tools/testing/selftests/bpf/xsk_prereqs.sh
index 9d54c4645127..41dd713d14df 100755
--- a/tools/testing/selftests/bpf/xsk_prereqs.sh
+++ b/tools/testing/selftests/bpf/xsk_prereqs.sh
@@ -15,7 +15,6 @@ NC='\033[0m'
STACK_LIM=131072
SPECFILE=veth.spec
XSKOBJ=xdpxceiver
-NUMPKTS=10000
validate_root_exec()
{
@@ -131,5 +130,5 @@ execxdpxceiver()
copy[$index]=${!current}
done
- ./${XSKOBJ} -i ${VETH0} -i ${VETH1},${NS1} ${copy[*]} -C ${NUMPKTS}
+ ./${XSKOBJ} -i ${VETH0} -i ${VETH1},${NS1} ${copy[*]}
}
--
2.17.1
next prev parent reply other threads:[~2021-02-08 9:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-08 9:05 [PATCH bpf-next v5 0/6] AF_XDP Packet Drop Tracing Ciara Loftus
2021-02-08 9:05 ` [PATCH bpf-next v5 1/6] xsk: add tracepoints for packet drops Ciara Loftus
2021-02-08 9:05 ` Ciara Loftus [this message]
2021-02-08 9:05 ` [PATCH bpf-next v5 3/6] selftests/bpf: add framework for xsk selftests Ciara Loftus
2021-02-08 9:05 ` [PATCH bpf-next v5 4/6] selftests/bpf: XSK_TRACE_DROP_PKT_TOO_BIG test Ciara Loftus
2021-02-08 9:05 ` [PATCH bpf-next v5 5/6] selftests/bpf: XSK_TRACE_INVALID_FILLADDR test Ciara Loftus
2021-02-08 9:05 ` [PATCH bpf-next v5 6/6] selftests/bpf: XSK_TRACE_INVALID_DESC_TX test Ciara Loftus
2021-02-11 8:03 ` [PATCH bpf-next v5 0/6] AF_XDP Packet Drop Tracing Magnus Karlsson
2021-02-11 8:18 ` Loftus, Ciara
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=20210208090530.5032-3-ciara.loftus@intel.com \
--to=ciara.loftus@intel.com \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=song@kernel.org \
--cc=weqaar.a.janjua@intel.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).