From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 497D6C2F3A0 for ; Mon, 21 Jan 2019 13:23:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0AEE02085A for ; Mon, 21 Jan 2019 13:23:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="SGxr28LH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728953AbfAUNXF (ORCPT ); Mon, 21 Jan 2019 08:23:05 -0500 Received: from mail-eopbgr60081.outbound.protection.outlook.com ([40.107.6.81]:48530 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728314AbfAUNXC (ORCPT ); Mon, 21 Jan 2019 08:23:02 -0500 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=ewycHXBG9YPmJ23uPHf8iS4AdWAciS8vqZ9rXRZCAeU=; b=SGxr28LHLrJEr9++gqhJ/Ln2QY543eiuCn+LzeDUY5DdI6SbtpB6TR8W7XFfHZn9Ky7nonzvDqRiP8qlBzl5oLdQLsNjZfdPBtoHKhl6oqxm3Y8wcGk4yARk/KJPmWe5vScX62PHpUUOCLdtJiCxeaaq5VNEcqs7R1/w3Eia+Tc= Received: from AM6PR05MB6056.eurprd05.prod.outlook.com (20.179.2.148) by AM6PR05MB5379.eurprd05.prod.outlook.com (20.177.117.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.29; Mon, 21 Jan 2019 13:22:54 +0000 Received: from AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::3411:612a:f48b:a5e2]) by AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::3411:612a:f48b:a5e2%5]) with mapi id 15.20.1537.031; Mon, 21 Jan 2019 13:22:54 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , "roopa@cumulusnetworks.com" , mlxsw , Ido Schimmel Subject: [PATCH net-next 3/4] selftests: forwarding: Add a test case for ARP suppression Thread-Topic: [PATCH net-next 3/4] selftests: forwarding: Add a test case for ARP suppression Thread-Index: AQHUsYxqIggL4a5BpU+n9pwOr1/MAA== Date: Mon, 21 Jan 2019 13:22:54 +0000 Message-ID: <20190121132231.25507-4-idosch@mellanox.com> References: <20190121132231.25507-1-idosch@mellanox.com> In-Reply-To: <20190121132231.25507-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5PR0601CA0036.eurprd06.prod.outlook.com (2603:10a6:203:68::22) To AM6PR05MB6056.eurprd05.prod.outlook.com (2603:10a6:20b:ab::20) authentication-results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM6PR05MB5379;6:80BuPzHKdmxeXj90bx6CwjqCI1B0h+sXDwIBdR/sdvKFF4zCyRjRtg5XbzaVl/J/Ap1pFJSVq3KDtyWuGeIvepsXrRJRk7D78F2fNdiEg32ZjWSGZ9czMkCg8w07c+z3yTpMi1gkSNAHOKWHP34OGPYSvCNhqqomoNXCr28d6emVD7JZtPJF5lgaSNuOyBG20/iFFj3qSAOqH1JF4b9/q50W7/g5S1TeS9ptSanIyjbzqEEij/3T6mPE3bzrJI35K4LIVFgSsRMj7yOcgQjFq+yhSKouXLEFvN0twswl1t0K4lOJiolPeRuEgrZZXhNuiQfYeqcIMu0/dxsVDjUYb87IN9SwGiNvf+5QaHQZNmW0VEm4eoDgWuXhWA3wSY7W1h9Ls29jtCCE5c+rnQVQHv8od52BiGk63UW/hSv+5Y/Rqso1o3F9l5QnkSU+W1kEkXeKsT08bYgzHRZ9oF6CYA==;5:GzWkaVuecKtq4I/7Hjtgd7RkJCSX0RAA0HI7AoiV3FIwx0IZZM6/ZMjM7gf0Nn7RU8vgwGRx2Je9QflMC6KSIWTzo9zLJDmTt5KthjsIR4h4QI3oW8rsEuwym7y/37lt5LQH17QWCnoC+yGtBHadx92vUsUua+qizF34yt7kx+7an08qeKAnTHC8gdXALe3FycD/1PAfkt13xU9qnFoPmw==;7:Qc6kp0JcFlygp/e+ymcJp+VVo65saR42goKQF5mXvXTCM+pnnaLcauVheLRRgiAfDf819zSBoH2F3GB8Pz1ZmCPgxedyRqfbnDeXA9A73iWOMza9zDsTLuQASCdxSsMFu4HA2bkxwEUmqX378K9Jag== x-ms-office365-filtering-correlation-id: e8b8a436-2ff9-46d2-e445-08d67fa38cb9 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM6PR05MB5379; x-ms-traffictypediagnostic: AM6PR05MB5379: x-microsoft-antispam-prvs: x-forefront-prvs: 0924C6A0D5 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(346002)(376002)(136003)(39860400002)(366004)(199004)(189003)(305945005)(486006)(1076003)(26005)(50226002)(6512007)(99286004)(8936002)(316002)(478600001)(53936002)(7736002)(186003)(476003)(76176011)(52116002)(446003)(97736004)(6506007)(86362001)(11346002)(54906003)(386003)(2616005)(81156014)(81166006)(2501003)(1730700003)(8676002)(2351001)(106356001)(102836004)(105586002)(68736007)(6916009)(71190400001)(2906002)(66066001)(5640700003)(107886003)(256004)(14444005)(25786009)(3846002)(4326008)(14454004)(6436002)(36756003)(6116002)(6486002)(71200400001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR05MB5379;H:AM6PR05MB6056.eurprd05.prod.outlook.com;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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Ckliet1vG1aCeNvFO4c+Ra2a3sXB2MTpZPwQXFnAow/mqleblyWckSHTxNvv66/y8lZufuxXFBaT0wGrBPVngaAFVV6fRc457NIvtWjzeIS1p42jLkk4sHzgonYBRjO7Kx49o+EtpbFrgXkIjOK/OYbiPh+9a5dFP8zD/mxPA8SD4GDpJU1t5RCH/dYYYrV7c0JP/Pp8eGZg84adwjGX0GPf+e0H3lN4iOKoE9XKTK0Fcl0MVy+iDq6CCkh0HDP5Zj4hp7pI8hNTPkRqKN5mrDfVyBKfeZuJWFqUGQUm6pgybRDRWj1xNxv3ll9TKTYj4GiNM+dcbvGgLNVar8Q5fWlkhOV+uwlFmeL44NK/4kfIBG6MDNMv046UnQ6ztBLPLhebGMch4FSRl2cmLTN/XSPXzoad1pH27tqngVE5T7g= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8b8a436-2ff9-46d2-e445-08d67fa38cb9 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2019 13:22:53.2362 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5379 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org ARP suppression allows the Linux bridge to answer ARP requests on behalf of remote hosts. It reduces the amount of packets a VTEP needs to flood. This test verifies that ARP suppression on / off works when a neighbour exists and when it does not exist. It does so by sending an ARP request from a host connected to one VTEP and checking whether it was received by a second VTEP. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata --- .../net/forwarding/vxlan_asymmetric.sh | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/vxlan_asymmetric.sh b/t= ools/testing/selftests/net/forwarding/vxlan_asymmetric.sh index 909426c25585..a0b5f57d6bd3 100755 --- a/tools/testing/selftests/net/forwarding/vxlan_asymmetric.sh +++ b/tools/testing/selftests/net/forwarding/vxlan_asymmetric.sh @@ -94,10 +94,13 @@ ALL_TESTS=3D" ping_ipv4 arp_decap + arp_suppression " NUM_NETIFS=3D6 source lib.sh =20 +require_command $ARPING + hx_create() { local vrf_name=3D$1; shift @@ -483,6 +486,77 @@ arp_decap() dev vlan20 extern_learn } =20 +arp_suppression_compare() +{ + local expect=3D$1; shift + local actual=3D$(in_ns ns1 tc_rule_stats_get vx10 1 ingress) + + (( expect =3D=3D actual )) + check_err $? "expected $expect arps got $actual" +} + +arp_suppression() +{ + ip link set dev vx10 type bridge_slave neigh_suppress on + + in_ns ns1 tc qdisc add dev vx10 clsact + in_ns ns1 tc filter add dev vx10 ingress proto arp pref 1 handle 101 \ + flower dst_mac ff:ff:ff:ff:ff:ff arp_tip 10.1.1.102 arp_op \ + request action pass + + # The neighbour is configured on the SVI and ARP suppression is on, so + # the ARP request should be suppressed + RET=3D0 + + $ARPING -I $h1 -fqb -c 1 -w 1 10.1.1.102 + check_err $? "arping failed" + + arp_suppression_compare 0 + + log_test "neigh_suppress: on / neigh exists: yes" + + # Delete the neighbour from the the SVI. A single ARP request should be + # received by the remote VTEP + RET=3D0 + + ip neigh del 10.1.1.102 dev vlan10 + + $ARPING -I $h1 -fqb -c 1 -w 1 10.1.1.102 + check_err $? "arping failed" + + arp_suppression_compare 1 + + log_test "neigh_suppress: on / neigh exists: no" + + # Turn off ARP suppression and make sure ARP is not suppressed, + # regardless of neighbour existence on the SVI + RET=3D0 + + ip neigh del 10.1.1.102 dev vlan10 &> /dev/null + ip link set dev vx10 type bridge_slave neigh_suppress off + + $ARPING -I $h1 -fqb -c 1 -w 1 10.1.1.102 + check_err $? "arping failed" + + arp_suppression_compare 2 + + log_test "neigh_suppress: off / neigh exists: no" + + RET=3D0 + + ip neigh add 10.1.1.102 lladdr $(in_ns ns1 mac_get w2) nud noarp \ + dev vlan10 extern_learn + + $ARPING -I $h1 -fqb -c 1 -w 1 10.1.1.102 + check_err $? "arping failed" + + arp_suppression_compare 3 + + log_test "neigh_suppress: off / neigh exists: yes" + + in_ns ns1 tc qdisc del dev vx10 clsact +} + trap cleanup EXIT =20 setup_prepare --=20 2.20.1