Skip to contentSkip to conversation

network: rename tcp_fastopen.c to netstress.c

PATCH New Alexey Kodanev 2 participants 5 messages Sep 27, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 network: rename tcp_fastopen.c to netstress.c

tcp_fastopen test used in various parts of network tests to run TCP/UDP network load. The more appropriate name would be netstress, as tcp_fastopen is very specific.

Move it to from 'tcp_fastopen' test directory (where tcp_fastopen_run.sh wrapper will be left untouched) to 'netstress' directory.

---
 testcases/network/netstress/.gitignore        |    1 +
 testcases/network/netstress/Makefile          |   22 +
 testcases/network/netstress/netstress.c       |  840 +++++++++++++++++++++++++
 testcases/network/tcp_fastopen/.gitignore     |    1 -
 testcases/network/tcp_fastopen/Makefile       |    3 +-
 testcases/network/tcp_fastopen/tcp_fastopen.c |  840 -------------------------
 6 files changed, 864 insertions(+), 843 deletions(-)
 create mode 100644 testcases/network/netstress/.gitignore
 create mode 100644 testcases/network/netstress/Makefile
 create mode 100644 testcases/network/netstress/netstress.c
 delete mode 100644 testcases/network/tcp_fastopen/.gitignore
 delete mode 100644 testcases/network/tcp_fastopen/tcp_fastopen.c
testcases/network/netstress/.gitignore new file +1 -0
new file mode 100644
index 0000000..587460f
@@ -0,0 +1 @@
+/netstress
testcases/network/netstress/Makefile new file +22 -0
new file mode 100644
index 0000000..0ada526
@@ -0,0 +1,22 @@
+# Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+top_srcdir		?= ../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+LDLIBS			+= -lpthread -lrt
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/network/netstress/netstress.c new file +840 -0

840 lines not on this page · raw message

testcases/network/tcp_fastopen/.gitignore deleted +0 -1
deleted file mode 100644
index f321cf0..0000000
@@ -1 +0,0 @@
-/tcp_fastopen
testcases/network/tcp_fastopen/Makefile +1 -2
index aa60bb0..68c8c44 100644
@@ -1,4 +1,4 @@
-# Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) 2014-2016 Oracle and/or its affiliates. All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -19,6 +19,5 @@ top_srcdir		?= ../../..
 include $(top_srcdir)/include/mk/testcases.mk
 
 INSTALL_TARGETS		:= tcp_fastopen_run.sh
-LDLIBS			+= -lpthread -lrt
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/network/tcp_fastopen/tcp_fastopen.c deleted +0 -840

840 lines not on this page · raw message

Signature · 1 line
1.7.1
#1 lore raw

PATCH 2/3 network: update tests with new name: tcp_fastopen -> netstress

---
 testcases/network/busy_poll/busy_poll01.sh         |    2 +-
 testcases/network/busy_poll/busy_poll02.sh         |    2 +-
 testcases/network/busy_poll/busy_poll03.sh         |    2 +-
 testcases/network/stress/interface/if-addr-adddel  |    2 +-
 .../network/stress/interface/if-addr-addlarge      |    2 +-
 testcases/network/stress/interface/if-lib.sh       |    8 ++++----
 testcases/network/stress/interface/if-mtu-change   |    2 +-
 testcases/network/stress/interface/if-route-adddel |    2 +-
 .../network/stress/interface/if-route-addlarge     |    2 +-
 testcases/network/stress/ssh/ssh-stress            |    4 ++--
 testcases/network/stress/ssh/ssh-stress03-rmt      |    2 +-
 testcases/network/tcp_fastopen/tcp_fastopen_run.sh |    8 ++++----
 testcases/network/virt/gre01.sh                    |    8 ++++----
 testcases/network/virt/virt_lib.sh                 |    2 +-
 testcases/network/virt/vlan03.sh                   |    8 ++++----
 testcases/network/virt/vxlan03.sh                  |    8 ++++----
 16 files changed, 32 insertions(+), 32 deletions(-)
testcases/network/busy_poll/busy_poll01.sh +1 -1
index 2d48339..8faa569 100755
@@ -31,7 +31,7 @@ max_requests=500000
 
 cleanup()
 {
-	tst_rhost_run -c "pkill -9 tcp_fastopen\$"
+	tst_rhost_run -c "pkill -9 netstress\$"
 	tst_rmdir
 
 	sysctl -q -w net.core.busy_read=$busy_read_old
testcases/network/busy_poll/busy_poll02.sh +1 -1
index 40dff7e..cd69ed2 100755
@@ -31,7 +31,7 @@ max_requests=500000
 
 cleanup()
 {
-	tst_rhost_run -c "pkill -9 tcp_fastopen\$"
+	tst_rhost_run -c "pkill -9 netstress\$"
 	tst_rmdir
 
 	sysctl -q -w net.core.busy_poll=$busy_poll_old
testcases/network/busy_poll/busy_poll03.sh +1 -1
index 6102e98..7e405ee 100755
@@ -25,7 +25,7 @@ TCID="busy_poll03"
 
 cleanup()
 {
-	tst_rhost_run -c "pkill -9 tcp_fastopen\$"
+	tst_rhost_run -c "pkill -9 netstress\$"
 	tst_rmdir
 
 	sysctl -q -w net.core.busy_poll=$busy_poll_old
testcases/network/stress/interface/if-addr-adddel +1 -1
index 5a88b2f..0a069ef 100644
@@ -83,7 +83,7 @@ test_body()
 		cnt=$(($cnt + 1))
 
 		# Check the background TCP traffic
-		pgrep -x tcp_fastopen > /dev/null || make_background_tcp_traffic
+		pgrep -x netstress > /dev/null || make_background_tcp_traffic
 
 		case $cmd_type in
 		if_cmd)
testcases/network/stress/interface/if-addr-addlarge +1 -1
index f90be73..a6b841d 100644
@@ -96,7 +96,7 @@ test_body()
 		check_connectivity $cnt || return
 
 		# Check the background TCP traffic
-		pgrep -x tcp_fastopen > /dev/null || make_background_tcp_traffic
+		pgrep -x netstress > /dev/null || make_background_tcp_traffic
 
 		case $cmd_type in
 		if_cmd)
testcases/network/stress/interface/if-lib.sh +4 -4
index 6d7bb0d..363c18d 100644
@@ -35,16 +35,16 @@ setup()
 cleanup()
 {
 	# Stop the background TCP traffic
-	pkill -13 -x tcp_fastopen
-	tst_rhost_run -c "pkill -13 -x tcp_fastopen"
+	pkill -13 -x netstress
+	tst_rhost_run -c "pkill -13 -x netstress"
 	tst_restore_ipaddr
 }
 
 make_background_tcp_traffic()
 {
 	port=$(tst_get_unused_port ipv${ipver} stream)
-	tcp_fastopen -R 3 -g $port > /dev/null 2>&1 &
-	tst_rhost_run -b -c "tcp_fastopen -l -H $(tst_ipaddr) -g $port"
+	netstress -R 3 -g $port > /dev/null 2>&1 &
+	tst_rhost_run -b -c "netstress -l -H $(tst_ipaddr) -g $port"
 }
 
 check_connectivity()
testcases/network/stress/interface/if-mtu-change +1 -1
index 06411f5..6c6ac25 100644
@@ -75,7 +75,7 @@ test_body()
 		check_connectivity $cnt || return
 
 		# Check the background TCP traffic
-		pgrep -x tcp_fastopen > /dev/null || make_background_tcp_traffic
+		pgrep -x netstress > /dev/null || make_background_tcp_traffic
 	done
 
 	tst_resm TINFO "check connectivity through $iface"
testcases/network/stress/interface/if-route-adddel +1 -1
index a9e999f..ac15b5e 100644
@@ -79,7 +79,7 @@ test_body()
 		check_connectivity $cnt || return
 
 		# Check the background TCP traffic
-		pgrep -x tcp_fastopen > /dev/null || make_background_tcp_traffic
+		pgrep -x netstress > /dev/null || make_background_tcp_traffic
 
 		cnt=$(($cnt + 1))
 	done
testcases/network/stress/interface/if-route-addlarge +1 -1
index 8f177f8..43a0599 100644
@@ -87,7 +87,7 @@ test_body()
 		check_connectivity $cnt || return
 
 		# Check the background TCP traffic
-		pgrep -x tcp_fastopen > /dev/null || make_background_tcp_traffic
+		pgrep -x netstress > /dev/null || make_background_tcp_traffic
 
 		cnt=$(($cnt + 1))
 		y=$(($y + 1))
testcases/network/stress/ssh/ssh-stress +2 -2
index 7960627..3fdb5c2 100644
@@ -34,7 +34,7 @@ cleanup()
 {
 	# Stop the ssh daemon
 	test -s sshd.pid && kill $(cat sshd.pid)
-	pkill 'tcp_fastopen$'
+	pkill 'netstress$'
 	tst_rmdir
 	[ "$rtmpdir" ] && tst_rhost_run -c "rm -rf $rtmpdir"
 	TMPDIR=
@@ -131,7 +131,7 @@ test03()
 	# Run a TCP traffic server
 	port=$(tst_get_unused_port ipv${ipver} stream)
 
-	tcp_fastopen -R 3 -g $port > tcp_server.log 2>&1 &
+	netstress -R 3 -g $port > tcp_server.log 2>&1 &
 
 	tst_rhost_run -s -c "ssh-stress03-rmt $ipver $(tst_ipaddr) \
 		$rconfig $port $NS_TIMES"
testcases/network/stress/ssh/ssh-stress03-rmt +1 -1
index a5b7af0..44077ec 100644
@@ -57,7 +57,7 @@ case $ip_ver in
 esac
 
 # Start the TCP traffic clients
-tcp_fastopen -r $requests -l -H $localhost -g $lport > /dev/null
+netstress -r $requests -l -H $localhost -g $lport > /dev/null
 ret=$?
 
 # Stop the ssh port forwarding
testcases/network/tcp_fastopen/tcp_fastopen_run.sh +4 -4
index 45bc742..d9dc400 100755
@@ -61,7 +61,7 @@ done
 cleanup()
 {
 	tst_resm TINFO "cleanup..."
-	tst_rhost_run -c "pkill -9 tcp_fastopen\$"
+	tst_rhost_run -c "pkill -9 netstress\$"
 	rm -f $tfo_result
 }
 
@@ -84,17 +84,17 @@ read_result_file()
 run_client_server()
 {
 	# kill tcp server on remote machine
-	tst_rhost_run -c "pkill -9 tcp_fastopen\$"
+	tst_rhost_run -c "pkill -9 netstress\$"
 
 	port=$(tst_rhost_run -c "tst_get_unused_port ipv6 stream")
 	[ $? -ne 0 ] && tst_brkm TBROK "failed to get unused port"
 
 	# run tcp server on remote machine
-	tst_rhost_run -s -b -c "tcp_fastopen -R $max_requests $1 -g $port"
+	tst_rhost_run -s -b -c "netstress -R $max_requests $1 -g $port"
 	sleep $bind_timeout
 
 	# run local tcp client
-	tcp_fastopen -a $clients_num -r $client_requests -l \
+	netstress -a $clients_num -r $client_requests -l \
 		-H $(tst_ipaddr rhost) $1 -g $port -d $tfo_result
 	[ "$?" -ne 0 ] && tst_brkm TBROK "Last test has failed"
 
testcases/network/virt/gre01.sh +4 -4
index f43d4e2..6aecbeb 100755
@@ -18,7 +18,7 @@
 #
 # It requires remote host. Test will setup IPv4 and IPv6 virtual
 # tunnel between two hosts, then will compare TCP performance
-# with and without GRE using ping or tcp_fastopen test.
+# with and without GRE using ping or netstress test.
 
 TCID=gre01
 TST_TOTAL=1
@@ -35,14 +35,14 @@ cleanup()
 	cleanup_vifaces
 	tst_rhost_run -c "ip link delete ltp_v0 2>/dev/null"
 	if [ "$net_load" = "TFO" ]; then
-		tst_rhost_run -c "pkill -9 tcp_fastopen\$"
-		pkill -9 "tcp_fastopen\$"
+		tst_rhost_run -c "pkill -9 netstress\$"
+		pkill -9 "netstress\$"
 	fi
 }
 TST_CLEANUP="cleanup"
 
 if [ "$net_load" = "TFO" ]; then
-	tst_check_cmds "tcp_fastopen"
+	tst_check_cmds "netstress"
 fi
 
 if [ -z $ip_local -o -z $ip_remote ]; then
testcases/network/virt/virt_lib.sh +1 -1
index 2246d0d..ee6488c 100644
@@ -60,7 +60,7 @@ while getopts :hsx:i:r:c:R:p:n:l:t:d:6 opt; do
 		echo "R n      num of reqs, after which conn.closed in TCP perf"
 		echo "p x      x and x + 1 are ports in TCP perf"
 		echo "n x      virtual network 192.168.x"
-		echo "l x      network load: x is PING or TFO(tcp_fastopen)"
+		echo "l x      network load: x is PING or TFO(netstress)"
 		echo "t x      performance threshold, default is 60%"
 		echo "d x      VxLAN destination address, 'uni' or 'multi'"
 		echo "6        run over IPv6"
testcases/network/virt/vlan03.sh +4 -4
index b0577ae..894d214 100755
@@ -18,7 +18,7 @@
 #
 # Test-case 1: It requires remote host. Test will setup IPv4 and IPv6 virtual
 #              sub-nets between two hosts, then will compare TCP performance
-#              with and without VLAN using ping or tcp_fastopen test.
+#              with and without VLAN using ping or netstress test.
 #
 # Test-case 2: The same as above but must fail, because VLAN allows
 #              to communicate only within the same VLAN segment.
@@ -36,14 +36,14 @@ cleanup()
 	cleanup_vifaces
 	tst_rhost_run -c "ip link delete ltp_v0 2>/dev/null"
 	if [ "$net_load" = "TFO" ]; then
-		tst_rhost_run -c "pkill -9 tcp_fastopen\$"
-		pkill -9 "tcp_fastopen\$"
+		tst_rhost_run -c "pkill -9 netstress\$"
+		pkill -9 "netstress\$"
 	fi
 }
 TST_CLEANUP="cleanup"
 
 if [ "$net_load" = "TFO" ]; then
-	tst_check_cmds "tcp_fastopen"
+	tst_check_cmds "netstress"
 fi
 
 if [ -z $ip_local -o -z $ip_remote ]; then
testcases/network/virt/vxlan03.sh +4 -4
index 055dfee..191576e 100755
@@ -18,7 +18,7 @@
 #
 # Test-case 1: It requires remote host. Test will setup IPv4 and IPv6 virtual
 #              sub-nets between two hosts, then will compare TCP performance
-#              with and without VxLAN using ping or tcp_fastopen test.
+#              with and without VxLAN using ping or netstress test.
 #
 # Test-case 2: The same as above but must fail, because VXLAN allows
 #              to communicate only within the same VXLAN segment.
@@ -47,14 +47,14 @@ cleanup()
 	cleanup_vifaces
 	tst_rhost_run -c "ip link delete ltp_v0 2>/dev/null"
 	if [ "$net_load" = "TFO" ]; then
-		tst_rhost_run -c "pkill -9 tcp_fastopen\$"
-		pkill -9 "tcp_fastopen\$"
+		tst_rhost_run -c "pkill -9 netstress\$"
+		pkill -9 "netstress\$"
 	fi
 }
 TST_CLEANUP="cleanup"
 
 if [ "$net_load" = "TFO" ]; then
-	tst_check_cmds "tcp_fastopen"
+	tst_check_cmds "netstress"
 fi
 
 if [ -z $ip_local -o -z $ip_remote ]; then
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/3 network: update tests with new name: tcp_fastopen -> netstress

Hi!
This patch should probably be merged with the previous one so that the rename done in single patch. Otherwise it's fine.

Signature · 2 lines
Cyril Hrubis
[email protected]
#3 lore raw

PATCH 2/3 network: update tests with new name: tcp_fastopen -> netstress

Hi,

Quoted 3 lines · Cyril Hrubis

Hi!
This patch should probably be merged with the previous one so that the rename done in single patch. Otherwise it's fine.

Merged this patch into previous one and pushed.

Thanks,
Alexey

#4 lore raw

PATCH 3/3 network/netsress: increase internal message buffer size to 2^16 - 1

In reply to Alexey Kodanev

Allow to pass larger buffer to sendto()/recvfrom(). netstress's protocol already supports setting such size as it has 16 bit field for message size parameter.

---
 testcases/network/netstress/netstress.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
testcases/network/netstress/netstress.c +1 -1
index 4d7ffcc..26fd217 100644
@@ -36,7 +36,7 @@
 
 char *TCID = "netstress";
 
-static const int max_msg_len = 1500;
+static const int max_msg_len = (1 << 16) - 1;
 
 /* TCP server requiers */
 #ifndef TCP_FASTOPEN
Signature · 1 line
1.7.1