From patchwork Thu Mar 24 20:05:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12791024 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90FAEC433F5 for ; Thu, 24 Mar 2022 20:05:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353184AbiCXUHE (ORCPT ); Thu, 24 Mar 2022 16:07:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344496AbiCXUHC (ORCPT ); Thu, 24 Mar 2022 16:07:02 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2088.outbound.protection.outlook.com [40.107.93.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F9E2B244B for ; Thu, 24 Mar 2022 13:05:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R4dPaVTHTXU7nADQi0TIsqkE4i5YdTWGV3VkAqHNO39pHWV0I8E0M01UtHuQt7DFXRTjYw3JIEDROiKrBctjvqCW0GC7PsEB7eJoPyHRsFK5ZAN1aGGRKp9WthJYoyvBonUVvllgZdNLj07pix6yj6oI2zZu3g/gWkDBvE7v2Ti7cSgIFDiphM+AInlvvdaoq1XDbw/hOVn3FmNW/sIRtGalK11/bjAptgNQqNAov3SBI+Z1PwXltestNVPoZPkoTTZfnVmWfjVbToWpXWXu2xq+D6JP9nhE6AMLn6JBNrmwAIm3CLmkvwf1+Rd+VIDPqo96WZXYYwH0OBWJs+Ljqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0muRVgS5ePMLWJnl11kyl7XQjtQcQzzx9p9vJPGxrvo=; b=DhrYTpcHD7z7XVqVKc5FkWOZjmvwMS85WhtlShxzgreGorrad8GRofSRKaelgBLtlP0VfAZhMLrHZMDYqAGDXWPDXgQusf7BLIJS68fAyP/r6CPOrMC8YPmoidOcI+GSV9rxbIOBcShsxjIcKOKacjQT3T2UcfQQvhhSyqCaGfMGbYB6o8v50LqPj3tUIlfWF/p57bch5ED+Wft3gXGeFP6dR6gViVGzmrulYMIT/5wZCfYOVdAH4G5keGcdTXnEkW9rVNCZwhN3Nx5zyZ032DEtf7vBMT3Jbodu4NJ1CMJJLCO0utZKcSNDNcdismLfxDbn1XTm8GCjOymd30CWEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0muRVgS5ePMLWJnl11kyl7XQjtQcQzzx9p9vJPGxrvo=; b=K1fleVGTBL8ruBC6psl1Tt4aSN1M1mEldThI3wWQoLmPdCSCTdnyeIm+Z2IrA71ST8S6eNbwuUGPXGOvkHzqzVi/0a859BK3bFJpdboAXckQDK0LM8vErAH80NFY3JCwYelOyX+8a/9Vm5F6tN2b/FEx2/RRVrZYa2eoNpPYq1xHu3p06VATR5TgQnxmJj97l7Tyiv8BNngCOiFVOLDSEdlST2rUkXNR2RAw57eVnDqC3uMcLb6+xR5bo2w2EfpQRerUSc5G3OBPLOqBbGzLQUYjrFviAL9IDEz4Im8qUpK6JlLhgEuLmp/rVKfOts8G3V0QQn1YEaUJf11YIEPp9w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from SA0PR12MB4352.namprd12.prod.outlook.com (2603:10b6:806:9c::9) by DM5PR12MB1529.namprd12.prod.outlook.com (2603:10b6:4:3::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.16; Thu, 24 Mar 2022 20:05:27 +0000 Received: from SA0PR12MB4352.namprd12.prod.outlook.com ([fe80::54cb:32b6:bbde:13c5]) by SA0PR12MB4352.namprd12.prod.outlook.com ([fe80::54cb:32b6:bbde:13c5%4]) with mapi id 15.20.5102.017; Thu, 24 Mar 2022 20:05:27 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, abauvin@scaleway.com, akherbouche@scaleway.com, dsahern@gmail.com, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH net] selftests: test_vxlan_under_vrf: Fix broken test case Date: Thu, 24 Mar 2022 22:05:14 +0200 Message-Id: <20220324200514.1638326-1-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 X-ClientProxiedBy: VI1PR0501CA0021.eurprd05.prod.outlook.com (2603:10a6:800:92::31) To SA0PR12MB4352.namprd12.prod.outlook.com (2603:10b6:806:9c::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3c33e1b4-5be5-47ab-e615-08da0dd1a3de X-MS-TrafficTypeDiagnostic: DM5PR12MB1529:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O8BvRGuFO6I/afeQ6Q/W/j7EnIjKNnZGa7Icnkxx1ZuxfNJndrK2Pwx73Ireb+CBzKJD+5b4odKbZAPi6JcrJUA2vyng/255tJxYEDKUR7kM2vAZMPaw8aFFMtAxcPjbFuHITd2R6WdVoDLCHHDp9oRH+XYIovhiDy75QjIrqyKplRRuReQhiTBzjyX4yUCVib1UtG/07sIiB2cGglFWBoJGLhfL6PuOOhoQe+bUYqpdyJ29ryD3jQFAFkf0DyI4Jz1hXPykyAQS0XFoaRVuUZx9wAWy/cI5JutnTX2JRuzglAFgM1BuGBVtkRE0qvrJsQjN3ngTMlsQ4X7WwkGoiKfpYkFi5cjD/2o55mUPDUyaym8KS2lE4VfSq1iJ01Gqqs/kuAueS5ejjHzu/EFbKVhd+wungnCEacdR6Ee/jnwirZeUKakMiY/fesbgMSpR6Csomc89xxvWkIkrUep1xGxuBVxoPlAUOiMpozhuDyxFivVeVT5WqIV7rmiy7bg2yuq+l2rQSbxfvQHxc8zWlk4lL3B//2LLRIzzImG3ojEHhv5isfEXzlkRLU6rULHA13psXBEiT9q+zQgGBDmRWTcSjXfhtbn3ImBjSrjV8EhBxdUcy8L3uD0rZVIHUO3MWast7RH8Puuyl5MxyRI5ag== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR12MB4352.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(2906002)(83380400001)(38100700002)(508600001)(8936002)(5660300002)(186003)(36756003)(107886003)(6486002)(316002)(4326008)(66476007)(66556008)(66946007)(6916009)(6506007)(6666004)(6512007)(8676002)(1076003)(86362001)(2616005)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VFSOvOVvOZYWl9/BcKYRf2BhLG5HPD61TgVMoSt84HunD5Jrwb5Lo0dufgtjc1nybIQcLfm0lQckx7Sz/CEfYF4jF2RisLGu2hl8x92AP+O9j9jMv3MKAqmbjMwnWHpVumeRIBQWJa72utCwGjS3pUkgFczh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rxGgBhB441fYluHWsnPKFx2dWEMTT0QSbeaU3MEoAUO2J+zd+T1mv6EWle5sCn0GdwTO1Ir1+iwI9bBzsMFxy9p/ySZp1HWVKsQ5P8VSgE6ZXueGekfhvfU9XNYZ8T2h7JAxd/9sNukc5SSIUuOJHV6WrsU0wbKwNlPyBuYpwaL2m3ENtNINFp6VgHmd628IjMkB6vdbrrYK3MGHIq/zCpEa1W0Bb4BoZJe X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c33e1b4-5be5-47ab-e615-08da0dd1a3de X-MS-Exchange-CrossTenant-AuthSource: SA0PR12MB4352.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2022 20:05:27.7323 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZjZBxLVA7kvwGTKpKDjF3rtsntKwBt/xfQRo0TFca+uDW+1xeZpZYHOE9q1gHKXJPVsCIlUYarb5L/Faroz2Ug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1529 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The purpose of the last test case is to test VXLAN encapsulation and decapsulation when the underlay lookup takes place in a non-default VRF. This is achieved by enslaving the physical device of the tunnel to a VRF. The binding of the VXLAN UDP socket to the VRF happens when the VXLAN device itself is opened, not when its physical device is opened. This was also mentioned in the cited commit ("tests that moving the underlay from a VRF to another works when down/up the VXLAN interface"), but the test did something else. Fix it by reopening the VXLAN device instead of its physical device. Before: # ./test_vxlan_under_vrf.sh Checking HV connectivity [ OK ] Check VM connectivity through VXLAN (underlay in the default VRF) [ OK ] Check VM connectivity through VXLAN (underlay in a VRF) [FAIL] After: # ./test_vxlan_under_vrf.sh Checking HV connectivity [ OK ] Check VM connectivity through VXLAN (underlay in the default VRF) [ OK ] Check VM connectivity through VXLAN (underlay in a VRF) [ OK ] Fixes: 03f1c26b1c56 ("test/net: Add script for VXLAN underlay in a VRF") Signed-off-by: Ido Schimmel Reviewed-by: David Ahern --- tools/testing/selftests/net/test_vxlan_under_vrf.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/net/test_vxlan_under_vrf.sh b/tools/testing/selftests/net/test_vxlan_under_vrf.sh index ea5a7a808f12..1fd1250ebc66 100755 --- a/tools/testing/selftests/net/test_vxlan_under_vrf.sh +++ b/tools/testing/selftests/net/test_vxlan_under_vrf.sh @@ -120,11 +120,11 @@ echo "[ OK ]" # Move the underlay to a non-default VRF ip -netns hv-1 link set veth0 vrf vrf-underlay -ip -netns hv-1 link set veth0 down -ip -netns hv-1 link set veth0 up +ip -netns hv-1 link set vxlan0 down +ip -netns hv-1 link set vxlan0 up ip -netns hv-2 link set veth0 vrf vrf-underlay -ip -netns hv-2 link set veth0 down -ip -netns hv-2 link set veth0 up +ip -netns hv-2 link set vxlan0 down +ip -netns hv-2 link set vxlan0 up echo -n "Check VM connectivity through VXLAN (underlay in a VRF) " ip netns exec vm-1 ping -c 1 -W 1 10.0.0.2 &> /dev/null || (echo "[FAIL]"; false)