From patchwork Thu Apr 27 09:49:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Mayer X-Patchwork-Id: 88181 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp170549vqo; Thu, 27 Apr 2023 03:34:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5SL05hLGbvdSYZzY01SJ9SYda83gKhKumoNzWe9F7W9C8Nr84H5TycyJpIolEQxKaUTaKT X-Received: by 2002:a17:903:32cb:b0:1a1:f5dd:2dce with SMTP id i11-20020a17090332cb00b001a1f5dd2dcemr1134777plr.6.1682591674165; Thu, 27 Apr 2023 03:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682591674; cv=none; d=google.com; s=arc-20160816; b=SpcZxCHn+fb51A74M0UfixIRzT8+KExu5vLIjSrniscRqDQTBnHm2rU3a6UXoogV4E u6m9Ql5mP5UhwmgqqgcpXv/pSuC7XQ1S0J10tFmh4xmkvNBFJ+Jgj5G/7pvO7IvAGY7I LMiEI3HL1Bmc4Xs5jaazfp7X+eFixIOHtr8BnfXljmfWfM4RInXiFYcn/kAWHjlT4h0r Yh/m8G3f2Cxf4AeXU178ayiHqSPtRdZRgLNncvpgsTvF/zAv9UUG3hMzlCl/zKv5Qd3P Gr4giZipwIYabIYcBGaBBCd/YEDzyplPf12HPhH4eUMv5/pLuVACGWa6n4kCLIsMcD6R YtQw== 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 :message-id:date:subject:cc:to:from; bh=SQJx3TYKx0LS3XOCdm466OqdsRJRS0aiqAgrk9ll4to=; b=Ujc82SQUo4ne2bZm9nGgR+zZcm+b2iVE9z1O/fp0qave98TWKohss9L2fbsRchfM/m 3YRGhF2vn15XtU48S6aFzGMUlUhmN8sRONxKYerpJuITx2WDhxCAZw3iwNrb769OKBl8 OgsNO8PwV0P89pWnNVQMUrJn/sLtppdZdme1gN/6ImwHWKIg4JNU/iBk6EEAC6Dq8g8X FMT94mhXlbg5j1RFvq5AV9dWWoHYMRWQPhU9NIfZs/0Nk4B1fBRnuAuO7z1c5jxSLLFJ v5uU2npmj9wcWdgLD/aLrnT9AFwBNqBoGu1lBn2bozFWNUiFU6DDcvquC7n7YEw20smK qxCA== 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 i18-20020a170902c95200b001a51c26f601si15344647pla.627.2023.04.27.03.34.10; Thu, 27 Apr 2023 03:34:34 -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 S243509AbjD0KWX (ORCPT + 99 others); Thu, 27 Apr 2023 06:22:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243577AbjD0KWA (ORCPT ); Thu, 27 Apr 2023 06:22:00 -0400 X-Greylist: delayed 569 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 27 Apr 2023 03:21:43 PDT Received: from smtp.uniroma2.it (smtp.uniroma2.it [160.80.6.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EE2259F8; Thu, 27 Apr 2023 03:21:43 -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 33R9naub002272 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 27 Apr 2023 11:49:36 +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 , Andrea Mayer , Hangbin Liu Subject: [net] selftests: srv6: make srv6_end_dt46_l3vpn_test more robust Date: Thu, 27 Apr 2023 11:49:23 +0200 Message-Id: <20230427094923.20432-1-andrea.mayer@uniroma2.it> X-Mailer: git-send-email 2.20.1 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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?1764325247437501638?= X-GMAIL-MSGID: =?utf-8?q?1764325247437501638?= On some distributions, the rp_filter is automatically set (=1) by default on a netdev basis (also on VRFs). In an SRv6 End.DT46 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: 03a0b567a03d ("selftests: seg6: add selftest for SRv6 End.DT46 Behavior") Reported-by: Hangbin Liu Signed-off-by: Andrea Mayer Tested-by: Hangbin Liu Reviewed-by: David Ahern --- .../testing/selftests/net/srv6_end_dt46_l3vpn_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/net/srv6_end_dt46_l3vpn_test.sh b/tools/testing/selftests/net/srv6_end_dt46_l3vpn_test.sh index aebaab8ce44c..441eededa031 100755 --- a/tools/testing/selftests/net/srv6_end_dt46_l3vpn_test.sh +++ b/tools/testing/selftests/net/srv6_end_dt46_l3vpn_test.sh @@ -292,6 +292,11 @@ setup_hs() ip netns exec ${hsname} sysctl -wq net.ipv6.conf.all.accept_dad=0 ip netns exec ${hsname} sysctl -wq net.ipv6.conf.default.accept_dad=0 + # 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 ${IPv6_HS_NETWORK}::${hs}/64 dev veth0 nodad @@ -316,11 +321,6 @@ setup_hs() ip netns exec ${rtname} sysctl -wq net.ipv6.conf.${rtveth}.proxy_ndp=1 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" }