Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1056088pxb; Wed, 6 Apr 2022 07:42:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyEXBJ6a1J/bwvVgj4tzDois+6hWbXkja35t8vV8ZMjV7recxOQGfNPpagWleVY53HsEAY X-Received: by 2002:a05:6a00:2494:b0:4fb:4c38:1f1e with SMTP id c20-20020a056a00249400b004fb4c381f1emr9126635pfv.10.1649256171739; Wed, 06 Apr 2022 07:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649256171; cv=none; d=google.com; s=arc-20160816; b=iE4MgWFM6KCiueXw8D+am8v1gTJ5zUKME5sK2ucdRzOu8bqsTJdEGiUiXvBY+0tNi5 aFpi9g1Khmv8+pmB6mTx84AT+2DGaJ+Ad6doWXHsvfI9uAw+KJ21opp6wGRcOXstpPbL +zM9XlzDZm8yqwC/SNofHc7S1tY/3eLEuyZh4chaRHRASJaXFTTGn+Y6ZxmypDF7kLcZ OWSRk7aMG94tr/Gi5M6vLeltWHhqeTWveXBybvaMPLLVFsUVTMKRvKYRsuCMw/oCRrXN JyRSuZI15aTjm8Ot7z7E9dZIHwzsNVUCV0ozn18TuDvQJ4gmR/A6CCg7xnhKeur2w4Rh WBaw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BbRAYNTq9abJlTA5a56fFtIbyNQIqucsPZnnruratEs=; b=UGn5MD5RwbPP7B/bf9iHeOR8hfxvR7EoB9r5YA9JGrH2IredfsvLUPXtY8A/lwSeYF DDNtwZThf+x7jIWmzVdz1+qXB+uXJXLvjWlNFpLSrX55nwC/91Djlv4XzkW1snFETZQB VKn2NaU3QBBX61OAPkkYyqxOUuBc9SnUL3RouhVNbWGmbTWV9u/RsNQeej75kYmw8UgP fbeWS8+fq+XGTD4KtveNIz32ySmWsKBoevPR9Lan0AC7MZfDJIC1ZhB+wNPfPATn/cfD y0dz9xjmtgIFjKPbs7EX6V9h5Zw287lxQJIwN+Saops8UZ20Av620Othjd3mYaBw0jZF Hhxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RPsQraQ7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u2-20020a17090a400200b001c6aad7b786si4642294pjc.172.2022.04.06.07.42.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 07:42:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RPsQraQ7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4A0EA6A05B; Wed, 6 Apr 2022 05:28:43 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1392309AbiDEUGw (ORCPT + 99 others); Tue, 5 Apr 2022 16:06:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358184AbiDEK2F (ORCPT ); Tue, 5 Apr 2022 06:28:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 458D69E9D5; Tue, 5 Apr 2022 03:16:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EDE62B81B7A; Tue, 5 Apr 2022 10:16:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68454C385A0; Tue, 5 Apr 2022 10:16:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649153784; bh=vC3HpaQC66yZXonEgmL5Uq5YOTH5rq+MgVEPdR036Wo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RPsQraQ7SNI3hcqDJ6P+JEBa54aV+IfT8u3m5VB9JI+v0JcfX2EBCd4Xa0s0vjM1e sNvSLQWfXySg8QqSdiY1ItobycgkT+vUAd0iNiVqD0RZlqusbPAA8YmwGmtTn3Ft6W R39qvUfPzfqoyZ4mVABjTY5pzpgFDk40whuPkRi8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felix Maurer , Daniel Borkmann , Sasha Levin Subject: [PATCH 5.10 346/599] selftests/bpf: Make test_lwt_ip_encap more stable and faster Date: Tue, 5 Apr 2022 09:30:40 +0200 Message-Id: <20220405070309.124744738@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070258.802373272@linuxfoundation.org> References: <20220405070258.802373272@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Felix Maurer [ Upstream commit d23a8720327d33616f584d76c80824bfa4699be6 ] In test_lwt_ip_encap, the ingress IPv6 encap test failed from time to time. The failure occured when an IPv4 ping through the IPv6 GRE encapsulation did not receive a reply within the timeout. The IPv4 ping and the IPv6 ping in the test used different timeouts (1 sec for IPv4 and 6 sec for IPv6), probably taking into account that IPv6 might need longer to successfully complete. However, when IPv4 pings (with the short timeout) are encapsulated into the IPv6 tunnel, the delays of IPv6 apply. The actual reason for the long delays with IPv6 was that the IPv6 neighbor discovery sometimes did not complete in time. This was caused by the outgoing interface only having a tentative link local address, i.e., not having completed DAD for that lladdr. The ND was successfully retried after 1 sec but that was too late for the ping timeout. The IPv6 addresses for the test were already added with nodad. However, for the lladdrs, DAD was still performed. We now disable DAD in the test netns completely and just assume that the two lladdrs on each veth pair do not collide. This removes all the delays for IPv6 traffic in the test. Without the delays, we can now also reduce the delay of the IPv6 ping to 1 sec. This makes the whole test complete faster because we don't need to wait for the excessive timeout for each IPv6 ping that is supposed to fail. Fixes: 0fde56e4385b0 ("selftests: bpf: add test_lwt_ip_encap selftest") Signed-off-by: Felix Maurer Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/4987d549d48b4e316cd5b3936de69c8d4bc75a4f.1646305899.git.fmaurer@redhat.com Signed-off-by: Sasha Levin --- tools/testing/selftests/bpf/test_lwt_ip_encap.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_lwt_ip_encap.sh b/tools/testing/selftests/bpf/test_lwt_ip_encap.sh index b497bb85b667..6c69c42b1d60 100755 --- a/tools/testing/selftests/bpf/test_lwt_ip_encap.sh +++ b/tools/testing/selftests/bpf/test_lwt_ip_encap.sh @@ -120,6 +120,14 @@ setup() ip netns exec ${NS2} sysctl -wq net.ipv4.conf.default.rp_filter=0 ip netns exec ${NS3} sysctl -wq net.ipv4.conf.default.rp_filter=0 + # disable IPv6 DAD because it sometimes takes too long and fails tests + ip netns exec ${NS1} sysctl -wq net.ipv6.conf.all.accept_dad=0 + ip netns exec ${NS2} sysctl -wq net.ipv6.conf.all.accept_dad=0 + ip netns exec ${NS3} sysctl -wq net.ipv6.conf.all.accept_dad=0 + ip netns exec ${NS1} sysctl -wq net.ipv6.conf.default.accept_dad=0 + ip netns exec ${NS2} sysctl -wq net.ipv6.conf.default.accept_dad=0 + ip netns exec ${NS3} sysctl -wq net.ipv6.conf.default.accept_dad=0 + ip link add veth1 type veth peer name veth2 ip link add veth3 type veth peer name veth4 ip link add veth5 type veth peer name veth6 @@ -289,7 +297,7 @@ test_ping() ip netns exec ${NS1} ping -c 1 -W 1 -I veth1 ${IPv4_DST} 2>&1 > /dev/null RET=$? elif [ "${PROTO}" == "IPv6" ] ; then - ip netns exec ${NS1} ping6 -c 1 -W 6 -I veth1 ${IPv6_DST} 2>&1 > /dev/null + ip netns exec ${NS1} ping6 -c 1 -W 1 -I veth1 ${IPv6_DST} 2>&1 > /dev/null RET=$? else echo " test_ping: unknown PROTO: ${PROTO}" -- 2.34.1