From patchwork Wed May 11 09:50:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12845999 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 AEE05C433F5 for ; Wed, 11 May 2022 09:50:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229748AbiEKJui (ORCPT ); Wed, 11 May 2022 05:50:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232540AbiEKJuf (ORCPT ); Wed, 11 May 2022 05:50:35 -0400 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20077.outbound.protection.outlook.com [40.107.2.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4B48527FF for ; Wed, 11 May 2022 02:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TKdrFyJDCVbTNEQqG3oFXJECL+2lMGRi5fpoQ7KBUCrvKtqfHX1MC3436sW/ZFOkQX/Nvdr8r8J104suafiu0MXEp0a2NJFpxMJltmiQJ2MHdOicBoWY/04CrdvZ0kT037tzi+LDXHmnEWN7dGMEzDNZVgfkVZLvFc5fCpLyiNyhJkWHy0bh9xsjWjJg+vycD3GLll7avVez2RhtVCJuteYXfAKqpXiSGC9pf7RZbYIIrBKTI7gIimQbIOC4xi+B0Q+8qm2Lx2JW13D+vukpGEIgSX5UaqJFiIYQxuHIerruv9+XHNyvtvYY71uJM4YVkzdOKoq/SHlGxL/qwlZ4qg== 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=U9kyAo2CwSK63MKiaCT35NLoHoOicZntE1trIjtyM5A=; b=RDYuhRFmRv6+58h1jqTCBgMJ+OOWGMMrSuGFOvQwOsAIGbRBWKYJ4htUvdsuiYWxPKT5urlpQgclylnC8/m6BrPgjq3IkoFd1APNyKw9qaSzkexvJC9ilxjIwm+Wr0wuCZM9nYHTdkzhfca/9R9fkAyc3bVr+uLauyD+jg2mHUXUfkc9Ln/lpCX5XNL7C596oumRaTW/I2ffhZ1iMyRMLe6jGhzDBhTa7RbPrQHwJIZiN9RugAFhGAGrQcaIuB0pRZ43qXKrsMusOX1vNyB6f7Q5dvUfNEHiGSqEONtSUQznc22Sk7qqILWRpVK1tgjp+GaRyirjf9mFrzTfb+1wlA== 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=U9kyAo2CwSK63MKiaCT35NLoHoOicZntE1trIjtyM5A=; b=nAVhRQTS+wOEc4qbtJUNN7NRkwZyV9tYlZ13amfjruhPOugTeoDQ4itlpzwR1k366cmK7xQiOLU7eZmLAI7LdTkQf4VWLTeGU4fYSgilTGzTs4vGSpNiB1Dm8vvmgRrW9NirtSHGMTgoGj73o2k2APJ9lo1QiVFjztd7NQiI0Fo= 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 PAXPR04MB9155.eurprd04.prod.outlook.com (2603:10a6:102:22e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.27; Wed, 11 May 2022 09:50:32 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::fd1f:cc16:dafe:4bf5]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::fd1f:cc16:dafe:4bf5%5]) with mapi id 15.20.5250.013; Wed, 11 May 2022 09:50:32 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Jakub Kicinski , "David S. Miller" , Paolo Abeni , Eric Dumazet , Florian Fainelli , Vivien Didelot , Andrew Lunn , Vladimir Oltean , Tobias Waldekranz , =?utf-8?q?Marek_Beh=C3=BAn?= , Ansuel Smith , DENG Qingfang , =?utf-8?q?Alvin_=C5=A0ipraga?= , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Colin Foster , Linus Walleij , Luiz Angelo Daros de Luca Subject: [PATCH v2 net-next 0/8] DSA changes for multiple CPU ports (part 1) Date: Wed, 11 May 2022 12:50:12 +0300 Message-Id: <20220511095020.562461-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: AS9PR06CA0158.eurprd06.prod.outlook.com (2603:10a6:20b:45c::16) 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: 78d164b3-18e2-4771-9995-08da3333b051 X-MS-TrafficTypeDiagnostic: PAXPR04MB9155:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Gc8g2WZ340BSTwSf0j+dxbsJf9BOs+q6WNuPVzUy/xEtDS0vdHuRVo1Mgbgxn42LL9R/FjtHCjUhtBrb+i5mbEHB83sfN2sV4lozKFSAftIWEtwDA3Cx/SKqLeG7/LC4sE7csiRxds/5HTqHkihtrShgGF2tkVVRMrTgjqXulXDtkmwyIDkV79mC4X/oCsf7EZrOgnKJeunNmrjFPZmGyUx8Ni9QbokJo1P5BK494r8RVVPFfNhGxv40vhyH9wUniPpsdxRm79z7hWjS3U8C9mFgws0RxoydjUBE5qxsfWvSkjdDClpbEC/eF6CwJ2LuV/GakwP5fk9KRR6p2EwmPWtWX6k6CKkQYA7Bpk+uYuTORvILZwYbONKqzYw15VWebeVWvw/Ekbhxc4VSskvQU0nbUTU6DXo/Zmqf//m9Zk9pMpN4jh7n9tMO/ItcTNjx2v+7oHxx14XMWvLgacRjsO4tHB16MkJPQJ32hH9KB+xwp49QossFbmtcWzbCw5P/MgbEKmOMOtm3oj5lADl7S/XLZfW8VnczY/l4mPMMg0fW+EAkb/j+M70wAfqCm/nxhZ7CBCHR3HD4rwcboN0jY0fMtzH6YTCnFPuB+dxn9VYvnlJ3dCvjMAjqtRSfPtjq0AU/OVdilxSKZ6fj8RiV5gQhjEWeUnXOB8zC6Zn0iYcwn2NNBTRiZxY4s4ME0EhLlqcm9tTpCO2hAXwRlnJyPA== 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:(13230001)(4636009)(366004)(83380400001)(186003)(38100700002)(38350700002)(1076003)(7416002)(2906002)(44832011)(5660300002)(8936002)(36756003)(2616005)(8676002)(6506007)(6666004)(66556008)(66946007)(54906003)(4326008)(66476007)(6916009)(52116002)(316002)(26005)(6512007)(6486002)(508600001)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YYEwtOQ88FGhq/UXDDgzgfOH+/BRw6RCZfq2LTb/fQHb4lNOLIzFn6ZzIZi7rB1M4KynbDMb+5N0hpYcPPhuTgMVBu0VWBvlnmgDI1+4jMlBClKqtOJox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snkjHtC93nW7cRISG+sey9zz+dX/bUbIo8Bqk09hVgWEMihRdaH56X3fjUSeq5iYTnp0FG2ALQiB/x/3dcy27RqYZ0V1PTRNyOxao0i13KaHrO95bYSViQlL2J2lvJ8RZEr9AHHvuHSv0V/ijw1ehZPZQYky2521wcL6MO9FVdp917OztegyBe99ZHmWEU3AaZ+AW5uU2Fu1DwUBTJocrKvVltqAlwAcJ01ri+VAMUTnBiig8YiE59eGcv6OnIIjPE602y8GFW40Rp5s4wORwn2uAUr0T0Sxv22NAap1crhE+w7O51RKC6QObDdrPf8kEKxU/O6AuXsz2XjUbwM4LBlPaAV4MvPIlER+bz8bZu7CidhbLFtmHEanlEVb9gBUcXrh4+TeCTlp4I1+X4lCie++DeBpoR00EKw2d4jgLlgbqH0c71oQ+h/zxGpNcV63eh1DzZImoGFI14cpqoAxWktYLU6Mq8V/F4lBTPj0DQNA9/7IPMf1x0v+CPFR4xz9w+tJZ4Sxr8BAB4/5wRn/nrg1HNlVD1ZmAbhLvh0yz+CQ0VIbbNy7dDmXSYE= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78d164b3-18e2-4771-9995-08da3333b051 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2022 09:50:32.2395 (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: 44oBAwKmCr790xyKADS/+DUVB+EdetYt/g+T5glg4/xoSODelQS7mDN1dVqVgOrzHiWY1O0pgy7/mAvt0hDslA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9155 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 part 1 (of an unknown number) of that effort. It does some preparation work, like managing host flooding in DSA via a dedicated method, and removing the CPU port as argument from the tagging protocol change procedure. In terms of driver-specific changes, it reworks the 2 tag protocol implementations in the Felix driver to have a structured data format. It enables host flooding towards all tag_8021q CPU ports. It dynamically updates the tag_8021q CPU port used for traps. It also fixes a bug introduced by a previous refactoring/oversimplification commit in net-next. Vladimir Oltean (8): net: dsa: felix: program host FDB entries towards PGID_CPU for tag_8021q too net: dsa: felix: bring the NPI port indirection for host MDBs to surface net: dsa: felix: bring the NPI port indirection for host flooding to surface net: dsa: introduce the dsa_cpu_ports() helper net: dsa: felix: manage host flooding using a specific driver callback net: dsa: remove port argument from ->change_tag_protocol() net: dsa: felix: dynamically determine tag_8021q CPU port for traps net: dsa: felix: reimplement tagging protocol change with function pointers drivers/net/dsa/mv88e6xxx/chip.c | 22 +- drivers/net/dsa/ocelot/felix.c | 469 +++++++++++++++------------- drivers/net/dsa/ocelot/felix.h | 16 + drivers/net/dsa/realtek/rtl8365mb.c | 2 +- drivers/net/ethernet/mscc/ocelot.c | 16 +- include/net/dsa.h | 19 +- net/dsa/dsa2.c | 18 +- net/dsa/dsa_priv.h | 1 + net/dsa/port.c | 8 + net/dsa/slave.c | 36 +-- net/dsa/switch.c | 10 +- 11 files changed, 337 insertions(+), 280 deletions(-)