From patchwork Tue Feb 19 14:47:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1044721 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="sYmTdKqH"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 443k7v3R4Jz9s5c for ; Wed, 20 Feb 2019 01:46:19 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 05738294AA7 for ; Tue, 19 Feb 2019 15:46:17 +0100 (CET) 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 [217.194.8.4]) by picard.linux.it (Postfix) with ESMTP id DC58C3EA37D for ; Tue, 19 Feb 2019 15:46:07 +0100 (CET) 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 892831000DAC for ; Tue, 19 Feb 2019 15:46:05 +0100 (CET) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x1JEiKfL184051 for ; Tue, 19 Feb 2019 14:46: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-2018-07-02; bh=KogWPGVvkRuEIOdRx+6oWmIYaLvnotLd1SS/y64p0no=; b=sYmTdKqHRXTXpWk2W3JSLb1UwfO1dvPhoIyigKk2bZITgApe/E7t5eLXbF/ZnrmwYjRu UBVt1ycoIsyRBANLJlfSENcHo9hEZUSa6Zvq4bqqHUDDAY7tU51BqUhCv9Fj7qZx1w0f dDL7uOfUB5bjIfs6RXr7iJSvlWw2J4vRBrGtD6Guu5JC+f5dIHFfs5elkqOKhJQXObAt /1Gfm1DE7NL6XU5NZDAQfzWnDLwzQg3LCCRHdPQcBsMt/sFUl51Lkh+SRipsueazVq8i 5gvprA2Lhv+kBCEtjyWuBYLoVQcYQ8qhRZbetrcaqN5JjJEkFwSMoBWPJb58ckxPSrwg Aw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2qpb5rbf8b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 19 Feb 2019 14:46:04 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x1JEk4No020735 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 19 Feb 2019 14:46:04 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x1JEk4Lv012258 for ; Tue, 19 Feb 2019 14:46:04 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Feb 2019 06:46:03 -0800 From: Alexey Kodanev To: ltp@lists.linux.it Date: Tue, 19 Feb 2019 17:47:51 +0300 Message-Id: <1550587673-7995-3-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1550587673-7995-1-git-send-email-alexey.kodanev@oracle.com> References: <1550587673-7995-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9171 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902190111 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 2/4] lib/tst_net.sh: add new TST_NET_MAX_PKT env variable 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 is critical for performance tests, which compare virtual devices with the real ones. Trigger the fragmentation but keep the number of fragments at the minimum for those cases. Also improve the test timing if MTU is not large. The previous numbers can be restored with TST_NET_MAX_PKT environment variable. Signed-off-by: Alexey Kodanev Reviewed-by: Petr Vorel --- testcases/lib/tst_net.sh | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index 06b8ad6..3148643 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -710,6 +710,13 @@ tst_cleanup_rhost() tst_rhost_run -c "rm -rf $TST_TMPDIR" } +tst_default_max_pkt() +{ + local mtu="$(cat /sys/class/net/$(tst_iface)/mtu)" + + echo "$((mtu + mtu / 10))" +} + # Management Link [ -z "$RHOST" ] && TST_USE_NETNS="yes" export RHOST="$RHOST" @@ -797,7 +804,8 @@ export MCASTNUM_HEAVY="${MCASTNUM_HEAVY:-4000}" # want to use more ifaces. export LHOST_IFACES="${LHOST_IFACES:-eth0}" export RHOST_IFACES="${RHOST_IFACES:-eth0}" - +# Maximum payload size for 'virt' performance tests, by default eqauls to 1.1 * MTU +export TST_NET_MAX_PKT="${TST_NET_MAX_PKT:-$(tst_default_max_pkt)}" # Set corresponding HW addresses, e.g. "00:00:00:00:00:01 00:00:00:00:00:02" export LHOST_HWADDRS="${LHOST_HWADDRS:-$(tst_get_hwaddrs lhost)}" export RHOST_HWADDRS="${RHOST_HWADDRS:-$(tst_get_hwaddrs rhost)}"