Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3659356rwd; Sat, 10 Jun 2023 11:56:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ783i3v+JxLiQSvh6LyTZxKx/YmselbO7oWkt297JXBrB2LAnxFAoadV37gBWBKo5C0OpJL X-Received: by 2002:a17:906:58d2:b0:96f:f19b:887a with SMTP id e18-20020a17090658d200b0096ff19b887amr5469837ejs.56.1686423370557; Sat, 10 Jun 2023 11:56:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686423370; cv=none; d=google.com; s=arc-20160816; b=rokW3cDl9uCQjIpvDe3S4gzHyJxI4VJvcGZjj5CQ6D3EFYE+gYfKLPHD1m5p6HEZ2T +LcCBUJUNIG+8H5/vnhH/sh2lAiZfUi0jc9qPnMhKQEcangLlOpQB/r63FcTs/2vt/hg w6f0Z5Ovt8sYUoPpfUnP/PPalt7LdoTyxcBrfoIZB3F1/Rw5QfCBryMSpbVvosZ9VLJJ 4Nk5D6hhFJj9473JkJBBbuaGLObyxYsj3UmU4EXg4Cvp4k/0t02dstUxb0smShYkYaCk 7xAU2RD1Xpw3J4VlTdRwKQlDJ1bFtLtCY+RZroifmuIKAegY4TintJD7JAYAOJRHn1mg e51g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-signature; bh=eB0sPkWeyBbBeJMzxfEzVDqet3/mYXw0g+dMqohfpDM=; b=NPaHVYi9LEvCN3tfRWnZA4zq9V7Ls/eoAgFhSnaOTUar98rXC+fLx3xitc/Cfqf3Al uGCqQ36VvMpRgU7eIW/rmOFIYO1cENQdOQB6FQdRaGwJPepmBHuRi237vmF2k5Z28QqN DHHZjGWOjAO0NBXo8AovOHzg2UO4YdFtjxh/FCqA2C7pHllSD5nJyTUbilxRTx0jN1z4 xtnt8N30KzjyWAP+1WOH83h6YMwuarX/2wGuJZP9QoCAcocgz7zTAZL7lFzWdnAeChsS UIjUolWrOvbDmjyD3cS/ZdzLTFpiV6vaMZZHQNk5gggzhukp4hB4isJ9wrid8coCaZQK xFLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=fBqLH6LL; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=ixSyeOn1; 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=alu.unizg.hr Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020a170906680d00b0097650856f54si2844483ejr.145.2023.06.10.11.55.46; Sat, 10 Jun 2023 11:56:10 -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; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=fBqLH6LL; dkim=fail header.i=@alu.unizg.hr header.s=mail header.b=ixSyeOn1; 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=alu.unizg.hr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231396AbjFJSE1 (ORCPT + 99 others); Sat, 10 Jun 2023 14:04:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbjFJSE0 (ORCPT ); Sat, 10 Jun 2023 14:04:26 -0400 Received: from domac.alu.hr (domac.alu.unizg.hr [161.53.235.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 515061734; Sat, 10 Jun 2023 11:04:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by domac.alu.hr (Postfix) with ESMTP id 6835260210; Sat, 10 Jun 2023 20:04:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1686420253; bh=a7kwb1zfYXMMAdqEu0rSxumVp5Tj+8Ey4XJUCAGXj3c=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=fBqLH6LLHPYfTBFFFB5RlL3Zs3BdIIhtsENnrmbblmiCEBLxjlaOs1sWCPzohkAQp qOwGDQCPe70wKWm+/S2SZMclC7YD63EUIruqZb/hLrV1RYY33bOFOKXJBwF+uoTGvI dm+0q4E/aGb0Ww4Q+rhcw1SEr3/CSMLWCWMP1N62oUh/SuLcPnS8Qu7aVHjs6FveCH MBjfZEAGU+g+Ezxfe2+scRNWiXU2m1pCaPq9zXz5cOoWjaPoBr/hwjildP6a1bBX22 HBhoNghVLQawiABSyb/9QsuiUAowVeHHtETEwD9j0ZwoLrvFADpBCmnncOn6ZyDf5+ 1TMHd433V3Pkg== X-Virus-Scanned: Debian amavisd-new at domac.alu.hr Received: from domac.alu.hr ([127.0.0.1]) by localhost (domac.alu.hr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hq02M9V8VEoC; Sat, 10 Jun 2023 20:04:10 +0200 (CEST) Received: from [192.168.1.6] (unknown [77.237.113.62]) by domac.alu.hr (Postfix) with ESMTPSA id 069F26020C; Sat, 10 Jun 2023 20:04:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=alu.unizg.hr; s=mail; t=1686420250; bh=a7kwb1zfYXMMAdqEu0rSxumVp5Tj+8Ey4XJUCAGXj3c=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ixSyeOn1pVjUjZV6EUrabQKc4uhuLgIVgcgmodf+j21Z+6UFBVMYtwxqPbl7dINxM TiVa4plWWAIEFrTcoz1xGX+mXn+u+T+ZwWWrjXnMG4TUryZTFx96o6LAaTxtWnLQDV q/zNyIJ0ZM1OFfX21hAf895JDFosgRPDdvK8oA47EucA389Imi5c6uVQza5cDZARG+ /HHoaHa2f9FtcJLtkk+uvi/fkU0Z0UPt6ocsDiJoUMkMP1rvE/4OQ9a00BmGApDiu1 GQ6L7uOMo8ZvDq2DjQ7A3+4Qerux53fBhvumQSc0081PYFzk6VbTrGe4gwrxjeeZbe ypnCH9PqWzf9g== Message-ID: Date: Sat, 10 Jun 2023 20:04:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: POSSIBLE BUG: selftests/net/fcnal-test.sh: [FAIL][FIX TESTED] in vrf "bind - ns-B IPv6 LLA" test To: Guillaume Nault Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <48cfd903-ad2f-7da7-e5a6-a22392dc8650@alu.unizg.hr> <884d9eb7-0e8e-3e59-cf6d-2c6931da35ee@alu.unizg.hr> Content-Language: en-US From: Mirsad Goran Todorovac In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,URIBL_BLOCKED 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 On 6/9/23 18:13, Guillaume Nault wrote: > On Thu, Jun 08, 2023 at 07:37:15AM +0200, Mirsad Goran Todorovac wrote: >> On 6/7/23 18:51, Guillaume Nault wrote: >>> On Wed, Jun 07, 2023 at 12:04:52AM +0200, Mirsad Goran Todorovac wrote: >>>> [...] >>>> TEST: ping local, VRF bind - ns-A IP [ OK ] >>>> TEST: ping local, VRF bind - VRF IP [FAIL] >>>> TEST: ping local, VRF bind - loopback [ OK ] >>>> TEST: ping local, device bind - ns-A IP [FAIL] >>>> TEST: ping local, device bind - VRF IP [ OK ] >>>> [...] >>>> TEST: ping local, VRF bind - ns-A IP [ OK ] >>>> TEST: ping local, VRF bind - VRF IP [FAIL] >>>> TEST: ping local, VRF bind - loopback [ OK ] >>>> TEST: ping local, device bind - ns-A IP [FAIL] >>>> TEST: ping local, device bind - VRF IP [ OK ] >>>> [...] >>> >>> I have the same failures here. They don't seem to be recent. >>> I'll take a look. >> >> Certainly. I thought it might be something architecture-specific? >> >> I have reproduced it also on a Lenovo IdeaPad 3 with Ubuntu 22.10, >> but on Lenovo desktop with AlmaLinux 8.8 (CentOS fork), the result >> was "888/888 passed". > > I've taken a deeper look at these failures. That's actually a problem in > ping. That's probably why you have different results depending on the > distribution. Thank you for your work. I feel encouraged by your aim to get to the bottom of the problem ... > The problem is that, for some versions, 'ping -I netdev ...' doesn't > bind the socket to 'netdev' if the IPv4 address to ping is set on that > same device. The VRF tests depend on this socket binding, so they fail > when ping refuses to bind. That was fixed upstream with commit > 92ce8ef21393 ("Revert "ping: do not bind to device when destination IP > is on device"") (https://github.com/iputils/iputils/commit/92ce8ef2139353da3bf55fe2280bd4abd2155c9f). > > Long story short, the tests should pass with the latest upstream ping > version. > > Alternatively, you can modify the commands run by fcnal-test.sh and > provide the -I option twice: one for setting the device binding and one > for setting the source IPv4 address. This way ping should accept to > bind its socket. > > Something like (not tested): > > - run_cmd ping -c1 -w1 -I ${VRF} ${a} > + run_cmd ping -c1 -w1 -I ${VRF} -I ${a} ${a} > [...] > - run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a} > + run_cmd ping -c1 -w1 -I ${NSA_DEV} -I ${a} ${a} I have tested this and the fix appears to work: ################################################################# With VRF SYSCTL: net.ipv4.raw_l3mdev_accept=1 TEST: ping out, VRF bind - ns-B IP [ OK ] TEST: ping out, device bind - ns-B IP [ OK ] TEST: ping out, vrf device + dev address bind - ns-B IP [ OK ] TEST: ping out, vrf device + vrf address bind - ns-B IP [ OK ] TEST: ping out, VRF bind - ns-B loopback IP [ OK ] TEST: ping out, device bind - ns-B loopback IP [ OK ] TEST: ping out, vrf device + dev address bind - ns-B loopback IP [ OK ] TEST: ping out, vrf device + vrf address bind - ns-B loopback IP [ OK ] TEST: ping in - ns-A IP [ OK ] TEST: ping in - VRF IP [ OK ] TEST: ping local, VRF bind - ns-A IP [ OK ] TEST: ping local, VRF bind - VRF IP [ OK ] TEST: ping local, VRF bind - loopback [ OK ] TEST: ping local, device bind - ns-A IP [ OK ] TEST: ping local, device bind - VRF IP [ OK ] TEST: ping local, device bind - loopback [ OK ] TEST: ping out, vrf bind, blocked by rule - ns-B loopback IP [ OK ] TEST: ping out, device bind, blocked by rule - ns-B loopback IP [ OK ] TEST: ping in, blocked by rule - ns-A loopback IP [ OK ] TEST: ping out, vrf bind, unreachable route - ns-B loopback IP [ OK ] TEST: ping out, device bind, unreachable route - ns-B loopback IP [ OK ] TEST: ping in, unreachable route - ns-A loopback IP [ OK ] SYSCTL: net.ipv4.ping_group_range=0 2147483647 SYSCTL: net.ipv4.raw_l3mdev_accept=1 TEST: ping out, VRF bind - ns-B IP [ OK ] TEST: ping out, device bind - ns-B IP [ OK ] TEST: ping out, vrf device + dev address bind - ns-B IP [ OK ] TEST: ping out, vrf device + vrf address bind - ns-B IP [ OK ] TEST: ping out, VRF bind - ns-B loopback IP [ OK ] TEST: ping out, device bind - ns-B loopback IP [ OK ] TEST: ping out, vrf device + dev address bind - ns-B loopback IP [ OK ] TEST: ping out, vrf device + vrf address bind - ns-B loopback IP [ OK ] TEST: ping in - ns-A IP [ OK ] TEST: ping in - VRF IP [ OK ] TEST: ping local, VRF bind - ns-A IP [ OK ] TEST: ping local, VRF bind - VRF IP [ OK ] TEST: ping local, VRF bind - loopback [ OK ] TEST: ping local, device bind - ns-A IP [ OK ] TEST: ping local, device bind - VRF IP [ OK ] TEST: ping local, device bind - loopback [ OK ] TEST: ping out, vrf bind, blocked by rule - ns-B loopback IP [ OK ] TEST: ping out, device bind, blocked by rule - ns-B loopback IP [ OK ] TEST: ping in, blocked by rule - ns-A loopback IP [ OK ] TEST: ping out, vrf bind, unreachable route - ns-B loopback IP [ OK ] TEST: ping out, device bind, unreachable route - ns-B loopback IP [ OK ] TEST: ping in, unreachable route - ns-A loopback IP [ OK ] ########################################################################### This also works on the Lenovo IdeaPad 3 Ubuntu 22.10 laptop, but on the AlmaLinux 8.8 Lenovo desktop I have a problem: [root@pc-mtodorov net]# grep FAIL ../fcnal-test-4.log TEST: ping local, VRF bind - ns-A IP [FAIL] TEST: ping local, VRF bind - VRF IP [FAIL] TEST: ping local, device bind - ns-A IP [FAIL] TEST: ping local, VRF bind - ns-A IP [FAIL] TEST: ping local, VRF bind - VRF IP [FAIL] TEST: ping local, device bind - ns-A IP [FAIL] [root@pc-mtodorov net]# Kernel is the recent one: [root@pc-mtodorov net]# uname -rms Linux 6.4.0-rc5-testnet-00003-g5b23878f7ed9 x86_64 [root@pc-mtodorov net]# >> However, I have a question: >> >> In the ping + "With VRF" section, the tests with net.ipv4.raw_l3mdev_accept=1 >> are repeated twice, while "No VRF" section has the versions: >> >> SYSCTL: net.ipv4.raw_l3mdev_accept=0 >> >> and >> >> SYSCTL: net.ipv4.raw_l3mdev_accept=1 >> >> The same happens with the IPv6 ping tests. >> >> In that case, it could be that we have only 2 actual FAIL cases, >> because the error is reported twice. >> >> Is this intentional? > > I don't know why the non-VRF tests are run once with raw_l3mdev_accept=0 > and once with raw_l3mdev_accept=1. Unless I'm missing something, this > option shouldn't affect non-VRF users. Maybe the objective is to make > sure that it really doesn't affect them. David certainly knows better. The problem appears to be that non-VRF tests are being ran with raw_l3mdev_accept={0|1}, while VRF tests w raw_l3mdev_accept={1|1} ... I will try to fix that, but I am not sure of the semantics either. Regards, Mirsad