From patchwork Tue Aug 30 19:59:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12959835 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55E3FECAAA1 for ; Tue, 30 Aug 2022 20:01:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231923AbiH3UBR (ORCPT ); Tue, 30 Aug 2022 16:01:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231843AbiH3UAc (ORCPT ); Tue, 30 Aug 2022 16:00:32 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2054.outbound.protection.outlook.com [40.107.20.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79C2E26118; Tue, 30 Aug 2022 13:00:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MX9fUD/AJ9Zo1yw6WH7sfiGT3mxINEgfI+iPlh/CF2s1TeR6cZqLM6r7lbz7iGwrcqmhFhROk6IPqzffLvZPlCEJGunyMQyQ3XS824mtj2cYa604kyUAsDD7eikxEDlXhHw/UfdHOo4qDn4j1FH4iPMZIORUAu+Ye82sI9nR1ubuA0pTGwpfu7uYr7lvxqgKwDhqTajyDgTJVxqMpfmYawh4GPYQfo/nt869K8KsbQS8GRqnW4ZYWBeMaOsBS9TupzMOHbA30pdsmrUxiDF/7ypJeE7sGVmb3gH2tSWHbFYWM9/XDricctoL4aFxNklgJtY0haL6SdHTXIWXyvAqTg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5h1VvgX8MF+zSQTU/wgwjESwnjvrwOu4/+TM8gKSDzw=; b=gbhHSmufoxGQgIX+NtuNqr0cuiL5/4bxjlz3XoqADt3MaJ+h1gISHGlGSd/LO3POEtdOWNy+wHInp375HMImRQlue6fjUkpoWXheBPq0KXXIyhOndWHx/EPb4HmwILt72MGLSDM8yBk+2yQXcDeyDZepsDEcDB+siC2bRVrB26hkdAvO3N/I/KVjpypnRfK+IfqgZ/hOJgZ3bNP/PCSbwUMheFrAuXeqEfDEibUzFC3QNot52xXLyNWlsHWQdA9ozjWalntWfM+jpwH2RPiEfyPov10qmJ4laUwLyScmntchX1sI1hAEZA39NuREq9DP2DYhHtDxbIQNobXLh76wcQ== 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=5h1VvgX8MF+zSQTU/wgwjESwnjvrwOu4/+TM8gKSDzw=; b=nzxdLwJlxaz52/2/lYTwiJO6WrJcLsCVC+yIx1bWS4sc2O0gkHJ7rEpP3d6URh9dexBA35Y3zo7bjkZgXQ3zY+rydAqChavULHjibwMc0/Ar85VAgo17NCn45MaBbdOeyaKRFD6HuvdzF50cc9KCBYPY2Rl3abmTo+f7udWw8hc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by VI1PR04MB6270.eurprd04.prod.outlook.com (2603:10a6:803:fb::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.21; Tue, 30 Aug 2022 19:59:52 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3412:9d57:ec73:fef3]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3412:9d57:ec73:fef3%5]) with mapi id 15.20.5588.010; Tue, 30 Aug 2022 19:59:52 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Florian Fainelli , Vivien Didelot , Andrew Lunn , Vladimir Oltean , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Colin Foster , Roopa Prabhu , Nikolay Aleksandrov , Tobias Waldekranz , =?utf-8?q?Marek_Beh=C3=BAn?= , Ansuel Smith , DENG Qingfang , =?utf-8?q?Alvin_=C5=A0ipraga?= , Linus Walleij , Luiz Angelo Daros de Luca , Felix Fietkau , John Crispin , Sean Wang Subject: [PATCH net-next 6/9] net: dsa: suppress device links to LAG DSA masters Date: Tue, 30 Aug 2022 22:59:29 +0300 Message-Id: <20220830195932.683432-7-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220830195932.683432-1-vladimir.oltean@nxp.com> References: <20220830195932.683432-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: BE0P281CA0005.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:a::15) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2a29cc30-7549-4d07-0ca6-08da8ac233b5 X-MS-TrafficTypeDiagnostic: VI1PR04MB6270:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u7mMc6YbL2dyR5Dlgft3HDjQL1R34c02ANXzZYtQW7LaES2Qv256F/ph9lsdx63F+WHKvAUbCwh9/cBCNi2vvI3PTw0SEnYB/doY/+FgMZj90LXrlIS5COGEWZHu16RkJ2QwmsOC4Rqlb5N2a9LdKK6U46YCzQUj0lxfk3m30fqfUYQPUl0MFtwDmjr+brzTucNvHESnVSsNwqZ5rO1HuMiizDVFpumpOiAOF2OIASZoFEvs8XCt9eqsdR9M/A9LjGRezuYqTsZPjrZU+4mpsdglenDh442HfvISrxkfAneYNI1by15n82KEf2GLwMH48s6SvOT5/ceBCrG+IL9wDaaOQm8ns71Oin2vwz3rxcJBID9y+YAu3QaFxjLkev9wl8JS5GSUmdyy7CrUhNur/BQJfYTcHelinRaB4ydPD9SwlfrByGf4BiCuV8Iqe3+KqXhctKrSosn8h5iFA0C1/U9BbMLzVVm8jtf+ux2+jMP5D22tN1lFvbBe/LS/9wV4t+l6innv8doyAdeAHgktFVgJaCQmIAHpk8tkdCJEu8haeVwhKXj0/AV6uOZxpD2L0SgLtn6fuZf7acXb1IgkC4kRU7w3mBlGi/+uRvNfjBayk7igNtXDaYeVB6FplpdixkkKk2HrWOIqIspxrGQymGFBlafP7sCcpJUmKuyFDyWdiT0umt4CmJYh3OsnPG54WWb91by17f7z0O8Wr7z+VH1o2GVZGnDJfkyB86QTlgQLV0DGoKsBBgSXV1Pcd5Ao X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(396003)(346002)(366004)(39860400002)(136003)(376002)(41300700001)(66476007)(6486002)(8676002)(4326008)(66946007)(478600001)(66556008)(52116002)(2906002)(83380400001)(44832011)(26005)(5660300002)(6506007)(6512007)(7416002)(6666004)(8936002)(2616005)(316002)(86362001)(6916009)(54906003)(36756003)(38350700002)(1076003)(38100700002)(186003);DIR:O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2ZgArADQid/kS/7t5xTybxEJ3z6uDbVWHs759NBXT+9fDqRK6/MZ4ZlMTpJUgH/h+gffdihAJouQAB6hido5RS6FpeL6cZd2r1jIRerZoOhWESvwbqvOmIM5VDIfWTg8KDhWMfyIOt346gMDeC+ANOQ3eXLoi7DDXglGWzoNjRDod+v+OD2Jmbj5nOKPVzvuLOhFDy8UYPyVa912HVfVvm2+JUjaVA3Y0EZ7Ey0DbzQgXoI3OMD0Aroz6pRO4cVxQXedZDyYK+lahQ8/5lIHoQghwqpH4hWGMVV/EiYuKP0ZOqi3ms209BDRIWp0xRuxZvHz3Ia6o1syDagKF6eY3oAfInEGescM4/BYhIeHfFApyPuGdva+vnDmLaOykWOE1Rr62ql1guaEXHOt4Bie6y3ilCbu0nKmvLNxP5ANf/x5Th0c1TVH8l3ZnpSMVT2QKendkHG6wHzAJkqtL4xFby0EPbJhUwISuQ4Xfii6nTxI+ieLyoBEEYTpfeKdvh0WIx8fYWYg5+VinSbCUtAjEtC3Q217soO+S/sxzKeTdoTFHJyvBAUZBpG3mpZSGA5AtWhWrPFV3jUPr6eKLZeg5tMqfLk2g== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2a29cc30-7549-4d07-0ca6-08da8ac233b5 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2022 19:59:52.3856 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pzOpWh0kyD9v8hKaycQliaunNsjklcCo/migVX+XlKLZN7wTFrxbHz1Z7sLHlORwqAfjdDsd8cNi4kCq2ArXfw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6270 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org These don't work (print a harmless error about the operation failing) and make little sense to have anyway, because when a LAG DSA master goes away, we will introduce logic to move our CPU port back to the first physical DSA master. So suppress these device links in preparation for adding support for LAG DSA masters. Signed-off-by: Vladimir Oltean --- net/dsa/master.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/net/dsa/master.c b/net/dsa/master.c index 99d773b24223..2176c14b97a8 100644 --- a/net/dsa/master.c +++ b/net/dsa/master.c @@ -364,12 +364,14 @@ int dsa_master_setup(struct net_device *dev, struct dsa_port *cpu_dp) mtu = ETH_DATA_LEN + dsa_tag_protocol_overhead(tag_ops); /* The DSA master must use SET_NETDEV_DEV for this to work. */ - consumer_link = device_link_add(ds->dev, dev->dev.parent, - DL_FLAG_AUTOREMOVE_CONSUMER); - if (!consumer_link) - netdev_err(dev, - "Failed to create a device link to DSA switch %s\n", - dev_name(ds->dev)); + if (!netif_is_lag_master(dev)) { + consumer_link = device_link_add(ds->dev, dev->dev.parent, + DL_FLAG_AUTOREMOVE_CONSUMER); + if (!consumer_link) + netdev_err(dev, + "Failed to create a device link to DSA switch %s\n", + dev_name(ds->dev)); + } /* The switch driver may not implement ->port_change_mtu(), case in * which dsa_slave_change_mtu() will not update the master MTU either,