From patchwork Tue Jan 8 16:48:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1022035 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="F7xAhB33"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43Yyqs0dzKz9sLw for ; Wed, 9 Jan 2019 03:48:09 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728987AbfAHQsI (ORCPT ); Tue, 8 Jan 2019 11:48:08 -0500 Received: from mail-eopbgr50086.outbound.protection.outlook.com ([40.107.5.86]:21248 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728238AbfAHQsH (ORCPT ); Tue, 8 Jan 2019 11:48:07 -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=Q07T2MPTOSO8bL/ue+c4sxDxMt7HSf1orVJOOliereg=; b=F7xAhB33OwMipvCo4MRh54viJhWkAhunJ+KnhtLrFwS4NWa8yGqT0zIMcWeyZKD+0+b7REnLuhKnS67VJjxvu7Xda+h+KQEts79Z90RVrQx3PfdS/61eh0z4Md1OfnSxP3xMfFrpRxR/YOmI5Aa8iQuxkScPF82kJMvIcqrOv3A= Received: from AM6PR05MB6056.eurprd05.prod.outlook.com (20.179.2.148) by AM6PR05MB4405.eurprd05.prod.outlook.com (52.135.163.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Tue, 8 Jan 2019 16:48:03 +0000 Received: from AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f]) by AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f%3]) with mapi id 15.20.1516.010; Tue, 8 Jan 2019 16:48:03 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , Petr Machata , Nir Dotan , mlxsw , Ido Schimmel Subject: [PATCH net 01/11] mlxsw: spectrum_acl: Add cleanup after C-TCAM update error condition Thread-Topic: [PATCH net 01/11] mlxsw: spectrum_acl: Add cleanup after C-TCAM update error condition Thread-Index: AQHUp3HskAnPeDvgx0C/v0BOcfxj4A== Date: Tue, 8 Jan 2019 16:48:03 +0000 Message-ID: <20190108164732.4024-2-idosch@mellanox.com> References: <20190108164732.4024-1-idosch@mellanox.com> In-Reply-To: <20190108164732.4024-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P192CA0024.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::37) 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; AM6PR05MB4405; 6:tATmo/z6ajDBfyBU3+evKWsmqBURfOUf/Hk3Ja2Mx5HZuovz9d5CG0T/PIfAddJqPmKikUs2flc0znwckEQ5Fb4bRB2R3kMf+E5n7QvI/PRHEyUH/G1DjNYwT4nL3QVd+rzmlvNozfqMa3+kS48FPXgeW8gj/nOalIgTBuQBOQtfzAPurdffedTUDB6A2pSwghtYlY6A+QeVb6nsfJqETnOn/gMvUhEhAmL9beRN9NUyB0aIoNir5egAOtub8TRFwCvKRQHOdhYCoX69bXYj+PfBV6Vlee8GE175sXnCim6EhkSuEogWJlMptIMOkoSXJIWV/hHhu2plKHWj9wHnR2ECSzfAb90kqYr4Q/th6m3333dcTICwS2fRBPcKo9MRCqdJV85AZvI9Ei3BxjN45nRbguDKkAzivett/m8ai7GXlMY2lWJ4pfv7lchfT1gItgwl5GVNMQGphBpNUrp0QA==; 5:S7jeydmrh9igATZ89CcG5D5aqbpRIYDHnTj1KJylsFF+WxCJQqc+VvoxPL3/hDk0Bvl7o7+PQMlHmoacPWLxhklwGi1hGp14ga1iqGNkVa+f0GQGx1XmqyueEnOAm3eYR9rANSfoEegIGTm2I2H69/Bl+Oarc5J871qvlyaEVQR1Qqovcgr6pPj6fRcAb2Mt4HoF03XymD4h/fd4bIrMZw==; 7:BGvJgFXwzSu13DlE0kGZVN0f+cwsUiET8sxqS60V5FK7oba4kbCE8wHDKMn3GuS7si+0h7epWzyQMJazjzJTr/2TqBe7NGZcSbuk49w7N0d0NTHOPn6399ACQHBQuIOZ3jSNXnJ1CaSkFkgcwlXrZA== x-ms-office365-filtering-correlation-id: 6e32d529-6ea9-4675-d4ef-08d675890e5d 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:AM6PR05MB4405; x-ms-traffictypediagnostic: AM6PR05MB4405: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM6PR05MB4405; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4405; x-forefront-prvs: 0911D5CE78 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(366004)(189003)(199004)(106356001)(105586002)(2906002)(6486002)(6116002)(3846002)(99286004)(6506007)(305945005)(486006)(7736002)(102836004)(386003)(76176011)(86362001)(52116002)(26005)(66066001)(5640700003)(6436002)(186003)(97736004)(2501003)(6512007)(2351001)(25786009)(1076003)(478600001)(81156014)(8936002)(36756003)(81166006)(68736007)(4326008)(50226002)(5660300001)(14444005)(575784001)(256004)(1730700003)(107886003)(8676002)(6916009)(53936002)(54906003)(316002)(11346002)(14454004)(2616005)(71200400001)(71190400001)(476003)(446003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4405; H:AM6PR05MB6056.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: RraCXQVBmmOurAXovV0R5Pt2uxrvOe7KLe/6l7LD96wlqVV2YODg4LHJp2XHxMXOpsJcYV78x5jxBHZIAYjy/xAyOebTaYvtzs1SEUAk4uQQ4CNSuSf2ynK+yEhMd7z+hAQwMmXhXhz0m1cw6ypdqc0VQBzDBuui592cSyz1GjFIwPLxLtXZW2gzZFBoApTCFBcjvERmrqZbFiRl00CYTm38JpuIzjaGwswQJRlUo55jFStZhaulz+mNCqf5GR3qyQ6z7EstQTwGfuCn2kwrGTZoSONIBq7BRrP8axJLSnJWIZ3CGq6ZqGwas26/grH3 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e32d529-6ea9-4675-d4ef-08d675890e5d X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2019 16:48:02.5959 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4405 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nir Dotan When writing to C-TCAM, mlxsw driver uses cregion->ops->entry_insert(). In case of C-TCAM HW insertion error, the opposite action should take place. Add error handling case in which the C-TCAM region entry is removed, by calling cregion->ops->entry_remove(). Fixes: a0a777b9409f ("mlxsw: spectrum_acl: Start using A-TCAM") Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel --- .../net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c index b0f2d8e8ded0..ac222833a5cf 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c @@ -72,7 +72,15 @@ mlxsw_sp_acl_ctcam_region_entry_insert(struct mlxsw_sp *mlxsw_sp, act_set = mlxsw_afa_block_first_set(rulei->act_block); mlxsw_reg_ptce2_flex_action_set_memcpy_to(ptce2_pl, act_set); - return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl); + err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl); + if (err) + goto err_ptce2_write; + + return 0; + +err_ptce2_write: + cregion->ops->entry_remove(cregion, centry); + return err; } static void From patchwork Tue Jan 8 16:48:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1022039 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="HVxSVsR/"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43Yyr771mKz9sLw for ; Wed, 9 Jan 2019 03:48:23 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729067AbfAHQsX (ORCPT ); Tue, 8 Jan 2019 11:48:23 -0500 Received: from mail-eopbgr50086.outbound.protection.outlook.com ([40.107.5.86]:21248 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728791AbfAHQsW (ORCPT ); Tue, 8 Jan 2019 11:48:22 -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=VGHxwQKp2NOsYpN75aW13KPF6WUgLANVDxLwUy90Qv8=; b=HVxSVsR/wkaTk/mWdmu4z46Io3wxavMMm/iu9O8NrFYBI+wSGLfJ4pbGVUnqs6i7B2F5k+MI3ebrJZMquJZ+XkkPdAr1sq+j2Op2TzOCRo0zhN5MYNCBg9BInc34qLDn27r4dpYD+vz8jA1P4dnhGUncEPLDVLDKq8vxuhSfkdM= Received: from AM6PR05MB6056.eurprd05.prod.outlook.com (20.179.2.148) by AM6PR05MB4405.eurprd05.prod.outlook.com (52.135.163.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Tue, 8 Jan 2019 16:48:04 +0000 Received: from AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f]) by AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f%3]) with mapi id 15.20.1516.010; Tue, 8 Jan 2019 16:48:04 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , Petr Machata , Nir Dotan , mlxsw , Ido Schimmel Subject: [PATCH net 02/11] mlxsw: spectrum_acl: Remove ASSERT_RTNL()s in module removal flow Thread-Topic: [PATCH net 02/11] mlxsw: spectrum_acl: Remove ASSERT_RTNL()s in module removal flow Thread-Index: AQHUp3Hsu7y9n14p0UuCMpC8FtJMzw== Date: Tue, 8 Jan 2019 16:48:04 +0000 Message-ID: <20190108164732.4024-3-idosch@mellanox.com> References: <20190108164732.4024-1-idosch@mellanox.com> In-Reply-To: <20190108164732.4024-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P192CA0024.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::37) 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; AM6PR05MB4405; 6:if2hu2PggTPXpyphV5UxqD5cFEQQ/zIP+p3Qsh4iYP59BIaMppkycMOu30DU2JLzstY/AlbdBRtMOAgjvhTVQT0WppELvQtp3qvxsv9bfho49pAUKIlodAqMnnNMh5E/Cem4vodevwVpDaC8/9I5YA2X2rSYCFMdl2wTT4EKjITvkopFjP6vTNjpLnuYFGNu8xYaByfH0RzD7ORcekYjmJSGSQqGvwSEQ4i5WHVuHdBh+F+BmJRhHXMRhfcdm6Mk7Bioa6lV08WqaCHNbkTI05M6/n0O7jLFQnCI/e2Kk6B5odUCRLog+ZeRogUnGer2Y0TOXj2fAQJ2R5fJ6tBPp4X9/zOR5jC7bmUYu0ks62ARefOUOrfVe/lad9u9Vyjs17MxSs8/yYriKw1OEew7xrdQzTP3wFRRavjdktn2AwdKHtgB40KaiQ9IWmlvrrT8SiVkZVxzuM1dWG7m/zJnMA==; 5:Q1NV4heTBKqvaV6IHmKMkQP0iFUGeX5nPDMTNihi2G8BBlKgmXVSAfZjxgc1AVTgNnHs3Ke1vDHhZnrGEzQp0cJjG5vCimqISOqzcFT+1jSPTPPj6PgO/PQu2E6pqenZBI8yRmf4NdDnQNHwVO8jvEKEZDXhz76ClOAeYtj8GC/cii4PX3uso6rVdYfD28l5GIYS3j9ij9EkcplFgMRqDQ==; 7:HBobZFZf/n+7iEapI4e0+CJ63gC91qOT/yLG095JTDvvptykJmmmdVyFhODhNoFom62UWFZk/Hjso/uzWMfXYF3IZeaGFvQnwDYHkPqAuToXYYzRtQG/GBJxZ7Q95t5iuY3SVaHYTp2fEyG6fQ6+1Q== x-ms-office365-filtering-correlation-id: 38fa2bc3-cac1-4ebf-d304-08d675890eed 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:AM6PR05MB4405; x-ms-traffictypediagnostic: AM6PR05MB4405: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM6PR05MB4405; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4405; x-forefront-prvs: 0911D5CE78 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(366004)(189003)(199004)(106356001)(105586002)(2906002)(6486002)(6116002)(3846002)(99286004)(6506007)(305945005)(486006)(7736002)(102836004)(386003)(76176011)(86362001)(52116002)(26005)(66066001)(5640700003)(6436002)(186003)(97736004)(2501003)(6512007)(2351001)(25786009)(1076003)(66574012)(478600001)(81156014)(8936002)(36756003)(81166006)(68736007)(4326008)(50226002)(5660300001)(14444005)(256004)(1730700003)(107886003)(8676002)(6916009)(53936002)(54906003)(316002)(11346002)(14454004)(2616005)(71200400001)(71190400001)(476003)(446003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4405; H:AM6PR05MB6056.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: AeUKE6XZX1r/I7Jh0dHLZR4MUyCLeuUp+75QhgJcJ/hndagCvU6lkt9AP33opbuk3Sfr41Q6o8YEeA/dQhmgOiT6aTzki44HCu5MBYzGPCIAmo634/IDmtd1uPmYe5vOGbq3DdPhru9lXMntkiuVlurgP4VOpIqE69KkrBK2nC5sK0qLi0dHtuvG+scZi6l6cNkvi8keyVPirXL+paMBPCmpK2LYh746VwUiTpp5EBkSvlfQ8Py76fth8lEVE42SaFSJHu8V0QB5/xKAr+WuBhlwegaFyYsVv8FEPzxeliyLaS9qQF5HcoFwrfvA/BoX spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 38fa2bc3-cac1-4ebf-d304-08d675890eed X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2019 16:48:03.5406 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4405 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nir Dotan Removal of the mlxsw driver on Spectrum-2 platforms hits an ASSERT_RTNL() in Spectrum-2 ACL Bloom filter and in ERP removal paths. This happens because the multicast router implementation in Spectrum-2 relies on ACLs. Taking the RTNL lock upon driver removal is useless since the driver first removes its ports and unregisters from notifiers so concurrent writes cannot happen at that time. The assertions were originally put as a reminder for future work involving ERP background optimization, but having these assertions only during addition serves this purpose as well. Therefore remove the ASSERT_RTNL() in both places related to ERP and Bloom filter removal. Fixes: cf7221a4f5a5 ("mlxsw: spectrum_router: Add Multicast routing support for Spectrum-2") Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c index 1c19feefa5f2..2941967e1cc5 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c @@ -1022,7 +1022,6 @@ void mlxsw_sp_acl_erp_mask_put(struct mlxsw_sp_acl_atcam_region *aregion, { struct objagg_obj *objagg_obj = (struct objagg_obj *) erp_mask; - ASSERT_RTNL(); objagg_obj_put(aregion->erp_table->objagg, objagg_obj); } @@ -1054,7 +1053,6 @@ void mlxsw_sp_acl_erp_bf_remove(struct mlxsw_sp *mlxsw_sp, const struct mlxsw_sp_acl_erp *erp = objagg_obj_root_priv(objagg_obj); unsigned int erp_bank; - ASSERT_RTNL(); if (!mlxsw_sp_acl_erp_table_is_used(erp->erp_table)) return; From patchwork Tue Jan 8 16:48:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1022037 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="XmOrohSH"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43Yyr15wLkz9sLw for ; Wed, 9 Jan 2019 03:48:17 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729009AbfAHQsQ (ORCPT ); Tue, 8 Jan 2019 11:48:16 -0500 Received: from mail-eopbgr50054.outbound.protection.outlook.com ([40.107.5.54]:49376 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729109AbfAHQsQ (ORCPT ); Tue, 8 Jan 2019 11:48:16 -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=Riml1bULJeub/AR4y6X//S24e2jHkAyhMOCE/bTMv7w=; b=XmOrohSH0kNah2SPxA03a6E7mp+Tnbmduh5hYjYPo37wKfJ91qPu8TkQxbSIXuym6dPpxLkJO7Qa2wt966+ln+74gQpm//h/cOIj3O9yH4FLFeY2bFWU0WJ7dRnjwBKgMrilxfH2a1BKmMKUQQeHQvdZZcYMpYRidlWBPrUL3gY= Received: from AM6PR05MB6056.eurprd05.prod.outlook.com (20.179.2.148) by AM6PR05MB4405.eurprd05.prod.outlook.com (52.135.163.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Tue, 8 Jan 2019 16:48:05 +0000 Received: from AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f]) by AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f%3]) with mapi id 15.20.1516.010; Tue, 8 Jan 2019 16:48:05 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , Petr Machata , Nir Dotan , mlxsw , Ido Schimmel Subject: [PATCH net 03/11] mlxsw: spectrum: Disable lag port TX before removing it Thread-Topic: [PATCH net 03/11] mlxsw: spectrum: Disable lag port TX before removing it Thread-Index: AQHUp3HtFi2n9vWHEkKRFeqyTeFT5g== Date: Tue, 8 Jan 2019 16:48:05 +0000 Message-ID: <20190108164732.4024-4-idosch@mellanox.com> References: <20190108164732.4024-1-idosch@mellanox.com> In-Reply-To: <20190108164732.4024-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P192CA0024.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::37) 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; AM6PR05MB4405; 6:KbwSiU+Jo9xIbuOX+AaNlRVmVMWWt+7pHpPkzqMJER2XB3ww28MRS2GZiTjfzd9ABgRdxBBhPOaEmBOcEWE9S0hQgBDrqVoFUeyETA0MHqLkZ8JVRyBylDw5Ug2qytzWt59A4HHOE5Qcqzr5wqBllj4FIm/VHmO+Pq/3bwRYMuCjWdvHrLXg4b34Q7qilWZlqU4HoueKlfSgsSjtC6QBNPuCEWoSOBRFXjfAicT7XDZkPSZUGc9DB3ZqLGjNu3f2zJ54HFQSCalL85qepyV7Ta53tu6qOZfr71lkA6oAOgZS3hPmnCo1pXwu14eXVmCJYcIf6VpMnidwHxw1QKzxebr+V0O5laqcKmXgWyOZy3UfKVJBqlgeO+8m4prdAZzXmKpwZStc4V8yx7zndanMALTTP4ZynCJi4z+bqidvXKfNmKuMx+GfTYvXx03N7U/5lygaOiiJ8ys3SDUeZOvHPg==; 5:V8UIIJSz0+828wvCr4UvGMtZUII2OpC+mtUXxT6VN5Ovsy+WISuZgrr8C1F5bcZntUUwzZCxGEGxK1s/jVk7PdITG1bZvcIIpqlajnuMnB6zEXhVSFOE8BoFwRYoFlxPfHHBiLM+g94pEQvrtOAl8ztjonr8yfyB++XXxyfsq7R0SDNRgxZSmjh80/e5yYSEev2LKRbhq03CRGX5CXkl1A==; 7:hfix/7dS0OphkwgnMdVi+J1pPedzHK6pasbNNQ7lKMEmqYifKq/qE4TjgOE1ca1mMQv6LCnDtr13dEcs0CPS1k7T0rXvFAmb1wLjj6OUKPo2/C9U70YcpNLH94LlSrJi/VUdW7CJ7NyR2BmHPSRLrw== x-ms-office365-filtering-correlation-id: 9075a90e-b405-4069-3f9c-08d675890f96 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:AM6PR05MB4405; x-ms-traffictypediagnostic: AM6PR05MB4405: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM6PR05MB4405; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4405; x-forefront-prvs: 0911D5CE78 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(366004)(189003)(199004)(106356001)(105586002)(2906002)(6486002)(6116002)(3846002)(99286004)(6506007)(305945005)(486006)(7736002)(102836004)(386003)(76176011)(86362001)(52116002)(26005)(66066001)(5640700003)(6436002)(186003)(97736004)(2501003)(6512007)(2351001)(25786009)(1076003)(478600001)(81156014)(8936002)(36756003)(81166006)(68736007)(4326008)(50226002)(5660300001)(14444005)(256004)(1730700003)(107886003)(8676002)(6916009)(53936002)(54906003)(316002)(11346002)(14454004)(2616005)(71200400001)(71190400001)(476003)(446003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4405; H:AM6PR05MB6056.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: fsrD2cfIBxeEPfqsutLI0opwqVka1/PIK5O0mV0K33rMGcP7BX08V5DdKnez4tgLSlRhE29SXKqWJ8NVj5reABNjD3GbHJU1r3gNNGZCdhSDQ0m7DZxVoR0CAO+A3vtKE5Rgr+v+8rxQzaWwDuQ2RUW6X2gyzDfLBE4OODx7tYDW6yAJ+W0bC1s62vU2RWFRM8NAk7QlFhlRBsGXVuHVln96aAKs3F0iytWn/xsrwHl7qWc9NQ9nq9YGgzZbZejttUaMxeQIaYL1iXMzYp4gjkDuX7F8dXWADuqlj0kwQym3OIJ9hKmssn4HS2jZy5aH spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9075a90e-b405-4069-3f9c-08d675890f96 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2019 16:48:04.6434 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4405 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jiri Pirko Make sure that lag port TX is disabled before mlxsw_sp_port_lag_leave() is called and prevent from possible EMAD error. Fixes: 0d65fc13042f ("mlxsw: spectrum: Implement LAG port join/leave") Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index eed1045e4d96..32519c93df17 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -5005,12 +5005,15 @@ static int mlxsw_sp_netdevice_port_upper_event(struct net_device *lower_dev, lower_dev, upper_dev); } else if (netif_is_lag_master(upper_dev)) { - if (info->linking) + if (info->linking) { err = mlxsw_sp_port_lag_join(mlxsw_sp_port, upper_dev); - else + } else { + mlxsw_sp_port_lag_tx_en_set(mlxsw_sp_port, + false); mlxsw_sp_port_lag_leave(mlxsw_sp_port, upper_dev); + } } else if (netif_is_ovs_master(upper_dev)) { if (info->linking) err = mlxsw_sp_port_ovs_join(mlxsw_sp_port); From patchwork Tue Jan 8 16:48:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1022038 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="sRpvVf7z"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43Yyr42kdmz9sLw for ; Wed, 9 Jan 2019 03:48:20 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729042AbfAHQsT (ORCPT ); Tue, 8 Jan 2019 11:48:19 -0500 Received: from mail-eopbgr50054.outbound.protection.outlook.com ([40.107.5.54]:49376 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728989AbfAHQsS (ORCPT ); Tue, 8 Jan 2019 11:48:18 -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=ocIpbhdJSXjRNy9NZt9yKtEsgq3JVa1QoTLs+82wjxM=; b=sRpvVf7zuNmW0neLyAo/uVT8N1tVqefmG/FEjOxMy/oVMSXvXXb7GsF2VAn6todtgLQrlHxHQsGivcuQGazZJSZoUZ4LZH/jTnCIh3YbAJdSWAIg7GmO9nGR1B4RuBKWyPF6JcFxHPuMd5ld7G32IfKwuXdv0Uw6/+fdd6MRHsw= Received: from AM6PR05MB6056.eurprd05.prod.outlook.com (20.179.2.148) by AM6PR05MB4405.eurprd05.prod.outlook.com (52.135.163.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Tue, 8 Jan 2019 16:48:06 +0000 Received: from AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f]) by AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f%3]) with mapi id 15.20.1516.010; Tue, 8 Jan 2019 16:48:06 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , Petr Machata , Nir Dotan , mlxsw , Ido Schimmel Subject: [PATCH net 04/11] mlxsw: spectrum: Add VXLAN dependency for spectrum Thread-Topic: [PATCH net 04/11] mlxsw: spectrum: Add VXLAN dependency for spectrum Thread-Index: AQHUp3HtPlPqv2BLYESbV51geoyTjA== Date: Tue, 8 Jan 2019 16:48:06 +0000 Message-ID: <20190108164732.4024-5-idosch@mellanox.com> References: <20190108164732.4024-1-idosch@mellanox.com> In-Reply-To: <20190108164732.4024-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P192CA0024.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::37) 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; AM6PR05MB4405; 6:AGxv1W/iy7Rg4AvLlslxt3lVEFOfDj8hindqBuAQ3YchkbvWscG2ZIusEk9asaTE6/vn5IlAAsbzgcwDSyA/4RHNF7qXdeh9/x6FL/EdrkHg8uGyBDK+hOj7+0nQ9rNytFwLlq7g4MRgM0gB6OsxN/V2nJNEZrkDchhJNpCqSLWR0BRYkZu0UVhhmvZn7rePK/CaPo4BA6eqrSAWhU8R2+ygA3iBbRsy4W49fJg79+qaXb2K2qad4uNupBDiPR3pd4oktFwLtLHP2upODkIrdgR+TDEn2Iy8vOlM3++ISINPt6W9aE3IfRIqPQ0n3DhL/VH7tQacePr6g3h4kyUzradvbIYyYeMIBxD04ahLHReE6j3sfQB4nyxaYfoxBw0PRaIqFoodahuQ+O47LZLAbdVGcefX4voNYUNPqP5lhhU16zgwrRyLD/s0n+Wyntd8Z1aRwaCIIjGSd73Y9ygbYQ==; 5:XkQAy106eIMhPyDNfbgbH4lR7lau/6TcqidSmquQb6xGnsnFIuRmhbKtw3Tjm21PLaX06kol7AXjm9ClNaiPvw1zYWOhsHMLYRsKVGMqYie2VAPS+fr73NIDIUmdMV5FshRSYo4x3l1QZuj4m4Us1SJna3feYJAU/PRYR99FmmY+uXHDOSuUaMnHSFPrAthNH1vnCPS9qhlqIjDgh2HgNQ==; 7:jzcTxOQe3OnQPWFbKi3tHCTf5T8TfEfayl5+M2XIMxYBf/WMYvDZOTj/2pMV5E0/Ei6uQSrc+XubOjZBnvi58sUue2G9dvn9EkJLPPBF/b9T4sI4oatxXIp58/2l1Rbm83q+vKb398C48GxXWvVAJQ== x-ms-office365-filtering-correlation-id: 3ce88dce-2a61-46c8-dd6b-08d675891043 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:AM6PR05MB4405; x-ms-traffictypediagnostic: AM6PR05MB4405: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM6PR05MB4405; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4405; x-forefront-prvs: 0911D5CE78 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(366004)(189003)(199004)(106356001)(105586002)(2906002)(6486002)(6116002)(3846002)(99286004)(6506007)(305945005)(486006)(7736002)(102836004)(386003)(76176011)(86362001)(52116002)(26005)(66066001)(5640700003)(6436002)(186003)(97736004)(2501003)(6512007)(2351001)(25786009)(1076003)(478600001)(81156014)(8936002)(36756003)(81166006)(68736007)(4326008)(50226002)(5660300001)(256004)(1730700003)(107886003)(8676002)(6916009)(53936002)(54906003)(316002)(11346002)(14454004)(2616005)(71200400001)(71190400001)(476003)(446003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4405; H:AM6PR05MB6056.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: oOzYbzeU17XjuYM3jbTOKskGfzv/CmpNOh7OUYKRhHF+MPwigHibbnN2HDMVps1zIrxHUas3jfsteZAbl7ART31lhcq+kFF+9nEdTH1kJioSVBsIMi5O+O4wLRly3LGiNeldCmQIfJQZ5uXdFmYqWmxkOhbQjk8tTGjJXR7cxDUz9bR0urGO3UqWvDzJx/nUNawodRS2PN350ymRYTwc61isqk4/nAHKmvvZIEoEpaowXQJY3/AcRkIln92GKOXCEWERS44qZUuKhiR2HZCY6fTLcnib+wjyLVWwJ1rXz5QhyjcGwDHkHWIvqCkanY1b spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ce88dce-2a61-46c8-dd6b-08d675891043 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2019 16:48:05.7822 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4405 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When VXLAN is a loadable module, MLXSW_SPECTRUM must not be built-in: drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c:2547: undefined reference to `vxlan_fdb_find_uc' Add Kconfig dependency to enforce usable configurations. Fixes: 1231e04f5bba ("mlxsw: spectrum_switchdev: Add support for VxLAN encapsulation") Signed-off-by: Ido Schimmel Reported-by: kbuild test robot Reviewed-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/Kconfig b/drivers/net/ethernet/mellanox/mlxsw/Kconfig index 080ddd1942ec..b9a25aed5d11 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/Kconfig +++ b/drivers/net/ethernet/mellanox/mlxsw/Kconfig @@ -78,6 +78,7 @@ config MLXSW_SPECTRUM depends on IPV6 || IPV6=n depends on NET_IPGRE || NET_IPGRE=n depends on IPV6_GRE || IPV6_GRE=n + depends on VXLAN || VXLAN=n select GENERIC_ALLOCATOR select PARMAN select OBJAGG From patchwork Tue Jan 8 16:48:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1022046 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="Ij5g1wOz"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43YytG34Cnz9sLw for ; Wed, 9 Jan 2019 03:50:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728113AbfAHQuM (ORCPT ); Tue, 8 Jan 2019 11:50:12 -0500 Received: from mail-eopbgr50054.outbound.protection.outlook.com ([40.107.5.54]:49376 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729021AbfAHQuM (ORCPT ); Tue, 8 Jan 2019 11:50:12 -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=k3AzvsaJVjMmloMXVfglyfuAzOI87o0yIf3A+xwBAUY=; b=Ij5g1wOzPjFBsamvAK2/0GsiWibaeEsiq997f1GrbOdrWmjHrIPSzC+G3KT5AZYr4Keo+j7VEM60N3gMGfaufCeTbY7vZTdK/2AY6tycvXOCgLLFss+oVlDQW/tSCO1eLTFFUJtJnJVIs7beIMjMoo+DxcIkWj3LKqcIdm1BfGU= Received: from AM6PR05MB6056.eurprd05.prod.outlook.com (20.179.2.148) by AM6PR05MB4405.eurprd05.prod.outlook.com (52.135.163.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Tue, 8 Jan 2019 16:48:07 +0000 Received: from AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f]) by AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f%3]) with mapi id 15.20.1516.010; Tue, 8 Jan 2019 16:48:07 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , Petr Machata , Nir Dotan , mlxsw , Ido Schimmel Subject: [PATCH net 05/11] mlxsw: spectrum_switchdev: Avoid returning errors in commit phase Thread-Topic: [PATCH net 05/11] mlxsw: spectrum_switchdev: Avoid returning errors in commit phase Thread-Index: AQHUp3HunHf01/y6sEGrd5U3DKf4Nw== Date: Tue, 8 Jan 2019 16:48:07 +0000 Message-ID: <20190108164732.4024-6-idosch@mellanox.com> References: <20190108164732.4024-1-idosch@mellanox.com> In-Reply-To: <20190108164732.4024-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P192CA0024.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::37) 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; AM6PR05MB4405; 6:WW03JnnGs+QzF7eJ7nLoxXCURDW80vwQerTjlgBDtfAM/jOY+v+BnMUQDPTIw6x8enuxzLTAr3Ay/6bGcBefLZ7Od6zeYbbD5vdcHPCGatcC+uKAk4+Px/JCVMM/tDr42FJ6m6KSAV2vjrjBWyecM3wuWjQJ70DQO3rlvfVy4yFMIMLFVivZHLz1CTyCv7RhFPNfhkcJoUjYOUdAycbQ0o1oOnsdAVEgEZSJP5BA7jgX2sPbCeNc0HFvpWOF7/PPL0pyYc0aWI6UqoLT/OGlrvwt5s1XrC0KsD54o3M03dS3mkIXzMF3+J6ryFn4OOcfYUl9fhtS1Ir1T2f2lfL0bJcCX9FdZcRu3bqdC7GMP/P2Vwd5mZvKok/7lOClHmtKr8NxB22q5RBd6tyKS8RO2OE6pNbV1L26VRvdDN9DUMRlV65DY4W0WJn8tK4tKZmuSWkkzaV6By5usyeEd8XMTQ==; 5:wJchpY6dTunic/KMJP0a/h5gFasEgD7QvEE6HLmzAu5Y3oQyrwrajKXkywUCKmbqJRI1PHgrPMb37fbdzFvoAi8b3CVU+g7wQq/xsMZJM4f0yU01j3PbxtKd8gac2mfsuehpE2mlgDKPtWnsi26ufoo6hpW5My+8LZeoEkl/W8j+udJzSNjLtF00kjODSTH1iT4d0lDtUP8tBqz6A2G7+A==; 7:p7JIk4NnSVeQNBlnivh+p0WI3hIh0WNlZrpTWy1YgAlPmncqj3jLzqtLItLIXJ/ev5h3rPOFTOB4WRuiFL2IA7lRBDllyRznwgx9loa24n6GKT09bNuOtEYX32a3bvQ+JrserFkmUYtVuaHt6Rwjgg== x-ms-office365-filtering-correlation-id: 0c1b21f8-45bd-4ed8-1063-08d6758910d7 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:AM6PR05MB4405; x-ms-traffictypediagnostic: AM6PR05MB4405: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM6PR05MB4405; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4405; x-forefront-prvs: 0911D5CE78 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(366004)(189003)(199004)(106356001)(105586002)(2906002)(6486002)(6116002)(3846002)(99286004)(6506007)(305945005)(486006)(7736002)(102836004)(386003)(76176011)(86362001)(52116002)(26005)(66066001)(5640700003)(6436002)(186003)(97736004)(2501003)(6512007)(2351001)(25786009)(1076003)(478600001)(81156014)(8936002)(36756003)(81166006)(68736007)(4326008)(50226002)(5660300001)(14444005)(256004)(1730700003)(107886003)(8676002)(6916009)(53936002)(54906003)(316002)(11346002)(14454004)(2616005)(71200400001)(71190400001)(476003)(446003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4405; H:AM6PR05MB6056.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: J6IG6w7GEz2lA42tbDBcc+7rCmHStuVleW8RVPRKlJG4dSZVIbLjRTGxN9MIzLDsLFreCiZAxvlWiZljXg9dGOEZzctHz5aK9QN0hkBpCM3fb/ZxQ/J0S6s4XssFU7EaH+aGoPWuCYx03LxP2Py9Bp5OalZuzmC9gGklG+HNqZ/lcvt0G780Uhip1Azv9HdCU4p8hlOtKWIimlDsMStwsEYr8FLsJNP47MA65OwJ+1sCREZyinGOgIp763MHRdcHdkEnplGic45LGAIpHJwUOIL6xnOUSiuwRqowOcul5FnzZmN0wYIkpTQHd5xUxLVd spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0c1b21f8-45bd-4ed8-1063-08d6758910d7 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2019 16:48:06.7459 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4405 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Drivers are not supposed to return errors in switchdev commit phase if they returned OK in prepare phase. Otherwise, a WARNING is emitted. However, when the offloading of a VXLAN tunnel is triggered by the addition of a VLAN on a local port, it is not possible to guarantee that the commit phase will succeed without doing a lot of work. In these cases, the artificial division between prepare and commit phase does not make sense, so simply do the work in the prepare phase. Fixes: d70e42b22dd4 ("mlxsw: spectrum: Enable VxLAN enslavement to VLAN-aware bridges") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata --- .../mellanox/mlxsw/spectrum_switchdev.c | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c index 1bd2c6e15f8d..e8ce2307352b 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c @@ -1078,8 +1078,7 @@ static int mlxsw_sp_bridge_port_vlan_add(struct mlxsw_sp_port *mlxsw_sp_port, struct mlxsw_sp_bridge_port *bridge_port, u16 vid, bool is_untagged, bool is_pvid, - struct netlink_ext_ack *extack, - struct switchdev_trans *trans) + struct netlink_ext_ack *extack) { u16 pvid = mlxsw_sp_port_pvid_determine(mlxsw_sp_port, vid, is_pvid); struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan; @@ -1095,9 +1094,6 @@ mlxsw_sp_bridge_port_vlan_add(struct mlxsw_sp_port *mlxsw_sp_port, mlxsw_sp_port_vlan->bridge_port != bridge_port) return -EEXIST; - if (switchdev_trans_ph_prepare(trans)) - return 0; - if (!mlxsw_sp_port_vlan) { mlxsw_sp_port_vlan = mlxsw_sp_port_vlan_create(mlxsw_sp_port, vid); @@ -1188,6 +1184,9 @@ static int mlxsw_sp_port_vlans_add(struct mlxsw_sp_port *mlxsw_sp_port, return err; } + if (switchdev_trans_ph_commit(trans)) + return 0; + bridge_port = mlxsw_sp_bridge_port_find(mlxsw_sp->bridge, orig_dev); if (WARN_ON(!bridge_port)) return -EINVAL; @@ -1200,7 +1199,7 @@ static int mlxsw_sp_port_vlans_add(struct mlxsw_sp_port *mlxsw_sp_port, err = mlxsw_sp_bridge_port_vlan_add(mlxsw_sp_port, bridge_port, vid, flag_untagged, - flag_pvid, extack, trans); + flag_pvid, extack); if (err) return err; } @@ -3207,7 +3206,6 @@ mlxsw_sp_switchdev_vxlan_vlan_add(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_bridge_device *bridge_device, const struct net_device *vxlan_dev, u16 vid, bool flag_untagged, bool flag_pvid, - struct switchdev_trans *trans, struct netlink_ext_ack *extack) { struct vxlan_dev *vxlan = netdev_priv(vxlan_dev); @@ -3225,9 +3223,6 @@ mlxsw_sp_switchdev_vxlan_vlan_add(struct mlxsw_sp *mlxsw_sp, mlxsw_sp_bridge_8021q_vxlan_dev_find(bridge_device->dev, vid)) return -EINVAL; - if (switchdev_trans_ph_prepare(trans)) - return 0; - if (!netif_running(vxlan_dev)) return 0; @@ -3345,6 +3340,9 @@ mlxsw_sp_switchdev_vxlan_vlans_add(struct net_device *vxlan_dev, port_obj_info->handled = true; + if (switchdev_trans_ph_commit(trans)) + return 0; + bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev); if (!bridge_device) return -EINVAL; @@ -3358,8 +3356,7 @@ mlxsw_sp_switchdev_vxlan_vlans_add(struct net_device *vxlan_dev, err = mlxsw_sp_switchdev_vxlan_vlan_add(mlxsw_sp, bridge_device, vxlan_dev, vid, flag_untagged, - flag_pvid, trans, - extack); + flag_pvid, extack); if (err) return err; } From patchwork Tue Jan 8 16:48:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1022040 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="ssGAkcby"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43YyrC44rRz9sLw for ; Wed, 9 Jan 2019 03:48:27 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729080AbfAHQs0 (ORCPT ); Tue, 8 Jan 2019 11:48:26 -0500 Received: from mail-eopbgr50086.outbound.protection.outlook.com ([40.107.5.86]:21248 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729043AbfAHQsY (ORCPT ); Tue, 8 Jan 2019 11:48:24 -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=6V9l50vvmQhSQEEyH4rGNx08C0UuizNqnDgmG+vQIDA=; b=ssGAkcbyAKlHQzEGVoph3HOCZ37NuqgzuKBi6v4g63qUZL3gscxP3s2AUnsdFtiUUHDNCjxgu1JwzsizCA0p1e3hVC97uMOb9fXF42X/EtarbpMChAEYNKjrnTQfl6mVHYIxmi8oXqo+YWveNaO83ApHGpZlpS3zmQs0Gpg1cMY= Received: from AM6PR05MB6056.eurprd05.prod.outlook.com (20.179.2.148) by AM6PR05MB4405.eurprd05.prod.outlook.com (52.135.163.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Tue, 8 Jan 2019 16:48:08 +0000 Received: from AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f]) by AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f%3]) with mapi id 15.20.1516.010; Tue, 8 Jan 2019 16:48:08 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , Petr Machata , Nir Dotan , mlxsw , Ido Schimmel Subject: [PATCH net 06/11] mlxsw: spectrum_nve: Replace error code with EINVAL Thread-Topic: [PATCH net 06/11] mlxsw: spectrum_nve: Replace error code with EINVAL Thread-Index: AQHUp3HvFvw0fusDaESgx4ncnmLWsg== Date: Tue, 8 Jan 2019 16:48:08 +0000 Message-ID: <20190108164732.4024-7-idosch@mellanox.com> References: <20190108164732.4024-1-idosch@mellanox.com> In-Reply-To: <20190108164732.4024-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P192CA0024.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::37) 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; AM6PR05MB4405; 6:mGJcnRC/da4Bhtt8wQvhgwv1nGX1cKbFXm8/TKpQ5PgEFPg+lN5hIxehJVpUdl4sQyuLOpA//JdxcVKKC/UHjXx4fwClkOM5G0VPL31JAdhYB7Sxno0GX04uFLyVGF9LVD0dfU6t0Fga29gPshNoJ7WO8n9He22LKtRdw2UfkeaBvVT6FxfT7SYJEcRi+VL+NW4JP0mWNAw9MsKfQeUq4TeAzR3PrFgFUT2EmvT+qXG/LuMPrDi2USFciNN2/1bk7S7nexwkKYO8e6uqIITb3X+/2H/aVf9zhi69SWimcElTDLRLWOrm7kC3DcZDEN2voaMDfonpYNJ9WSn0FORmQLIEAe46C/uTYz/m+9U8UwEAZYaCujjVjh4LZda9UwLgiMvx3yE94cTZcACr6xbdFPgh25e2aYXkdkh8qONQcevFjltCvxOw9KU9M9BR2d9CYL17kDWEX000lX1Rrnon2Q==; 5:HykanOJuOZzfVT+V8OBkSOCik4gAwbycy02CPnsmlbzmXR47wAJdUSK+hf0p8bXl3jyMhlKeS3TboG/DIGddlmogyIApmjZcrnpzSCR2MoBFVfx2SgIUoMCi0WrWGNdkUNvOX6gTph8Qf7cGR/5lwoCRTzBnNZYRoGIZzMxnT5PGMA8hZZHpobXiHojwQ5h/NG7J3uyw7ruKHnpryxHRJw==; 7:aFoySM92f6MBEJw6viGfSmOhcUnpnQElYPBUPKh0IdMhb0918moLnr1CXrROAo+bdum/uIQ1WQRA4Hrp+lE+Uxk1/uJy5S9UNEP4AhkY8rsyY2DmhNjkwsIn9ySCY+4qy8Dx60cnawY1Jgwbsb+HlA== x-ms-office365-filtering-correlation-id: f82964de-fb99-4337-7b6b-08d67589118a 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:AM6PR05MB4405; x-ms-traffictypediagnostic: AM6PR05MB4405: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM6PR05MB4405; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4405; x-forefront-prvs: 0911D5CE78 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(366004)(189003)(199004)(106356001)(105586002)(2906002)(6486002)(6116002)(3846002)(99286004)(6506007)(305945005)(486006)(7736002)(102836004)(386003)(76176011)(86362001)(52116002)(26005)(66066001)(5640700003)(6436002)(186003)(97736004)(2501003)(6512007)(2351001)(25786009)(1076003)(478600001)(81156014)(8936002)(36756003)(81166006)(68736007)(4326008)(50226002)(5660300001)(256004)(1730700003)(107886003)(8676002)(6916009)(53936002)(54906003)(316002)(11346002)(14454004)(2616005)(71200400001)(71190400001)(476003)(446003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4405; H:AM6PR05MB6056.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: xvU7XKh/6cWFdObTb0TpCP9SPWgM7EjQX5SXuBlU4RYgnXortvfVagLGz965Pk8p+neM4GNbUc2ovROzEaS8OC0dGt8rJC+j3lBXtZD1RRmFx9AYXAVOoqcKJzOtIi36+BFOf2tmC60b6qwJhOeayGkKfhxUwLR1o/Pl0SKCFSuauJ8PxG40OA9KcZkMnlghks4ks87RIYrrOTdU+2LyqpZ6p9J701Gja0LFM4vDEGr1t7fkVchJq9KqGrzEHOOt1SKelj8zLGpq4rbCU2+eKJwKtrue/3WFzb711JJY2twIw8ohci737X98ZRz90bAr spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: f82964de-fb99-4337-7b6b-08d67589118a X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2019 16:48:07.9227 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4405 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Adding a VLAN on a port can trigger the offload of a VXLAN tunnel which is already a member in the VLAN. In case the configuration of the VXLAN is not supported, the driver would return -EOPNOTSUPP. This is problematic since bridge code does not interpret this as error, but rather that it should try to setup the VLAN using the 8021q driver instead of switchdev. Fixes: d70e42b22dd4 ("mlxsw: spectrum: Enable VxLAN enslavement to VLAN-aware bridges") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c index 0a31fff2516e..fb1c48c698f2 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c @@ -816,14 +816,14 @@ int mlxsw_sp_nve_fid_enable(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_fid *fid, ops = nve->nve_ops_arr[params->type]; if (!ops->can_offload(nve, params->dev, extack)) - return -EOPNOTSUPP; + return -EINVAL; memset(&config, 0, sizeof(config)); ops->nve_config(nve, params->dev, &config); if (nve->num_nve_tunnels && memcmp(&config, &nve->config, sizeof(config))) { NL_SET_ERR_MSG_MOD(extack, "Conflicting NVE tunnels configuration"); - return -EOPNOTSUPP; + return -EINVAL; } err = mlxsw_sp_nve_tunnel_init(mlxsw_sp, &config); From patchwork Tue Jan 8 16:48:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1022041 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="a0nl5T9k"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43YyrF6Hmyz9sLw for ; Wed, 9 Jan 2019 03:48:29 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729134AbfAHQs2 (ORCPT ); Tue, 8 Jan 2019 11:48:28 -0500 Received: from mail-eopbgr50086.outbound.protection.outlook.com ([40.107.5.86]:21248 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729069AbfAHQs1 (ORCPT ); Tue, 8 Jan 2019 11:48:27 -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=P5ez5EZ/EBeyWKrBhrIb/HblZ68eThAoXX8yhkjZw88=; b=a0nl5T9kzVDhf1zSwXoagAzUaLzfOWS4oldhij+ig2La5/Ov/QaZLPl0QPu8yUCwdS/POWgXC/Sg4UfshhkjWBwVr1XUCObukaUKMRWbA4bjg94OmtzKsW96S6Via4WCNxjgPEdztiNnUe9aN+ZrbusTsUVH0SgOMWoZz5zpn+8= Received: from AM6PR05MB6056.eurprd05.prod.outlook.com (20.179.2.148) by AM6PR05MB4405.eurprd05.prod.outlook.com (52.135.163.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Tue, 8 Jan 2019 16:48:10 +0000 Received: from AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f]) by AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f%3]) with mapi id 15.20.1516.010; Tue, 8 Jan 2019 16:48:10 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , Petr Machata , Nir Dotan , mlxsw , Ido Schimmel Subject: [PATCH net 07/11] selftests: mlxsw: Add a test case for VLAN addition error flow Thread-Topic: [PATCH net 07/11] selftests: mlxsw: Add a test case for VLAN addition error flow Thread-Index: AQHUp3HwtXrmudghi0yQMuSMsDCS4A== Date: Tue, 8 Jan 2019 16:48:10 +0000 Message-ID: <20190108164732.4024-8-idosch@mellanox.com> References: <20190108164732.4024-1-idosch@mellanox.com> In-Reply-To: <20190108164732.4024-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P192CA0024.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::37) 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; AM6PR05MB4405; 6:b8+JyRoViSgbRpEZp48/eMXuVDqlfCJIM93PAoh8Tyq+ewdDKA/DDHvRb+lROMSDT/j9W715DbCrZIHOatfS5QmBQ5SpuUBsbetcnezk6gfNs7nLAtPMwCrB604ulHKKbEeAU5C6rX/qLiAamSetuP/44tD1zlVzkdDYKQ35oizmxIm8EnWi+d7oEZ6ayyPupSzAP5VPLa6M/eyldKlLrI0scByJOA0tBpRKtoh2clP9RNHIv4Y56QpFNNwO3bh7UpJmqIHeRiXaVaaYp5p1dNv/MJ+WACmbzLsbr3ecfmUern/yBeUHf6AOyu5hBXYIhw7j+D7oNeb637JQAzoJZqvVBD0PYcMC7fry7caRMIg7vMqVBB77RhHgfHYeFMQRty+xMzT6CRWMulxWmNWUb7DUjhm/X92ZJgKH2ln0e1GqPL7p3a/gD8bjHDvYGryvz1YPGRh+CQ7+eZPVDfQ3pA==; 5:xYvWlf1L05CtS0kaLX434iQyE2AfFjJGDmzZVohhXwbzCHcWOVQ1pS0Fk/4Q84W5e3afqoshQK+qkjZXuQnZjgp3Qri7AEGHECZOp4MMHuygsfSXJTcf0Rx8L17ES61p/np/RS7lr3PgvIj/51xe8eIRDlEs/w5+N0Wt37HXeROgw9MYTIOPFV3atA4H9DfC4O0WDdHuHrq+xt2mK26lxQ==; 7:RzR1GgD0sLAsHmC7fNgiD2wWf4g7+ssdSDvPabyUVSYcnjeaPZxr1XRWpwCwDEgfw6vVNol2fysEpuJzDHT/XZ06YREogGygYVOXGh+5zaWFbNtf0jvru0jWSw6ry5gVVlzqlufKGJ4JaOoEGjgh6w== x-ms-office365-filtering-correlation-id: 9037da85-1b9b-4379-812c-08d675891216 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:AM6PR05MB4405; x-ms-traffictypediagnostic: AM6PR05MB4405: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM6PR05MB4405; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4405; x-forefront-prvs: 0911D5CE78 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(366004)(189003)(199004)(106356001)(105586002)(2906002)(6486002)(6116002)(3846002)(99286004)(6506007)(305945005)(486006)(7736002)(102836004)(386003)(76176011)(86362001)(52116002)(26005)(66066001)(5640700003)(6436002)(186003)(97736004)(2501003)(6512007)(2351001)(25786009)(1076003)(478600001)(81156014)(8936002)(36756003)(81166006)(68736007)(4326008)(50226002)(5660300001)(256004)(1730700003)(107886003)(8676002)(6916009)(53936002)(54906003)(316002)(11346002)(14454004)(2616005)(71200400001)(71190400001)(476003)(446003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4405; H:AM6PR05MB6056.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: K4/EjhD0WFuSP/moPPtYe8AJNQ4nXmE9mo3KppHE1h4uD+e/iVQ74wW21sDlNAw8RbFdsx66uwaKuA2UxZoihoriXLIKTazZSIh3yJ5AfLr8qi2V+mczj0P9r+FyoU4xMsHYl+noq8OPc4u2kJt28ZwB/0TzXbCC1bW119ZFRhiVPBRI5h2MLrR6dl4t6t0vAifcAsdYJuuwDRUe8PBlrM0Ef6/rlFUxjI1cXSvWymzbeIGQQ1uJ/2lcuEhMe+sshr5x4VOui47reIb55yfV9vsAVZfLc7HDaNqlDvlZoXvoDUh5WgXNdw55WudJPOzA spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9037da85-1b9b-4379-812c-08d675891216 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2019 16:48:08.8404 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4405 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add a test case for the issue fixed by previous commit. In case the offloading of an unsupported VxLAN tunnel was triggered by adding the mapped VLAN to a local port, then error should be returned to the user. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata --- .../selftests/drivers/net/mlxsw/vxlan.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/testing/selftests/drivers/net/mlxsw/vxlan.sh b/tools/testing/selftests/drivers/net/mlxsw/vxlan.sh index dcf9f4e913e0..ae6146ec5afd 100755 --- a/tools/testing/selftests/drivers/net/mlxsw/vxlan.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/vxlan.sh @@ -847,6 +847,24 @@ sanitization_vlan_aware_test() log_test "vlan-aware - failed enslavement to vlan-aware bridge" + bridge vlan del vid 10 dev vxlan20 + bridge vlan add vid 20 dev vxlan20 pvid untagged + + # Test that offloading of an unsupported tunnel fails when it is + # triggered by addition of VLAN to a local port + RET=0 + + # TOS must be set to inherit + ip link set dev vxlan10 type vxlan tos 42 + + ip link set dev $swp1 master br0 + bridge vlan add vid 10 dev $swp1 &> /dev/null + check_fail $? + + log_test "vlan-aware - failed vlan addition to a local port" + + ip link set dev vxlan10 type vxlan tos inherit + ip link del dev vxlan20 ip link del dev vxlan10 ip link del dev br0 From patchwork Tue Jan 8 16:48:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1022042 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="GQ9Ds3m4"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43YyrJ5QqHz9sLw for ; Wed, 9 Jan 2019 03:48:32 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729140AbfAHQsb (ORCPT ); Tue, 8 Jan 2019 11:48:31 -0500 Received: from mail-eopbgr50086.outbound.protection.outlook.com ([40.107.5.86]:21248 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729043AbfAHQsa (ORCPT ); Tue, 8 Jan 2019 11:48:30 -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=irBq6d+Vz3Sw+oCxjqZCdLasQkY69eFd2VGVc5REPGY=; b=GQ9Ds3m49U4VzLlPYDzXJGfnCuCWsSzsT/yzPaIMTpeJz/nrEyP7ME0aiZ2W8I7UyC4pmoPi0z5esNh5/FZMnQUbfLNtXDGzxJo+/jAaf3OaYjm0Entp0p7NZzw3MOxx2PQe9DEJuWZR9BnZFJsCy3YUSuL5renFXHecV+nqEIU= Received: from AM6PR05MB6056.eurprd05.prod.outlook.com (20.179.2.148) by AM6PR05MB4405.eurprd05.prod.outlook.com (52.135.163.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Tue, 8 Jan 2019 16:48:11 +0000 Received: from AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f]) by AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f%3]) with mapi id 15.20.1516.010; Tue, 8 Jan 2019 16:48:11 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , Petr Machata , Nir Dotan , mlxsw , Ido Schimmel , Roopa Prabhu , Nikolay Aleksandrov , "bridge@lists.linux-foundation.org" Subject: [PATCH net 08/11] net: bridge: Fix VLANs memory leak Thread-Topic: [PATCH net 08/11] net: bridge: Fix VLANs memory leak Thread-Index: AQHUp3HwDXy9vcGAcEqIUNVwy3i28w== Date: Tue, 8 Jan 2019 16:48:11 +0000 Message-ID: <20190108164732.4024-9-idosch@mellanox.com> References: <20190108164732.4024-1-idosch@mellanox.com> In-Reply-To: <20190108164732.4024-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P192CA0024.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::37) 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; AM6PR05MB4405; 6:vTCaUe5eboUZnssfBscjKb0uzibKhWa+a07IARer6kQdtNWpCeN1CWGr3Q4BL8tLkfdjTpNMLQ2Au+xRNr/JCJmZ+b8JM2lVLFmI5tBz8QHI3n/KaIdf0GJ41xw1Xf9Zo2DZxhVNzr6ciN885+DBxJ2wsXPWx3yHykD46DgGueRhUNRsKQc2F+TUD39ZaKq8uhRisBxVHDuGvo6wo4vGT7UxCFLYloA82FSM76KkzjcWMz5o7lUxxHuA1o8z47T7661EtTWFPKQn8JDcSLKnnflbgXsW/HMJZmvXTNAeB9ZAToZ1/pTgbetvxNGacAj297FjHjHBYHGDqqOLJgi9HaxgZS9kAaBoytDrgbKvlZlnYclKGYI4kbCrl+l9LSXG6dzvWM02qNThDPNCza0zrVXS6KuJ41024SnpOyuEhQzLmJLpYTrAOZw8sr8V6s6D5XTrPWOSpAYY0b86hcINTA==; 5:O0WoFvyy4ArSONdYYuuHNpBgffkYlzcKe5P2wHPuSBza3XIX/pcE5ThjHoh/8deJC1B6dpsl0b9y0+zfUh3M+c7N9BeL0j4CoOmVlwyJQVIsXKtwrE0mVZVKochy4/brbWYDhVZsx/kMlJ6jluE+K3S7KGwSMWZl0Ipwl13vpk3j2o4mdw4zIEeaTa2NYAtXamsPPXUAZitDbfOyWcQOsQ==; 7:q7lpMTQyr4LAqHTMdzNxsFg9eJUK+PFnKVH4NtqruQkm8WpSXfuU0pEiZH6GWUJ9qvDz/OlfxnqvKp/RGaeINnqvs1W3DTvgrk+XcYwpvYg2wIgRZr2spqURUYogVdpiI1+QNMtFAanzuDegU3CqEg== x-ms-office365-filtering-correlation-id: 26b1f9d6-3691-4d40-ef0a-08d675891338 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:AM6PR05MB4405; x-ms-traffictypediagnostic: AM6PR05MB4405: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM6PR05MB4405; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4405; x-forefront-prvs: 0911D5CE78 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(366004)(189003)(199004)(106356001)(105586002)(2906002)(6486002)(6116002)(3846002)(99286004)(6506007)(305945005)(486006)(7736002)(102836004)(386003)(76176011)(86362001)(52116002)(26005)(66066001)(5640700003)(6436002)(186003)(97736004)(2501003)(6512007)(2351001)(25786009)(1076003)(478600001)(81156014)(8936002)(36756003)(81166006)(68736007)(4326008)(50226002)(5660300001)(14444005)(256004)(1730700003)(8676002)(6916009)(53936002)(54906003)(316002)(11346002)(14454004)(2616005)(71200400001)(71190400001)(476003)(446003)(505234006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4405; H:AM6PR05MB6056.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: YXXB3/QYZW6SQVeES2f1zdu3vJwuN2Z5F3/Imrj/uyNSoXa+ecmd/nwPu+2CTvmmRZ0WKJgm1KAlY9bu/F/Mdc1kf0laNVI3tsL0284msTbW6E2XkiUVqEEBlCVnFmDT2t/6TZYMZuEmSDBiw1WVsVcy8WBRddFd/c4nnW/+1275J/a8PDtruOJfRhfSGRzwef0U7ANEGZ3zwJ9hoxzDx9qXFzMBAtM/QAH0yNvch0nmPa0fLubjxdMjlIiM20MgDCSx4nFb5cSK9XK9t2f3LdbQFCekxLlnHSzRU7yuCMgOfddzppLvEgP+ApuLWN/l spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26b1f9d6-3691-4d40-ef0a-08d675891338 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2019 16:48:10.5546 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4405 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When adding / deleting VLANs to / from a bridge port, the bridge driver first tries to propagate the information via switchdev and falls back to the 8021q driver in case the underlying driver does not support switchdev. This can result in a memory leak [1] when VXLAN and mlxsw ports are enslaved to the bridge: $ ip link set dev vxlan0 master br0 # No mlxsw ports are enslaved to 'br0', so mlxsw ignores the switchdev # notification and the bridge driver adds the VLAN on 'vxlan0' via the # 8021q driver $ bridge vlan add vid 10 dev vxlan0 pvid untagged # mlxsw port is enslaved to the bridge $ ip link set dev swp1 master br0 # mlxsw processes the switchdev notification and the 8021q driver is # skipped $ bridge vlan del vid 10 dev vxlan0 This results in 'struct vlan_info' and 'struct vlan_vid_info' being leaked, as they were allocated by the 8021q driver during VLAN addition, but never freed as the 8021q driver was skipped during deletion. Fix this by introducing a new VLAN private flag that indicates whether the VLAN was added on the port by switchdev or the 8021q driver. If the VLAN was added by the 8021q driver, then we make sure to delete it via the 8021q driver as well. [1] unreferenced object 0xffff88822d20b1e8 (size 256): comm "bridge", pid 2532, jiffies 4295216998 (age 1188.830s) hex dump (first 32 bytes): e0 42 97 ce 81 88 ff ff 00 00 00 00 00 00 00 00 .B.............. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000f82d851d>] kmem_cache_alloc_trace+0x1be/0x330 [<00000000e0178b02>] vlan_vid_add+0x661/0x920 [<00000000218ebd5f>] __vlan_add+0x1be9/0x3a00 [<000000006eafa1ca>] nbp_vlan_add+0x8b3/0xd90 [<000000003535392c>] br_vlan_info+0x132/0x410 [<00000000aedaa9dc>] br_afspec+0x75c/0x870 [<00000000f5716133>] br_setlink+0x3dc/0x6d0 [<00000000aceca5e2>] rtnl_bridge_setlink+0x615/0xb30 [<00000000a2f2d23e>] rtnetlink_rcv_msg+0x3a3/0xa80 [<0000000064097e69>] netlink_rcv_skb+0x152/0x3c0 [<000000008be8d614>] rtnetlink_rcv+0x21/0x30 [<000000009ab2ca25>] netlink_unicast+0x52f/0x740 [<00000000e7d9ac96>] netlink_sendmsg+0x9c7/0xf50 [<000000005d1e2050>] sock_sendmsg+0xbe/0x120 [<00000000d51426bc>] ___sys_sendmsg+0x778/0x8f0 [<00000000b9d7b2cc>] __sys_sendmsg+0x112/0x270 unreferenced object 0xffff888227454308 (size 32): comm "bridge", pid 2532, jiffies 4295216998 (age 1188.882s) hex dump (first 32 bytes): 88 b2 20 2d 82 88 ff ff 88 b2 20 2d 82 88 ff ff .. -...... -.... 81 00 0a 00 01 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000f82d851d>] kmem_cache_alloc_trace+0x1be/0x330 [<0000000018050631>] vlan_vid_add+0x3e6/0x920 [<00000000218ebd5f>] __vlan_add+0x1be9/0x3a00 [<000000006eafa1ca>] nbp_vlan_add+0x8b3/0xd90 [<000000003535392c>] br_vlan_info+0x132/0x410 [<00000000aedaa9dc>] br_afspec+0x75c/0x870 [<00000000f5716133>] br_setlink+0x3dc/0x6d0 [<00000000aceca5e2>] rtnl_bridge_setlink+0x615/0xb30 [<00000000a2f2d23e>] rtnetlink_rcv_msg+0x3a3/0xa80 [<0000000064097e69>] netlink_rcv_skb+0x152/0x3c0 [<000000008be8d614>] rtnetlink_rcv+0x21/0x30 [<000000009ab2ca25>] netlink_unicast+0x52f/0x740 [<00000000e7d9ac96>] netlink_sendmsg+0x9c7/0xf50 [<000000005d1e2050>] sock_sendmsg+0xbe/0x120 [<00000000d51426bc>] ___sys_sendmsg+0x778/0x8f0 [<00000000b9d7b2cc>] __sys_sendmsg+0x112/0x270 Fixes: d70e42b22dd4 ("mlxsw: spectrum: Enable VxLAN enslavement to VLAN-aware bridges") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Cc: Roopa Prabhu Cc: Nikolay Aleksandrov Cc: bridge@lists.linux-foundation.org Acked-by: Nikolay Aleksandrov --- net/bridge/br_private.h | 1 + net/bridge/br_vlan.c | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index d240b3e7919f..eabf8bf28a3f 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h @@ -107,6 +107,7 @@ struct br_tunnel_info { /* private vlan flags */ enum { BR_VLFLAG_PER_PORT_STATS = BIT(0), + BR_VLFLAG_ADDED_BY_SWITCHDEV = BIT(1), }; /** diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c index 4a2f31157ef5..96abf8feb9dc 100644 --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c @@ -80,16 +80,18 @@ static bool __vlan_add_flags(struct net_bridge_vlan *v, u16 flags) } static int __vlan_vid_add(struct net_device *dev, struct net_bridge *br, - u16 vid, u16 flags, struct netlink_ext_ack *extack) + struct net_bridge_vlan *v, u16 flags, + struct netlink_ext_ack *extack) { int err; /* Try switchdev op first. In case it is not supported, fallback to * 8021q add. */ - err = br_switchdev_port_vlan_add(dev, vid, flags, extack); + err = br_switchdev_port_vlan_add(dev, v->vid, flags, extack); if (err == -EOPNOTSUPP) - return vlan_vid_add(dev, br->vlan_proto, vid); + return vlan_vid_add(dev, br->vlan_proto, v->vid); + v->priv_flags |= BR_VLFLAG_ADDED_BY_SWITCHDEV; return err; } @@ -121,19 +123,17 @@ static void __vlan_del_list(struct net_bridge_vlan *v) } static int __vlan_vid_del(struct net_device *dev, struct net_bridge *br, - u16 vid) + const struct net_bridge_vlan *v) { int err; /* Try switchdev op first. In case it is not supported, fallback to * 8021q del. */ - err = br_switchdev_port_vlan_del(dev, vid); - if (err == -EOPNOTSUPP) { - vlan_vid_del(dev, br->vlan_proto, vid); - return 0; - } - return err; + err = br_switchdev_port_vlan_del(dev, v->vid); + if (!(v->priv_flags & BR_VLFLAG_ADDED_BY_SWITCHDEV)) + vlan_vid_del(dev, br->vlan_proto, v->vid); + return err == -EOPNOTSUPP ? 0 : err; } /* Returns a master vlan, if it didn't exist it gets created. In all cases a @@ -242,7 +242,7 @@ static int __vlan_add(struct net_bridge_vlan *v, u16 flags, * This ensures tagged traffic enters the bridge when * promiscuous mode is disabled by br_manage_promisc(). */ - err = __vlan_vid_add(dev, br, v->vid, flags, extack); + err = __vlan_vid_add(dev, br, v, flags, extack); if (err) goto out; @@ -305,7 +305,7 @@ static int __vlan_add(struct net_bridge_vlan *v, u16 flags, out_filt: if (p) { - __vlan_vid_del(dev, br, v->vid); + __vlan_vid_del(dev, br, v); if (masterv) { if (v->stats && masterv->stats != v->stats) free_percpu(v->stats); @@ -338,7 +338,7 @@ static int __vlan_del(struct net_bridge_vlan *v) __vlan_delete_pvid(vg, v->vid); if (p) { - err = __vlan_vid_del(p->dev, p->br, v->vid); + err = __vlan_vid_del(p->dev, p->br, v); if (err) goto out; } else { From patchwork Tue Jan 8 16:48:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1022043 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="sNk+NY8j"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43YyrM54Nmz9sLw for ; Wed, 9 Jan 2019 03:48:35 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729153AbfAHQse (ORCPT ); Tue, 8 Jan 2019 11:48:34 -0500 Received: from mail-eopbgr50086.outbound.protection.outlook.com ([40.107.5.86]:21248 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729069AbfAHQsd (ORCPT ); Tue, 8 Jan 2019 11:48:33 -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=Fd4fjQ7eb5M4GcOoK2iDTfLR/7DIXoxyYCY2MlFbcYY=; b=sNk+NY8jvw1+99h1U66G9meJTAmxaAka1Falr8RUcifxL36MYgw2JgqRNhUEn+I0IlhYBK+q0FwjM48lcTUdfvtG0bvjTtrlPLZXed+IvdRZ8Igw3UsMCGvyuwqNaFeXjK/li1gZ5i3Z+Dxfj3DEFeQu5vaqowBLop/yNaS1tOk= Received: from AM6PR05MB6056.eurprd05.prod.outlook.com (20.179.2.148) by AM6PR05MB4405.eurprd05.prod.outlook.com (52.135.163.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Tue, 8 Jan 2019 16:48:12 +0000 Received: from AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f]) by AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f%3]) with mapi id 15.20.1516.010; Tue, 8 Jan 2019 16:48:12 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , Petr Machata , Nir Dotan , mlxsw , Ido Schimmel Subject: [PATCH net 09/11] selftests: forwarding: Fix test for different devices Thread-Topic: [PATCH net 09/11] selftests: forwarding: Fix test for different devices Thread-Index: AQHUp3Hxn8zYmRj63EW13Q/veGd7EQ== Date: Tue, 8 Jan 2019 16:48:12 +0000 Message-ID: <20190108164732.4024-10-idosch@mellanox.com> References: <20190108164732.4024-1-idosch@mellanox.com> In-Reply-To: <20190108164732.4024-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P192CA0024.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::37) 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; AM6PR05MB4405; 6:RyKV6zk0pgkkriQTYG6rtj+H/eNBtvxiY7ynsw42jmLML3YijHnXCCAKANBLp8Tqhep+cbY6c62YganFestn14qBvSzQpgCQS6MOxjmmxi105PUR1bv9/88xXNuV/bSDRZE3bInJy9krJNuZbV3Jzr6WlKckin3eJoiVmZeL+2J4y06jj/paRaEBzyuP7lY5GTZ2KKIdPV71m160WWzTv+9/336hP5CSC/OXni8x6Tm41rBBDQAI4hy483eC89KP+GUqv8/e1QsPXc8pyEM69KlTPZ29mi2kSCnp/bkpOzC407ODFDr3HwzCUv4pHeVYy1Afj0YPCSqNZiVMHgZSTXOGxIDM4fbhbaTVA3k3uF1Q1QxzKONUb+c5M2p8xTieRnmoutdMhnQ14enQVPmhqeBcGmUxxNclRV6HOLqgqtdglJ0y8OHu6IQhL/4WPBd5NXQZFMwqy8SXJCtPpFVFDA==; 5:2OzZFUmvFAtnqdIQvUbwO4uWl5TlBNv1XdElydIdw5Xwyw3KbBjwXy2aU1CBuUiZvvNnoRO5HQYKO5MmDw7RjHiPfeCzH32SqMEkTNwG+AEnteP0CCKv4P95wFD9/lI4q5uJKXf4noRqolmyihhkwdKrxYKf1Slh3aA9ODLKhwAKwri9hQQco9GO4k6Y8yBwiYaatPwoEO9DxABjPGIjLg==; 7:rFi6Vwh9fs8rzjA831UdqAEz5WXqwdjXZSS05aq8VVkzQ5FVNlAO/S9U/cLUPWOKtggB1EJcwVaOXY3XYp3tED+2YN3EthlW/IhccEpKAwOEzJlEGtfls6KXt8NvRt80tN0hXcxFid7cB2h8bLSstw== x-ms-office365-filtering-correlation-id: a398879d-1bd3-4cc2-c242-08d6758913ca 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:AM6PR05MB4405; x-ms-traffictypediagnostic: AM6PR05MB4405: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM6PR05MB4405; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4405; x-forefront-prvs: 0911D5CE78 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(366004)(189003)(199004)(106356001)(105586002)(2906002)(6486002)(6116002)(3846002)(99286004)(6506007)(305945005)(486006)(7736002)(102836004)(386003)(76176011)(86362001)(52116002)(26005)(66066001)(5640700003)(6436002)(186003)(97736004)(2501003)(6512007)(2351001)(25786009)(1076003)(66574012)(478600001)(81156014)(8936002)(36756003)(81166006)(68736007)(4326008)(50226002)(5660300001)(14444005)(575784001)(256004)(1730700003)(107886003)(8676002)(6916009)(53936002)(54906003)(316002)(11346002)(14454004)(2616005)(71200400001)(71190400001)(476003)(446003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4405; H:AM6PR05MB6056.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: UyOZLqif7GWqv3er8oP50t1CNu5+RKw+ZwdIEIGvCITE71Is6C9kEkOLeRLR/dhtCvDX211Ec+rs2Otkp3f9nWds4daAheRCbv0pHRxpymTf65jBuxLg6Jy4cVf4/Ua/lhrZyNMyksk69ZaghvGL41yRkPUm4qvtbDfKaGMWQWyIWZTEq29PECw9NG/cVwGEus48PTkK8lBAE373Q1w33wvATfn1w5fxsHgePhKO+ns5Czplk/AocHBy2aC8qsoBEoupHnW/h6PLe0HWkRjhKwFMEEpBYIwHJVjxkirFs1lxx0ohRVGTRHdMPL3etEjC spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: a398879d-1bd3-4cc2-c242-08d6758913ca X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2019 16:48:11.6984 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4405 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When running the test on the Spectrum ASIC the generated packets are counted on the ingress filter and injected back to the pipeline because of the 'pass' action. The router block then drops the packets due to checksum error, as the test generates packets with zero checksum. When running the test on an emulator that is not as strict about checksum errors the test fails since packets are counted twice. Once by the emulated ASIC on its ingress filter and again by the kernel as the emulator does not perform checksum validation and allows the packets to be trapped by a matching host route. Fix this by changing the action to 'drop', which will prevent the packet from continuing further in the pipeline to the router block. For veth pairs this change is essentially a NOP given packets are only processed once (by the kernel). Fixes: a0b61f3d8ebf ("selftests: forwarding: vxlan_bridge_1d: Add an ECN decap test") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata --- tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh index 56cef3b1c194..bb10e33690b2 100755 --- a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh +++ b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh @@ -629,7 +629,7 @@ __test_ecn_decap() RET=0 tc filter add dev $h1 ingress pref 77 prot ip \ - flower ip_tos $decapped_tos action pass + flower ip_tos $decapped_tos action drop sleep 1 vxlan_encapped_ping_test v2 v1 192.0.2.17 \ $orig_inner_tos $orig_outer_tos \ From patchwork Tue Jan 8 16:48:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1022044 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="LlpoRoxo"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43YyrR5Sf7z9sMM for ; Wed, 9 Jan 2019 03:48:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729163AbfAHQsi (ORCPT ); Tue, 8 Jan 2019 11:48:38 -0500 Received: from mail-eopbgr50086.outbound.protection.outlook.com ([40.107.5.86]:21248 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729043AbfAHQsf (ORCPT ); Tue, 8 Jan 2019 11:48:35 -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=BDrU2KoKNEnCD62gBJnXsTgVbrvTgkLKhmGY+OaWz6U=; b=LlpoRoxombWERXC0Btw0BP4rqRxoetLeWcHUcD+qTNk/HRPYYta66TLR64kaDts7q9YdyePumeROQsIQTLgx/p8KVSkaE4IkDV4Kzpm1Vlau04dT9ZNIFXmoyPth6HtORHJw53wn7sZR+RoOiFhPAAGs9AT10GmofnOwv5ifxGM= Received: from AM6PR05MB6056.eurprd05.prod.outlook.com (20.179.2.148) by AM6PR05MB4405.eurprd05.prod.outlook.com (52.135.163.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Tue, 8 Jan 2019 16:48:13 +0000 Received: from AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f]) by AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f%3]) with mapi id 15.20.1516.010; Tue, 8 Jan 2019 16:48:13 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , Petr Machata , Nir Dotan , mlxsw , Ido Schimmel Subject: [PATCH net 10/11] mlxsw: spectrum_switchdev: Set PVID correctly during VLAN deletion Thread-Topic: [PATCH net 10/11] mlxsw: spectrum_switchdev: Set PVID correctly during VLAN deletion Thread-Index: AQHUp3HyFM/Z5bTTXkmn/PbqSJP8Ew== Date: Tue, 8 Jan 2019 16:48:13 +0000 Message-ID: <20190108164732.4024-11-idosch@mellanox.com> References: <20190108164732.4024-1-idosch@mellanox.com> In-Reply-To: <20190108164732.4024-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P192CA0024.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::37) 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; AM6PR05MB4405; 6:p03VetVsjlSAuQ08tIbvt6gX2xTy5N364m2s9Eypal26wSXFZughF++aeFf9q3EyCMSGJW1wC11KqOWnzYo2pifRttzKSLFw0ECke7+R2T6CnUA4n3NYxfhso0xQ+0Da5DZr4imVJBfATGooXDtsnhxUtrrfll1UDiV/LWWMN8077cuxNl1efO8Dm8ikW/u5Cmr7gFy2aMdX48d9xHdT1tIxfuiysAC/aGK6lzzyk3YkFX2yP5FQfi4XWvSky+MQD8Fh7Mp8MQJTgG9gSUbzCXn0ru+PqjyPRUJt+UxlB5HaZz0AX6UL+KAyq2FgAwozJNK/fzeQQs+T2gfDAysYOYjOHVCgOUfLSMIU6hhcIXRUoOClHeFwTVlX2WabHrpCSJdXSBvqH79+96s6p8Lovur+hZRVuUfo2H9sgtGlQcVu1Kwi9e1netwdvsneCIbd6STDTOC5F/D51HBH+K5fFg==; 5:zWzdGYM/bY67lKef6sUwgrbPrOZVw2NDsxrm+xx0Tm4VGh1DY1q46hYEMcXFH1Ql7XEjVTKEclZe2NfGIcypjhbG0gVD2nqyPTXdjlukFlpu06Ff3wI4DF/V7gxz9KYZj8qb7TTHQqEd9+EdZ2m57kTiRCdC0SzCmZrT2/QL5L7Fnq+vhiYY3GV8zrgV2B1bzfplRaOW0EFrRWWqlE+w5w==; 7:I+tEoeMa1dRTugpvydFZvycqkIxpcO3Acxr3XM6UMjDTUp5VbUBCiAzIun+hrvxma+hO+pWyqJ5Hr8JWzI0KUnaMCf3j5E/kZo2mIHkqzU4GPNQ9pIuVyKehXvqbd6CXRB+PSMuWYweWhNH+80PMrQ== x-ms-office365-filtering-correlation-id: a4d3ab73-cc73-48bc-c2d4-08d675891463 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:AM6PR05MB4405; x-ms-traffictypediagnostic: AM6PR05MB4405: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM6PR05MB4405; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4405; x-forefront-prvs: 0911D5CE78 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(366004)(189003)(199004)(106356001)(105586002)(2906002)(6486002)(6116002)(3846002)(99286004)(6506007)(305945005)(486006)(7736002)(102836004)(386003)(76176011)(86362001)(52116002)(26005)(66066001)(5640700003)(6436002)(186003)(97736004)(2501003)(6512007)(2351001)(25786009)(1076003)(478600001)(81156014)(8936002)(36756003)(81166006)(68736007)(4326008)(50226002)(5660300001)(14444005)(575784001)(256004)(1730700003)(107886003)(8676002)(6916009)(53936002)(54906003)(316002)(11346002)(14454004)(2616005)(71200400001)(71190400001)(476003)(446003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4405; H:AM6PR05MB6056.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: qtIJijaAaUKrS03zwDEQkm34o8D7rCoccOQ1maBbcpT2oaHhP0DHxrnZ5wqoEwV7sBP4lJEErCq0aRNMnqywXPqOHLGLjWXPC0MN4xKR+cYFprs/8S1Ga2iQxxmDDTV8FfNhNkH2RjlY8y1111eADm22wMvq2O3jyQYUfZ3k4tXkAKprHKHL3SIb4dwHIswJkmth4rzezUKZcveui444hP8hKLIYzet654YYHkn2PcwsU1StIeZbjsvrJB2SMPKyRk+R1R7wnAALEA7V4jVRRZkV6qyCDIn8NhBjmcC/LMLpUyFEXSFCUWphIPMiDKnG spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4d3ab73-cc73-48bc-c2d4-08d675891463 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2019 16:48:12.7031 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4405 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When a VLAN is deleted from a bridge port we should not change the PVID unless the deleted VLAN is the PVID. Fixes: fe9ccc785de5 ("mlxsw: spectrum_switchdev: Don't batch VLAN operations") Signed-off-by: Ido Schimmel Acked-by: Jiri Pirko --- drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c index e8ce2307352b..0abbaa0fbf14 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c @@ -1807,7 +1807,7 @@ static void mlxsw_sp_bridge_port_vlan_del(struct mlxsw_sp_port *mlxsw_sp_port, struct mlxsw_sp_bridge_port *bridge_port, u16 vid) { - u16 pvid = mlxsw_sp_port->pvid == vid ? 0 : vid; + u16 pvid = mlxsw_sp_port->pvid == vid ? 0 : mlxsw_sp_port->pvid; struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan; mlxsw_sp_port_vlan = mlxsw_sp_port_vlan_find_by_vid(mlxsw_sp_port, vid); From patchwork Tue Jan 8 16:48:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1022045 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="mK5APMUI"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43Yys10Rrbz9sLw for ; Wed, 9 Jan 2019 03:49:08 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728989AbfAHQtH (ORCPT ); Tue, 8 Jan 2019 11:49:07 -0500 Received: from mail-eopbgr50045.outbound.protection.outlook.com ([40.107.5.45]:53976 "EHLO EUR03-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727656AbfAHQtG (ORCPT ); Tue, 8 Jan 2019 11:49:06 -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=bGiyxz9Ccz1KEA4sJ01V326ABL+j90GwO2JB8k4Ztkk=; b=mK5APMUIksh+3IROtuDDeMh/6d0c5V+iOOTvHWi0hLe8ooAXhr5kiBNlK46rcYND5ef2SXa8gQ9C6w89fVJpmlZj5FODpqgdUpwpsqnTMbzQQP85+hRL7fwm1HvdvN4AeHCTAbZvXaKy+1MP2Ahy1RNuGH+dAI9JQF0/VQAoyIE= Received: from AM6PR05MB6056.eurprd05.prod.outlook.com (20.179.2.148) by AM6PR05MB4405.eurprd05.prod.outlook.com (52.135.163.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.6; Tue, 8 Jan 2019 16:48:14 +0000 Received: from AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f]) by AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::5490:e4ea:7798:e65f%3]) with mapi id 15.20.1516.010; Tue, 8 Jan 2019 16:48:14 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , Petr Machata , Nir Dotan , mlxsw , Ido Schimmel Subject: [PATCH net 11/11] selftests: forwarding: Add a test for VLAN deletion Thread-Topic: [PATCH net 11/11] selftests: forwarding: Add a test for VLAN deletion Thread-Index: AQHUp3HysPTBoSAkc02ShEc/XlRPWQ== Date: Tue, 8 Jan 2019 16:48:14 +0000 Message-ID: <20190108164732.4024-12-idosch@mellanox.com> References: <20190108164732.4024-1-idosch@mellanox.com> In-Reply-To: <20190108164732.4024-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P192CA0024.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:83::37) 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; AM6PR05MB4405; 6:0p+qwT3LHMvqKcMAtZVavkDwJVhtm+TnKE9uZSu38PqiowEfeJzmKcm1BDWxcip+a0okIgaQ8bqALmfpKOHWwdZ0E3AGYFeIF2gxTEW+oFxRvzRUNn2eDwUcJo84HNsMH0xY68EsMyOhsitE/j14EQeDl0MiX+ofTYwVxZH1szhQm1FXHtwwtxnENjDFVHkARunfL1ObYHAwvGTZUsC0K271RcUjK9E2JVy0k4N0Xdi648zO04NmmiU4j/MmTTd82EZKNxhlKPuyAq1NqyxN2SQDTNkMdpWRUEkcFLbKIQQfCj1KDwdWs/VEPIRPqy+3ZgxfPBsI/ky6r0YPSK+fmRJYXtKmq51ym5jE0kgvjyz00qt90T7pLaj5H5nk/i6IdutHjgfYt6o8E5134YFkrXf9oYP6irC3eBicYF8iwzEmJWKioiDvX21AtjN8j7WkT/vtyLYCm27/9wT0YY5NeQ==; 5:eLOXgczeirga8PTdUNtPI2TSneqoKuD3WzmpnZA9yQ1IcTr8dcE3ldHgRwS3ydjrJ+gGGy0RKENJmFwZAI03gg1hvhlOH/s9UBhdhouO7/s3trCb0AV7K05InLzdzxNawluI0SpKc2UPbiSeN6EV27awF7e5VyY8gwXaqYyoWDivlJi2kNcfDvi2T5iFPmAVH0FKuutPkMrB4L2YA6PeSQ==; 7:97lXu3wASC9z9IdFmjOFnYgL21db5n1OrC4Vw0NOfG9Qz4EQj2wZluvGWCVmEgN2sciY3+5KS7lT35p3voAeYsONF2f4ZzjOImMYXwGqOWJowlaFIgnjgMufQ8E6VcvD/mS5WwVk3FuENPXElt5ufQ== x-ms-office365-filtering-correlation-id: 90b89b50-bae6-49e2-5943-08d6758914f6 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:AM6PR05MB4405; x-ms-traffictypediagnostic: AM6PR05MB4405: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231475)(944501520)(52105112)(6055026)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM6PR05MB4405; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4405; x-forefront-prvs: 0911D5CE78 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(366004)(189003)(199004)(106356001)(105586002)(2906002)(6486002)(6116002)(3846002)(99286004)(6506007)(305945005)(486006)(7736002)(102836004)(386003)(76176011)(86362001)(52116002)(26005)(66066001)(5640700003)(6436002)(186003)(97736004)(2501003)(6512007)(2351001)(25786009)(1076003)(478600001)(81156014)(8936002)(36756003)(81166006)(68736007)(4326008)(50226002)(5660300001)(14444005)(256004)(1730700003)(107886003)(8676002)(6916009)(53936002)(54906003)(316002)(11346002)(14454004)(2616005)(71200400001)(71190400001)(476003)(446003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4405; H:AM6PR05MB6056.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: 4DvwW9jlgj5ruNeI3wp/SL8/sYOuscYGaBLJvSQdJZ1CEpgcEBSqdFuVIqrW0AXx99hOfpsF4vatw66XH7xaKpa2HoKeTxbshRenRIZhIJmcOaMUsok+7+eu3gsgxnXOQLypnwcZLQM5cO7CKzZm+WSPJYv8UoAzLbIsGs4x2GfOHmlGwOOAiDhaFL5vAYcPQnkXwJ6goUK6EAL7ZI9XT8X+pHiyCfmd7ldTCaFsajeZKx88BqDpaTk/fY1CTGMAFUG988xlPKTJb1BK/nMtrrDyk5r/asPI0G0KC0O2/0e2zQFwIl8IdJbin+3HHAAB spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90b89b50-bae6-49e2-5943-08d6758914f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2019 16:48:13.6608 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4405 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add a VLAN on a bridge port, delete it and make sure the PVID VLAN is not affected. Signed-off-by: Ido Schimmel --- .../selftests/net/forwarding/bridge_vlan_aware.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh b/tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh index d8313d0438b7..04c6431b2bd8 100755 --- a/tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh +++ b/tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh @@ -1,7 +1,7 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 -ALL_TESTS="ping_ipv4 ping_ipv6 learning flooding" +ALL_TESTS="ping_ipv4 ping_ipv6 learning flooding vlan_deletion" NUM_NETIFS=4 CHECK_TC="yes" source lib.sh @@ -96,6 +96,19 @@ flooding() flood_test $swp2 $h1 $h2 } +vlan_deletion() +{ + # Test that the deletion of a VLAN on a bridge port does not affect + # the PVID VLAN + log_info "Add and delete a VLAN on bridge port $swp1" + + bridge vlan add vid 10 dev $swp1 + bridge vlan del vid 10 dev $swp1 + + ping_ipv4 + ping_ipv6 +} + trap cleanup EXIT setup_prepare