Skip to content

Commit f97252a

Browse files
committed
Merge branch 'UDP-GSO-audit-tests'
Fred Klassen says: ==================== UDP GSO audit tests Updates to UDP GSO selftests ot optionally stress test CMSG subsytem, and report the reliability and performance of both TX Timestamping and ZEROCOPY messages. ==================== Acked-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 4bd366c + 4ffc37f commit f97252a

File tree

2 files changed

+327
-16
lines changed

2 files changed

+327
-16
lines changed

tools/testing/selftests/net/udpgso_bench.sh

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
#
44
# Run a series of udpgso benchmarks
55

6+
GREEN='\033[0;92m'
7+
RED='\033[0;31m'
8+
NC='\033[0m' # No Color
9+
610
wake_children() {
711
local -r jobs="$(jobs -p)"
812

@@ -29,43 +33,89 @@ run_in_netns() {
2933

3034
run_udp() {
3135
local -r args=$@
36+
local errors=0
3237

3338
echo "udp"
3439
run_in_netns ${args}
40+
errors=$(( $errors + $? ))
3541

3642
echo "udp gso"
3743
run_in_netns ${args} -S 0
44+
errors=$(( $errors + $? ))
3845

3946
echo "udp gso zerocopy"
4047
run_in_netns ${args} -S 0 -z
48+
errors=$(( $errors + $? ))
49+
50+
echo "udp gso timestamp"
51+
run_in_netns ${args} -S 0 -T
52+
errors=$(( $errors + $? ))
53+
54+
echo "udp gso zerocopy audit"
55+
run_in_netns ${args} -S 0 -z -a
56+
errors=$(( $errors + $? ))
57+
58+
echo "udp gso timestamp audit"
59+
run_in_netns ${args} -S 0 -T -a
60+
errors=$(( $errors + $? ))
61+
62+
echo "udp gso zerocopy timestamp audit"
63+
run_in_netns ${args} -S 0 -T -z -a
64+
errors=$(( $errors + $? ))
65+
66+
return $errors
4167
}
4268

4369
run_tcp() {
4470
local -r args=$@
71+
local errors=0
4572

4673
echo "tcp"
4774
run_in_netns ${args} -t
75+
errors=$(( $errors + $? ))
4876

4977
echo "tcp zerocopy"
5078
run_in_netns ${args} -t -z
79+
errors=$(( $errors + $? ))
80+
81+
# excluding for now because test fails intermittently
82+
# add -P option to include poll() to reduce possibility of lost messages
83+
#echo "tcp zerocopy audit"
84+
#run_in_netns ${args} -t -z -P -a
85+
#errors=$(( $errors + $? ))
86+
87+
return $errors
5188
}
5289

5390
run_all() {
54-
local -r core_args="-l 4"
91+
local -r core_args="-l 3"
5592
local -r ipv4_args="${core_args} -4 -D 127.0.0.1"
5693
local -r ipv6_args="${core_args} -6 -D ::1"
94+
local errors=0
5795

5896
echo "ipv4"
5997
run_tcp "${ipv4_args}"
98+
errors=$(( $errors + $? ))
6099
run_udp "${ipv4_args}"
100+
errors=$(( $errors + $? ))
61101

62102
echo "ipv6"
63103
run_tcp "${ipv4_args}"
104+
errors=$(( $errors + $? ))
64105
run_udp "${ipv6_args}"
106+
errors=$(( $errors + $? ))
107+
108+
return $errors
65109
}
66110

67111
if [[ $# -eq 0 ]]; then
68112
run_all
113+
if [ $? -ne 0 ]; then
114+
echo -e "$(basename $0): ${RED}FAIL${NC}"
115+
exit 1
116+
fi
117+
118+
echo -e "$(basename $0): ${GREEN}PASS${NC}"
69119
elif [[ $1 == "__subprocess" ]]; then
70120
shift
71121
run_one $@

0 commit comments

Comments
 (0)