Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4600070rwe; Tue, 30 Aug 2022 13:12:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR5KrXLS7/yqWwFNFn/HPvAQ8KEeefEN3kj81fg3CxVjn3LrUQPV7AUo59MX6PSwDn2oSUsp X-Received: by 2002:a17:906:4fd2:b0:742:133b:3522 with SMTP id i18-20020a1709064fd200b00742133b3522mr4115838ejw.21.1661890367930; Tue, 30 Aug 2022 13:12:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1661890367; cv=pass; d=google.com; s=arc-20160816; b=Hot59bMUXes/nQ1FJCP2K+y4AeH+MVJEyHQ9+ugU2yCybuywGwyKmbYecWCjBMyyDs hG+jVYpQSZek6Oq0HhJ0MCEfYoRWJYSSuEej6uCTZHH6s40SSMGvaNog9eciC/cOAWVo uUFpJnStQgsA2k15/8KJ9YLN2bjm1DhCl24iFYt9UcgCpPKrm4L7ycDm6tRxEhkZY9fJ zCD7uvBzpzctop18e7esMRnVEAhTxF5dLMgKYGZ6iMzbZ7sETfrd7iRbX+GYhG8MxFmH gmNVDhjTizlER78ZWuWFknjyw6m2PdnbDXijGFtOZU4cjq2H6J5BJV/x4aciPJAp4jbT nTYw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=ZQNuxSredIr7K400qHd+wTVjoByguZ0F4DKTZHP04xY=; b=Lnzt93Q8TYSz3+ve8gTyoAHxU4giYqGKxfF1Zx9Gr+n2NE8+X8a6de6/1xTh9KESUx pMN5UuYoewyJWVF7aPZ1wNX7x0wrNTIYN36/qM/aTUPBcPVWC2jSkArL2Qo8U7u4CO5v 4k8YzZyQ1B15i9+VBPDaJqxypBWx41NYceaeWyj/SvpUs7fQ4NKcjhVP/kS32J6eCKjC s+Fcy/7Qhu93Qqy/o9S7ogta7a1XM2fx3pt+U1mgfm2hqi0ZCODcP/eMBBkymywc+nnW wg49h3sIpxvIwiHe+Pz6ZhscPtQer/gznMGQybD7ZllBmhiKQOuQesBzcvnt4thuzPR+ C3aQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="ZdvsAgb/"; 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 h7-20020a1709066d8700b0072ae61935afsi8520309ejt.304.2022.08.30.13.12.22; Tue, 30 Aug 2022 13:12:47 -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="ZdvsAgb/"; 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 S231811AbiH3T7y (ORCPT + 99 others); Tue, 30 Aug 2022 15:59:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229842AbiH3T7v (ORCPT ); Tue, 30 Aug 2022 15:59:51 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2063.outbound.protection.outlook.com [40.107.20.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D00FE252; Tue, 30 Aug 2022 12:59:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JYkx59xgOznERSpAqElt7wdkSgrQtIkjneGXc4gSfAWTGPGeiTwtuWv+XLrfouo7oMlNWVw4TPCUZC47fffXoZScVORGJVzAPkp3EYIWC+2/nvkg9YEUdZbYCjOiea9UDpZnT0EMmmkT6JCrWnrk/EG+J8INxnH3j328D5jnDRTAXmla44UTiTMCgWZ8igKpzVfd+gFI15XrmCWeROdjEVZNweKkxzjsqOzCb88GkpUsObx3jKVaztvuAhiMFySNXX7SzjHsJXpL2Kyhi4Kv5p/IYCE0Tzu92vC/gqFz1vBYP8f5cDB9EoNGb0C2EXWHI2ITZs7V8EGi26753LnDTA== 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=ZQNuxSredIr7K400qHd+wTVjoByguZ0F4DKTZHP04xY=; b=GblM57gEe0M0EjFaCjTLoB9saH2pf9VVVdKedqEH57vJVmE3Rc0/+9mchdY5Ls+ynyjYi6A/LbCnZhyb0dEm/a/Dogl5BcONagi0yscmHBon0h/9uBUbE3s5Ug8z3QYUowczUYeQPw79qDWwxq0wOfxrwVIDuU+uEma3ekr/qeHdFSiz070outBPuqCXv1Sszgyay+ER3Q0psHc+W6RN3p1vZUyHpLP+uWFtxmloowhLk/lo5ht+DyKmPBqhzIDviMY+eJmJwIEOpr4gKMLunBdOxzE6y818wooCBz7MWjGh+UagA89CDHiJ1BYsLzkUJWnAJpmS8LL9tmhoP/RM8g== 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=ZQNuxSredIr7K400qHd+wTVjoByguZ0F4DKTZHP04xY=; b=ZdvsAgb/qAn5EV3IdZFETAmexTQzDnqsqQVpZ7Z7IIbj9NEtQyjTScCdt13vCrJJkSmby/5lksrJczWR2lCnG8m6el11mrYW5fnZkWrRGPBejPNRD+3elHXQhi8I3l1K6AugnwMTVd6H/1p8xXhT1pNvBs4MTdpuz07AnJifB4k= 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:42 +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:42 +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 0/9] DSA changes for multiple CPU ports (part 4) Date: Tue, 30 Aug 2022 22:59:23 +0300 Message-Id: <20220830195932.683432-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 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: 9da0c8dc-43a9-4c46-99ba-08da8ac22d8f 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: GVQD9uMF20R8vkWllR2K2WeP9kIGD9ZahYsuQ7MCGf2eQnj5yOJCbWknxiPEp7yDdSu6c/s/3HD0Ck5o4jhAgPZEYaPWL6eNEkHzXWCYuZRDmmmq8vBaUwqC93WmT31tRLLEZBjp+ePFJpDDzyziLLQ/7VLdu9Jvrd++cJQapJ3rXqiTu6m/IJKyhDUTgquFe44klrdgRWPDBn+hzNmX5fmyQD3jFFbWa8Siw3GR4sB0+hNTUcmwfGUXpn5oT9xdUspwW/pZxwTBE+0420MQ7YARm/pIJb4g7kBjbvNJy4l6MBROIiWAgXyThVYyI5b9+yPhRWZOTmE2ZLqavkNflcBMsTcnxeXARD6WpZ8eXTt3fzIwI5LTaLKhUtBoXb+BR7lY2o+Ll1R/i26E/90OWT5lEeE7BxwLgqA7No0wbzPJJoUc1fg7W2H6WsS6a8e29lU3s7/TVSaGQOnV5RTpAMmkzhzk+LRlHa8zNk30aE2z2GK2DVXnIsvGnmcl4ZHU14+1KVw4uraO+vgoZhmiRupa6WDQbEDl0wfUut0AEer5U0iyqWjp0s1yclYCKDxgYN/EdP6sWQSrhih8+b8IMTo7xeJRqufCqoJ+Aw8FFmdPHKp/cAD0GEyIRi/v2a4vq+2nic0Lm7ldVieqkiO5+JkIWzkQPgVdbeNCkO/NwgluuR2fybPOTV6cQLLGYzhWL6n0F3u3FJxctdi1pMuNSvNURQQMQwmh8OP9TfTfLvFuuCaoReJegjxH0CftmiTD2sDLb0+VSUYYdUWWrMn+Hil3S3l5c0dYkkG5bvimVlKbw+c5adkKZ1rGyh8xLA6ESuzvv3ndm52tKyvk+0WEOQ== 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)(966005)(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?KrGQoroWjx1nqMQ/uyq1nlI2OScrL8cl9+F7NOCeGLIt8Mmpm5m4d3wzYsvA?= =?us-ascii?Q?yUvPwcUD7lB7J3WzPUg5wcbm+OfpjKUmMQ5xbTDWKLwyT2TZ27BCLzkl3kcS?= =?us-ascii?Q?CTWZKLfUOQZoFgcuIiDqBpA7NBrpIIP4QM4VLzGIi1KHh3lnHSCmT1s9MbFG?= =?us-ascii?Q?ttAOWNn91V6hA4oI8gadZUUC78mplooiB09Iac3MUSuWJ6TUGPQcbJdgCmZJ?= =?us-ascii?Q?hECElZ5yEk3UKVjGDeWO86jijHS2ZwhmnKrk5j8mw4sSGRjBmjaIENKxEDQ0?= =?us-ascii?Q?ujpEwEAvN/4aoVO+1UuR7IX4tfpJb3h4PWRK5LNI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aMRJ1ngd+FtCzApg4v6YQBQ7f269dw4v8Xt3QXd?= =?us-ascii?Q?TQiFDl/5qYvwtDNktPS5dtExKBXoLDJz+DPOViUociiQgOyzyzzCBPjBxGM+?= =?us-ascii?Q?wkakRIlD+ABFlkX9CrgJh+x6mzMH3orL1BFjAcSwA9z/ZVlBzIUoyYPqt6Xd?= =?us-ascii?Q?MnqpfFih1R70REOs149rPDXFjVDd0lAZHc3SHjjYCxvE/AHmEkTOMcvYryfb?= =?us-ascii?Q?f9XhBDWY31MXefOS0IQDCtFEplI+2RdTJffLa+/H1NNZl+vWClWAywzNsISg?= =?us-ascii?Q?KYw6XGc7/vBCDgIVlxt9Xxpdac6M5TJ+o51zUSC3prA2Y1jzRMjQ3qzmRxJa?= =?us-ascii?Q?zjQRDOf61EyP+QvjgCJ1q+aiwnIlM6KAWkWJI0OGhYRpcG6WjxDnlU7JM62F?= =?us-ascii?Q?Tw=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9da0c8dc-43a9-4c46-99ba-08da8ac22d8f 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:42.1676 (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: vK4rykdE/a/f24GcHnh/ovvBqK+4SpX7zF2jXiChgYJys6d1fuKwDSGCWmAV5s0Ge47O8wtCkh9nFYe0/waywA== 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 Those who have been following part 1: https://patchwork.kernel.org/project/netdevbpf/cover/20220511095020.562461-1-vladimir.oltean@nxp.com/ part 2: https://patchwork.kernel.org/project/netdevbpf/cover/20220521213743.2735445-1-vladimir.oltean@nxp.com/ and part 3: https://patchwork.kernel.org/project/netdevbpf/cover/20220819174820.3585002-1-vladimir.oltean@nxp.com/ will know that I am trying to enable the second internal port pair from the NXP LS1028A Felix switch for DSA-tagged traffic via "ocelot-8021q". This series represents the final part of that effort. We have: - the introduction of new UAPI in the form of IFLA_DSA_MASTER - preparation for LAG DSA masters in terms of suppressing some operations for masters in the DSA core that simply don't make sense when those masters are a bonding/team interface - handling all the net device events that occur between DSA and a LAG DSA master, including migration to a different DSA master when the current master joins a LAG, or the LAG gets destroyed - updating documentation - adding an implementation for NXP LS1028A, where things are insanely complicated due to hardware limitations. We have 2 tagging protocols: * the native "ocelot" protocol (NPI port mode). This does not support CPU ports in a LAG, and supports a single DSA master. The DSA master can be changed between eno2 (2.5G) and eno3 (1G), but all ports must be down during the changing process, and user ports assigned to the old DSA master will refuse to come up if the user requests that during a "transient" state. * the "ocelot-8021q" software-defined protocol, where the Ethernet ports connected to the CPU are not actually "god mode" ports as far as the hardware is concerned. So here, static assignment between user and CPU ports is possible by editing the PGID_SRC masks for the port-based forwarding matrix, and "CPU ports in a LAG" simply means "a LAG like any other". The series was regression-tested on LS1028A using the local_termination.sh kselftest, in most of the possible operating modes and tagging protocols. I have not done a detailed performance evaluation yet, but using LAG, is possible to exceed the termination bandwidth of a single CPU port in an iperf3 test with multiple senders and multiple receivers. There was a previous RFC posted, which contains most of these changes, however it's so old by now that it's unlikely anyone of the reviewers remembers it in detail. I've applied most of the feedback requested by Florian and Ansuel there. https://lore.kernel.org/netdev/20220523104256.3556016-1-olteanv@gmail.com/ Vladimir Oltean (9): net: introduce iterators over synced hw addresses net: dsa: introduce dsa_port_get_master() net: dsa: allow the DSA master to be seen and changed through rtnetlink net: dsa: don't keep track of admin/oper state on LAG DSA masters net: dsa: suppress appending ethtool stats to LAG DSA masters net: dsa: suppress device links to LAG DSA masters net: dsa: allow masters to join a LAG docs: net: dsa: update information about multiple CPU ports net: dsa: felix: add support for changing DSA master .../networking/dsa/configuration.rst | 84 +++++ Documentation/networking/dsa/dsa.rst | 38 ++- drivers/net/dsa/bcm_sf2.c | 4 +- drivers/net/dsa/bcm_sf2_cfp.c | 4 +- drivers/net/dsa/lan9303-core.c | 4 +- drivers/net/dsa/ocelot/felix.c | 117 ++++++- drivers/net/dsa/ocelot/felix.h | 3 + .../net/ethernet/mediatek/mtk_ppe_offload.c | 2 +- drivers/net/ethernet/mscc/ocelot.c | 3 +- include/linux/netdevice.h | 6 + include/net/dsa.h | 19 ++ include/soc/mscc/ocelot.h | 1 + include/uapi/linux/if_link.h | 10 + net/dsa/Makefile | 10 +- net/dsa/dsa.c | 9 + net/dsa/dsa2.c | 34 ++- net/dsa/dsa_priv.h | 17 +- net/dsa/master.c | 82 ++++- net/dsa/netlink.c | 62 ++++ net/dsa/port.c | 159 +++++++++- net/dsa/slave.c | 288 +++++++++++++++++- net/dsa/switch.c | 22 +- net/dsa/tag_8021q.c | 4 +- 23 files changed, 924 insertions(+), 58 deletions(-) create mode 100644 net/dsa/netlink.c -- 2.34.1