From patchwork Wed May 10 11:16:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Mayer X-Patchwork-Id: 92034 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3543944vqo; Wed, 10 May 2023 04:26:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6d/+YMurQh3AyE4P1bo1qEhGzJ8N0MbAIxa8hkK6xzfNjBjqcPRFgRZwHJxF6Y9UP+g4n6 X-Received: by 2002:a17:902:9b97:b0:1a9:813f:7d6f with SMTP id y23-20020a1709029b9700b001a9813f7d6fmr16275856plp.42.1683717977546; Wed, 10 May 2023 04:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683717977; cv=none; d=google.com; s=arc-20160816; b=xg3BoZFBoTmviyyXeXM4OJpnK5psw7axzTVxlj1Gx6Nkq4zqSmNCLAtWQtpPG1uS33 oRdKwv5T61Ffa070XLgKPckKh/ZLJpdbDemOVpCRCl5pHUFyWB8COkR3RvYjf0W88xtm uq4ZoXN5XHUPTUQmJTjml3NdLP41CHHkumyjE1c2N6IDrUZxdCWNpGcLvSkKqpdXDb3Z IJ8Z1kIm6sKCI3gM/+dkfT/CdhZSXOYkoZRhX1s/j92pOKn7HjFw/YOMsnXZQotm9CDn PVebEbTgPbLeZlYztJStzowU3yfORdyLHA/alWaFeKhWLo1/RvQDxXt7CW7coJFvG8lr 6OEw== 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; bh=cKUYhu8wZU6ABPpmnj1CJ3593uxp+ugA94g9WPbVBME=; b=deJ0A0QAVL9+OCn4+LI0j5gldAZ+X5OW+/jgNFKCtdL4soO2UyVz/OiVoNL30rPPVv 7N8SSYmI5hD21TaMGdztvByEB+ijj9o3XRIlQfccAM9LOzaD+diuIWhGBoZ6yXSSGCUo M4cWnDS8fx2vDPCxVUyN/t5edb8YxyORVzXlosEgS2tsEpBtJD81Q3abiJw/OV01XzWe 5jooloA51uahJ7eOHzFcqB0WIkirzATpwxZgCyWw4uDspzsZCPLehGxQVB1+Pkri38d3 QZMUwRfDZ8Lp69Jeaw8ARULo5LE3bnNcse5aOFPOz5u1RBDH/KqIl64sSOcOU/glsye6 lgTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=uniroma2.it Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jj10-20020a170903048a00b001a6825fe670si3722860plb.6.2023.05.10.04.26.02; Wed, 10 May 2023 04:26:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=uniroma2.it Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236749AbjEJLSB (ORCPT + 99 others); Wed, 10 May 2023 07:18:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236538AbjEJLRz (ORCPT ); Wed, 10 May 2023 07:17:55 -0400 Received: from smtp.uniroma2.it (smtp.uniroma2.it [160.80.6.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC5C41A6; Wed, 10 May 2023 04:17:53 -0700 (PDT) Received: from localhost.localdomain ([160.80.103.126]) by smtp-2015.uniroma2.it (8.14.4/8.14.4/Debian-8) with ESMTP id 34ABHOim003525 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 10 May 2023 13:17:25 +0200 From: Andrea Mayer To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Shuah Khan , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: Stefano Salsano , Paolo Lungaroni , Ahmed Abdelsalam , Hangbin Liu , Andrea Mayer Subject: [net 1/2] selftests: seg6: disable DAD on IPv6 router cfg for srv6_end_dt4_l3vpn_test Date: Wed, 10 May 2023 13:16:37 +0200 Message-Id: <20230510111638.12408-2-andrea.mayer@uniroma2.it> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230510111638.12408-1-andrea.mayer@uniroma2.it> References: <20230510111638.12408-1-andrea.mayer@uniroma2.it> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.100.0 at smtp-2015 X-Virus-Status: Clean X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765506261612197681?= X-GMAIL-MSGID: =?utf-8?q?1765506261612197681?= The srv6_end_dt4_l3vpn_test instantiates a virtual network consisting of several routers (rt-1, rt-2) and hosts. When the IPv6 addresses of rt-{1,2} routers are configured, the Deduplicate Address Detection (DAD) kicks in when enabled in the Linux distros running the selftests. DAD is used to check whether an IPv6 address is already assigned in a network. Such a mechanism consists of sending an ICMPv6 Echo Request and waiting for a reply. As the DAD process could take too long to complete, it may cause the failing of some tests carried out by the srv6_end_dt4_l3vpn_test script. To make the srv6_end_dt4_l3vpn_test more robust, we disable DAD on routers since we configure the virtual network manually and do not need any address deduplication mechanism at all. Fixes: 2195444e09b4 ("selftests: add selftest for the SRv6 End.DT4 behavior") Signed-off-by: Andrea Mayer Reviewed-by: David Ahern --- tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh b/tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh index 1003119773e5..37f08d582d2f 100755 --- a/tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh +++ b/tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh @@ -232,10 +232,14 @@ setup_rt_networking() local nsname=rt-${rt} ip netns add ${nsname} + + ip netns exec ${nsname} sysctl -wq net.ipv6.conf.all.accept_dad=0 + ip netns exec ${nsname} sysctl -wq net.ipv6.conf.default.accept_dad=0 + ip link set veth-rt-${rt} netns ${nsname} ip -netns ${nsname} link set veth-rt-${rt} name veth0 - ip -netns ${nsname} addr add ${IPv6_RT_NETWORK}::${rt}/64 dev veth0 + ip -netns ${nsname} addr add ${IPv6_RT_NETWORK}::${rt}/64 dev veth0 nodad ip -netns ${nsname} link set veth0 up ip -netns ${nsname} link set lo up From patchwork Wed May 10 11:16:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Mayer X-Patchwork-Id: 92044 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3550229vqo; Wed, 10 May 2023 04:36:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5LJw7hBxhyC/aEEQ/QM19ia7QaoL0Yhm1q/cUZFE12s7vlc+TjtTkyeCgy7mqBQynLOouw X-Received: by 2002:a05:6a20:244d:b0:f0:ec64:f3db with SMTP id t13-20020a056a20244d00b000f0ec64f3dbmr21897504pzc.24.1683718617305; Wed, 10 May 2023 04:36:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683718617; cv=none; d=google.com; s=arc-20160816; b=yPHJ1ZmpduSgiveSvQypebFCfKMwYDTMsgPbe2AFVer8cRDgZti9tGu3kZxlyGqcUP gyKIxNrNsAJ92VaHxz5FB5PxyizElumWLsHug+RAfCPqxP/1/uXRCy4gzGpx3O8MZBRn oYgxmu09AuKcm1Jcz/utqMvYoCthFPWjdC/fHO9kDYVmkb+K7cDAqiRI4IO6EAp4pSfY Xbr3BVtFNB/Jwy29tnR0o28fST7TvqOaHkD3fDSLl1VrvSi+7DLg1pJnRQiMPHwxumvE gvS+h/e2ALGLe8mYE3CLkjUQwoK+Y3o8pE4nzC2tN6aOXnGSSlpUg7P+cvbM5+Nr1HKr k4IQ== 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; bh=zgbjjfUwv2+iyohz/z5TI8pXzmRZsNTh8PzB3OGpc0E=; b=Oo5gJfc7LEIair0+qammIlPtq3s+SQ7bKl8IXonRPlT/p3wQ3B1zji9KVppngIbPLk IURb5rMp4/eWmoihbWOh6YuwhhmpSaf5SDdg8++pxuwnB9USC6SHOn2FGJEYsC4aeUQu Yr6YdWPswjrLNY7dcYjfSuEaNuJ84tGeZpG50C8dI1d/AqKCs4RlAibhqWprXxQQzMvh 3Cbl4kQFnH4ARMvuJ4Jfi5S7p/z/ApWgJMgYbe5ZPCF9r6nOuQmmcj3P+DAcSXeMbhMe dGVjvGEWm8ZIoM0h67reJAwoCxbqLRVVJfDIXCuFamAkvhKefVBx/wql+ljEkxeiN/P0 BOug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=uniroma2.it Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a138-20020a621a90000000b0063d289b8d47si4732618pfa.126.2023.05.10.04.36.44; Wed, 10 May 2023 04:36:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=uniroma2.it Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236652AbjEJLR4 (ORCPT + 99 others); Wed, 10 May 2023 07:17:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229656AbjEJLRz (ORCPT ); Wed, 10 May 2023 07:17:55 -0400 Received: from smtp.uniroma2.it (smtp.uniroma2.it [160.80.6.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1490DAB; Wed, 10 May 2023 04:17:52 -0700 (PDT) Received: from localhost.localdomain ([160.80.103.126]) by smtp-2015.uniroma2.it (8.14.4/8.14.4/Debian-8) with ESMTP id 34ABHOin003525 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Wed, 10 May 2023 13:17:25 +0200 From: Andrea Mayer To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Shuah Khan , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: Stefano Salsano , Paolo Lungaroni , Ahmed Abdelsalam , Hangbin Liu , Andrea Mayer Subject: [net 2/2] selftets: seg6: disable rp_filter by default in srv6_end_dt4_l3vpn_test Date: Wed, 10 May 2023 13:16:38 +0200 Message-Id: <20230510111638.12408-3-andrea.mayer@uniroma2.it> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230510111638.12408-1-andrea.mayer@uniroma2.it> References: <20230510111638.12408-1-andrea.mayer@uniroma2.it> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.100.0 at smtp-2015 X-Virus-Status: Clean X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765506933091780557?= X-GMAIL-MSGID: =?utf-8?q?1765506933091780557?= On some distributions, the rp_filter is automatically set (=1) by default on a netdev basis (also on VRFs). In an SRv6 End.DT4 behavior, decapsulated IPv4 packets are routed using the table associated with the VRF bound to that tunnel. During lookup operations, the rp_filter can lead to packet loss when activated on the VRF. Therefore, we chose to make this selftest more robust by explicitly disabling the rp_filter during tests (as it is automatically set by some Linux distributions). Fixes: 2195444e09b4 ("selftests: add selftest for the SRv6 End.DT4 behavior") Reported-by: Hangbin Liu Signed-off-by: Andrea Mayer Tested-by: Hangbin Liu Reviewed-by: David Ahern --- .../testing/selftests/net/srv6_end_dt4_l3vpn_test.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh b/tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh index 37f08d582d2f..f96282362811 100755 --- a/tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh +++ b/tools/testing/selftests/net/srv6_end_dt4_l3vpn_test.sh @@ -258,6 +258,12 @@ setup_hs() # set the networking for the host ip netns add ${hsname} + + # disable the rp_filter otherwise the kernel gets confused about how + # to route decap ipv4 packets. + ip netns exec ${rtname} sysctl -wq net.ipv4.conf.all.rp_filter=0 + ip netns exec ${rtname} sysctl -wq net.ipv4.conf.default.rp_filter=0 + ip -netns ${hsname} link add veth0 type veth peer name ${rtveth} ip -netns ${hsname} link set ${rtveth} netns ${rtname} ip -netns ${hsname} addr add ${IPv4_HS_NETWORK}.${hs}/24 dev veth0 @@ -276,11 +282,6 @@ setup_hs() ip netns exec ${rtname} sysctl -wq net.ipv4.conf.${rtveth}.proxy_arp=1 - # disable the rp_filter otherwise the kernel gets confused about how - # to route decap ipv4 packets. - ip netns exec ${rtname} sysctl -wq net.ipv4.conf.all.rp_filter=0 - ip netns exec ${rtname} sysctl -wq net.ipv4.conf.${rtveth}.rp_filter=0 - ip netns exec ${rtname} sh -c "echo 1 > /proc/sys/net/vrf/strict_mode" }