From patchwork Thu Apr 22 13:16:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1469200 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2020-01-29 header.b=OIUo5t+/; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FQyd43ySCz9sWD for ; Thu, 22 Apr 2021 23:17:11 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 90D393C6AEA for ; Thu, 22 Apr 2021 15:17:05 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [IPv6:2001:4b78:1:20::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id B19AB3C6AD4 for ; Thu, 22 Apr 2021 15:17: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-7.smtp.seeweb.it (Postfix) with ESMTPS id DC514201743 for ; Thu, 22 Apr 2021 15:17:02 +0200 (CEST) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13MCA684076735 for ; Thu, 22 Apr 2021 13:17: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 : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=os1trUIZa+kMigpbdCg70PMRoFzuWT+GW6yAW0gbjO4=; b=OIUo5t+/R9oKMbj+dxV/AkkJdOZLEEcV/GhvD+4G/Dsb8WfSmTKJdMLT1SOc2p3m/b5C KGRk8IahOPu5hJiVZlLUeW5c4+estP6wSt2k4+m+rmdQAuyZ7TyeSNnWO4IlK/d7w1CX 74G7fbt66eo8hoTlAI9lNpwuATuJiqZ2hwEuL/Aq00Cjq5f0947RQ76P/cFTd8GhpNvC THkU6tcrpSgYDI9zHuSuHC7XHwHU7qM8xHh8JOMOLwJcd3hxSA40TiKeAWxJWlVaKqe1 upXVYsFPUFunb+gePVYqIYPPF/Er9Da0W4HdwZebvrntQyXgSZCwLvsFGdGOe4MD26iI RA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 38022y4qhk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 22 Apr 2021 13:17:00 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13MDG3q3051084 for ; Thu, 22 Apr 2021 13:16:59 GMT Received: from pps.reinject (localhost [127.0.0.1]) by userp3020.oracle.com with ESMTP id 3809evw95v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 22 Apr 2021 13:16:59 +0000 Received: from userp3020.oracle.com (userp3020.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 13MDGxuu055700 for ; Thu, 22 Apr 2021 13:16:59 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 3809evw953-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Apr 2021 13:16:59 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 13MDGvl4008744; Thu, 22 Apr 2021 13:16:57 GMT Received: from gyrotron.nl.oracle.com (/10.175.36.197) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 22 Apr 2021 06:16:57 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Thu, 22 Apr 2021 16:16:28 +0300 Message-Id: <20210422131630.28565-2-alexey.kodanev@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210422131630.28565-1-alexey.kodanev@oracle.com> References: <20210422131630.28565-1-alexey.kodanev@oracle.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: yNLoiZS5x4cLn7eQJQIkAzJY277k6hCl X-Proofpoint-GUID: yNLoiZS5x4cLn7eQJQIkAzJY277k6hCl X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9961 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 bulkscore=0 phishscore=0 clxscore=1015 impostorscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104220103 X-Virus-Scanned: clamav-milter 0.102.4 at in-7.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,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-7.smtp.seeweb.it Subject: [LTP] [PATCH 1/3] lib/tst_test.sh: add TST_IPV6_FLAG ('-6') X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Move the flag from route_lib.sh, it will also be used in the other net tests. It's set to blank for IPv4 and to '-6' for IPv6. Signed-off-by: Alexey Kodanev --- testcases/lib/tst_net.sh | 4 +++- testcases/lib/tst_test.sh | 2 +- testcases/network/stress/route/route-lib.sh | 15 +++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index ee35bdd5c..fc5719057 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -18,11 +18,13 @@ TST_SETUP="tst_net_setup" # Blank for an IPV4 test; 6 for an IPV6 test. TST_IPV6=${TST_IPV6:-} TST_IPVER=${TST_IPV6:-4} +# Blank for IPv4, '-6' for IPv6 test. +TST_IPV6_FLAG=${TST_IPV6_FLAG:-} tst_net_parse_args() { case $1 in - 6) TST_IPV6=6 TST_IPVER=6;; + 6) TST_IPV6=6 TST_IPVER=6 TST_IPV6_FLAG="-6";; *) [ "$TST_PARSE_ARGS_CALLER" ] && $TST_PARSE_ARGS_CALLER "$1" "$2";; esac } diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index a6a8e9579..dcd470dfc 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -540,7 +540,7 @@ tst_run() NEEDS_ROOT|NEEDS_TMPDIR|TMPDIR|NEEDS_DEVICE|DEVICE);; NEEDS_CMDS|NEEDS_MODULE|MODPATH|DATAROOT);; NEEDS_DRIVERS|FS_TYPE|MNTPOINT|MNT_PARAMS);; - IPV6|IPVER|TEST_DATA|TEST_DATA_IFS);; + IPV6|IPV6_FLAG|IPVER|TEST_DATA|TEST_DATA_IFS);; RETRY_FUNC|RETRY_FN_EXP_BACKOFF|TIMEOUT);; NET_DATAROOT|NET_MAX_PKT|NET_RHOST_RUN_DEBUG|NETLOAD_CLN_NUMBER);; *) tst_res TWARN "Reserved variable TST_$_tst_i used!";; diff --git a/testcases/network/stress/route/route-lib.sh b/testcases/network/stress/route/route-lib.sh index a5bb96c12..194bd40cc 100644 --- a/testcases/network/stress/route/route-lib.sh +++ b/testcases/network/stress/route/route-lib.sh @@ -91,20 +91,19 @@ setup_if() test_netlink() { + local opt="-c $ROUTE_CHANGE_NETLINK $TST_IPV6_FLAG -p $ROUTE_RHOST_PORT $ROUTE_CHANGE_NETLINK_PARAMS" + local cmd="route-change-netlink" local ret=0 - local cmd ip_flag - [ "$TST_IPV6" ] && ip_flag="-6" - cmd="route-change-netlink -c $ROUTE_CHANGE_NETLINK $ip_flag -p $ROUTE_RHOST_PORT $ROUTE_CHANGE_NETLINK_PARAMS" - tst_res TINFO "running $cmd" - $cmd || ret=$? + tst_res TINFO "running $cmd $opt" + $cmd $opt || ret=$? if [ "$ret" -ne 0 ]; then [ $((ret & 3)) -ne 0 ] && \ - tst_brk TFAIL "route-change-netlink failed" + tst_brk TFAIL "$cmd failed" [ $((ret & 32)) -ne 0 ] && \ tst_brk TCONF "not supported configuration" [ $((ret & 4)) -ne 0 ] && \ - tst_res TWARN "route-change-netlink has warnings" + tst_res TWARN "$cmd has warnings" fi - tst_res TPASS "route-change-netlink passed" + tst_res TPASS "$cmd passed" } From patchwork Thu Apr 22 13:16:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1469202 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2020-01-29 header.b=ISs9X1hW; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FQydM21J9z9sW5 for ; Thu, 22 Apr 2021 23:17:27 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 9C5253C6AE5 for ; Thu, 22 Apr 2021 15:17:24 +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 [217.194.8.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 31D123C6AE2 for ; Thu, 22 Apr 2021 15:17:05 +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-2.smtp.seeweb.it (Postfix) with ESMTPS id 6387860227F for ; Thu, 22 Apr 2021 15:17:04 +0200 (CEST) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13MD529S097073 for ; Thu, 22 Apr 2021 13:17: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 : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=vJ3sxjJ4jvlvpQFcbBSBsOXUObvuO31oWQkCqgx7mmU=; b=ISs9X1hWFXqbnTsjOOHJkeixu9dUNQ0beH/qdcy3qJ3uEXQvLCVnXsZ+wPtCZ75kdM/3 W3KbfhRC65B6gRVnRUjswbnD6ZyoNeCBPXtqtu9b9sw8Yn2WMiI91rlYS12mmLq9YSu/ +d563aX9AuyHH+lNOKrkjRWjuzdGJLw0D6HSDUxqByrkdFfUIxndkGMeFbg5cInsVHrp 0/wPQcfsVyZ17vKztkRGSmSeuYaRKsE9jmIUu3VSXJ3St39jWxDaXoPSTCHDB3vlviWa Z1RmlG+GWs9TGFBwemNPFVHaOi8xX5xLCa14ecbSXtmroGM2jtQiMMooVSfOfRgkRT+y 8Q== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 37yvean04g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 22 Apr 2021 13:17:02 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13MDGHD0161685 for ; Thu, 22 Apr 2021 13:17:01 GMT Received: from pps.reinject (localhost [127.0.0.1]) by aserp3020.oracle.com with ESMTP id 3809k3gewa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 22 Apr 2021 13:17:01 +0000 Received: from aserp3020.oracle.com (aserp3020.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 13MDH1Gw165159 for ; Thu, 22 Apr 2021 13:17:01 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 3809k3gev3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Apr 2021 13:17:01 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 13MDGwgm004284; Thu, 22 Apr 2021 13:16:58 GMT Received: from gyrotron.nl.oracle.com (/10.175.36.197) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 22 Apr 2021 06:16:58 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Thu, 22 Apr 2021 16:16:29 +0300 Message-Id: <20210422131630.28565-3-alexey.kodanev@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210422131630.28565-1-alexey.kodanev@oracle.com> References: <20210422131630.28565-1-alexey.kodanev@oracle.com> MIME-Version: 1.0 X-Proofpoint-GUID: U5UZ64zcngFSqyw9evHo5SrnIa97fP-U X-Proofpoint-ORIG-GUID: U5UZ64zcngFSqyw9evHo5SrnIa97fP-U X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9961 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 phishscore=0 mlxscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=997 spamscore=0 bulkscore=0 adultscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104220106 X-Virus-Scanned: clamav-milter 0.102.4 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,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH 2/3] network/virt: new test for generic udp encapsulation (gue) X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The test sets up sit(IPv4) or ip6tnl(IPv6) virtual device using Generic UDP Encapsulation for each side. Then, it transmits TCP/UDP/UDP-Lite as inner packets with random size payload in both directions (using virt_netperf_rand_sizes()). The test will pass if the performance of encapsulation is not significantly worse than without it. This is controlled by VIRT_PERF_THRESHOLD. Signed-off-by: Alexey Kodanev --- runtest/net.features | 3 ++ testcases/network/virt/gue01.sh | 45 ++++++++++++++++++++++++++++++ testcases/network/virt/virt_lib.sh | 17 +++++++++-- 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100755 testcases/network/virt/gue01.sh diff --git a/runtest/net.features b/runtest/net.features index 617a6b91e..091cf9c55 100644 --- a/runtest/net.features +++ b/runtest/net.features @@ -60,6 +60,9 @@ gre_ipv6_01 gre01.sh -6 gre_ipv4_02 gre02.sh gre_ipv6_02 gre02.sh -6 +gue01 gue01.sh +gue01_ipv6 gue01.sh -6 + dctcp_ipv4_01 dctcp01.sh dctcp_ipv6_01 dctcp01.sh -6 diff --git a/testcases/network/virt/gue01.sh b/testcases/network/virt/gue01.sh new file mode 100755 index 000000000..13ac03211 --- /dev/null +++ b/testcases/network/virt/gue01.sh @@ -0,0 +1,45 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2021 Oracle and/or its affiliates. All Rights Reserved. + +TST_TESTFUNC=virt_netperf_rand_sizes +TST_SETUP=do_setup +TST_CLEANUP=do_cleanup +TST_NEEDS_TMPDIR=1 + +virt_type="gue" +. virt_lib.sh + +do_cleanup() +{ + if [ "$FOU_PORT" ]; then + tst_net_run -l $FOU_PORT -r $FOU_PORT_RMT \ + "ip fou del gue ${TST_IPV6_FLAG} port" + fi + + virt_cleanup_rmt + virt_cleanup +} + +do_setup() +{ + local get_port_cmd="tst_get_unused_port ipv${TST_IPVER} dgram" + local encap_cmd="encap gue encap-sport auto encap-dport" + local loc_ip=$(tst_ipaddr) + local rmt_ip=$(tst_ipaddr rhost) + local fou="fou$TST_IPV6" + + tst_require_drivers $fou + tst_net_run -s modprobe $fou + + FOU_PORT=$($get_port_cmd) + FOU_PORT_RMT=$(tst_rhost_run -c "$get_port_cmd") + + tst_net_run -s -l $FOU_PORT -r $FOU_PORT_RMT \ + "ip fou add gue ${TST_IPV6_FLAG} port" + + virt_setup "local $loc_ip remote $rmt_ip $encap_cmd $FOU_PORT_RMT" \ + "local $rmt_ip remote $loc_ip $encap_cmd $FOU_PORT" +} + +tst_run diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh index abf331428..f5c8bab09 100644 --- a/testcases/network/virt/virt_lib.sh +++ b/testcases/network/virt/virt_lib.sh @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2018-2019 Petr Vorel -# Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) 2014-2021 Oracle and/or its affiliates. All Rights Reserved. # Author: Alexey Kodanev # # VxLAN @@ -118,7 +118,7 @@ virt_add() [ -z "$opt" ] && \ opt="remote $(tst_ipaddr rhost) dev $(tst_iface)" ;; - sit) + sit|gue) [ -z "$opt" ] && opt="remote $(tst_ipaddr rhost) local $(tst_ipaddr)" ;; esac @@ -130,6 +130,12 @@ virt_add() gre|ip6gre) ip -f inet$TST_IPV6 tu add $vname mode $virt_type $opt ;; + gue) + local tnl=sit + + [ -n "$TST_IPV6" ] && tnl="ip6tnl" + ip link add name $vname type $tnl $opt + ;; *) ip li add link $(tst_iface) $vname type $virt_type $opt ;; @@ -152,6 +158,13 @@ virt_add_rhost() tst_rhost_run -s -c "ip -f inet$TST_IPV6 tu add ltp_v0 \ mode $virt_type $@" ;; + gue) + local tnl=sit + + [ -n "$TST_IPV6" ] && tnl="ip6tnl" + + tst_rhost_run -s -c "ip link add name ltp_v0 type $tnl $@" + ;; *) tst_rhost_run -s -c "ip li add link $(tst_iface rhost) ltp_v0 \ type $virt_type $@" From patchwork Thu Apr 22 13:16:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1469201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2020-01-29 header.b=W7N6grq6; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FQyd92Q99z9sW5 for ; Thu, 22 Apr 2021 23:17:17 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 15C7E3C6AEB for ; Thu, 22 Apr 2021 15:17:15 +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]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id B05913C6AD4 for ; Thu, 22 Apr 2021 15:17:03 +0200 (CEST) Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) (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 B37C160157D for ; Thu, 22 Apr 2021 15:17:02 +0200 (CEST) Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13MDE2LG172458 for ; Thu, 22 Apr 2021 13:17: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 : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=3vrrmw3EOwyjN5wM7FiJ+jQfsSZ8dSN+6J014sUQqu8=; b=W7N6grq6QasPXq4FEpDw4pr0pldNzqDB8MgdAP3CSfv9VoXniy5Gx2JgePmh9B04hD81 y9HFSaZ8zfXwNEkrUuZWoSjepuaCrSbs5VcOeIduUQWzc8sMaWBYBbmfJ0l3jSAFIngw 1RO0xcIYWXAQ5ZPwy/wbdR3BjtQQtESZuUcU1d4ld3CsMKFUQrOj4jaUY7kW/rTrVLsa nOLUcrvZSxdnJTJtd2OjYUN/M6z1naJdM6NTonBxb9iUpgELJE98OvhfvOrrP86HIDkB zP6m71794z/XC1o5uijA6d6wqd/1msAHNAy/txGvAAf4BeEv485f5ZzWGT6HoD7fDQwi ow== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 37yn6cdd7p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 22 Apr 2021 13:17:00 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13MDGGWJ161520 for ; Thu, 22 Apr 2021 13:17:00 GMT Received: from pps.reinject (localhost [127.0.0.1]) by aserp3020.oracle.com with ESMTP id 3809k3geut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 22 Apr 2021 13:17:00 +0000 Received: from aserp3020.oracle.com (aserp3020.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 13MDH0Ub164924 for ; Thu, 22 Apr 2021 13:17:00 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 3809k3geua-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Apr 2021 13:17:00 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 13MDGxmm008811; Thu, 22 Apr 2021 13:16:59 GMT Received: from gyrotron.nl.oracle.com (/10.175.36.197) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 22 Apr 2021 06:16:59 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Thu, 22 Apr 2021 16:16:30 +0300 Message-Id: <20210422131630.28565-4-alexey.kodanev@oracle.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210422131630.28565-1-alexey.kodanev@oracle.com> References: <20210422131630.28565-1-alexey.kodanev@oracle.com> MIME-Version: 1.0 X-Proofpoint-GUID: xENXrmXpQ4ISnZfwv5rCRsNC2QTU4w4u X-Proofpoint-ORIG-GUID: xENXrmXpQ4ISnZfwv5rCRsNC2QTU4w4u X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9962 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 priorityscore=1501 bulkscore=0 suspectscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104220109 X-Virus-Scanned: clamav-milter 0.102.4 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,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-5.smtp.seeweb.it Subject: [LTP] [PATCH 3/3] network/virt: new foo over udp (fou) tunneling test X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The test sets up GRE(IPv4 and IPv6) virtual device using Foo over UDP for each side. Then, it transmits TCP/UDP/UDP-Lite as inner packets with random size payload in both directions (using virt_netperf_rand_sizes()). The test will pass if the performance of encapsulation is not significantly worse than without it. This is controlled by VIRT_PERF_THRESHOLD. Signed-off-by: Alexey Kodanev --- runtest/net.features | 3 ++ testcases/network/virt/fou01.sh | 48 ++++++++++++++++++++++++++++++ testcases/network/virt/virt_lib.sh | 31 +++++++++++-------- 3 files changed, 70 insertions(+), 12 deletions(-) create mode 100755 testcases/network/virt/fou01.sh diff --git a/runtest/net.features b/runtest/net.features index 091cf9c55..4e1504df5 100644 --- a/runtest/net.features +++ b/runtest/net.features @@ -63,6 +63,9 @@ gre_ipv6_02 gre02.sh -6 gue01 gue01.sh gue01_ipv6 gue01.sh -6 +fou01 fou01.sh +fou01_ipv6 fou01.sh -6 + dctcp_ipv4_01 dctcp01.sh dctcp_ipv6_01 dctcp01.sh -6 diff --git a/testcases/network/virt/fou01.sh b/testcases/network/virt/fou01.sh new file mode 100755 index 000000000..77521e260 --- /dev/null +++ b/testcases/network/virt/fou01.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2021 Oracle and/or its affiliates. All Rights Reserved. + +TST_TESTFUNC=virt_netperf_rand_sizes +TST_SETUP=do_setup +TST_CLEANUP=do_cleanup +TST_NEEDS_TMPDIR=1 + +virt_type="fou" +. virt_lib.sh + +# GRE IP protocol number +PROTO=47 + +do_cleanup() +{ + if [ "$FOU_PORT" ]; then + tst_net_run -l $FOU_PORT -r $FOU_PORT_RMT \ + "ip fou del ipproto $PROTO ${TST_IPV6_FLAG} port" + fi + + virt_cleanup_rmt + virt_cleanup +} + +do_setup() +{ + local get_port_cmd="tst_get_unused_port ipv${TST_IPVER} dgram" + local encap_cmd="encap fou encap-sport auto encap-dport" + local loc_ip=$(tst_ipaddr) + local rmt_ip=$(tst_ipaddr rhost) + local fou="fou$TST_IPV6" + + tst_require_drivers $fou + tst_net_run -s modprobe $fou + + FOU_PORT=$($get_port_cmd) + FOU_PORT_RMT=$(tst_rhost_run -c "$get_port_cmd") + + tst_net_run -s -l $FOU_PORT -r $FOU_PORT_RMT \ + "ip fou add ipproto $PROTO ${TST_IPV6_FLAG} port" + + virt_setup "local $loc_ip remote $rmt_ip $encap_cmd $FOU_PORT_RMT" \ + "local $rmt_ip remote $loc_ip $encap_cmd $FOU_PORT" +} + +tst_run diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh index f5c8bab09..f511d3f92 100644 --- a/testcases/network/virt/virt_lib.sh +++ b/testcases/network/virt/virt_lib.sh @@ -99,6 +99,19 @@ virt_cleanup() virt_cleanup_rmt } +_get_gue_fou_tnl() +{ + local enc_type="$1" + local tnl=sit + + if [ "$enc_type" = "gue" ]; then + [ -n "$TST_IPV6" ] && tnl="ip6tnl" + else + [ -n "$TST_IPV6" ] && tnl="ip6gre" || tnl="gre" + fi + echo "$tnl" +} + virt_add() { local vname=$1 @@ -118,7 +131,7 @@ virt_add() [ -z "$opt" ] && \ opt="remote $(tst_ipaddr rhost) dev $(tst_iface)" ;; - sit|gue) + sit|gue|fou) [ -z "$opt" ] && opt="remote $(tst_ipaddr rhost) local $(tst_ipaddr)" ;; esac @@ -130,11 +143,8 @@ virt_add() gre|ip6gre) ip -f inet$TST_IPV6 tu add $vname mode $virt_type $opt ;; - gue) - local tnl=sit - - [ -n "$TST_IPV6" ] && tnl="ip6tnl" - ip link add name $vname type $tnl $opt + gue|fou) + ip link add name $vname type $(_get_gue_fou_tnl $virt_type) $opt ;; *) ip li add link $(tst_iface) $vname type $virt_type $opt @@ -158,12 +168,9 @@ virt_add_rhost() tst_rhost_run -s -c "ip -f inet$TST_IPV6 tu add ltp_v0 \ mode $virt_type $@" ;; - gue) - local tnl=sit - - [ -n "$TST_IPV6" ] && tnl="ip6tnl" - - tst_rhost_run -s -c "ip link add name ltp_v0 type $tnl $@" + gue|fou) + tst_rhost_run -s -c "ip link add name ltp_v0 \ + type $(_get_gue_fou_tnl $virt_type) $@" ;; *) tst_rhost_run -s -c "ip li add link $(tst_iface rhost) ltp_v0 \