From patchwork Fri Sep 8 13:33:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 13377472 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E0F763B0 for ; Fri, 8 Sep 2023 13:34:17 +0000 (UTC) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2040.outbound.protection.outlook.com [40.107.22.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1F8719BC; Fri, 8 Sep 2023 06:34:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J1sx+59DrrqIf9wVvMB5jpsK9cusDORMgyq7uUTEhwEHdQLvC/LYbFToL91WcFugj4nqQwXxhGQiVvEmatHTLcpR9UGcdJsEWzRL0P7LWMb6clOYh+KivnNawfnsxnq+XJwAkwM01ZAGOQI2HRNgEsig2/sWZxR2bouw5DP5WHVn+33xRrVWpRN/8XnLJF7YeLZka1YpVpwT++RpHK/6R5A3xnm2ODgP1xwUYBJwVFh50H9ZsOgPiSP/3DfhKI9I7zzL1WK4szDL1262dYusBrNRYIXLcGbpsBOtACbNMiC0jesM2KD873EGnfDGvFLRQrI4AzzyWtWE5ttLd+D2lw== 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=xjb7B1O9DlPIb0eyKB2G/SgS2Ntu/1itOg2hzWof3RE=; b=nMlKtWqRciqpB+jRNWS7rpGXlqwAoPTC10ppV2Zm38122xcIx711Wq1r8X6tgAnGR8lQB4D20MmwWNmJPYyFcKNhQLW+Xir8goITxwGhM13xl4A+Fn4nKxPJ8SUTy8lkqCF8OOJvUNkTS3u5PGDbT7RHFAY2CVVHVJ+Y77JeLtIE7EcgDMu6dY4an9QkBQ3rMfiyMgsMCm0Zejpjb1U6ZLOb3l5EBEvOIKS+m5xWCBPlefs31ujkTZIY3yXqMnrP7Sm4mR+O1ayvwg2WyE1cW8Er9F+M4NSGEPW3I7PTbr1nKAquPSN4lDxYTOw08lq4UK3+OfFsAsN6W4sKdDq3+A== 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=xjb7B1O9DlPIb0eyKB2G/SgS2Ntu/1itOg2hzWof3RE=; b=neGwolei2FmbrIAkvNLjjYJu9YpR7pKYlyj8++aM8s7o7dOWyRgwYkcMeBsVkDf8eH4QGTl9dsKuyb5VlLL39ST04M+G45Xf3iyj/7Mi7x/4Y3bbh2JB1JoYs4zz8RrU/xHkI4tmYS2xT4hbJq2kZvTvLQr8X3zVA2SG8koYAoI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by PAWPR04MB9718.eurprd04.prod.outlook.com (2603:10a6:102:381::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.34; Fri, 8 Sep 2023 13:34:04 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::568a:57ee:35b5:e454]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::568a:57ee:35b5:e454%3]) with mapi id 15.20.6745.034; Fri, 8 Sep 2023 13:34:04 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Eric Dumazet , Jakub Kicinski , Paolo Abeni , "David S. Miller" , Xiaoliang Yang , Andrew Lunn , Florian Fainelli , Yanan Yang , linux-kernel@vger.kernel.org Subject: [PATCH net 1/5] net: dsa: sja1105: hide all multicast addresses from "bridge fdb show" Date: Fri, 8 Sep 2023 16:33:48 +0300 Message-Id: <20230908133352.2007218-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230908133352.2007218-1-vladimir.oltean@nxp.com> References: <20230908133352.2007218-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: FR2P281CA0036.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:14::23) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|PAWPR04MB9718:EE_ X-MS-Office365-Filtering-Correlation-Id: ad7d018d-bab2-4d38-186d-08dbb07044df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6dvDPh3O0bMd2iy7K4nJ8yA2Bg8E6z+w/szUNSXNyAXFywz6hNMe1FYgeLkXecEFYcSyYXbkTv1oujUgJ1Ja4LhuwzkOzgoCprQCKfxPGGKs1lccPatYVm6/mCXHWmP85MaXBxh7OFrF8azWS4ueiOYOZQRy32L6htI6oq/lOEIKiG8Ko+MlJeWugr2gmrgYb+iwwIDedz6hhyIIDMUyajYXclJn5tQcu5We4y/i67YQXXmv8ZTK8nifA0lq0oiJgwqlvsXozOK93eo9J1luSfqmSra9SPXAoABOCrNy15i71RqbOe18TY5xQEiUP6f3wFCxaj1Wf+JAtFx+7Gvj1Fkgt7RsfBugCWU7Pf+4qaH/lFudYxVV6FJkmpAOxsDitPrTxvsPFQfgqD/vhKjwsdEugl/29/XSZjBsouwn/5CnMyahFzBphi1XBexrBmsA/7ElHxmZHDlWWJQzNBrPyoUoZscOdyGXET1bHAevo5kSO+wTW8FJe87VYnJK+zvkYRAGPbC+BQRmjy+uhMwKpn3IxBJ6CDP/vUjClIUGhRTn5iux4MfQxOhGyFuou0OLvLcr851+QRn3Z1nOyFmpbsudTJa/MRiAosBA2d3Q+TjZqc2D1PUku2g1OdgcTBUF X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(396003)(366004)(346002)(39860400002)(376002)(1800799009)(186009)(451199024)(2906002)(38350700002)(38100700002)(36756003)(6506007)(41300700001)(6512007)(6486002)(52116002)(66556008)(54906003)(2616005)(66946007)(66476007)(6916009)(316002)(1076003)(86362001)(8676002)(8936002)(4326008)(6666004)(478600001)(5660300002)(26005)(83380400001)(44832011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NWv2FmCVoSVhez8nJVBRdWsgZ1B5jXKiGoM7XL1/43CQoNiF0m9RqN8N/nugU1yd8D54XE62yZombZoSuVMqy9mW81Q+dmKhpphdiBK1EsMxl11kA6VIAVTQAWbzqTUExj2E481KHIT3DCzfJBdJVFRn0/OOyLp1QucSpwCu7kpRguifXVQHm24i1kY4YURZRagtS7XfKq1Hs4pwKpNnTuPPe3dl5PyXkfyk0p7RKz3i4OueptUXQKuBsvqis6ue+Ls2f6SSUiUtGDWeQ2D/Po47NRgMsckkPdyv8xU2b9i69+YKTvfOwnriZEiP+daACQQOKz2eAqj3c5x2gb26a1lnMAZcsdK0oDBQMODaCWzTW+yvDTk6AzXGYhMT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3CrYWXBGJ0VDpLi4ZJq5LCIu3hu9jOfSai0LnOWQM5c79pQ3pArwMPe3nxvYQoNTe78ozkhPOuvmu+p0FmVPYJ70a5Wga/m+NNid0WORoAv7Qeum7R25NUF/CWxKfJAtKpM6zGDucrVD9hC/ymLh90AWoUfmSsik2qDwQqMFILM9FQhAqVEbXKWg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad7d018d-bab2-4d38-186d-08dbb07044df X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2023 13:34:04.2735 (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: n3Yr5m+oxh8Ext7jAwy3Wgcv25tXlG84wuheWI72g7z3QFW/zrXeXVbGcTnedPWOgChpmp4GjligOoYzyUDrqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR04MB9718 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_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Commit 4d9423549501 ("net: dsa: sja1105: offload bridge port flags to device") has partially hidden some multicast entries from showing up in the "bridge fdb show" output, but it wasn't enough. Addresses which are added through "bridge mdb add" still show up. Hide them all. Fixes: 291d1e72b756 ("net: dsa: sja1105: Add support for FDB and MDB management") Signed-off-by: Vladimir Oltean --- drivers/net/dsa/sja1105/sja1105_main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c index a23d980d28f5..11c917d5ce43 100644 --- a/drivers/net/dsa/sja1105/sja1105_main.c +++ b/drivers/net/dsa/sja1105/sja1105_main.c @@ -1868,13 +1868,14 @@ static int sja1105_fdb_dump(struct dsa_switch *ds, int port, if (!(l2_lookup.destports & BIT(port))) continue; - /* We need to hide the FDB entry for unknown multicast */ - if (l2_lookup.macaddr == SJA1105_UNKNOWN_MULTICAST && - l2_lookup.mask_macaddr == SJA1105_UNKNOWN_MULTICAST) - continue; - u64_to_ether_addr(l2_lookup.macaddr, macaddr); + /* Hardware FDB is shared for fdb and mdb, "bridge fdb show" + * only wants to see unicast + */ + if (is_multicast_ether_addr(macaddr)) + continue; + /* We need to hide the dsa_8021q VLANs from the user. */ if (vid_is_dsa_8021q(l2_lookup.vlanid)) l2_lookup.vlanid = 0;