From patchwork Tue Jun 5 13:37:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10448313 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 C942960467 for ; Tue, 5 Jun 2018 13:38:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B9E5828CEF for ; Tue, 5 Jun 2018 13:38:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE193293D3; Tue, 5 Jun 2018 13:38:01 +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 9100B28CEF for ; Tue, 5 Jun 2018 13:37:59 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 410XtY5pqLzF1nL for ; Tue, 5 Jun 2018 23:37:57 +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="BK09805t"; 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.54; 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="BK09805t"; dkim-atps=neutral Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0054.outbound.protection.outlook.com [104.47.0.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 410XtS36mJzF1n9 for ; Tue, 5 Jun 2018 23:37:51 +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=olYd2C7Oi7D3NmDVT3IPfJ+WLsYMrz5iRugzFjWXSPs=; b=BK09805tUXCbOiZOB57Oc6P+QVgfMIp8UtCxdwniy2/4ZHijjD9jxy8ehv4Dq0eISRf7aFnmPGho7rseBLhOfpROudlotAc//GrJJHDjwAKRx2z2UYv/hZB7DTDW+yIbLDmdcaULNDqxnuXukf5Zjmc3uR3pxzQk2aD6h9LKEAY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) 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.820.13; Tue, 5 Jun 2018 13:37:43 +0000 From: Petr Machata To: Subject: [PATCH net-next mlxsw 1/6] mlxsw: spectrum_router: Propagate extack to .fid_get() In-Reply-To: References: Message-Id: Date: Tue, 05 Jun 2018 15:37:39 +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: CWLP265CA0027.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:11::15) To VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) 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:VI1PR05MB4191; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 3:xXIs51ksTi5LqdhVDRS2GN4ZYJwpOg1yVpfwWI9tPuPQlop5ecMYuaxwnUKT8sswDl428cahM8xUvvrSuw5YZkT2tEv2vnea2OhS9AMWY69DyAw6vQnb6JpNaGClY/08uY8ZDNWBAY/WVlJP9vSGQspsE4xMUV1qXvIo/QW+QKboldPL/mXaPU0uukAz+IBRwPSSFYiIGzQdDs+Laq2ruCzYg/bCz01oMofM8gJWdYiaaW1cCzYftkAqDnuh0b89; 25:XPR9G8i3RvbFLp6CWu3kXPANbiLpKwEa68U+XtsqA1/TquRncOLvsh3psB4+zgBeWpVAuGujbcwMjSnywJuC8UQA2UUnpQdxvhtm6t4CTepvrX8Gc91xOk46nwh247Gxqr1XhrQPIg6P3UQYO1jgBCCh3OOhednsZzw/ChD8lYEcWROWkY4vmdV6BgAm/c1ULAnOzSTqeq+8QLhhBzX1VRUVqfjtxeZOPhu+C4PYjfyPe7VT8Bvt3G2pl6vlpsv8ZUZkgPIMxU691Owo9wogPiLsC65+5VbZ6S8+qeHbqXO0Ds1i/72hHTArOKwY/rMsddeDPTK9Wy8pEKjgeGRppQ==; 31:Xh3+zGLOSrZLiMjwdk08ieS37sI95EsIUCPsTdOnDyqSepiCjaaVs+xl7FQeDaa44ioI++ZOsbTWNDGRnXliOxihORF2BBeYhVT0hdxs4EhfdMqXGdsvDAedIJJ//AjT2RpVqKASJUGnI91xJGwh15q9SI57DkfRBhPFRdn7F755nFvZQCJ3K0aC32iTIa99s7tKqbDXX6FcK3TGovX+pW0XTNpcVVltU5qdAKBIjxE= X-MS-TrafficTypeDiagnostic: VI1PR05MB4191: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 20:hblGu6tKSIe/I3in06UxmD8i/0cbWncwGeADabOLoVdyqD/WTyW7WGgC/xr8NWtiDHvSdPtW8/dl6srrMUEF6XIAGrZKGmt3cBy5JKIb9hR/FK0YBX/c8W/rFGH3xWJSYptz4NJ/Su5kYyL5JOFqEo2YUfQv9oKhb3QKmhIAZuzr0BQmdIOpWAOq8Mw7ETcKN1PTDx4OBezdQvWTbC6dWWevO0N5JaAFYnjgmL8b5l8SM/KSOlzNxRTruCN7mmPC6cakKOYtjgvCPwc9iHCxVf/pJCq/O11CqScBuCvf1Rbw1g58JTBlrPXNTi5rVqBeopanlslz5EqykE4xuOB3biZTZqfSUN8tXrphimbRYQwnme19D1TRCc7oCY7c3+G+vqOOlEFLJXp9foa0KfYtsu7kYR43tL0LPO7U2VSAIknA13YRa09H+c/qb+P+iOzFPLyAxRDK9wc8z2kgRN7Mh9Ck5W5rM3Qm7GuZlmvFg9tXHbgjJ9F47LMF7zlN+OR4; 4:qQz7TZ8/ttghLAtRCgc9acP+rtZjyeFWTEWSbJHFgY2XYMP3dT6wv2pQOMINSsxf/mi1TrHFMR947s4YVGMP0jcsH46vdyRmoRcpEx4TG/aXksDeMOlHH2qHwqGL+NIZeAftrxOoTC/eRfdVApn/X3bwGTH0lfXQbCD15Tr9A5CGwwY2rzrocVXn2vS9DTbH/0xkwmuO2DAHKEJdBCZa7DXWBSHWbmGLfQ84WBKNQ2jvTaI5oBJXDdDiKf0NKMV2XaOB88xkxC9R9kciTB2zBg== 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)(10201501046)(3231254)(944501410)(52105095)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:VI1PR05MB4191; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4191; X-Forefront-PRVS: 0694C54398 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(376002)(39380400002)(39860400002)(346002)(366004)(199004)(189003)(486006)(68736007)(6496006)(118296001)(956004)(2616005)(305945005)(476003)(446003)(86362001)(11346002)(7736002)(16586007)(316002)(58126008)(50466002)(48376002)(2351001)(36756003)(97736004)(53936002)(3846002)(6116002)(37006003)(2906002)(105586002)(106356001)(8676002)(81156014)(478600001)(5660300001)(81166006)(6862004)(26005)(16526019)(25786009)(8936002)(6666003)(6636002)(66066001)(51416003)(47776003)(386003)(76176011)(6486002)(59450400001)(52116002)(186003)(142923001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4191; 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; VI1PR05MB4191; 23:+vq7jYjmmfpibeT05xHJYDfnY8yW22cbtEHErOk+T?= =?us-ascii?Q?VMcE96d1IDWRjMIPz2/8twPjWksz8bIFgqe3lavcwgL/AUphunaIOay69k3n?= =?us-ascii?Q?8jadDaKkH9RKKoUyFtiXiak9FNc8XmPCFL71MUcgHCPmgfwT+I7KhZuEBA6B?= =?us-ascii?Q?MTmAfvel90VL/DPpqb48hAL5bGZdov3KvCPebVO5dz+95pBhp/hTehwZD0pX?= =?us-ascii?Q?XmaqCcr+WDDi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CJY+MuEYCKET7YW9tM+0mXCRuXk=; 24:mC6Zqswp5D8LEnfJpAfgUWzdtfyrxoIwKZm5S/WKV1n52vjYnK3a5Y9g7QBNZ2qLm9UtPj0cQ08JskEM6aWg6LG9b3dCeaZgPP5dNSlOGuM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 7:ntVMJsxhf/y11XiC7JbX6ZvQQZp2pufGB5sV7uJB79rSq5PgNtcrPEl4iq+VBJKZS5Hix+CGSk76KFh/DMftN70mXGREDabmSxKQtemvQ6Xwok+BbT01OzymGRcjExFGcYbvyXuU+kOICv7uBmZtGHqscPUlayiloXty9XwUQRwNf3BF0vdQ5sVYS5Bv6hMil3Qf9BmTxFsBign0NcnMaoLv7bMgqSRTLSqEIfp+lcMs9Dk9bkNNWMUIg0AwQOTT X-MS-Office365-Filtering-Correlation-Id: 8050054b-94d0-4eec-ead8-08d5cae9848b X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2018 13:37:43.9783 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8050054b-94d0-4eec-ead8-08d5cae9848b 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 the follow-up patch, mlxsw_sp_rif_vlan_fid_get() will be changed in a way that could fail. Give that function a possibility to explain the failure through extack. Signed-off-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 77b2adb..54692c8 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -163,7 +163,8 @@ struct mlxsw_sp_rif_ops { const struct mlxsw_sp_rif_params *params); int (*configure)(struct mlxsw_sp_rif *rif); void (*deconfigure)(struct mlxsw_sp_rif *rif); - struct mlxsw_sp_fid * (*fid_get)(struct mlxsw_sp_rif *rif); + struct mlxsw_sp_fid * (*fid_get)(struct mlxsw_sp_rif *rif, + struct netlink_ext_ack *extack); }; static void mlxsw_sp_lpm_tree_hold(struct mlxsw_sp_lpm_tree *lpm_tree); @@ -6162,7 +6163,7 @@ mlxsw_sp_rif_create(struct mlxsw_sp *mlxsw_sp, rif->ops = ops; if (ops->fid_get) { - fid = ops->fid_get(rif); + fid = ops->fid_get(rif, extack); if (IS_ERR(fid)) { err = PTR_ERR(fid); goto err_fid_get; @@ -6267,7 +6268,7 @@ mlxsw_sp_port_vlan_router_join(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan, } /* FID was already created, just take a reference */ - fid = rif->ops->fid_get(rif); + fid = rif->ops->fid_get(rif, extack); err = mlxsw_sp_fid_port_vid_map(fid, mlxsw_sp_port, vid); if (err) goto err_fid_port_vid_map; @@ -6775,7 +6776,8 @@ static void mlxsw_sp_rif_subport_deconfigure(struct mlxsw_sp_rif *rif) } static struct mlxsw_sp_fid * -mlxsw_sp_rif_subport_fid_get(struct mlxsw_sp_rif *rif) +mlxsw_sp_rif_subport_fid_get(struct mlxsw_sp_rif *rif, + struct netlink_ext_ack *extack) { return mlxsw_sp_fid_rfid_get(rif->mlxsw_sp, rif->rif_index); } @@ -6865,7 +6867,8 @@ static void mlxsw_sp_rif_vlan_deconfigure(struct mlxsw_sp_rif *rif) } static struct mlxsw_sp_fid * -mlxsw_sp_rif_vlan_fid_get(struct mlxsw_sp_rif *rif) +mlxsw_sp_rif_vlan_fid_get(struct mlxsw_sp_rif *rif, + struct netlink_ext_ack *extack) { u16 vid = is_vlan_dev(rif->dev) ? vlan_dev_vlan_id(rif->dev) : 1; @@ -6937,7 +6940,8 @@ static void mlxsw_sp_rif_fid_deconfigure(struct mlxsw_sp_rif *rif) } static struct mlxsw_sp_fid * -mlxsw_sp_rif_fid_fid_get(struct mlxsw_sp_rif *rif) +mlxsw_sp_rif_fid_fid_get(struct mlxsw_sp_rif *rif, + struct netlink_ext_ack *extack) { return mlxsw_sp_fid_8021d_get(rif->mlxsw_sp, rif->dev->ifindex); }