Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp273630pxb; Wed, 6 Oct 2021 04:51:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbMjWqgBTryQDUhqqgP4beYdSYxU0X9Ki3VRPKHIw0TihS/L8q9yEw2QajONIrwqfyrtPM X-Received: by 2002:a17:906:1184:: with SMTP id n4mr23980710eja.87.1633521115263; Wed, 06 Oct 2021 04:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633521115; cv=none; d=google.com; s=arc-20160816; b=WCtfAEi6p6wVli5LHaicazmbezVqi2HwI+3i+k3sxXkCCvTSN10lUZKRBUq8c+DDdx r4QT3P5FEFXBtm59mp9S0FYX/rXIBUlIGE76YKwiSbbb+YlRir04RaE9M+b5gAmrYiog zv0g7lHgWTL1w8qjQJgnSyKRyiRIjgamXbANpIf6bouZT4Jry/9ZRMcNE7ZiFBdhvegy NHsc0A2HQBUAm4pkL+a1TmoFcncx5X3pg1L+FKtvCAiheQYImNRJWmzgv7hz2oBh2S5M Hmzj7R94CfxVy+edDt4XJRnrCKFbe9XnDts/KFZXRjFEul0E5fF4CUPehGSjkxy/bwcZ OeIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vxpCd9DTD+L+m0nuHZPiU7pujsT7ePOGVZipNpzzkmY=; b=xdWIszwdyRdpTL3nLzhhiaDHKgWgJiotSpaJljCaunEwulNyAHlMinwplVbBJ0VWE2 QZ9opcaJQdLekocsJ8PWYOBdKNCWMFygqxLg2hafxq/jwu3bYjQ3CGcrd/LYMpFdOSRI EmUOp2ea6V8mx2o9Zf/Ttn9NYQWWWMIOk5snJ4a4Ontd3ocy9xHEX5XwCEHhKfG8X3mZ K7jCNW+PGvDiyWLWada5oD+wgmA4mFyHUvqf5HZPp8B+sCh60oJGR9JIKLWkQKMMc5sm 56LFpuzfIf7+MSPTbB1bdG8O202RYSGtJPmU4XGafXaWm9K3VFTf3ZddPNHRA2BYUG8O izSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=p6kpuSLH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rn22si624424ejb.276.2021.10.06.04.51.27; Wed, 06 Oct 2021 04:51:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=p6kpuSLH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238496AbhJFLtz (ORCPT + 99 others); Wed, 6 Oct 2021 07:49:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238421AbhJFLtt (ORCPT ); Wed, 6 Oct 2021 07:49:49 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6BE2C061755; Wed, 6 Oct 2021 04:47:57 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id l7so8910332edq.3; Wed, 06 Oct 2021 04:47:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vxpCd9DTD+L+m0nuHZPiU7pujsT7ePOGVZipNpzzkmY=; b=p6kpuSLH5GrXiQRUm8Wc/iqauzF/veeUIu5HFE566yVmikcq5hglXUs7ocopJ0vnRS mhw6keP3Dq8CvMBj+dO878mmZfx5qvsPTOU+Xj5zCi33DsAliH0GcS/5sRG/zniUe1Rg tv8HL9ixJtqVp9jl4/UENVZessdweSwru0IbAvlA7WzFibYNNiMzWl7BDll0p+HJY/Dj ldae5XOL4rsSgrVTCW91PSSLjBjnRCy4Ckbz8j+hxMGq26aqlCuEZ4slFV0HNKgiYgS3 DCjfV+3BlJByPGxMBOcAgoIc98jifDPjs8+f+o+xgRM3vQSw51s1iNruBGBDbue8j7V/ cbeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vxpCd9DTD+L+m0nuHZPiU7pujsT7ePOGVZipNpzzkmY=; b=0TD6Uglwyh8GFYJ0td3h3x1OMrsCjW5f3IAldh037zRnK6FH40SmtTp7CyxSg/eiKm xTFW+Z5xBaKwGU48GgriD6pwdDI+uFO8WHTBUQm6A9MWXp2EXQ+zUvAqvem5Uw+FGXKH kFaNR4qEYC8H82gTu2/c6Xi+zckMOLPX9NaclzZOjEKAgRy0SKWknq9bD2R2cAhk2ZM9 0BKs1GCgSjFhNXAr+vnwvPSI39QIQNGmnbn1sS1x1S4yoF8dzz0+2g3iHmEICaUnzy/X 9CV7fMt5l4rHTo6nqLeIYpCygbG0WkuVOn9rkWoPpB0OhF1Rg7xpFNOa93MeijgItf2U k65w== X-Gm-Message-State: AOAM531+VN7DT+GEtYBki/7qzlgdrrfAdDR4689DUdCu9j8AA3ltcPP/ dMaD1d09vHcd9ZdqmkxB3iU= X-Received: by 2002:a17:906:3148:: with SMTP id e8mr31472956eje.240.1633520876292; Wed, 06 Oct 2021 04:47:56 -0700 (PDT) Received: from localhost.localdomain ([95.76.3.69]) by smtp.gmail.com with ESMTPSA id y40sm1402187ede.31.2021.10.06.04.47.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Oct 2021 04:47:55 -0700 (PDT) From: Leonard Crestez To: Jakub Kicinski , Shuah Khan , David Ahern Cc: "David S. Miller" , Ido Schimmel , Seth David Schoen , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/11] selftests: net/fcnal: Use accept_dad=0 to avoid setup sleep Date: Wed, 6 Oct 2021 14:47:20 +0300 Message-Id: <9cfeec9f336bf6f5fe06309526820e9bbbc87ea3.1633520807.git.cdleonard@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Duplicate Address Detection makes ipv6 addresses unavailable for a short period after adding (average about 1 second). Adding sleep statements avoid this but since all addresses in the test environment are controlled from the same source we can just disable DAD for the entire namespace. Unlike sprinkling nodad to all ipv6 address additions this also skips DAD for link-local-addresses. Signed-off-by: Leonard Crestez --- tools/testing/selftests/net/fcnal-test.sh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh index 9cf05e6e0d9b..0bd60cd3bc06 100755 --- a/tools/testing/selftests/net/fcnal-test.sh +++ b/tools/testing/selftests/net/fcnal-test.sh @@ -357,11 +357,11 @@ create_vrf() ip -netns ${ns} link set ${vrf} up ip -netns ${ns} route add vrf ${vrf} unreachable default metric 8192 ip -netns ${ns} -6 route add vrf ${vrf} unreachable default metric 8192 ip -netns ${ns} addr add 127.0.0.1/8 dev ${vrf} - ip -netns ${ns} -6 addr add ::1 dev ${vrf} nodad + ip -netns ${ns} -6 addr add ::1 dev ${vrf} if [ "${addr}" != "-" ]; then ip -netns ${ns} addr add dev ${vrf} ${addr} fi if [ "${addr6}" != "-" ]; then ip -netns ${ns} -6 addr add dev ${vrf} ${addr6} @@ -378,10 +378,11 @@ create_ns() local ns=$1 local addr=$2 local addr6=$3 ip netns add ${ns} + ip netns exec ${ns} sysctl -wq net.ipv6.conf.{all,default}.accept_dad=0 ip -netns ${ns} link set lo up if [ "${addr}" != "-" ]; then ip -netns ${ns} addr add dev lo ${addr} fi @@ -490,12 +491,10 @@ setup() # tell ns-B how to get to remote addresses of ns-A ip -netns ${NSB} ro add ${NSA_LO_IP}/32 via ${NSA_IP} dev ${NSB_DEV} ip -netns ${NSB} ro add ${NSA_LO_IP6}/128 via ${NSA_IP6} dev ${NSB_DEV} set +e - - sleep 1 } setup_lla_only() { # make sure we are starting with a clean slate @@ -520,12 +519,10 @@ setup_lla_only() create_vrf ${NSA} ${VRF} ${VRF_TABLE} "-" "-" ip -netns ${NSA} link set dev ${NSA_DEV} vrf ${VRF} ip -netns ${NSA} link set dev ${NSA_DEV2} vrf ${VRF} set +e - - sleep 1 } ################################################################################ # IPv4 @@ -3014,11 +3011,11 @@ ipv6_udp_novrf() sleep 1 run_cmd_nsb nettest -6 -D -r ${NSA_IP6} log_test $? 0 "UDP in - LLA to GUA" run_cmd_nsb ip -6 ro del ${NSA_IP6}/128 dev ${NSB_DEV} - run_cmd_nsb ip -6 addr add ${NSB_IP6}/64 dev ${NSB_DEV} nodad + run_cmd_nsb ip -6 addr add ${NSB_IP6}/64 dev ${NSB_DEV} } ipv6_udp_vrf() { local a @@ -3292,11 +3289,11 @@ ipv6_udp_vrf() sleep 1 run_cmd_nsb nettest -6 -D -r ${NSA_IP6} log_test $? 0 "UDP in - LLA to GUA" run_cmd_nsb ip -6 ro del ${NSA_IP6}/128 dev ${NSB_DEV} - run_cmd_nsb ip -6 addr add ${NSB_IP6}/64 dev ${NSB_DEV} nodad + run_cmd_nsb ip -6 addr add ${NSB_IP6}/64 dev ${NSB_DEV} } ipv6_udp() { # should not matter, but set to known state @@ -3742,11 +3739,11 @@ use_case_br() setup_cmd ip addr del dev ${NSA_DEV} ${NSA_IP}/24 setup_cmd ip -6 addr del dev ${NSA_DEV} ${NSA_IP6}/64 setup_cmd ip link add br0 type bridge setup_cmd ip addr add dev br0 ${NSA_IP}/24 - setup_cmd ip -6 addr add dev br0 ${NSA_IP6}/64 nodad + setup_cmd ip -6 addr add dev br0 ${NSA_IP6}/64 setup_cmd ip li set ${NSA_DEV} master br0 setup_cmd ip li set ${NSA_DEV} up setup_cmd ip li set br0 up setup_cmd ip li set br0 vrf ${VRF} @@ -3791,15 +3788,15 @@ use_case_br() setup_cmd ip li set br0 nomaster setup_cmd ip li add br0.100 link br0 type vlan id 100 setup_cmd ip li set br0.100 vrf ${VRF} up setup_cmd ip addr add dev br0.100 172.16.101.1/24 - setup_cmd ip -6 addr add dev br0.100 2001:db8:101::1/64 nodad + setup_cmd ip -6 addr add dev br0.100 2001:db8:101::1/64 setup_cmd_nsb ip li add vlan100 link ${NSB_DEV} type vlan id 100 setup_cmd_nsb ip addr add dev vlan100 172.16.101.2/24 - setup_cmd_nsb ip -6 addr add dev vlan100 2001:db8:101::2/64 nodad + setup_cmd_nsb ip -6 addr add dev vlan100 2001:db8:101::2/64 setup_cmd_nsb ip li set vlan100 up sleep 1 rmmod br_netfilter 2>/dev/null -- 2.25.1