From patchwork Mon May 21 11:48:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 917559 X-Patchwork-Delegate: akodanev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="pnZ3IVYb"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40qGyY0NxWz9s2k for ; Mon, 21 May 2018 21:39:17 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 62B723E647A for ; Mon, 21 May 2018 13:39:14 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [IPv6:2001:4b78:1:20::6]) by picard.linux.it (Postfix) with ESMTP id 71C113E63E1 for ; Mon, 21 May 2018 13:39:03 +0200 (CEST) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id 665251401335 for ; Mon, 21 May 2018 13:39:02 +0200 (CEST) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4LBUv6h157493 for ; Mon, 21 May 2018 11:38:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=gQKQRYkCCSC3V55MyX0OwOwjTfmHrTcQmX43xsc34tk=; b=pnZ3IVYb14mCCUYkJM4ZqQ5HdHuVdipn6vB013+CItjZMhS/SLcOf5VQacx8apWHyS1M 9A+sRyT10a+pj+Jq1CdjkEk/dde+Tk3JVe+/PmXLvKXExxUgAys11whjbB+26hu4/Ljs nWMG5rWccvTjeDb/nRAzuN47S64VgtHtLVd7HukK89BQ3+hRLfn8VCW9o8iJM09QNrfw TEv1XsFrh/15c9p4nGbv3alpO3kXE4Gxa/xaZepR5eC3cDOB0lcF0ihiY3wzcV00dX2G PROMTOaoiiMBkPOX7wBKQroZl1n1a4gyDnf8Rx9RtayK+BDLvBjm3UAmIQ8n561d4Tqf sw== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2j2ck9bsuw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 May 2018 11:38:59 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4LBcw1C028410 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 May 2018 11:38:58 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4LBcwdM011934 for ; Mon, 21 May 2018 11:38:58 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 May 2018 04:38:58 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Mon, 21 May 2018 14:48:25 +0300 Message-Id: <1526903310-2833-2-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1526903310-2833-1-git-send-email-alexey.kodanev@oracle.com> References: <1526903310-2833-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8899 signatures=668700 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=581 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805210139 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it Subject: [LTP] [PATCH 1/6] network: rename dcctp dir to tcp_cc X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" This directory will include other TCP congestion control related tests, not only dctcp algorithm. Signed-off-by: Alexey Kodanev Acked-by: Petr Vorel Acked-by: Petr Vorel --- testcases/network/dctcp/Makefile | 22 -------- testcases/network/dctcp/dctcp01.sh | 91 ----------------------------------- testcases/network/tcp_cc/Makefile | 22 ++++++++ testcases/network/tcp_cc/dctcp01.sh | 91 +++++++++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+), 113 deletions(-) delete mode 100644 testcases/network/dctcp/Makefile delete mode 100755 testcases/network/dctcp/dctcp01.sh create mode 100644 testcases/network/tcp_cc/Makefile create mode 100755 testcases/network/tcp_cc/dctcp01.sh diff --git a/testcases/network/dctcp/Makefile b/testcases/network/dctcp/Makefile deleted file mode 100644 index 82a6262..0000000 --- a/testcases/network/dctcp/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2015 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 . - -top_srcdir ?= ../../.. - -include $(top_srcdir)/include/mk/env_pre.mk - -INSTALL_TARGETS := dctcp01.sh - -include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/dctcp/dctcp01.sh b/testcases/network/dctcp/dctcp01.sh deleted file mode 100755 index 92ac97d..0000000 --- a/testcases/network/dctcp/dctcp01.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -# Copyright (c) 2015 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 . -# -# Author: Alexey Kodanev - -TCID=dctcp01 -TST_TOTAL=1 -TST_CLEANUP="cleanup" -TST_NEEDS_TMPDIR=1 -def_alg="cubic" -prev_alg= - -TST_USE_LEGACY_API=1 -. tst_net.sh - -set_cong_alg() -{ - local alg=$1 - tst_resm TINFO "setting $alg" - - tst_set_sysctl net.ipv4.tcp_congestion_control $alg safe -} - -cleanup() -{ - if [ "$prev_cong_ctl" ]; then - tst_set_sysctl net.ipv4.tcp_congestion_control $prev_alg - fi - tst_rmdir - tc qdisc del dev $(tst_iface) root netem loss 0.03% ecn -} - -setup() -{ - if tst_kvcmp -lt "3.18"; then - tst_brkm TCONF "test requires kernel 3.18 or newer" - fi - - tst_require_root - tst_check_cmds sysctl tc - - tst_resm TINFO "emulate congestion with packet loss 0.03% and ECN" - tc qdisc add dev $(tst_iface) root netem loss 0.03% ecn > /dev/null 2>&1 - if [ $? -ne 0 ]; then - tst_brkm TCONF "netem doesn't support ECN" - fi - - prev_alg="$(sysctl -n net.ipv4.tcp_congestion_control)" -} - -test_run() -{ - tst_resm TINFO "compare '$def_alg' and 'dctcp' congestion alg. results" - - set_cong_alg "$def_alg" - - tst_netload -H $(tst_ipaddr rhost) - local res0="$(cat tst_netload.res)" - - set_cong_alg "dctcp" - - tst_netload -H $(tst_ipaddr rhost) - local res1="$(cat tst_netload.res)" - - local per=$(( $res0 * 100 / $res1 - 100 )) - - if [ "$per" -lt "10" ]; then - tst_resm TFAIL "dctcp performance $per %" - else - tst_resm TPASS "dctcp performance $per %" - fi -} - -setup - -test_run - -tst_exit diff --git a/testcases/network/tcp_cc/Makefile b/testcases/network/tcp_cc/Makefile new file mode 100644 index 0000000..82a6262 --- /dev/null +++ b/testcases/network/tcp_cc/Makefile @@ -0,0 +1,22 @@ +# Copyright (c) 2015 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 . + +top_srcdir ?= ../../.. + +include $(top_srcdir)/include/mk/env_pre.mk + +INSTALL_TARGETS := dctcp01.sh + +include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cc/dctcp01.sh b/testcases/network/tcp_cc/dctcp01.sh new file mode 100755 index 0000000..92ac97d --- /dev/null +++ b/testcases/network/tcp_cc/dctcp01.sh @@ -0,0 +1,91 @@ +#!/bin/sh +# Copyright (c) 2015 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 . +# +# Author: Alexey Kodanev + +TCID=dctcp01 +TST_TOTAL=1 +TST_CLEANUP="cleanup" +TST_NEEDS_TMPDIR=1 +def_alg="cubic" +prev_alg= + +TST_USE_LEGACY_API=1 +. tst_net.sh + +set_cong_alg() +{ + local alg=$1 + tst_resm TINFO "setting $alg" + + tst_set_sysctl net.ipv4.tcp_congestion_control $alg safe +} + +cleanup() +{ + if [ "$prev_cong_ctl" ]; then + tst_set_sysctl net.ipv4.tcp_congestion_control $prev_alg + fi + tst_rmdir + tc qdisc del dev $(tst_iface) root netem loss 0.03% ecn +} + +setup() +{ + if tst_kvcmp -lt "3.18"; then + tst_brkm TCONF "test requires kernel 3.18 or newer" + fi + + tst_require_root + tst_check_cmds sysctl tc + + tst_resm TINFO "emulate congestion with packet loss 0.03% and ECN" + tc qdisc add dev $(tst_iface) root netem loss 0.03% ecn > /dev/null 2>&1 + if [ $? -ne 0 ]; then + tst_brkm TCONF "netem doesn't support ECN" + fi + + prev_alg="$(sysctl -n net.ipv4.tcp_congestion_control)" +} + +test_run() +{ + tst_resm TINFO "compare '$def_alg' and 'dctcp' congestion alg. results" + + set_cong_alg "$def_alg" + + tst_netload -H $(tst_ipaddr rhost) + local res0="$(cat tst_netload.res)" + + set_cong_alg "dctcp" + + tst_netload -H $(tst_ipaddr rhost) + local res1="$(cat tst_netload.res)" + + local per=$(( $res0 * 100 / $res1 - 100 )) + + if [ "$per" -lt "10" ]; then + tst_resm TFAIL "dctcp performance $per %" + else + tst_resm TPASS "dctcp performance $per %" + fi +} + +setup + +test_run + +tst_exit From patchwork Mon May 21 11:48:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 917557 X-Patchwork-Delegate: akodanev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="ggrKnpVT"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40qGyS1NqSz9s2k for ; Mon, 21 May 2018 21:39:11 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 2988A3E6448 for ; Mon, 21 May 2018 13:39:09 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) by picard.linux.it (Postfix) with ESMTP id E92D23E63D0 for ; Mon, 21 May 2018 13:39:02 +0200 (CEST) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id 029611401328 for ; Mon, 21 May 2018 13:39:01 +0200 (CEST) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4LBV6VA122206 for ; Mon, 21 May 2018 11:39:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=YAD9gX72v+H+YnOemMOrI3IAmzGyRCxvxbLYDXXImQ4=; b=ggrKnpVT+ZDkeUW8x0bM2ImZ4M5PmlTTeQFMEpK3Q5M3Ib5GAGpdPjgPje8+c1iIGzxG F4/h71YCUePRnP0UZAlEuvAddaWd64bu0LJvSShYFDTEGj5Zetrd0FpqDrvo/EqIVeVi cRzY+gL7l8Cw/76xUI7NmbFMUqMwK+xCacc7VeVfifLg5O/fCQTKgWbNZ93YJqKXa/Ur upM/GWIS71As9w8bm7q/PtwVEF5ScZQOM6L/J3pWUni1JQFdDiLHqzJYJNcfeCazf1jT kVp4akuwy5fAXV2F8RR5BsE9Y+H5+Pphp+wV1sYNTneoqnZZXMOlz4k59K71IRB/zlAR Yg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2j2bcdbub1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 May 2018 11:39:00 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w4LBcxUN027239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 May 2018 11:38:59 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w4LBcxmv013633 for ; Mon, 21 May 2018 11:38:59 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 May 2018 04:38:59 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Mon, 21 May 2018 14:48:26 +0300 Message-Id: <1526903310-2833-3-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1526903310-2833-1-git-send-email-alexey.kodanev@oracle.com> References: <1526903310-2833-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8899 signatures=668700 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=812 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805210139 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it Subject: [LTP] [PATCH 2/6] dctcp01: convert to new API and move common code to a library X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Signed-off-by: Alexey Kodanev Acked-by: Petr Vorel --- testcases/network/tcp_cc/Makefile | 2 +- testcases/network/tcp_cc/dctcp01.sh | 80 +++++-------------------------- testcases/network/tcp_cc/tcp_cc_lib.sh | 57 ++++++++++++++++++++++ 3 files changed, 71 insertions(+), 68 deletions(-) create mode 100755 testcases/network/tcp_cc/tcp_cc_lib.sh diff --git a/testcases/network/tcp_cc/Makefile b/testcases/network/tcp_cc/Makefile index 82a6262..a564eb4 100644 --- a/testcases/network/tcp_cc/Makefile +++ b/testcases/network/tcp_cc/Makefile @@ -17,6 +17,6 @@ top_srcdir ?= ../../.. include $(top_srcdir)/include/mk/env_pre.mk -INSTALL_TARGETS := dctcp01.sh +INSTALL_TARGETS := *.sh include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/network/tcp_cc/dctcp01.sh b/testcases/network/tcp_cc/dctcp01.sh index 92ac97d..02b27cf 100755 --- a/testcases/network/tcp_cc/dctcp01.sh +++ b/testcases/network/tcp_cc/dctcp01.sh @@ -1,91 +1,37 @@ #!/bin/sh -# Copyright (c) 2015 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 . +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved. # # Author: Alexey Kodanev -TCID=dctcp01 -TST_TOTAL=1 +TST_SETUP="setup" +TST_TESTFUNC="do_test" TST_CLEANUP="cleanup" -TST_NEEDS_TMPDIR=1 -def_alg="cubic" -prev_alg= +TST_MIN_KVER="3.18" -TST_USE_LEGACY_API=1 -. tst_net.sh - -set_cong_alg() -{ - local alg=$1 - tst_resm TINFO "setting $alg" - - tst_set_sysctl net.ipv4.tcp_congestion_control $alg safe -} +. tcp_cc_lib.sh cleanup() { - if [ "$prev_cong_ctl" ]; then - tst_set_sysctl net.ipv4.tcp_congestion_control $prev_alg - fi - tst_rmdir tc qdisc del dev $(tst_iface) root netem loss 0.03% ecn + + tcp_cc_cleanup } setup() { - if tst_kvcmp -lt "3.18"; then - tst_brkm TCONF "test requires kernel 3.18 or newer" - fi - - tst_require_root - tst_check_cmds sysctl tc + tcp_cc_setup - tst_resm TINFO "emulate congestion with packet loss 0.03% and ECN" + tst_res TINFO "emulate congestion with packet loss 0.03% and ECN" tc qdisc add dev $(tst_iface) root netem loss 0.03% ecn > /dev/null 2>&1 if [ $? -ne 0 ]; then tst_brkm TCONF "netem doesn't support ECN" fi - - prev_alg="$(sysctl -n net.ipv4.tcp_congestion_control)" } -test_run() +do_test() { - tst_resm TINFO "compare '$def_alg' and 'dctcp' congestion alg. results" - - set_cong_alg "$def_alg" - - tst_netload -H $(tst_ipaddr rhost) - local res0="$(cat tst_netload.res)" - - set_cong_alg "dctcp" - - tst_netload -H $(tst_ipaddr rhost) - local res1="$(cat tst_netload.res)" - - local per=$(( $res0 * 100 / $res1 - 100 )) - - if [ "$per" -lt "10" ]; then - tst_resm TFAIL "dctcp performance $per %" - else - tst_resm TPASS "dctcp performance $per %" - fi + tcp_cc_test01 dctcp 10 } -setup - -test_run - -tst_exit +tst_run diff --git a/testcases/network/tcp_cc/tcp_cc_lib.sh b/testcases/network/tcp_cc/tcp_cc_lib.sh new file mode 100755 index 0000000..b96c8af --- /dev/null +++ b/testcases/network/tcp_cc/tcp_cc_lib.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved. + +TST_NEEDS_TMPDIR=1 +TST_NEEDS_ROOT=1 +TST_NEEDS_CMDS="sysctl tc" + +. tst_net.sh + +def_alg="cubic" +prev_alg= + +set_cong_alg() +{ + local alg=$1 + tst_res TINFO "setting $alg" + + tst_set_sysctl net.ipv4.tcp_congestion_control $alg safe +} + +tcp_cc_cleanup() +{ + [ "$prev_cong_ctl" ] && \ + tst_set_sysctl net.ipv4.tcp_congestion_control $prev_alg +} + +tcp_cc_setup() +{ + prev_alg="$(sysctl -n net.ipv4.tcp_congestion_control)" +} + +tcp_cc_test01() +{ + local alg=$1 + local threshold=${2:-10} + + tst_res TINFO "compare '$def_alg' and '$alg' congestion alg. results" + + set_cong_alg "$def_alg" + + tst_netload -H $(tst_ipaddr rhost) -A 15000 + local res0="$(cat tst_netload.res)" + + set_cong_alg "$alg" + + tst_netload -H $(tst_ipaddr rhost) -A 15000 + local res1="$(cat tst_netload.res)" + + local per=$(( $res0 * 100 / $res1 - 100 )) + + if [ "$per" -lt "$threshold" ]; then + tst_res TFAIL "$alg performance $per %" + else + tst_res TPASS "$alg performance $per %" + fi +} From patchwork Mon May 21 11:48:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 917561 X-Patchwork-Delegate: akodanev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="N9NQVgA9"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40qGyg4BBcz9s2k for ; Mon, 21 May 2018 21:39:23 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id E15D73E646D for ; Mon, 21 May 2018 13:39:20 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [IPv6:2001:4b78:1:20::5]) by picard.linux.it (Postfix) with ESMTP id DAC2D3E640F for ; Mon, 21 May 2018 13:39:04 +0200 (CEST) Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-5.smtp.seeweb.it (Postfix) with ESMTPS id B5B7F600BF3 for ; Mon, 21 May 2018 13:39:03 +0200 (CEST) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4LBV6eG015180 for ; Mon, 21 May 2018 11:39:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=f2pBer3dpWb+sj5PrKpB+VimMZ5adWuRU4H1Oq35RxM=; b=N9NQVgA9qSSNEFucBkBIBGpAvuG5zoo7JJJnFsqksdAhfcm7kDI935DSjL9Hy7QiwlGb A6EoUeldEJDhM+PfaQ/mKBHIz5qz8wxYul51kF9xpB50M7Eeax6FFrXkTWgz48GKpkBA Ndzr8WnChcZlASfPTXqCxapnfL/EZYy8f0AkeErxwtgWxBfpcgI1K5YoRbVfVgoGDeCr ilWru4wN/rGuc22JKRoBRvZft/9cn1QC7SHbgDxP+35tu4UISC2FP2sWHja7c/vp+Fwx kXCuEzKLscYrPGH00b0cGdFCMeASNp1/W6G+zZkrQ7Z5jZm9jxemz4uyJrxu9m2pj1AZ gw== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2j2bw83tu9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 May 2018 11:39:01 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w4LBd0CU027328 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 May 2018 11:39:01 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w4LBd00O013645 for ; Mon, 21 May 2018 11:39:00 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 May 2018 04:39:00 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Mon, 21 May 2018 14:48:27 +0300 Message-Id: <1526903310-2833-4-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1526903310-2833-1-git-send-email-alexey.kodanev@oracle.com> References: <1526903310-2833-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8899 signatures=668700 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=442 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805210139 X-Virus-Scanned: clamav-milter 0.99.2 at in-5.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-5.smtp.seeweb.it Subject: [LTP] [PATCH 3/6] network/tcp_cc/dctcp01: increase packet loss for dctcp X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Avoid false positive failures for this test-case. Signed-off-by: Alexey Kodanev Acked-by: Petr Vorel --- testcases/network/tcp_cc/dctcp01.sh | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/testcases/network/tcp_cc/dctcp01.sh b/testcases/network/tcp_cc/dctcp01.sh index 02b27cf..3562f5a 100755 --- a/testcases/network/tcp_cc/dctcp01.sh +++ b/testcases/network/tcp_cc/dctcp01.sh @@ -13,7 +13,7 @@ TST_MIN_KVER="3.18" cleanup() { - tc qdisc del dev $(tst_iface) root netem loss 0.03% ecn + tc qdisc del dev $(tst_iface) root netem loss 0.5% ecn tcp_cc_cleanup } @@ -22,8 +22,9 @@ setup() { tcp_cc_setup - tst_res TINFO "emulate congestion with packet loss 0.03% and ECN" - tc qdisc add dev $(tst_iface) root netem loss 0.03% ecn > /dev/null 2>&1 + tst_res TINFO "emulate congestion with packet loss 0.5% and ECN" + tc qdisc add dev $(tst_iface) root netem loss 0.5% ecn > /dev/null 2>&1 + if [ $? -ne 0 ]; then tst_brkm TCONF "netem doesn't support ECN" fi From patchwork Mon May 21 11:48:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 917560 X-Patchwork-Delegate: akodanev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="j1ERMODx"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40qGyd1P8Kz9s33 for ; Mon, 21 May 2018 21:39:21 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 97A253E63D7 for ; Mon, 21 May 2018 13:39:17 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [IPv6:2001:4b78:1:20::2]) by picard.linux.it (Postfix) with ESMTP id 667573E640A for ; Mon, 21 May 2018 13:39:04 +0200 (CEST) Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 98A95600A5D for ; Mon, 21 May 2018 13:39:03 +0200 (CEST) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4LBUliL014794 for ; Mon, 21 May 2018 11:39:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=24eggk8qnHBF6+2WdBeVZgod+Vz5KyeB68p355lfK5U=; b=j1ERMODx+6oRphI1pp4SpP1mBkIisgeVPDF1wugz6WFgycT3w26M803X9u9y9fJYblfU 3MlgvspvQWe87b4nu2tYEZwTSo8pO7un0RaCpG89qO3jfaMeRndCG0owom9L3B4Bp0Aq L3R/v7D+5IHnrXJKEVPViHTWHc8wIVIIk5mA06UZk6gqxOn34h5Z4NnulVQK06YVjwTv DPHE4dfqxD7tXEK4JA+i/BwQHHNdk1asAHqz0Bf/MuYLzyMnOG0BQMtoS4pBgIU54bdU KJn9GVik9hRgnUFfVLN7hVVdgWVPMvxSVBd0ZkzDtI47OTaMPa2i6MrjH5i/9D8vEJqw iA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2j2bw83tua-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 May 2018 11:39:02 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4LBd16N028529 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 May 2018 11:39:01 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4LBd1Z9011960 for ; Mon, 21 May 2018 11:39:01 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 May 2018 04:39:01 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Mon, 21 May 2018 14:48:28 +0300 Message-Id: <1526903310-2833-5-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1526903310-2833-1-git-send-email-alexey.kodanev@oracle.com> References: <1526903310-2833-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8899 signatures=668700 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=378 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805210139 X-Virus-Scanned: clamav-milter 0.99.2 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH 4/6] network/tcp_cc/lib: add a function to set qdisc and txqueuelen X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Signed-off-by: Alexey Kodanev Acked-by: Petr Vorel Acked-by: Petr Vorel --- testcases/network/tcp_cc/tcp_cc_lib.sh | 34 ++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-) diff --git a/testcases/network/tcp_cc/tcp_cc_lib.sh b/testcases/network/tcp_cc/tcp_cc_lib.sh index b96c8af..7e93e1d 100755 --- a/testcases/network/tcp_cc/tcp_cc_lib.sh +++ b/testcases/network/tcp_cc/tcp_cc_lib.sh @@ -9,6 +9,8 @@ TST_NEEDS_CMDS="sysctl tc" . tst_net.sh def_alg="cubic" +prev_qlen= +prev_queue= prev_alg= set_cong_alg() @@ -21,8 +23,16 @@ set_cong_alg() tcp_cc_cleanup() { + local rmt_dev="dev $(tst_iface rhost)" + [ "$prev_cong_ctl" ] && \ tst_set_sysctl net.ipv4.tcp_congestion_control $prev_alg + + [ "$prev_qlen" ] && \ + tst_rhost_run -c "ip li set txqueuelen $prev_qlen $rmt_dev" + + [ "$prev_queue" ] && \ + tst_rhost_run -c "tc qdisc replace $rmt_dev root $prev_queue" } tcp_cc_setup() @@ -30,6 +40,30 @@ tcp_cc_setup() prev_alg="$(sysctl -n net.ipv4.tcp_congestion_control)" } +qdisc_list="pfifo_fast codel pfifo fq hfsc hhf htb pie prio sfb sfq" + +tcp_cc_set_qdisc() +{ + local qdisc="$1" + local qlen="${2:-1000}" + local cmd="tc qdisc replace" + local rmt_dev="$(tst_iface rhost)" + + tst_res TINFO "set qdisc on $(tst_iface rhost) to $qdisc len $qlen" + + [ -z "$prev_qlen" ] && \ + prev_qlen=$(tst_rhost_run -s -c \ + "cat /sys/class/net/$rmt_dev/tx_queue_len") + + [ -z "$prev_queue" ] && \ + prev_queue=$(tst_rhost_run -s -c \ + "tc qdisc show dev $rmt_dev | head -1" | \ + cut -f2 -d' ') + + tst_rhost_run -s -c "ip li set txqueuelen $qlen dev $rmt_dev" + tst_rhost_run -s -c "$cmd dev $rmt_dev root $qdisc" +} + tcp_cc_test01() { local alg=$1 From patchwork Mon May 21 11:48:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 917562 X-Patchwork-Delegate: akodanev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="H5dwLwhp"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40qGyk1qsJz9s1w for ; Mon, 21 May 2018 21:39:26 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 8BB383E63D0 for ; Mon, 21 May 2018 13:39:23 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [217.194.8.5]) by picard.linux.it (Postfix) with ESMTP id CC9743E641C for ; Mon, 21 May 2018 13:39:05 +0200 (CEST) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-5.smtp.seeweb.it (Postfix) with ESMTPS id 0220E600BF3 for ; Mon, 21 May 2018 13:39:04 +0200 (CEST) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4LBUn87157200 for ; Mon, 21 May 2018 11:39:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=ctL7ik6MnPTxD6IMIa6rVd2ItRDhRncD5SR2lM767dk=; b=H5dwLwhp1hkF+vf8D8nSJQbD9oy/e67JKBC72PlfeUtdcbIWAbG/KgzuzoZqQH4Lynnu rQQspM47/7VHRLYo1ZgKn89ptBVIRf4MSSUfSDOZyeaHtvsfqsck8qaWekd3B30bocTX X3Sx095vmCQ8C/mYJFf+0QksZFCxkA3dPPl5vx50EH5YbqaH/b1asksEPGMUbQ8J1UfL q7XGRWvW2Bz3XJLi2DqsR7fH+5fz/xfLPPCYQBAuacIGh8OaHIzjwKYgyunMRwR9ifDU 5MjymWgbvnC622ToZCfe/kfEv4GbIKTnH8RHNF75hYGt2j9zUYvurMheju9ySVvGmndh Fg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2j2ck9bsv9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 May 2018 11:39:03 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w4LBd36u027445 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 May 2018 11:39:03 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4LBd2Gg009307 for ; Mon, 21 May 2018 11:39:02 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 May 2018 04:39:02 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Mon, 21 May 2018 14:48:29 +0300 Message-Id: <1526903310-2833-6-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1526903310-2833-1-git-send-email-alexey.kodanev@oracle.com> References: <1526903310-2833-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8899 signatures=668700 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=337 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805210139 X-Virus-Scanned: clamav-milter 0.99.2 at in-5.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-5.smtp.seeweb.it Subject: [LTP] [PATCH 5/6] network/tcp_cc: add new test bbr01 X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Emulates congestion with packet loss. The test expects that 'bbr' congestion-control algorithm not significantly worse than 'cubic'. Signed-off-by: Alexey Kodanev Acked-by: Petr Vorel Acked-by: Petr Vorel --- runtest/net.features | 2 ++ testcases/network/tcp_cc/bbr01.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 0 deletions(-) create mode 100755 testcases/network/tcp_cc/bbr01.sh diff --git a/runtest/net.features b/runtest/net.features index df78c04..732c053 100644 --- a/runtest/net.features +++ b/runtest/net.features @@ -1,6 +1,8 @@ # # Stress tests for various network features # +bbr01 bbr01.sh +bbr01_ipv6 bbr01.sh -6 bind_noport01 bind_noport01.sh bind_noport01_ipv6 bind_noport01.sh -6 diff --git a/testcases/network/tcp_cc/bbr01.sh b/testcases/network/tcp_cc/bbr01.sh new file mode 100755 index 0000000..3825c22 --- /dev/null +++ b/testcases/network/tcp_cc/bbr01.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved. + +TST_SETUP="setup" +TST_TESTFUNC="do_test" +TST_CLEANUP="cleanup" +TST_MIN_KVER="4.13" + +. tcp_cc_lib.sh + +cleanup() +{ + tc qdisc del dev $(tst_iface) root netem + + tcp_cc_cleanup +} + +setup() +{ + tcp_cc_setup + + tst_res TINFO "emulate congestion with packet loss 0.5%" + ROD tc qdisc add dev $(tst_iface) root netem loss 0.5% +} + +do_test() +{ + tcp_cc_test01 bbr -50 +} + +tst_run From patchwork Mon May 21 11:48:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 917563 X-Patchwork-Delegate: akodanev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="dgZDY6jc"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40qGyn6Z3Bz9s1w for ; Mon, 21 May 2018 21:39:29 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 8846D3E7736 for ; Mon, 21 May 2018 13:39:26 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) by picard.linux.it (Postfix) with ESMTP id B42533E6403 for ; Mon, 21 May 2018 13:39:07 +0200 (CEST) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id A3F9E1000CD0 for ; Mon, 21 May 2018 13:39:06 +0200 (CEST) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4LBUb20157156 for ; Mon, 21 May 2018 11:39:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=EiJ7HNkNBdZkLIjMe7Q/W2Kj5SZ45kYY/yselJTVJS0=; b=dgZDY6jcNuQrEPKkk7a7qhRiMIYtbKDgPDde+DV+BQ809kUCo0HzdWLwE19/kGnJqh3a 31EBsvwXYRrZKMgsr+4gJG+NAjLIE35DiLY/ZbWu62UcQzkOIcE/fepAuHLEPqVg9mRB Vmyo/hPcH6L6uVHEU771VE0cW1gBKh4zI3rmzWozy7qY23l21gieO+jsoU2+ZohjNfMa QEhegeNmouH53YX7Zzsz04bk9SxSXTA+K2YpfGw3aIa0lZk40Ph2e9p9kqf+GbgjJ3lS hgHUk1aDyqkcH3pBALCFDzHTR9EnUadYJV26GcxpDRsIxz59EndmpbCWz4WBEejfV1is 7w== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2j2ck9bsvc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 May 2018 11:39:04 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4LBd4D3028606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 May 2018 11:39:04 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w4LBd3pY011985 for ; Mon, 21 May 2018 11:39:03 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 21 May 2018 04:39:03 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Mon, 21 May 2018 14:48:30 +0300 Message-Id: <1526903310-2833-7-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1526903310-2833-1-git-send-email-alexey.kodanev@oracle.com> References: <1526903310-2833-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8899 signatures=668700 X-Proofpoint-Spam-Details: rule=notspam policy=default score=3 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=3 mlxscore=3 mlxlogscore=156 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805210139 X-Virus-Scanned: clamav-milter 0.99.2 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH 6/6] network/tcp_cc: add new test bbr02 X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Difference, comparing to bbr01: * Uses different (not default) qdisc: pfifo_fast, codel, pfifo, fq, hfsc, hhf, htb, pie, prio, sfb and sfq. * Emulates congestion not only with packet loss but with delay, corrupt and reorder. The test expects that 'bbr' congestion-control algorithm not significantly worse than 'cubic'. Signed-off-by: Alexey Kodanev Acked-by: Petr Vorel Acked-by: Petr Vorel --- runtest/net.features | 3 ++ testcases/network/tcp_cc/bbr02.sh | 45 +++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 0 deletions(-) create mode 100755 testcases/network/tcp_cc/bbr02.sh diff --git a/runtest/net.features b/runtest/net.features index 732c053..eac1b2b 100644 --- a/runtest/net.features +++ b/runtest/net.features @@ -4,6 +4,9 @@ bbr01 bbr01.sh bbr01_ipv6 bbr01.sh -6 +bbr02 bbr02.sh +bbr02_ipv6 bbr02.sh -6 + bind_noport01 bind_noport01.sh bind_noport01_ipv6 bind_noport01.sh -6 diff --git a/testcases/network/tcp_cc/bbr02.sh b/testcases/network/tcp_cc/bbr02.sh new file mode 100755 index 0000000..ca3a9b4 --- /dev/null +++ b/testcases/network/tcp_cc/bbr02.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved. + +TST_SETUP="setup" +TST_TESTFUNC="do_test" +TST_CLEANUP="cleanup" +TST_MIN_KVER="4.13" + +. tcp_cc_lib.sh + +TST_CLEANUP="cleanup" + +cleanup() +{ + tc qdisc del dev $(tst_iface) root netem + + tcp_cc_cleanup +} + +setup() +{ + tcp_cc_setup + + local emu_opts="delay 5ms 1ms 20% loss 0.3% ecn corrupt \ +0.1% reorder 93% 50% limit 10000" + + tst_res TINFO "emulate congestion with packet $emu_opts" + ROD tc qdisc add dev $(tst_iface) root netem $emu_opts +} + +do_test() +{ + for q in $qdisc_list; do + if tc qdisc add $q >/dev/null 2>&1; then + tst_res TCONF "$q qdisc not supported" + continue + fi + + tcp_cc_set_qdisc $q + tcp_cc_test01 bbr -50 + done +} + +tst_run