From patchwork Wed Jan 16 23:06:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 1026266 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="LzRhmFw4"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43g2sF3J4Hz9sBQ for ; Thu, 17 Jan 2019 10:06:57 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388075AbfAPXG4 (ORCPT ); Wed, 16 Jan 2019 18:06:56 -0500 Received: from mail-eopbgr00050.outbound.protection.outlook.com ([40.107.0.50]:53954 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388051AbfAPXG4 (ORCPT ); Wed, 16 Jan 2019 18:06:56 -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=TtYX7V9Xqh0jIcbN0ZFa60vQd3WZBSR1R4vPFrZbDPk=; b=LzRhmFw4KUxAnEngUR1ncsZKtF/FvViyj4OB5I3eMlmnhNMGEKB0opHG8G8S9d3yrMw8YnXc9SEGPIEFuUr1pWzcciephiTWXHKcUP26Uhil0J7ZkmEGMrl5HBCXj4EGpPVI18XGLFQy4oKoMWHyZXOsAC9iY7WMk3uohni+HK8= Received: from DB3PR0502MB3946.eurprd05.prod.outlook.com (52.134.71.23) by DB3PR0502MB4058.eurprd05.prod.outlook.com (52.134.68.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.26; Wed, 16 Jan 2019 23:06:43 +0000 Received: from DB3PR0502MB3946.eurprd05.prod.outlook.com ([fe80::14e8:d98f:3ec2:3981]) by DB3PR0502MB3946.eurprd05.prod.outlook.com ([fe80::14e8:d98f:3ec2:3981%2]) with mapi id 15.20.1516.019; Wed, 16 Jan 2019 23:06:43 +0000 From: Petr Machata To: "netdev@vger.kernel.org" CC: "ivecera@redhat.com" , Jiri Pirko , Ido Schimmel , "davem@davemloft.net" Subject: [PATCH net-next 07/13] vxlan: changelink: Delete remote after update Thread-Topic: [PATCH net-next 07/13] vxlan: changelink: Delete remote after update Thread-Index: AQHUrfAlpZiWdMGA9E2RFx6dUq2kPQ== Date: Wed, 16 Jan 2019 23:06:43 +0000 Message-ID: <63e9eeafa3f989e298722119aeca900492899bd9.1547679599.git.petrm@mellanox.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5P190CA0020.EURP190.PROD.OUTLOOK.COM (2603:10a6:206:14::33) To DB3PR0502MB3946.eurprd05.prod.outlook.com (2603:10a6:8:e::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [78.45.160.211] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR0502MB4058; 6:pLv1pndOFNHNYpkw4Fq7xLsIaxZ3aTDXnEEDWrPrSXT16LbOVWY+7vufT84a5mHAwq7u54Cd3+rZHqsHhaZah9SSbYRcpugDfFVPBTcfmipZp/91eTDP+bnmHRc46LvuAB/HB4VMxw9PF8coI7liZWsPiBFPKGZkXFZwPnzCKi0YyihM7dCJedMG/r77gZkHeytNk3vVf8utZjj5wiJr6VOD5+Ym2k1hVjfPlVo6D+v2Bjzh10Xmc65MSOSg9JO6PFVD828rz9sDJSelsgivXQHFzNluPRN5BEAvLKH3O71gDrAXaC0b3fkQLQvyWApCZIb+ATEXHIKeFMLj+g4zICMw9uA0nSvMezp6rG+UrrhcWIkjWqv2sSbPiotqOknt+S62hauBiALVZ4R1s446H/mxP+7wRFBVv2LwQlE8gsdc24GJcFELoPz7YIyp/JBJVFeGL7T6suw9sbJGkT8CXg==; 5:0sExwPqodPP5Qo8t9dHvA3o++nbB+U2HiMD3bqWLdKRTOOL6PTahxzhNH80aG0seW4hNP9bb+CYFDFkAOGsVekQ/VxShdAAriOjWHF3N98dx7Zrd3gtFlxb0TY7+XQW5cJQ+moMsGgHtzaQc+j49frI7wIX/vpj0O5HF9i3nen0eeMPjmXcr+s/3BJTqMJ8N+av9P+kH8SvgSGqvQsuFow==; 7:4pc67jKBiEmvPIR7IXQylkwVj7WF4vwIVRghcHZoEe6WwNpAen/1rdOBVmkbphY+RjoXPKBWLz94SkGpxCk34BvNv+nGhXAGdDzVUi1JDE7hGCfJO90F3VgYp4GEMSNKGn9+agZmWgoUJbcPA7d3Mg== x-ms-office365-filtering-correlation-id: 1fa356bc-cdc0-4060-8fd8-08d67c0747f1 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:DB3PR0502MB4058; x-ms-traffictypediagnostic: DB3PR0502MB4058: x-microsoft-antispam-prvs: x-forefront-prvs: 091949432C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(366004)(396003)(376002)(346002)(189003)(199004)(71200400001)(106356001)(71190400001)(105586002)(118296001)(81166006)(2351001)(1730700003)(7736002)(14444005)(256004)(5660300001)(6436002)(8936002)(305945005)(6916009)(478600001)(14454004)(5640700003)(81156014)(8676002)(53936002)(68736007)(36756003)(6512007)(99286004)(186003)(52116002)(6506007)(6116002)(3846002)(486006)(76176011)(66066001)(2906002)(6486002)(25786009)(26005)(54906003)(446003)(316002)(476003)(2616005)(11346002)(386003)(97736004)(4326008)(2501003)(86362001)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4058; H:DB3PR0502MB3946.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: f16D+liE5CnEQRZBEmFTWojWJ0AlEGFgN7+5PIHrlFNhMpgl+/33PD50VL3evEKB95E1eDNrTaXMOg/nKfpmhWO+yYpSrmA822Piw7Amp736odQRIdyrh5HI3uUZh+qvPORnHNVIKsGwUoEXRuvngYvW+zCuX7c3gt0I8b3m7O4x3vstiuH2OnHCzoK6rLc77ZRKHsgD+zGYHnWCNZOeqFeERuwTxw6qpFXOMyh0+cRE1fGR/jfGOj1nDz3REl3pz7mCCESJ/wvE0i9OZc54oAAC1+Y/WP6eB23wAwlQZt/BpD13KE8SAhEfRpasQitQsTsgPULw8ncOFftBCaRhpaQd5qPV3430aiw9NqObA0Z6S4DH3Wb26Z/bkUlXyJm5nWpEJMkuPMhsXmZm4YaHsY8w4yTyjrSfj8/kwgPYly8= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1fa356bc-cdc0-4060-8fd8-08d67c0747f1 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jan 2019 23:06:42.9730 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB4058 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If a change in remote address prompts a change in a default FDB entry, that change might be vetoed. If that happens, it would then be necessary to reinstate the already-removed default FDB entry corresponding to the previous remote address. Instead, arrange to have the previous address removed only after the FDB is successfully vetted. Signed-off-by: Petr Machata --- drivers/net/vxlan.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 51e10f47d4f1..83f65eb3085f 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -3809,15 +3809,6 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[], /* handle default dst entry */ if (!vxlan_addr_equal(&conf.remote_ip, &dst->remote_ip)) { spin_lock_bh(&vxlan->hash_lock); - if (!vxlan_addr_any(&dst->remote_ip)) - __vxlan_fdb_delete(vxlan, all_zeros_mac, - dst->remote_ip, - vxlan->cfg.dst_port, - dst->remote_vni, - dst->remote_vni, - dst->remote_ifindex, - true); - if (!vxlan_addr_any(&conf.remote_ip)) { err = vxlan_fdb_update(vxlan, all_zeros_mac, &conf.remote_ip, @@ -3832,6 +3823,14 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[], return err; } } + if (!vxlan_addr_any(&dst->remote_ip)) + __vxlan_fdb_delete(vxlan, all_zeros_mac, + dst->remote_ip, + vxlan->cfg.dst_port, + dst->remote_vni, + dst->remote_vni, + dst->remote_ifindex, + true); spin_unlock_bh(&vxlan->hash_lock); }