Audit tests count the total number of messages sent and compares with total number of CMSG received on error queue. Example: udp gso zerocopy timestamp audit udp rx: 1599 MB/s 1166414 calls/s udp tx: 1615 MB/s 27395 calls/s 27395 msg/s udp rx: 1634 MB/s 1192261 calls/s udp tx: 1633 MB/s 27699 calls/s 27699 msg/s udp rx: 1633 MB/s 1191358 calls/s udp tx: 1631 MB/s 27678 calls/s 27678 msg/s Summary over 4.000 seconds... sum udp tx: 1665 MB/s 82772 calls (27590/s) 82772 msgs (27590/s) Tx Timestamps: 82772 received 0 errors Zerocopy acks: 82772 received Errors are thrown if CMSG count does not equal send count, example: Summary over 4.000 seconds... sum tcp tx: 7451 MB/s 493706 calls (123426/s) 493706 msgs (123426/s) ./udpgso_bench_tx: Unexpected number of Zerocopy completions: 493706 expected 493704 received Also reduce individual test time from 4 to 3 seconds so that overall test time does not increase significantly. v3: Enhancements as per Willem de Bruijn <willemb@google.com> - document -P option for TCP audit Signed-off-by: Fred Klassen <fklassen@appneta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
92 lines
1.5 KiB
Bash
Executable File
92 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Run a series of udpgso benchmarks
|
|
|
|
wake_children() {
|
|
local -r jobs="$(jobs -p)"
|
|
|
|
if [[ "${jobs}" != "" ]]; then
|
|
kill -1 ${jobs} 2>/dev/null
|
|
fi
|
|
}
|
|
trap wake_children EXIT
|
|
|
|
run_one() {
|
|
local -r args=$@
|
|
|
|
./udpgso_bench_rx &
|
|
./udpgso_bench_rx -t &
|
|
|
|
./udpgso_bench_tx ${args}
|
|
}
|
|
|
|
run_in_netns() {
|
|
local -r args=$@
|
|
|
|
./in_netns.sh $0 __subprocess ${args}
|
|
}
|
|
|
|
run_udp() {
|
|
local -r args=$@
|
|
|
|
echo "udp"
|
|
run_in_netns ${args}
|
|
|
|
echo "udp gso"
|
|
run_in_netns ${args} -S 0
|
|
|
|
echo "udp gso zerocopy"
|
|
run_in_netns ${args} -S 0 -z
|
|
|
|
echo "udp gso timestamp"
|
|
run_in_netns ${args} -S 0 -T
|
|
|
|
echo "udp gso zerocopy audit"
|
|
run_in_netns ${args} -S 0 -z -a
|
|
|
|
echo "udp gso timestamp audit"
|
|
run_in_netns ${args} -S 0 -T -a
|
|
|
|
echo "udp gso zerocopy timestamp audit"
|
|
run_in_netns ${args} -S 0 -T -z -a
|
|
}
|
|
|
|
run_tcp() {
|
|
local -r args=$@
|
|
|
|
echo "tcp"
|
|
run_in_netns ${args} -t
|
|
|
|
echo "tcp zerocopy"
|
|
run_in_netns ${args} -t -z
|
|
|
|
# excluding for now because test fails intermittently
|
|
# add -P option to include poll() to reduce possibility of lost messages
|
|
#echo "tcp zerocopy audit"
|
|
#run_in_netns ${args} -t -z -P -a
|
|
}
|
|
|
|
run_all() {
|
|
local -r core_args="-l 3"
|
|
local -r ipv4_args="${core_args} -4 -D 127.0.0.1"
|
|
local -r ipv6_args="${core_args} -6 -D ::1"
|
|
|
|
echo "ipv4"
|
|
run_tcp "${ipv4_args}"
|
|
run_udp "${ipv4_args}"
|
|
|
|
echo "ipv6"
|
|
run_tcp "${ipv4_args}"
|
|
run_udp "${ipv6_args}"
|
|
}
|
|
|
|
if [[ $# -eq 0 ]]; then
|
|
run_all
|
|
elif [[ $1 == "__subprocess" ]]; then
|
|
shift
|
|
run_one $@
|
|
else
|
|
run_in_netns $@
|
|
fi
|