* [LTP] [PATCH 1/6] network/sctp: use TST_NETLOAD_* parameters
@ 2017-11-28 13:08 Alexey Kodanev
2017-11-28 13:08 ` [LTP] [PATCH 2/6] network/virt_lib: " Alexey Kodanev
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Alexey Kodanev @ 2017-11-28 13:08 UTC (permalink / raw)
To: ltp
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/sctp/sctp01.sh | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/testcases/network/sctp/sctp01.sh b/testcases/network/sctp/sctp01.sh
index 68a872a..197c819 100755
--- a/testcases/network/sctp/sctp01.sh
+++ b/testcases/network/sctp/sctp01.sh
@@ -31,16 +31,17 @@ cleanup()
setup()
{
tst_require_root
+ TST_NETLOAD_MAX_SRV_REPLIES=3
}
test_run()
{
tst_resm TINFO "compare TCP/SCTP performance"
- tst_netload -H $(tst_ipaddr rhost) -a 3 -R 3 -T tcp
+ tst_netload -H $(tst_ipaddr rhost) -T tcp
local res0="$(cat tst_netload.res)"
- tst_netload -H $(tst_ipaddr rhost) -a 3 -R 3 -T sctp
+ tst_netload -H $(tst_ipaddr rhost) -T sctp
local res1="$(cat tst_netload.res)"
local per=$(( $res0 * 100 / $res1 - 100 ))
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [LTP] [PATCH 2/6] network/virt_lib: use TST_NETLOAD_* parameters
2017-11-28 13:08 [LTP] [PATCH 1/6] network/sctp: use TST_NETLOAD_* parameters Alexey Kodanev
@ 2017-11-28 13:08 ` Alexey Kodanev
2017-11-28 13:08 ` [LTP] [PATCH 3/6] netstress: support setting local source address Alexey Kodanev
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Alexey Kodanev @ 2017-11-28 13:08 UTC (permalink / raw)
To: ltp
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/virt/virt_lib.sh | 37 ++++++-----------------------------
1 files changed, 7 insertions(+), 30 deletions(-)
diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh
index bbac0dd..ae0b2fd 100644
--- a/testcases/network/virt/virt_lib.sh
+++ b/testcases/network/virt/virt_lib.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (c) 2014-2016 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) 2014-2017 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
@@ -40,38 +40,17 @@ ip6_virt_remote="$(TST_IPV6=6 tst_ipaddr_un rhost)"
VIRT_PERF_THRESHOLD=${VIRT_PERF_THRESHOLD:-80}
vxlan_dstport=0
-clients_num=2
-client_requests=500000
-max_requests=20
-
-while getopts :hsi:r:c:R:p:n:t:d:6 opt; do
+while getopts :hi:d:6 opt; do
case "$opt" in
h)
echo "Usage:"
echo "h help"
- echo "s use ssh to run remote cmds"
echo "i n start ID to use"
- echo "r n client requests for TCP performance test"
- echo "c n clients run concurrently in TCP perf"
- 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 "t x performance threshold, default is 60%"
echo "d x VxLAN destination address, 'uni' or 'multi'"
echo "6 run over IPv6"
exit 0
;;
- s) TST_USE_SSH=1 ;;
i) start_id=$OPTARG ;;
- c) clients_num=$OPTARG ;;
- r) client_requests=$OPTARG ;;
- R) max_requests=$OPTARG ;;
- p) srv_port=$OPTARG ;;
- n)
- ip_virt_local="192.168.${OPTARG}.1"
- ip_virt_remote="192.168.${OPTARG}.2"
- ;;
- t) VIRT_PERF_THRESHOLD=$OPTARG ;;
d) vxlan_dst_addr=$OPTARG ;;
6) # skip, test_net library already processed it
;;
@@ -261,20 +240,18 @@ virt_compare_netperf()
local expect_res="${1:-pass}"
local opts="$2"
- tst_netload -H $ip_virt_remote -a $clients_num -R $max_requests $opts \
- -r $client_requests -d res_ipv4 -e $expect_res || ret1="fail"
+ tst_netload -H $ip_virt_remote $opts -d res_ipv4 -e $expect_res || \
+ ret1="fail"
- tst_netload -H ${ip6_virt_remote} -a $clients_num $opts \
- -R $max_requests -r $client_requests -d res_ipv6 \
- -e $expect_res || ret2="fail"
+ tst_netload -H ${ip6_virt_remote} $opts -d res_ipv6 -e $expect_res || \
+ ret2="fail"
[ "$ret1" = "fail" -o "$ret2" = "fail" ] && return
local vt="$(cat res_ipv4)"
local vt6="$(cat res_ipv6)"
- tst_netload -H $ip_remote -a $clients_num -R $max_requests $opts \
- -r $client_requests -d res_ipv4
+ tst_netload -H $ip_remote $opts -d res_ipv4
local lt="$(cat res_ipv4)"
tst_resm TINFO "time lan($lt) $virt_type IPv4($vt) and IPv6($vt6) ms"
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [LTP] [PATCH 3/6] netstress: support setting local source address
2017-11-28 13:08 [LTP] [PATCH 1/6] network/sctp: use TST_NETLOAD_* parameters Alexey Kodanev
2017-11-28 13:08 ` [LTP] [PATCH 2/6] network/virt_lib: " Alexey Kodanev
@ 2017-11-28 13:08 ` Alexey Kodanev
2017-11-28 13:08 ` [LTP] [PATCH 4/6] tst_netload: support -S and -A netstress options Alexey Kodanev
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Alexey Kodanev @ 2017-11-28 13:08 UTC (permalink / raw)
To: ltp
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/netstress/netstress.c | 41 ++++++++++++++++++++++---------
1 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/testcases/network/netstress/netstress.c b/testcases/network/netstress/netstress.c
index 5d7c657..41d5952 100644
--- a/testcases/network/netstress/netstress.c
+++ b/testcases/network/netstress/netstress.c
@@ -33,6 +33,7 @@
#include <errno.h>
#include "lapi/posix_clocks.h"
+#include "tst_safe_stdio.h"
#include "tst_safe_pthread.h"
#include "tst_test.h"
@@ -108,6 +109,7 @@ static int client_max_requests = 10;
static int clients_num;
static char *tcp_port = "61000";
static char *server_addr = "localhost";
+static char *source_addr;
static int busy_poll = -1;
static int max_etime_cnt = 12; /* ~30 sec max timeout if no connection */
@@ -278,6 +280,10 @@ static int client_connect_send(const char *msg, int size)
SAFE_SENDTO(1, cfd, msg, size, MSG_FASTOPEN | MSG_NOSIGNAL,
remote_addrinfo->ai_addr, remote_addrinfo->ai_addrlen);
} else {
+ if (local_addrinfo) {
+ SAFE_BIND(cfd, local_addrinfo->ai_addr,
+ local_addrinfo->ai_addrlen);
+ }
/* old TCP API */
SAFE_CONNECT(cfd, remote_addrinfo->ai_addr,
remote_addrinfo->ai_addrlen);
@@ -390,6 +396,19 @@ static int parse_client_request(const char *msg)
static struct timespec tv_client_start;
static struct timespec tv_client_end;
+static void setup_addrinfo(const char *src_addr, const char *port,
+ const struct addrinfo *hints,
+ struct addrinfo **addr_info)
+{
+ int err = getaddrinfo(src_addr, port, hints, addr_info);
+
+ if (err)
+ tst_brk(TBROK, "getaddrinfo failed, %s", gai_strerror(err));
+
+ if (!*addr_info)
+ tst_brk(TBROK, "failed to get the address");
+}
+
static void client_init(void)
{
if (clients_num >= MAX_THREADS) {
@@ -406,11 +425,9 @@ static void client_init(void)
hints.ai_flags = 0;
hints.ai_protocol = 0;
- int err = getaddrinfo(server_addr, tcp_port, &hints, &remote_addrinfo);
- if (err) {
- tst_brk(TBROK, "getaddrinfo of '%s' failed, %s",
- server_addr, gai_strerror(err));
- }
+ if (source_addr)
+ setup_addrinfo(source_addr, NULL, &hints, &local_addrinfo);
+ setup_addrinfo(server_addr, tcp_port, &hints, &remote_addrinfo);
tst_res(TINFO, "Running the test over IPv%s",
(remote_addrinfo->ai_family == AF_INET6) ? "6" : "4");
@@ -570,6 +587,7 @@ static pthread_t server_thread_add(intptr_t client_fd)
static void server_init(void)
{
+ char *src_addr = NULL;
struct addrinfo hints;
memset(&hints, 0, sizeof(struct addrinfo));
@@ -577,13 +595,11 @@ static void server_init(void)
hints.ai_socktype = sock_type;
hints.ai_flags = AI_PASSIVE;
- int err = getaddrinfo(NULL, tcp_port, &hints, &local_addrinfo);
-
- if (err)
- tst_brk(TBROK, "getaddrinfo failed, %s", gai_strerror(err));
-
- if (!local_addrinfo)
- tst_brk(TBROK, "failed to get the address");
+ if (source_addr && !strchr(source_addr, ':'))
+ SAFE_ASPRINTF(&src_addr, "::ffff:%s", source_addr);
+ setup_addrinfo(src_addr ? src_addr : source_addr, tcp_port,
+ &hints, &local_addrinfo);
+ free(src_addr);
/* IPv6 socket is also able to access IPv4 protocol stack */
sfd = SAFE_SOCKET(family, sock_type, protocol);
@@ -842,6 +858,7 @@ static struct tst_option options[] = {
"-F TCP_FASTOPEN_CONNECT socket option and standard API"},
{"t:", &targ, "-t x Set tcp_fastopen value"},
+ {"S:", &source_addr, "-S x Source address to bind"},
{"g:", &tcp_port, "-g x x - server port"},
{"b:", &barg, "-b x x - low latency busy poll timeout"},
{"T:", &type, "-T x tcp (default), udp, dccp, sctp\n"},
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [LTP] [PATCH 4/6] tst_netload: support -S and -A netstress options
2017-11-28 13:08 [LTP] [PATCH 1/6] network/sctp: use TST_NETLOAD_* parameters Alexey Kodanev
2017-11-28 13:08 ` [LTP] [PATCH 2/6] network/virt_lib: " Alexey Kodanev
2017-11-28 13:08 ` [LTP] [PATCH 3/6] netstress: support setting local source address Alexey Kodanev
@ 2017-11-28 13:08 ` Alexey Kodanev
2017-11-28 13:08 ` [LTP] [PATCH 5/6] sctp: fix tests when hosts have multi-paths with diff MTU Alexey Kodanev
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Alexey Kodanev @ 2017-11-28 13:08 UTC (permalink / raw)
To: ltp
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/lib/test_net.sh | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/testcases/lib/test_net.sh b/testcases/lib/test_net.sh
index 83639e2..1e001f7 100644
--- a/testcases/lib/test_net.sh
+++ b/testcases/lib/test_net.sh
@@ -402,6 +402,8 @@ tst_netload()
local expect_res="pass"
local ret=0
local type="tcp"
+ local hostopt=
+ local setup_srchost=0
# common options for client and server
local cs_opts=
@@ -414,15 +416,19 @@ tst_netload()
local s_opts=
OPTIND=0
- while getopts :a:H:d:n:N:r:R:b:t:T:fFe:m: opt; do
+ while getopts :a:H:d:n:N:r:R:S:b:t:T:fFe:m:A: opt; do
case "$opt" in
a) c_num="$OPTARG" ;;
- H) c_opts="${c_opts}-H $OPTARG " ;;
+ H) c_opts="${c_opts}-H $OPTARG "
+ hostopt="$OPTARG" ;;
d) rfile="$OPTARG" ;;
n) c_opts="${c_opts}-n $OPTARG " ;;
N) c_opts="${c_opts}-N $OPTARG " ;;
r) c_requests="$OPTARG" ;;
+ A) c_opts="${c_opts}-A $OPTARG " ;;
R) s_replies="$OPTARG" ;;
+ S) c_opts="${c_opts}-S $OPTARG "
+ setup_srchost=1 ;;
b) cs_opts="${cs_opts}-b $OPTARG " ;;
t) cs_opts="${cs_opts}-t $OPTARG " ;;
T) cs_opts="${cs_opts}-T $OPTARG "
@@ -436,6 +442,8 @@ tst_netload()
done
OPTIND=0
+ [ "$setup_srchost" = 1 ] && s_opts="${s_opts}-S $hostopt "
+
local expect_ret=0
[ "$expect_res" != "pass" ] && expect_ret=1
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [LTP] [PATCH 5/6] sctp: fix tests when hosts have multi-paths with diff MTU
2017-11-28 13:08 [LTP] [PATCH 1/6] network/sctp: use TST_NETLOAD_* parameters Alexey Kodanev
` (2 preceding siblings ...)
2017-11-28 13:08 ` [LTP] [PATCH 4/6] tst_netload: support -S and -A netstress options Alexey Kodanev
@ 2017-11-28 13:08 ` Alexey Kodanev
2017-11-28 13:08 ` [LTP] [PATCH 6/6] sctp: add test-case with random payload Alexey Kodanev
2017-12-21 11:46 ` [LTP] [PATCH 1/6] network/sctp: use TST_NETLOAD_* parameters Alexey Kodanev
5 siblings, 0 replies; 7+ messages in thread
From: Alexey Kodanev @ 2017-11-28 13:08 UTC (permalink / raw)
To: ltp
Setup source address in sctp tests and bind to it, which
allows to avoid sending additional host IP addresses in
INIT/INIT ACK packets (sctp sets min MTU b/w those paths),
and bind the traffic to one path.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/sctp/sctp01.sh | 2 +-
testcases/network/stress/sctp/sctp_ipsec.sh | 2 +-
testcases/network/stress/sctp/sctp_ipsec_vti.sh | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/testcases/network/sctp/sctp01.sh b/testcases/network/sctp/sctp01.sh
index 197c819..99dcce8 100755
--- a/testcases/network/sctp/sctp01.sh
+++ b/testcases/network/sctp/sctp01.sh
@@ -41,7 +41,7 @@ test_run()
tst_netload -H $(tst_ipaddr rhost) -T tcp
local res0="$(cat tst_netload.res)"
- tst_netload -H $(tst_ipaddr rhost) -T sctp
+ tst_netload -S $(tst_ipaddr) -H $(tst_ipaddr rhost) -T sctp
local res1="$(cat tst_netload.res)"
local per=$(( $res0 * 100 / $res1 - 100 ))
diff --git a/testcases/network/stress/sctp/sctp_ipsec.sh b/testcases/network/stress/sctp/sctp_ipsec.sh
index 0b60238..677ccbf 100755
--- a/testcases/network/stress/sctp/sctp_ipsec.sh
+++ b/testcases/network/stress/sctp/sctp_ipsec.sh
@@ -36,7 +36,7 @@ do_test()
{
for p in $IPSEC_SIZE_ARRAY; do
tst_netload -H $(tst_ipaddr rhost) -T sctp -n $p -N $p \
- -r $IPSEC_REQUESTS
+ -r $IPSEC_REQUESTS -S $(tst_ipaddr)
done
}
diff --git a/testcases/network/stress/sctp/sctp_ipsec_vti.sh b/testcases/network/stress/sctp/sctp_ipsec_vti.sh
index ddb4784..ab9ddc3 100755
--- a/testcases/network/stress/sctp/sctp_ipsec_vti.sh
+++ b/testcases/network/stress/sctp/sctp_ipsec_vti.sh
@@ -27,7 +27,7 @@ do_test()
{
for p in $IPSEC_SIZE_ARRAY; do
tst_netload -H $ip_rmt_tun -T sctp -n $p -N $p \
- -r $IPSEC_REQUESTS
+ -r $IPSEC_REQUESTS -S $ip_src_tun
done
}
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [LTP] [PATCH 6/6] sctp: add test-case with random payload
2017-11-28 13:08 [LTP] [PATCH 1/6] network/sctp: use TST_NETLOAD_* parameters Alexey Kodanev
` (3 preceding siblings ...)
2017-11-28 13:08 ` [LTP] [PATCH 5/6] sctp: fix tests when hosts have multi-paths with diff MTU Alexey Kodanev
@ 2017-11-28 13:08 ` Alexey Kodanev
2017-12-21 11:46 ` [LTP] [PATCH 1/6] network/sctp: use TST_NETLOAD_* parameters Alexey Kodanev
5 siblings, 0 replies; 7+ messages in thread
From: Alexey Kodanev @ 2017-11-28 13:08 UTC (permalink / raw)
To: ltp
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
testcases/network/sctp/sctp01.sh | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/testcases/network/sctp/sctp01.sh b/testcases/network/sctp/sctp01.sh
index 99dcce8..51de2b1 100755
--- a/testcases/network/sctp/sctp01.sh
+++ b/testcases/network/sctp/sctp01.sh
@@ -17,7 +17,7 @@
# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
TCID=sctp01
-TST_TOTAL=3
+TST_TOTAL=4
TST_CLEANUP="cleanup"
TST_NEEDS_TMPDIR=1
@@ -36,12 +36,14 @@ setup()
test_run()
{
+ local opt="$@"
+
tst_resm TINFO "compare TCP/SCTP performance"
- tst_netload -H $(tst_ipaddr rhost) -T tcp
+ tst_netload -H $(tst_ipaddr rhost) -T tcp $opt
local res0="$(cat tst_netload.res)"
- tst_netload -S $(tst_ipaddr) -H $(tst_ipaddr rhost) -T sctp
+ tst_netload -S $(tst_ipaddr) -H $(tst_ipaddr rhost) -T sctp $opt
local res1="$(cat tst_netload.res)"
local per=$(( $res0 * 100 / $res1 - 100 ))
@@ -55,5 +57,6 @@ test_run()
setup
test_run
+test_run -A 65000
tst_exit
--
1.7.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [LTP] [PATCH 1/6] network/sctp: use TST_NETLOAD_* parameters
2017-11-28 13:08 [LTP] [PATCH 1/6] network/sctp: use TST_NETLOAD_* parameters Alexey Kodanev
` (4 preceding siblings ...)
2017-11-28 13:08 ` [LTP] [PATCH 6/6] sctp: add test-case with random payload Alexey Kodanev
@ 2017-12-21 11:46 ` Alexey Kodanev
5 siblings, 0 replies; 7+ messages in thread
From: Alexey Kodanev @ 2017-12-21 11:46 UTC (permalink / raw)
To: ltp
Applied the patch-set.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-12-21 11:46 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-28 13:08 [LTP] [PATCH 1/6] network/sctp: use TST_NETLOAD_* parameters Alexey Kodanev
2017-11-28 13:08 ` [LTP] [PATCH 2/6] network/virt_lib: " Alexey Kodanev
2017-11-28 13:08 ` [LTP] [PATCH 3/6] netstress: support setting local source address Alexey Kodanev
2017-11-28 13:08 ` [LTP] [PATCH 4/6] tst_netload: support -S and -A netstress options Alexey Kodanev
2017-11-28 13:08 ` [LTP] [PATCH 5/6] sctp: fix tests when hosts have multi-paths with diff MTU Alexey Kodanev
2017-11-28 13:08 ` [LTP] [PATCH 6/6] sctp: add test-case with random payload Alexey Kodanev
2017-12-21 11:46 ` [LTP] [PATCH 1/6] network/sctp: use TST_NETLOAD_* parameters Alexey Kodanev
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.