Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4601426rwe; Tue, 30 Aug 2022 13:14:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR4f//7kgyrT9b8BPDAV6tzfVGwxLoY0jc8AIMOPOzI3YP//kVAc5GhzJDB5wjJUBfSxFIcQ X-Received: by 2002:a17:902:b217:b0:172:bd6c:814d with SMTP id t23-20020a170902b21700b00172bd6c814dmr22720688plr.55.1661890473242; Tue, 30 Aug 2022 13:14:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1661890473; cv=pass; d=google.com; s=arc-20160816; b=0scYE88P3L5ySvjBwyChgsSwJaIBeSzgQfXCyLOeLGBoaPSKIn+irpwsAqEpWCCcFG iiVV6YXGp8LcuPhQTNKajTorkpwIGaWmBsu21hC4IitY4q1l3q7Oh6MWjlkcyOqtokg2 ZRhc9LEUoGXdzBp54a5TUhENL8lPAXuhKPE7nZgxj6qyhGGYrN297HWwFs5HCALYrtUc n21PkqDF62CgOPuhESkKHWhkZe86A487TLYyg7lRaDLJGX7vF6PqrOWHz9hfWAdc8gkt puIu59ADVzsHUNKkIkwp2SZUbmaWIvqkSaq/zo77PbRQk85w81q/2+S8398P9cXN2GNR uXng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5h1VvgX8MF+zSQTU/wgwjESwnjvrwOu4/+TM8gKSDzw=; b=Fi5axo+vUPHukEBvhKJt0dXMaqlUBH0y98r4s7vBREshmbk6p1qE86Np3qQP4KHl0W TxcwGB370YDMJZ/57qSkJLkgAZD0J6md9dBMRCpe3APTB2Tk1pv/iBZKxtX/HttvlK32 fXBO0riFGJSrOxCVT51xzo66yFPTTL0s6RHUW+XG0x4yRZKNthwOSkA+COrXnOFxgbiO RlNWTP/b5hI27vleh7/55I8f6VPfAwuDDFwEetNL4sQu/8sTMEHdTZd/gUitG0qkgS/h asJwBFlPYVFqoIgtyskUf0hzZvAyQJatcezUWZjS0pQgEwLAS9z+T0rwWfJ9PL8oL3Do 3XIg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=nzxdLwJl; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y22-20020a170902b49600b0016a2a8ac8e0si5829494plr.531.2022.08.30.13.14.21; Tue, 30 Aug 2022 13:14:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=nzxdLwJl; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229954AbiH3UBT (ORCPT + 99 others); Tue, 30 Aug 2022 16:01:19 -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=20Beh=C3=BAn?= , Ansuel Smith , DENG Qingfang , =?UTF-8?q?Alvin=20=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> Content-Transfer-Encoding: 8bit Content-Type: text/plain 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:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?6LEXVcW47Vw/cPTf1OpT7bGSXlQKhSU7a1duPde37Tt8n3lTToEjJF5zasRq?= =?us-ascii?Q?bkQ5n8jJp4p6kt2jJ/fyT4aLdVSwmKehO7J8tJvCrewB+urEJAujlcljr3TY?= =?us-ascii?Q?WWInl7cyXxBqXysRlVEsytIaL9jxULi35HfnUhx34rFRLbv8fUOz81Lf0jPb?= =?us-ascii?Q?Ybt9EV6aVawbUuQ4/eM/TY8J9l3HcodscYbqGAS7qSJPCAe3/cavEajt4oiw?= =?us-ascii?Q?5wtmH70ea5zUagxgXxhjzuThUt/b1sWpaNYsvoxlgaLiQlP+uJXy6KFl1mrR?= =?us-ascii?Q?XIrBvg/Mg8OEv5TiXJO+y4YTtpoX2iALK/2nz7CJrvnKPYN8Wq7jVBqrCEFX?= =?us-ascii?Q?5SZV+fvdbbSMAKaUrRg9oseTqFe8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pRO4cVxQXedZDyYK+lahQ8/5lIHoQghwqpH4hWGMVV/EiYuKP0ZOqi?= =?us-ascii?Q?3ms209BDRIWp0xRuxZvHz3Ia6o1syDagKF6eY3oAfInEGescM4/BYhIeHfFA?= =?us-ascii?Q?pyPuGdva+vnDmLaOykWOE1Rr62ql1guaEXHOt4Bie6y3ilCbu0nKmvLNxP5A?= =?us-ascii?Q?Nf/x5Th0c1TVH8l3ZnpSMVT2QKendkHG6wHzAJkqtL4xFby0EPbJhUwISuQ4?= =?us-ascii?Q?Xfii6nTxI+ieLyoBEEYTpfeKdvh0WIx8fYWYg5+VinSbCUtAjEtC3Q217soO?= =?us-ascii?Q?+S/sxzKeTdoTFHJyvBAUZBpG3mpZSGA5AtWhWrPFV3jUPr6eKLZeg5tMqfLk?= =?us-ascii?Q?2g=3D=3D?= 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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, -- 2.34.1