From patchwork Thu Dec 17 01:58:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 11978969 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97034C1B0D8 for ; Thu, 17 Dec 2020 02:01:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A15923441 for ; Thu, 17 Dec 2020 02:01:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728324AbgLQCBO (ORCPT ); Wed, 16 Dec 2020 21:01:14 -0500 Received: from mail-am6eur05on2048.outbound.protection.outlook.com ([40.107.22.48]:59936 "EHLO EUR05-AM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727942AbgLQCBO (ORCPT ); Wed, 16 Dec 2020 21:01:14 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SyixAqE4vgRI/7VmXm2omNEVMYIjxjh5T7YuTIYKaQlu6QENlxafxEMLO51vO3Y5DCbjiGPz5zeAxW/30BTuTHg92nX8n+P7i1DxbtHuHkOrFSAowBq3YR+GaFWXa4+1JdMUdFIGgPD0eMUplGTWSUllH++g6hMz3SrtvJ8e08UShR4ZtMN3N96dsHcTmowVpmTEh890H4KYY28WFDmBcXS1XXyM6LMUYzHOnmIJG1mGGY2zsoHl0AzkE6MmGBAGN7MyvJlkfkN9h4UiRgKP3tpIrkU/S4cYurItg5YYSIeVVKAJbkynBgDBgLydEZWM4ub3ZyQpiESy7tbz98Zq5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JR1kZcu+kkmKQxoTTAKQfoOuCUrLgOQTyxfmCTO4ZJw=; b=YPveoAxDmOa8NK9Mvzyg9WixuBPPt51wsUggpjazmxvgayS4l48ACSAH0qIB4yuW4HMJoTyE19Dx1CcsU/DPODMHwZGLW98Kri74tLFpTGKRbT8wax+5TepBy+TM6n5CfvkrRYjTSdUf7RplTDGlWCM/3aA8cv+nMzl2gpPuoPumGvX+bdRdhXG2UrAsv5NgYQUl4oy6ADCaG5nj5wa8b4yJWLyLrtN9fhhqeurqi05xkzAQzUOSdmQoUPYj9J9V8Ce69P22S3fbnZJ6bAGSfRF4OCYdalOzqgXBcvCqJPAEyiElM1Psy/6sIosrgzSodLNt1HQcVZl0sYmxShYm7g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JR1kZcu+kkmKQxoTTAKQfoOuCUrLgOQTyxfmCTO4ZJw=; b=NurMptsAI+CKnQvwGl0YCD5mu6qAhhy5bYKqgeigABvjKMKWP20HepSqhqK/A3E4aKzFBknuOOig7gFVSOCrSf76Lm/I+0vRlt1/7/zZNm6QCaz+hd7oABcjkb1DdlkHIMnIdfOLpz5VkkMNEYs0LNJ/YWsCiuXq38pVcrCLQtc= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none;davemloft.net; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) by VI1PR04MB6943.eurprd04.prod.outlook.com (2603:10a6:803:13a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.17; Thu, 17 Dec 2020 01:59:12 +0000 Received: from VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84]) by VI1PR04MB5696.eurprd04.prod.outlook.com ([fe80::2dd6:8dc:2da7:ad84%5]) with mapi id 15.20.3654.025; Thu, 17 Dec 2020 01:59:12 +0000 From: Vladimir Oltean To: "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: Florian Fainelli , Andrew Lunn , Vivien Didelot , Vladimir Oltean , Kurt Kanzenbach , Hauke Mehrtens , Woojung Huh , Microchip Linux Driver Support , Sean Wang , Landen Chao , Claudiu Manoil , Alexandre Belloni , Linus Walleij , Vadym Kochan , Taras Chornyi , Jiri Pirko , Ido Schimmel , Grygorii Strashko , Ioana Ciornei , Ivan Vecera Subject: [RFC PATCH net-next 8/9] mlxsw: spectrum_switchdev: remove transactional logic for VLAN objects Date: Thu, 17 Dec 2020 03:58:21 +0200 Message-Id: <20201217015822.826304-9-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201217015822.826304-1-vladimir.oltean@nxp.com> References: <20201217015822.826304-1-vladimir.oltean@nxp.com> X-Originating-IP: [188.25.2.120] X-ClientProxiedBy: VE1PR08CA0028.eurprd08.prod.outlook.com (2603:10a6:803:104::41) To VI1PR04MB5696.eurprd04.prod.outlook.com (2603:10a6:803:e7::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.2.120) by VE1PR08CA0028.eurprd08.prod.outlook.com (2603:10a6:803:104::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3654.12 via Frontend Transport; Thu, 17 Dec 2020 01:59:11 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3e4b5eb2-d900-4029-c6a8-08d8a22f598c X-MS-TrafficTypeDiagnostic: VI1PR04MB6943: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2QzK+t8rJF2n1R8T56JixAZDy5K8G/cLEMf5BNrSL9PR8yYDUZtxLRuNQoq5LMwCPeoHV+UznP0T2FijtkGWzFGXfjtvTuLHR6BBU+N5cP1UmvS8y96RdS0EcPHbPa8wXri6uiwbZpCkRQ147cJQGynsieJz6bJyfMlDLzQA7gdZ2TbVj0RLVk/PwK0FP3+UW+2/qgsqbRqMQGWfniWpwwb/Q/lKbn32FbAEPpqzrllr1KoWQw467NukWkRZPv23s+WrBrF2kfFEkY5vIonr29UEUiuwagV+e/2lKy25aDxFw8KLLpGq3M8baa+4fAPOT2ns0YzLXi/mXxNji5ZQ/A5gD2cDTxdneM89efVjfpmAecojFvVbNTn9CiTO6Z4L X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5696.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(376002)(136003)(366004)(39850400004)(396003)(6666004)(6506007)(16526019)(478600001)(956004)(2616005)(26005)(7416002)(83380400001)(36756003)(66476007)(66556008)(110136005)(86362001)(1076003)(5660300002)(66946007)(316002)(186003)(52116002)(6486002)(54906003)(69590400008)(6512007)(44832011)(2906002)(8676002)(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S-Exchange-CrossTenant-AuthSource: VI1PR04MB5696.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2020 01:59:12.0776 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 3e4b5eb2-d900-4029-c6a8-08d8a22f598c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5AMoNN9VQmFFX7J90WY0kcb+Q1bJo1uZkn+BZmI7fF5td6uwbVTc40+YV7idYROjaMtS6yWw+7oEptKy/SgzKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6943 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC As of commit 457e20d65924 ("mlxsw: spectrum_switchdev: Avoid returning errors in commit phase"), the mlxsw driver performs the VLAN object offloading during the prepare phase. So conversion just seems to be a matter of removing the code that was running in the commit phase. Signed-off-by: Vladimir Oltean --- .../mellanox/mlxsw/spectrum_switchdev.c | 38 +++---------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c index e248f9deb2ec..c775c9edea78 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c @@ -1199,7 +1199,6 @@ mlxsw_sp_br_ban_rif_pvid_change(struct mlxsw_sp *mlxsw_sp, static int mlxsw_sp_port_vlans_add(struct mlxsw_sp_port *mlxsw_sp_port, const struct switchdev_obj_port_vlan *vlan, - struct switchdev_trans *trans, struct netlink_ext_ack *extack) { bool flag_untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; @@ -1213,8 +1212,7 @@ static int mlxsw_sp_port_vlans_add(struct mlxsw_sp_port *mlxsw_sp_port, int err = 0; if ((vlan->flags & BRIDGE_VLAN_INFO_BRENTRY) && - br_vlan_enabled(orig_dev) && - switchdev_trans_ph_prepare(trans)) + br_vlan_enabled(orig_dev)) err = mlxsw_sp_br_ban_rif_pvid_change(mlxsw_sp, orig_dev, vlan); if (!err) @@ -1222,9 +1220,6 @@ 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; @@ -1776,29 +1771,20 @@ static int mlxsw_sp_port_obj_add(struct net_device *dev, { struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev); const struct switchdev_obj_port_vlan *vlan; - struct switchdev_trans trans; int err = 0; switch (obj->id) { case SWITCHDEV_OBJ_ID_PORT_VLAN: vlan = SWITCHDEV_OBJ_PORT_VLAN(obj); - trans.ph_prepare = true; - err = mlxsw_sp_port_vlans_add(mlxsw_sp_port, vlan, &trans, - extack); + err = mlxsw_sp_port_vlans_add(mlxsw_sp_port, vlan, extack); if (err) break; - /* The event is emitted before the changes are actually - * applied to the bridge. Therefore schedule the respin - * call for later, so that the respin logic sees the + /* Schedule the respin call, so that the respin logic sees the * updated bridge state. */ mlxsw_sp_span_respin(mlxsw_sp_port->mlxsw_sp); - - trans.ph_prepare = false; - err = mlxsw_sp_port_vlans_add(mlxsw_sp_port, vlan, &trans, - extack); break; case SWITCHDEV_OBJ_ID_PORT_MDB: err = mlxsw_sp_port_mdb_add(mlxsw_sp_port, @@ -3364,8 +3350,7 @@ mlxsw_sp_switchdev_vxlan_vlan_del(struct mlxsw_sp *mlxsw_sp, static int mlxsw_sp_switchdev_vxlan_vlans_add(struct net_device *vxlan_dev, struct switchdev_notifier_port_obj_info * - port_obj_info, - struct switchdev_trans *trans) + port_obj_info) { struct switchdev_obj_port_vlan *vlan = SWITCHDEV_OBJ_PORT_VLAN(port_obj_info->obj); @@ -3388,9 +3373,6 @@ 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; @@ -3451,22 +3433,12 @@ mlxsw_sp_switchdev_handle_vxlan_obj_add(struct net_device *vxlan_dev, struct switchdev_notifier_port_obj_info * port_obj_info) { - struct switchdev_trans trans; int err = 0; switch (port_obj_info->obj->id) { case SWITCHDEV_OBJ_ID_PORT_VLAN: - trans.ph_prepare = true; - err = mlxsw_sp_switchdev_vxlan_vlans_add(vxlan_dev, - port_obj_info, - &trans); - if (err) - break; - - trans.ph_prepare = false; err = mlxsw_sp_switchdev_vxlan_vlans_add(vxlan_dev, - port_obj_info, - &trans); + port_obj_info); break; default: break;