From patchwork Wed May 23 16:35:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10421903 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 64B4B60224 for ; Wed, 23 May 2018 16:35:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 534E5290F2 for ; Wed, 23 May 2018 16:35:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACD2B291DB; Wed, 23 May 2018 16:35:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EA4729075 for ; Wed, 23 May 2018 16:35:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933614AbeEWQfN (ORCPT ); Wed, 23 May 2018 12:35:13 -0400 Received: from mail-eopbgr00079.outbound.protection.outlook.com ([40.107.0.79]:49133 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933599AbeEWQfJ (ORCPT ); Wed, 23 May 2018 12:35:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OpKxAgfOyDo8Hk0tonZUZ6wBrJHJQ/eBcQMvLcsYRk8=; b=Wkq01F4NOfWNBc86MVyIf8ifpL/UOK+uQ0HSvNcUpytAlxvq1uk9Q3rN+r2psY+wSc4GLUQVITqEVdOTfvH3Gi5KKIIL37DbuhL6Zd6dzij8u1Z0QUEhRY2SoCpwj78ki89fVBGQa74YVDZdQkbW0cRQKtahA13+PRmB5a5p/G4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) by AM6PR05MB4181.eurprd05.prod.outlook.com (2603:10a6:209:40::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.797.11; Wed, 23 May 2018 16:35:06 +0000 From: Petr Machata To: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: davem@davemloft.net, shuah@kernel.org, idosch@mellanox.com Subject: [PATCH net-next 2/3] selftests: forwarding: Test removal of underlay route In-Reply-To: References: Message-Id: <0f1c5fd8a2e601ac13f3343a8de1cdd845da559e.1527093017.git.petrm@mellanox.com> Date: Wed, 23 May 2018 18:35:01 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [78.45.160.211] X-ClientProxiedBy: CWLP265CA0137.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:53::29) To AM6PR05MB4181.eurprd05.prod.outlook.com (2603:10a6:209:40::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM6PR05MB4181; X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4181; 3:8S7ugqqRFY38+R0s9pqmqGsBf80wxYkEtyPdCBRDq0liuT2ZMo/FVAhDedUoAyqxHHlJeCc2wujkgfkQqpzTr64QBLNZTwKdWUOfv9r9VGZRA1PRZsfWG0hcZtw2MLvw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Gdq66Q4gPSVIIgB3ax2pG3sXzv3UzsExAK+aOsqop3IgsHILelD+ktG95Pr/sVq7pP24dNEkxZjUp6cVcv7d/YXySpQGI94rIdnJmdKb/O3GIpild7zOj3ARxBflJN+2w4dRUBpn/RFQZPmwwN0TQGXTav1kIEXwSzg+V6VCNbUnbAYn62iPgDLTLL1gpc5Y9oFEWU0LkWqpXZu2KuSaOEF; 4:SggxbaY/OpMIF5hH92ieXxB2IGK0de+NVkuZ32D2ovPYjc+lLWEu+JKX//r+xxT284Ipcf47myk9HbVIaQTotaTf6eEeCuLz4kKxg0/aBNKZshBUp0W9Dthm3JaRzpuJKL6kFWBl7s7NhUZuZpxhWhq3Ks429C2ZYQrxe87IbRDiAEU3xjDNUcIJf227PXKzRhF+C0FSuK52nZ/ZBNHPax1E7adpEn9RMNKAqd+2vFYEVmBgGPB6h9IAyeJQAPN/uqILn7Vitj/6AztNxpI63g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:AM6PR05MB4181; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4181; X-Forefront-PRVS: 06818431B9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(396003)(39860400002)(39380400002)(366004)(346002)(376002)(199004)(189003)(47776003)(66066001)(118296001)(25786009)(97736004)(4326008)(107886003)(53936002)(6486002)(58126008)(316002)(16586007)(386003)(446003)(2616005)(26005)(476003)(956004)(11346002)(486006)(50466002)(86362001)(478600001)(48376002)(36756003)(3846002)(6116002)(5660300001)(81156014)(81166006)(8676002)(8936002)(68736007)(16526019)(305945005)(2906002)(7736002)(106356001)(105586002)(76176011)(6666003)(6496006)(51416003)(52116002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4181; H:t540p; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR05MB4181; 23:RcKO3DNzJjRAkeQ7XuuDxyolCmRhfmoM7xLWQyRdf?= =?us-ascii?Q?znvyHtOD+bvUbtFWkRa9/1QUSEzlHanQ+1uLYUxAyiAEeWQ/HkNRgrZvJQC1?= =?us-ascii?Q?6Gz6JfD/f8J02NPcRl+1UaW6AdS8JBiOC+6a4klD0kNm4xupUmrH4/4ub8N4?= =?us-ascii?Q?zRhL+/09pdJ4D5cAHd8H6QnTUUcXxVSfnjQW75+mOtYspvpdZyzV8jEg3BOn?= =?us-ascii?Q?5gEYzaE4LCL6wFZ6lvt1SOqtkRwJwxLkKUrycZmwjPBsjATd1UcgaXxrjwI3?= =?us-ascii?Q?4ZmdwS+lJkGboKspHDEvrTcVriRN9gwFPnqokT2cG5vGkOtAVHMntxKBP+OE?= =?us-ascii?Q?HhPgnFUPGRoxqpJs63ESYukxP0mhXuHMUC7xRfLF8AnNAHQiNfhpP3/3oz4P?= =?us-ascii?Q?LIqVw1IJFg33e+snaK3/0tloEimdR+4GABt+ufj4wVM3RviVN5YlnTDDucXY?= =?us-ascii?Q?+IkPbmw+VtwZO2wzHXT5RIFukQem+lHVJaJg6skGrNtavEPwXraZNS4eMX5X?= =?us-ascii?Q?w3yNsQlDiTwbHY0nI+S+GXTBpJmcmXu8sIGewLkWrq9VAOaxqCsDgU4UrNNA?= =?us-ascii?Q?BLxwZpKL8ftDqUUl/8sMu0P7Af+5GkxGSFccITFH23RXw6V05IueZVdmKq+N?= =?us-ascii?Q?Npz9V2QxyZFWpf2uuO0PSManJTici/KqvunoFLTUkEksjj91IbF1GIskhkHC?= =?us-ascii?Q?o6O5thpSadBnrWikFakDBySmJuAId0+hC9DTkysTSreVpM24OXO7gAdVh2V6?= =?us-ascii?Q?eaMnB9COLhpUebyXkFJeKnh/8acwZXhgKGbK7vR18pvV3kkzmLSEdxGn5Km8?= =?us-ascii?Q?Us/dqgAY25a1y+O2rfdyE6S3MbrXX8cxFrZ+LrJoKyaE5QjmxB635KobFnK0?= =?us-ascii?Q?6QF3apbOjxtGopWkmN166HBYNWCUioJYzM9dGV85KhBsyiYIuM/xsojBFM1w?= =?us-ascii?Q?aeEoZr8Fj4gAAu4VS+I+mpcYUZ14MdK2SWoAbAX4s+NyB5L6qFzISw2HLKWM?= =?us-ascii?Q?qsHfQ92z7iB1hVcC0OygyvKQ6dgxmjMunaYzIUGAK5LtpyyYlv2nvib+dfN/?= =?us-ascii?Q?2JeWWT9EqcU3WMteAhOff6NI73K1ElYbxXWBk9tQlGPI83hCW/pv/AHUfsl5?= =?us-ascii?Q?5tGJOPjXwPPg8y35ZT51bWMB7HAw25HLpCwR7In+zJVoqtrOBw50qbeEGJnb?= =?us-ascii?Q?BCnhAYyscTfS6mdqbSTGzGGq3CLveMDJPM966/GOMzeH+rfRD6dcv6THDCyy?= =?us-ascii?Q?Tj+dm06tlC78wqAjMftVWBPr/kE/Ul+q1T1B8i+?= X-Microsoft-Antispam-Message-Info: AOv4lfu4gio6saGd2HAryW+I82RjIYQpwbettCEZo57Ntb4T/zzrj7uY3GrTBeddscJEQfdzbYSzKu4cVGPJfor21ME8YA/STybZPkM+klw9wvpi6w2/bbaGOYkD63StChApn1G8GLtDIaSuWEaf4629KQsQhdlU0NPfpt5QL58rAoiM2Ynx3gf+Q7wbAc8G X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4181; 6:JXyhFUBRFu7I8uyBS3F6XlUV9nH2w5NrhaWTb8PaQPO4D943C/6eqTRfUej6kX33n5VLMITfQ1/NH2FgMOS8HBXpTatFG/dg/bKa6gg8zX4QiLQ0VRVpyVdXahVdaGpDpW609sMXYIa+e9CjlosE+xVjrzHcAubIl2XwRRsnK9fPmeZPz6p8lwKTWqfWtgkHLzYs+Gy+2kcGEEZv9zQWgwdzD/8xND2dfubMgA+cfwslquPYhxpzaXuznIq3FBBBZ/gyUTOYLlA+htp5czthHA3JWWcfC+Bo4pewrBQrwIJqButbCTQfvmOTi2QyG05gUp74S0sJzgGiTbLSGSWEASscjCsRaVFXix5kpW5EMXLUjurFSueTyA1ZPEvDA5riOVrtRJTCPLHmJyyhb16SNeQgU9J1WhnKwbeR6lC68w68ebUJyFWg6q/V/HvlBsrnW7pluyVChC2GaD0jh3RirA==; 5:2ReqWHN55TOdaLv+74VTlZlROwi3d4FdjFP1+8J2Ph0ks8/LqfXi8sEumMAT7rsHi9LwrdY2O5SQ7EoZqcVsAVlcuQLPlxGUhr2Y1Qy15EVAqA2+xaeMghZ0tnSYBsJz3NJ9IunBNXrPbaaUEat3Ju+47vwHgSjMhjVetBXU8OE=; 24:TuG+2uIlq2Z5lK7Pe0AKHhlin2eg/TYVn5oty9WD/fWcVoQxRJ+f+Lo3J0WAFKB+S0nDev/WXbFA8ekcEE1gyWzyx401ejFcAOcNmLrNnNY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4181; 7:Z91BovpnumanfVcrX86+Cwv874yzm7u9GG9unphIaFWsf5OE7UN9oWHmFNKQJrj6MhHm3y9i/vd5U5+HLjXO0PcZpcM+wMlhKVHCC813nFJUcBOPVbLBx91guF9PFpDAaTQDjtk8JqJx9nOaV71RQp85PT/5ik+owtFnW0QAxlQOhE25G+phzKzARNpMG51ZGSe2ATFszD3d1p49WWaNL+vFCpmg2dlh7PN5UdcxJyNYmz2ygH+uC0jgI5/XQ+mj X-MS-Office365-Filtering-Correlation-Id: 43e7f4b1-2c03-4c0b-e2a3-08d5c0cb247c X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2018 16:35:06.2101 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43e7f4b1-2c03-4c0b-e2a3-08d5c0cb247c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4181 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When underlay route is removed, the mirrored traffic should not be forwarded. Signed-off-by: Petr Machata --- .../selftests/net/forwarding/mirror_gre_changes.sh | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh b/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh index a35fd55..e22a9e4 100755 --- a/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh +++ b/tools/testing/selftests/net/forwarding/mirror_gre_changes.sh @@ -13,6 +13,7 @@ ALL_TESTS=" test_egress_up test_remote_ip test_tun_del + test_route_del " NUM_NETIFS=6 @@ -189,6 +190,29 @@ test_span_gre_tun_del() log_test "$what: tunnel deleted ($tcflags)" } +test_span_gre_route_del() +{ + local tundev=$1; shift + local edev=$1; shift + local route=$1; shift + local what=$1; shift + + RET=0 + + mirror_install $swp1 ingress $tundev "matchall $tcflags" + quick_test_span_gre_dir $tundev ingress + + ip route del $route dev $edev + fail_test_span_gre_dir $tundev ingress + + ip route add $route dev $edev + quick_test_span_gre_dir $tundev ingress + + mirror_uninstall $swp1 ingress + + log_test "$what: underlay route removal ($tcflags)" +} + test_ttl() { test_span_gre_ttl gt4 gretap ip "mirror to gretap" @@ -221,6 +245,12 @@ test_tun_del() 2001:db8:2::1 2001:db8:2::2 "mirror to ip6gretap" } +test_route_del() +{ + test_span_gre_route_del gt4 $swp3 192.0.2.128/28 "mirror to gretap" + test_span_gre_route_del gt6 $swp3 2001:db8:2::/64 "mirror to ip6gretap" +} + test_all() { slow_path_trap_install $swp1 ingress