From patchwork Thu Jun 14 02:02:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10463219 X-Patchwork-Delegate: idosch@idosch.org 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 B4B2560348 for ; Thu, 14 Jun 2018 02:03:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A570F28B7C for ; Thu, 14 Jun 2018 02:03:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99FC828B93; Thu, 14 Jun 2018 02:03:39 +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 A598E28B7C for ; Thu, 14 Jun 2018 02:03:38 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 415n3D7474zDrpC for ; Thu, 14 Jun 2018 12:03:36 +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="rWSJqJ0j"; 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.1.77; helo=eur01-ve1-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="rWSJqJ0j"; dkim-atps=neutral Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0077.outbound.protection.outlook.com [104.47.1.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 415n393htVzDrnp for ; Thu, 14 Jun 2018 12:03:33 +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=sB43MiNebklIsK3ZYRhLtv8x3KoG9JeK+q9mr2eqH2E=; b=rWSJqJ0jMQSTnu8fF8XGmQAKpy1lWFi7fMUCcptF2b3DYT89V8gLSH/He1sM/eq4vM6SNLFlLNpkQAlitdMnAo4gNFGF8KW53NL/jZgU9cZqofCL75YuZUxZojkxOTSexxOFaS0IvZu4m7z3NpT8DO5UVUWgIFl6mSgAxOgVcEo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (89.176.83.59) by VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.16; Thu, 14 Jun 2018 02:03:26 +0000 From: Petr Machata To: Subject: [PATCH net-next mlxsw v2 3/6] mlxsw: spectrum_router: Publish mlxsw_sp_rif_find_by_dev() In-Reply-To: References: Message-Id: Date: Thu, 14 Jun 2018 04:02:37 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [89.176.83.59] X-ClientProxiedBy: CWLP265CA0245.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:25::17) To VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 32c28588-782d-4c48-0bf2-08d5d19b0463 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4191; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 3:7zm0MRj6CpdfcTHWa9c8zfSpm6xX/NPNe4whVLqEskeaqTTC7VCc2RC9BS+vQHIBVAEcfGeS3AScN2KRj6nyQA1vZ1XdC07YQA8fmCRb/XFq52ECqfvdENA/BP3IrTXcEIVRZz/jXATcTjFlRv3jUw6H4nzONn6Xz5/sVv1jAKYUB1foR856VXIa3N1DQeXpBSnKgpBhIjFa7HYZPUKQjjgx3pKybnBQv504RgTw6W/IP/Q8y7JwP48DdoYt0M27; 25:KCglHUOPEPR4IY018fWzhEombYGmIFKGj3KBNvG2qJHpcAdV0silH9hFX5q3ta+uA6Xqp1DpEi64DzlyME3xr5wGJiMg/7pax8H5RNsYXfNKukGbtgMuGdcq9DrY8CItuy6Z/kyQgBaoVw3PPTUpdTOiNxkUJGAZyfNW+96Hjd3R2A5dR6+wxpYt9D1iiSecQWBHCUEXa0KnwHhTmyZ18V6BozW2OJ2RKis1IcGlr3k4UziF6daAW1uFJXS53RKKUlGvpl8qPLf7yaRe7T8W0n49qXU+rjtaV6dNCM/eJs7YbCVCkYqGSL9uUobiaxOrj3F0Aw0Kofc92oK/NgA9VA==;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qic6xI9FZjOXHfQzRbTGphQ== X-Microsoft-Antispam-PRVS: 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)(5005006)(8121501046)(3231254)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:VI1PR05MB4191; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4191; X-Forefront-PRVS: 0703B549E4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(366004)(396003)(39380400002)(376002)(189003)(199004)(59450400001)(446003)(11346002)(105586002)(486006)(6496006)(305945005)(6486002)(386003)(48376002)(106356001)(16586007)(66066001)(52116002)(51416003)(58126008)(7736002)(47776003)(316002)(478600001)(37006003)(6666003)(81156014)(81166006)(8676002)(5660300001)(6636002)(8936002)(118296001)(476003)(2616005)(76176011)(956004)(97736004)(50466002)(25786009)(3846002)(6116002)(68736007)(86362001)(36756003)(26005)(16526019)(6862004)(186003)(53936002)(2906002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4191; H:t540p; 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-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR05MB4191; 23:AX6Ln0YmnBSlihxPOilKRGegPpEaSaRFIF2nQwdkS?= =?us-ascii?Q?RgoHVWlTmMa77s+mi8PObaf4VbAqVU5V8LOYWdAnKPydGfOQkQttwdIJghUb?= =?us-ascii?Q?wfvZ3/PzZwBcqK/QLnRPlYwnFHgbJ4KYx0a+EPSpbtTODYEToYAnnm7eM8iK?= =?us-ascii?Q?2S1FIl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QaA8pWxjlE64h1gyFWNDjznIaAzxrmCvD33GpMT3WjiMD8+VQ1eo4zjRY+NvoXc6KAQKLAC7vGDxpP2twxwcU=; 24:kUhjykBF6ssGd2RwLdxi9/mJzpLUBiAPv5x4XCxEoXZYLoJKvda8myHmqnA61ws5IboLjrIedhjIpWiBd0jv9NpO7ybGOrIIDZPMZZp5Iew= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 7:udJrMz8d6wck8cAmCMqd9XRlBfJSOZSgBWWmhAnf7lCeeszevnFtLYYriqigEoAWywIxRfsPvswjBc17ZiDHto/fFrVhVRpcvOKFwmztmm+DDyWE/xnOFiDSE9a/CdJY2BvHWbHb5kYOXvLgWNLmCBRV41PKewvrhE6zf8itAkhBcFSYmEjxVtIKuOpJDAe+PUfdZzL4EOKJxgLzJKy1Rd5dbKWpkAMI/KtIb78W1Od0M7fUDsK8SqEfR1VKQ3DV X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2018 02:03:26.3377 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 32c28588-782d-4c48-0bf2-08d5d19b0463 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4191 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 In order to guard against removal of a PVID for which a FID was allocated, spectrum_switchdev needs to first determine whether there is a RIF associated with a given bridge. To that end, publish a preexisting function mlxsw_sp_rif_find_by_dev(). Signed-off-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 6 +----- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h | 2 ++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index c7243d3f91df..880092c6c94c 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -343,10 +343,6 @@ static void mlxsw_sp_rif_counters_free(struct mlxsw_sp_rif *rif) mlxsw_sp_rif_counter_free(mlxsw_sp, rif, MLXSW_SP_RIF_COUNTER_EGRESS); } -static struct mlxsw_sp_rif * -mlxsw_sp_rif_find_by_dev(const struct mlxsw_sp *mlxsw_sp, - const struct net_device *dev); - #define MLXSW_SP_PREFIX_COUNT (sizeof(struct in6_addr) * BITS_PER_BYTE + 1) struct mlxsw_sp_prefix_usage { @@ -5968,7 +5964,7 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb, return NOTIFY_DONE; } -static struct mlxsw_sp_rif * +struct mlxsw_sp_rif * mlxsw_sp_rif_find_by_dev(const struct mlxsw_sp *mlxsw_sp, const struct net_device *dev) { diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h index a01edcf56797..5a258b1db03c 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h @@ -66,6 +66,8 @@ struct mlxsw_sp_neigh_entry; struct mlxsw_sp_nexthop; struct mlxsw_sp_ipip_entry; +struct mlxsw_sp_rif *mlxsw_sp_rif_find_by_dev(const struct mlxsw_sp *mlxsw_sp, + const struct net_device *dev); struct mlxsw_sp_rif *mlxsw_sp_rif_by_index(const struct mlxsw_sp *mlxsw_sp, u16 rif_index); u16 mlxsw_sp_rif_index(const struct mlxsw_sp_rif *rif);