[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210208090530.5032-3-ciara.loftus@intel.com>
Date: Mon, 8 Feb 2021 09:05:26 +0000
From: Ciara Loftus <ciara.loftus@...el.com>
To: netdev@...r.kernel.org, bpf@...r.kernel.org,
magnus.karlsson@...el.com, bjorn@...nel.org,
weqaar.a.janjua@...el.com
Cc: daniel@...earbox.net, song@...nel.org,
Ciara Loftus <ciara.loftus@...el.com>
Subject: [PATCH bpf-next v5 2/6] selftests/bpf: restructure setting the packet count
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@...el.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
Powered by blists - more mailing lists