From patchwork Thu Jun 7 15:01:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10452651 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6B81060234 for ; Thu, 7 Jun 2018 15:03:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BA45260CD for ; Thu, 7 Jun 2018 15:03:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FEC22907B; Thu, 7 Jun 2018 15:03:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C4976260CD for ; Thu, 7 Jun 2018 15:03:44 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 411phZ386dzF34r for ; Fri, 8 Jun 2018 01:03:42 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="xOHQIgP8"; dkim-atps=neutral X-Original-To: linux-mlxsw@lists.ozlabs.org Delivered-To: linux-mlxsw@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mellanox.com (client-ip=104.47.0.56; helo=eur01-he1-obe.outbound.protection.outlook.com; envelope-from=petrm@mellanox.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="xOHQIgP8"; dkim-atps=neutral Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0056.outbound.protection.outlook.com [104.47.0.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 411pf25wr1zF34d for ; Fri, 8 Jun 2018 01:01:30 +1000 (AEST) 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=A5RCMcIuB7MEkTA2L8nGR6J8TjQ8wvh343EB+3bFPdw=; b=xOHQIgP8BcM1B9KqGs3dasMQ671+dHTWsmH5Mj5YtqUPfWK8VY/QFcGh2AKxB8e5w802c5cyu/bPLUqxzGYJkO9XKzJnp2RUAbR2BsMMA8ebN9v263VdmVGrWQ/M4vqDM45rMrfnqs+QXY5x8ljCJE80FMc45y6DS9rIV2jQsuk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) by AM6PR05MB4181.eurprd05.prod.outlook.com (2603:10a6:209:40::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.14; Thu, 7 Jun 2018 15:01:23 +0000 From: Petr Machata To: Subject: [PATCH net mlxsw 1/2] mlxsw: spectrum: Publish mlxsw_sp_port_vlan_create() In-Reply-To: References: Message-Id: <71be1a792906ae4a7d0ea24187e1eea62e174503.1528383246.git.petrm@mellanox.com> Date: Thu, 07 Jun 2018 17:01:18 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [78.45.160.211] X-ClientProxiedBy: LNXP265CA0035.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5c::23) To AM6PR05MB4181.eurprd05.prod.outlook.com (2603:10a6:209:40::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM6PR05MB4181; X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4181; 3:iugHpjFDhxeZmfDaH2CjsgBbeud5TjWrmSXjz97U94kwMAj8jHJX49Rx9rKLkYBN5mLY6fr2fk6Qqbl43elz5NT4H6GAqK/I1f3lf7Jmj29BnJmEn/24b515DMSKzQMZWWEPLHUny6/kjhA3dretNlWUbVqXbMKmjcI/m2DFHYRgZOgyf+TLWcF1dqcYGPuCkDm5ASiGlzHeeR3eM0GC3xP9pryFXgLVFaQyTfuQu+5z8ymcBoD/mQm5TObwVW4h; 25:JWleOZoUP45iPKh5MpoTpp6pWY2plI9EZ2WoS6SCRF4Wi/8Vo7bJXLt7X9b6oo5AfW/E7VCQRujGI75jh8apDmKAdb1mM95VzFcuMAz43KynatcwBtge8IAFloZfwagD/KwnGMtY2J3FOfd0WrFuJ5kPRXrazjPmpqo2nWeI7CKlcCGt2UJ3TbeQl5jMzkrzezvSQVRvlMWOuE5/hfPsAO/UPFkrA5i0slHaEiCbvnor2W00fCBZFsmrI0aNsI3sr3Vq2LbOglBV5ye7wcJxbigZ99By2MZyoAGC2/y+Ctb2s70F9OJn7xfsLVsv1A9UcaJq6a5mQNaUOEcN0FwyTQ==; 31:4/tYwFE1bqrITCVYrjWpINP5m+Q3OXsYnIz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RVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:AM6PR05MB4181; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4181; X-Forefront-PRVS: 06968FD8C4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(346002)(376002)(396003)(366004)(199004)(189003)(58126008)(37006003)(6862004)(59450400001)(5660300001)(68736007)(316002)(386003)(97736004)(16586007)(6636002)(6666003)(48376002)(6496006)(51416003)(50466002)(52116002)(25786009)(106356001)(2906002)(105586002)(76176011)(2351001)(186003)(6116002)(486006)(7736002)(86362001)(81156014)(81166006)(8676002)(11346002)(36756003)(446003)(6486002)(3846002)(16526019)(956004)(2616005)(476003)(53936002)(8936002)(305945005)(118296001)(66066001)(478600001)(47776003)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4181; H:t540p; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR05MB4181; 23:5TlARg0YYEX7evdBei04/uuPmqiwC8R9+y3vjNcXj?= =?us-ascii?Q?NXBT8IhJPWX7T7L/6Iry2jAOg2OOYQzLo7lXDAWo0HMSJ4rjCD8UArsL9/hG?= =?us-ascii?Q?Wi0NTu3XYvvBSu5rmm4wL9yt+Ry4HxIPJT+Ztsup8QiwMb6dzUz/OHkb2CZ0?= =?us-ascii?Q?71WXnedvPUkKA1I5p+3X4j6efSaFcn279u1eGPkTa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7qP70pvkXwDEFjiEyaCdjJDkHPnMKtw6K2Ur4doqm/KwBZeAUZd11hPi4Ls=; 24:Z5Dmoq+24BNa7DHQ3dBe+HCM2JApe90DGxp6T9AWt1c6pm3nUupKKcUiWKMp07qPij67C7JG0nhDRNQNL9xSJ4pNnjQThGNoAMyxrMLSFPY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4181; 7:FsVDwE01FgG6F7ovpTjd9JUrvDXFxGGCe9VjgPhn0AQxiw4aUP7kkIZ7DGzAZMDAzJcvWsDYdeUrIiAFAohyRPgpRb2G+MnTVWQY9JN8SeWF4GwRCdtOTBHz9cVksTPBYERlDJEWM84N8MOhWUZ5ACwHFEGR6GhnO/p9nWcuyHJURvKzMMD571XwjXcdTCP9p+LZ7kJEqj5eBEov5TsghIR1TxQhcizJIwMxPoQeBLo9p/oYcfNQkKPwHEds3ycg X-MS-Office365-Filtering-Correlation-Id: 4f2e6ca9-0a4f-4a9a-9adc-08d5cc878916 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2018 15:01:23.3212 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f2e6ca9-0a4f-4a9a-9adc-08d5cc878916 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4181 X-BeenThere: linux-mlxsw@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: mlxsw driver development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org X-Virus-Scanned: ClamAV using ClamSMTP The follow-up patch calls mlxsw_sp_port_vlan_find_by_vid() to determine whether a given port_vlan already exists. When it does not, it could then call mlxsw_sp_port_vlan_get() to request creation. However that latter call then makes an unnecessary new lookup before calling mlxsw_sp_port_vlan_create() anyway. So instead, publish the latter function and call it directly. Signed-off-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +- drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index 968b88a..7f9f9dc 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -1131,7 +1131,7 @@ static void mlxsw_sp_port_vlan_flush(struct mlxsw_sp_port *mlxsw_sp_port) mlxsw_sp_port_vlan_put(mlxsw_sp_port_vlan); } -static struct mlxsw_sp_port_vlan * +struct mlxsw_sp_port_vlan * mlxsw_sp_port_vlan_create(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid) { struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h index 4a519d8..9a05838 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h @@ -372,6 +372,8 @@ int mlxsw_sp_port_vid_learning_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid, bool learn_enable); int mlxsw_sp_port_pvid_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid); struct mlxsw_sp_port_vlan * +mlxsw_sp_port_vlan_create(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid); +struct mlxsw_sp_port_vlan * mlxsw_sp_port_vlan_get(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid); void mlxsw_sp_port_vlan_put(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan); int mlxsw_sp_port_vlan_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid_begin,