From patchwork Wed Jan 16 23:06:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 1026264 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="tu+lG50T"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43g2sB1x5Lz9sBQ for ; Thu, 17 Jan 2019 10:06:54 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388049AbfAPXGw (ORCPT ); Wed, 16 Jan 2019 18:06:52 -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 S2388106AbfAPXGw (ORCPT ); Wed, 16 Jan 2019 18:06:52 -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=r2aigsimj+4rCjgffxjwrRWxRaCEsMwGXEFRcsuTMKg=; b=tu+lG50TIJx2GnTTqlCHXIenq5tMickY6Qgum8MSK217GFTaTlgqAfhDHNil/nHKXDVAM6jv+4lnX6VIJTVnyWQZPMyY+kD6VG/NsqmRHu9LbqXDS1vcLnfitkVrt0MoFmvpL2ba9GUuf2TNpYIk++DYDUwZ+ft/hTRDQcPK6GI= 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:40 +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:39 +0000 From: Petr Machata To: "netdev@vger.kernel.org" CC: "ivecera@redhat.com" , Jiri Pirko , Ido Schimmel , "davem@davemloft.net" Subject: [PATCH net-next 05/13] vxlan: changelink: Inline vxlan_dev_configure() Thread-Topic: [PATCH net-next 05/13] vxlan: changelink: Inline vxlan_dev_configure() Thread-Index: AQHUrfAjthIqnV+cuUa1D5lNfzFv4A== Date: Wed, 16 Jan 2019 23:06:39 +0000 Message-ID: <287f680e9670c41141d07cdd24245c36f3b1407c.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: AM5PR06CA0006.eurprd06.prod.outlook.com (2603:10a6:206:2::19) 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:ZFY5yPPWjKg7TF5ujsIULBMgT4qvpY6gvEWyaY/aCQAyea3xlMj9Z1XjfUpoJh2ZtZNaZT2Y7gdolwDOHcIlEuIzDtladumPwfkxf1Z4Ej7VMvjOy6zfK/BAPJ/2FXCtkemVpnF0qBx1sHGOK6rlQZLNdvtGjq3Qt/YhKgwWToqsh6NvF6hloHdrThOnvPHgf3gj3pqjiisRszbbUK1AFcjXr2aeM6hDqkA5FX2VpNuL4JkoeoSuS0Fc3LiAo63n4kaOVfiXra8yujVCcBVhzYAtdO6KEzB8cNAag5lH6nFmrgcE+SRuJBl/SGWe4niNNTtk0OO7PlWXQffmPdJIAeGetSQTbHq7OZf1eAVjFCkYERSGXGQZ9F3UAqZ5da+s/U1fmZxQ6jhfZCWOKVpTcGJNyTVlXbgxasZsz7bXeeVdyT2mayAcxMb7tJSOGwOX0r8dcc24FdLYsjJ52AvFIg==; 5:F6AvzrcU3v9WCNA31XPJShLjcxKS5I2f77gKAci4VZ7HiD2MERe4Iays7e4iUAmEfGlqHt8VF5tqLfN9EQZy/JEwFKzPc/29+Dk1if3kbrr8gBhrYtbQ5X/kblJnq94ct1JBINzi0khxGE4SMLw1ZiFJDWzzquDRf1/QS0VqbYtu3h82R4TcTJDlRtsVXutCvDeWN/jzDp3YWgxeDJRiEA==; 7:boPguvGEdvcE4dIAZjuJC2kj250S9+vySeU6VDj6kvkG+FCqHIDLUAijc7G4gRBb9EigaVGyv0E2sJCkANYtKJsIcbY4xVN9WT2VdXHnIUcav8hq9fqZaTuVhCRte1di8qCviJp2AcFPoKSmDhfgWA== x-ms-office365-filtering-correlation-id: 60e15ee4-4f9a-4e3d-3018-08d67c0745d3 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: XJzCXs54aD+6Vc0n6z6Buje5k7NvI+gQj0c0DPZXJM4kFtBp9R8iZg4Rx3PbCj5zkYFHM2U2Im/9nXRHKR4crtaBWsneroGI5vD1/lnD41B1UA+WdT19A3ccG2SfI3R2VsnwHdOFGZpCHeG03nbksn/Xw6TefxAlw+Pyw/ivEpp8tAuI7q9cktPMRzPJJiKjAfXEgjqUwGdQYXTdi7PEIm0n7WvlzSNFUVWS3qHu0MNSNnx1iffIiEzEQv8csf1P8jlMRie+7qlZQ4CG6raKOFI9/zEIKXHEneQt5LRq0k1o2h+4cNF9W3+rIjFjrz+4R5KMyOwQWoOeT7MXn+9hmIRKb4gCo+tN1QzfouoDU5jVRLcQqmKBdLw/3h6IlJFHphYvjFUQqemCPhsSUCgESqHVeHZIUtKpLUED0YbqVk0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60e15ee4-4f9a-4e3d-3018-08d67c0745d3 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jan 2019 23:06:39.4115 (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 The changelink operation may cause change in remote address, and therefore an FDB update, which can be vetoed. To properly handle vetoing, vxlan_changelink() needs to be gradually updated. In this patch simply replace vxlan_dev_configure() with the two constituent calls. Signed-off-by: Petr Machata --- drivers/net/vxlan.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 92904ee16053..f2f419c60dfe 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -3793,6 +3793,7 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[], struct vxlan_dev *vxlan = netdev_priv(dev); struct vxlan_rdst *dst = &vxlan->default_dst; unsigned long old_age_interval; + struct net_device *lowerdev; struct vxlan_rdst old_dst; struct vxlan_config conf; int err; @@ -3805,10 +3806,13 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[], old_age_interval = vxlan->cfg.age_interval; memcpy(&old_dst, dst, sizeof(struct vxlan_rdst)); - err = vxlan_dev_configure(vxlan->net, dev, &conf, true, extack); + err = vxlan_config_validate(vxlan->net, &conf, &lowerdev, + vxlan, extack); if (err) return err; + vxlan_config_apply(dev, &conf, lowerdev, vxlan->net, true); + if (old_age_interval != vxlan->cfg.age_interval) mod_timer(&vxlan->age_timer, jiffies);