From patchwork Thu Apr 26 23:21:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10367013 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 092006032C for ; Thu, 26 Apr 2018 23:22:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBB4528A1B for ; Thu, 26 Apr 2018 23:22:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEBE428A8C; Thu, 26 Apr 2018 23:22:36 +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=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EB29829252 for ; Thu, 26 Apr 2018 23:22:35 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40XClZ1YltzF25Z for ; Fri, 27 Apr 2018 09:22:34 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="XT494fH/"; dkim-atps=neutral X-Original-To: linux-mlxsw@lists.ozlabs.org Delivered-To: linux-mlxsw@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mellanox.com (client-ip=40.107.3.62; helo=eur03-am5-obe.outbound.protection.outlook.com; envelope-from=petrm@mellanox.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="XT494fH/"; dkim-atps=neutral Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30062.outbound.protection.outlook.com [40.107.3.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40XClW3KWczF25Z for ; Fri, 27 Apr 2018 09:22:31 +1000 (AEST) 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; bh=fJkXIwkwlBIbhJWMiIi+IPm0BxxKhiuYQ+O7RAGIK/w=; b=XT494fH/QQSpdAr4XoPh1X9sunSyIPJRerhxZroJ9i+A5SF0NenF8ZM+0rg9PYcvZKjPeQsKiyXfIozdIcOGRt4DO+M0nZ1C0uw2qi0+Ad3hQXCmVs/Qp2h1gSMlySvgujnZYD9psaMBCgn1CByY2d48kKlHAtc9GPQauO9Rq6I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (89.176.83.59) by VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.15; Thu, 26 Apr 2018 23:22:25 +0000 From: Petr Machata To: netdev@vger.kernel.org Subject: [PATCH net-next 6/7] selftests: forwarding: Test neighbor updates when mirroring to gretap In-Reply-To: References: Message-Id: Date: Fri, 27 Apr 2018 01:21:23 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [89.176.83.59] X-ClientProxiedBy: VI1PR08CA0218.eurprd08.prod.outlook.com (2603:10a6:802:15::27) To VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4191; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 3:bux8PQGVoxLQtorIJL6lFdLsxsw635+7nTZBE1JOXbrovN2Wkhihj/jYYiypRAC45fAJaxuByOK5YziVICatgC8yD8S2ILva7S2oBTwCJbX85BmASPpyJ78dFqfsxPviJUoEXKd91fb9OFwjWqBUGR4Y2pSHKnHra4PWM0XLA5fkFNR6pl2xgQsTfhgjNNyCm7cF0ZCFk/6Fu5p20eD07U8kJE8P8X83QcAaJOGCIzWq88QH437Jy1j1L9gWurih; 25:KmGZgxKF9tEqDyVaFC6gLw6RHHxZk+VNNoEStHOk9418U2Np0d6PBKtYDNT7KKRA9FdEjhYMUPwtkkTkoiJB1chkfw0YkJBfTqTnnpdQPUvo4DiTuaV+e8g83zceepQjm8PXSirywxv3GpoOGht+nxQp7IciIFQiWw97k99WIuXKFbQYDQ3JcDBCa0XJbVPi0dZRZbJMFLOVfi2NUPhCmZdfbdVXi+PsE54Bwt0SdO5oMzpXDa13tnPok4ztO2sNJ4ot/8/eIB0d4khiWk5pNGC/LeqiDSoaqzTvnh1VUlUzv0ZJC1gS7Cngr8NuZ8WQo7VGak0Lj7JvAi3xfmIJxg==; 31:b6w7k1H6KcvmBtbNQ6l3uTEPE6cbOtEUPMhuzVqFOorpBvAFTCEhMwoSvB+DSj57EW/t8rwL8rrwgjKMsKN83saepdR1+/UxFDxtSEhE9QGitQr6PrP0nLcGUBzpGOPGnln/+lZtmfpG7BucnCBp+KhnmjjLGOOHPxPALk94rNpEN6LyV1ucffSr+d8sk74fhbRIDP04uzYBOBcmaPUvowX6l7Jropmf5WHH5dVO5Pc= X-MS-TrafficTypeDiagnostic: VI1PR05MB4191: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 20:PY4erhki0e/VhtaUDY3HHoE3RKBK5gtIhKYtEAmCmdN8qJaKlpTLQJ2/LerZArUIwZRZFbZ1uPyMhzwTzqsL17hR1s712hXjly94mZpHCCtHh9Ls06xMCMUVgk6Yya3fdyZVNgEEDKfTrHVyabBrBAZUwKy3JEKpzIFlJTomZa8VGoK5lWk64ueBtU1csNhTQOdkPY+q/lPrBhI7R+NMKjAwSIEEVx7l05ndiaCgvc916IRvakg1eS09YssSqLR4XjNq/Td92aLG9AHHCiunLVXIOnODvOPn2dFLeoKfYMO64Y65UdtQDtf4vbJxYPeCHfgbXjqpr7TIlmajsmD2IwTcgYDtKyHsRAH76e2DON7HX1bDvS+SNT2IEEecIQxkdmG9Qe9OKZFIkFIVIgbWPLD1u1drbxb91zEF6RVYdllQAjk5C/qVWx948HstXq4lqs3xZktyK5RwKJXshF/8/pYj4ca70eekj4ARnwWGvLFS2QySVQQU/KWPRdk12S2S; 4:TvUejjfE1xc3ncjd7DC0u601PmpeMItolD90v3NK/JIGfGW9yOZpkOjpKDM2nLwLaS6mHiQSbgg8qHgZ0GXdLvdG7ONZdrmDKV9Pcfj/o579hyAIpk/IAksMUswtYVjWcsEUW0e7MkQdLr0DBmuSx+S5jl3JOa3THyi9iTeZJwTYkI8ac2EqSr5x7TTKt/X0sL+uqNT/o5FdwBKNrJ0Upx8S7BbY3w8rpSlxczP4DBxWmymAKO7GFTxDpGXxo5IYAMOa8hp5L+Gd1+m9XP5NPje7mlVVk6FeP8L23JJK5/ICDcgybvKp0OiuJku4hcWf X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231232)(944501410)(52105095)(93006095)(93001095)(6055026)(6041310)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:VI1PR05MB4191; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4191; X-Forefront-PRVS: 0654257CF5 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(346002)(396003)(366004)(39860400002)(39380400002)(199004)(189003)(2616005)(6486002)(106356001)(5660300001)(53936002)(66066001)(476003)(26005)(6916009)(305945005)(97736004)(48376002)(486006)(86362001)(50466002)(186003)(105586002)(7736002)(3846002)(956004)(16526019)(2361001)(11346002)(2351001)(446003)(6496006)(478600001)(386003)(2906002)(25786009)(4326008)(6116002)(8936002)(68736007)(52116002)(51416003)(36756003)(81156014)(118296001)(8676002)(58126008)(15650500001)(81166006)(16586007)(316002)(47776003)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4191; 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; VI1PR05MB4191; 23:+skZFD+x5FS3wL+hgBxm9p30LhuS/2wtOMjDsArbp?= =?us-ascii?Q?xBXEz4zQ91SkXPkGob2h+LMh7ktRfgGdbGrG9avOiMVRCBB2Tv/5zhv74fGy?= =?us-ascii?Q?birc68lsF0GDB3ZReIY4eutG69Xmb8q9hwzaTgoeQT537lWAMi2kUqnvcG4K?= =?us-ascii?Q?FWw/vNheXC5SIX9dErsNmlvkBO58/ibfJ5COViS+/xldd3qWHBOyeuQrGWfy?= =?us-ascii?Q?5WDi6Jynmc9kQqUIWmCN1Do3GwbOW/Qqu9nwx8/j7guT0s55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SZC7IN697Fe3zhIxMq8LKgQFwgr+BWQSb+3Z1EKoQ/1ISqhuEMtycFHwJqmEb4mm4woGDH9uDObdmEiBwgL1tyQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 7:UCt891H0psYeGYpHtryRXECR81xQK7pK2vyTsn+WpuxYxL/pzuOVUJTTKb0lYYW/MX6sFg0CCdQk5FNTc38c1jfDnZO8QSXKqlpAnbGdNhey37QhZ12NtPosV2lTOjUFDrEiHJ+ZkMqi0z/NZCmQAW5Z3qKZ9mZiRhoO19IQGh6XnlBnY3HpVI89/nkah2mZpJ82NiHXd8j3W+YtcNx90zQa827GsPXaD1Hjl6gqn91c+p5se8dq1K/fQDFhsH4p X-MS-Office365-Filtering-Correlation-Id: 8236f87c-a7da-4ad8-9306-08d5abcc91ef X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Apr 2018 23:22:25.1930 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8236f87c-a7da-4ad8-9306-08d5abcc91ef X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4191 X-BeenThere: linux-mlxsw@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: mlxsw driver development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mlxsw@lists.ozlabs.org, davem@davemloft.net Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org Sender: "Linux-mlxsw" X-Virus-Scanned: ClamAV using ClamSMTP Test that when a mirror to gretap or ip6gretap netdevice is configured, changes to neighbors are reflected. Signed-off-by: Petr Machata Reviewed-by: Jiri Pirko --- .../selftests/net/forwarding/mirror_gre_neigh.sh | 101 +++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100755 tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh b/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh new file mode 100755 index 0000000..1ca29ba --- /dev/null +++ b/tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 + +# This test uses standard topology for testing gretap. See +# mirror_gre_topo_lib.sh for more details. +# +# Test for mirroring to gretap and ip6gretap, such that the neighbor entry for +# the tunnel remote address has invalid address at the time that the mirroring +# is set up. Later on, the neighbor is deleted and it is expected to be +# reinitialized using the usual ARP process, and the mirroring offload updated. + +NUM_NETIFS=6 +source lib.sh +source mirror_lib.sh +source mirror_gre_lib.sh +source mirror_gre_topo_lib.sh + +setup_prepare() +{ + h1=${NETIFS[p1]} + swp1=${NETIFS[p2]} + + swp2=${NETIFS[p3]} + h2=${NETIFS[p4]} + + swp3=${NETIFS[p5]} + h3=${NETIFS[p6]} + + vrf_prepare + mirror_gre_topo_create + + ip address add dev $swp3 192.0.2.129/28 + ip address add dev $h3 192.0.2.130/28 + + ip address add dev $swp3 2001:db8:2::1/64 + ip address add dev $h3 2001:db8:2::2/64 +} + +cleanup() +{ + pre_cleanup + + ip address del dev $h3 2001:db8:2::2/64 + ip address del dev $swp3 2001:db8:2::1/64 + + ip address del dev $h3 192.0.2.130/28 + ip address del dev $swp3 192.0.2.129/28 + + mirror_gre_topo_destroy + vrf_cleanup +} + +test_span_gre_neigh() +{ + local addr=$1; shift + local tundev=$1; shift + local direction=$1; shift + local what=$1; shift + + RET=0 + + ip neigh replace dev $swp3 $addr lladdr 00:11:22:33:44:55 + mirror_install $swp1 $direction $tundev "matchall $tcflags" + fail_test_span_gre_dir $tundev ingress + ip neigh del dev $swp3 $addr + quick_test_span_gre_dir $tundev ingress + mirror_uninstall $swp1 $direction + + log_test "$direction $what: neighbor change ($tcflags)" +} + +test_all() +{ + slow_path_trap_install $swp1 ingress + slow_path_trap_install $swp1 egress + + test_span_gre_neigh 192.0.2.130 gt4 ingress "mirror to gretap" + test_span_gre_neigh 192.0.2.130 gt4 egress "mirror to gretap" + test_span_gre_neigh 2001:db8:2::2 gt6 ingress "mirror to ip6gretap" + test_span_gre_neigh 2001:db8:2::2 gt6 egress "mirror to ip6gretap" + + slow_path_trap_uninstall $swp1 egress + slow_path_trap_uninstall $swp1 ingress +} + +trap cleanup EXIT + +setup_prepare +setup_wait + +tcflags="skip_hw" +test_all + +if ! tc_offload_check; then + echo "WARN: Could not test offloaded functionality" +else + tcflags="skip_sw" + test_all +fi + +exit $EXIT_STATUS