From patchwork Fri Aug 13 23:04:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 496929 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 651C9C4338F for ; Fri, 13 Aug 2021 23:04:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4452B6109E for ; Fri, 13 Aug 2021 23:04:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235397AbhHMXFV (ORCPT ); Fri, 13 Aug 2021 19:05:21 -0400 Received: from mail-eopbgr00060.outbound.protection.outlook.com ([40.107.0.60]:34243 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235029AbhHMXFV (ORCPT ); Fri, 13 Aug 2021 19:05:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DbfnPnNWhRJ/r+tt+Wx9RaIfqi6SO52HrfcOg846C1Q94mJFVE3vmTi723Lp8hbsiGDZv+r4BRqS0BptfK4P5i9gK3PGo8mr82OV88O6mBnKR5BGqq/vSIwFGETxINMRU+VNdFeibVHykcVNHevpo5gUpeGuv15Do976Znx7fL5Mr44EVbdxvectq2O3/GwCkvikSAEtoZ5vsh18e+vc4yB+khZAkIu17vPd/ZhMmn8ulR5XbXWwJyLPl50Nq6Y4I/qHfD3ivmYtdKSur+6c4fxK4oOEoGd5dyPsL4Euwd0znzsB8o5ywn0od0u2an6IXbaIglxngDrbwczmbW3yOA== 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-SenderADCheck; bh=Bn0xJIuCROlzmuqSu4Sz2hqLLICzGlns7qcK51yxSyE=; b=lP9TdvmbWuIYQJTS7QAdcLwT8crEs/mbjCF3SWDZGcx3XEf2fljTPKFnPVmHTIfY4Kk74q9+/G4HHwQ/4cq5zuNUDYf126Q7RSzVZ/1NdS9tRcEaBM5G0DIK7gIqStWuzFvbCdzUfDsCDSOoO2FzKzrmM2Vf+q2QJVgivP4vdQaJoBY8U3wArNtk3uisJdSCdpFmPgHmx3GPTHhNbRphLCrUv/ryEz7Ql4fZjhMEg0po/ZTXNmTvhMXcSRiXzIvI5joDzkqhYSyIMOKJwu0GYqJYyFpyF9HlAAv58K/bAG+NEqnOYLIQ26OOF5rz3JATI1Q8JxWLsq5tagPE2MoQ1A== 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=Bn0xJIuCROlzmuqSu4Sz2hqLLICzGlns7qcK51yxSyE=; b=kQNUcBubTvEusyLRpk1RCj3K+9qT3KMJKxfGQfy+kUV6Py/zkodmeA/VmEuphk0ESR6eG3/t8NXyZbLq4WOM7DwQpipDQv2hziREtqMTRvkcM7meJZjMj0cOrSUiAI3dQldL70QoRfNvdI1TDgAgqMAjpL5DFCelUQvEByXOpPE= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by VI1PR04MB5504.eurprd04.prod.outlook.com (2603:10a6:803:d8::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16; Fri, 13 Aug 2021 23:04:51 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::109:1995:3e6b:5bd0]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::109:1995:3e6b:5bd0%2]) with mapi id 15.20.4415.021; Fri, 13 Aug 2021 23:04:50 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" Cc: Florian Fainelli , Andrew Lunn , Vivien Didelot Subject: [PATCH net-next] net: dsa: tag_8021q: fix notifiers broadcast when they shouldn't, and vice versa Date: Sat, 14 Aug 2021 02:04:22 +0300 Message-Id: <20210813230422.111175-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: AM0PR02CA0224.eurprd02.prod.outlook.com (2603:10a6:20b:28f::31) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.144.60) by AM0PR02CA0224.eurprd02.prod.outlook.com (2603:10a6:20b:28f::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.17 via Frontend Transport; Fri, 13 Aug 2021 23:04:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6bed2898-33f4-4caa-45ee-08d95eaec11e X-MS-TrafficTypeDiagnostic: VI1PR04MB5504: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YOsq7exLdYklxkVf7k7BeABC2t6uKrL12KFA1M3ZV6OZ8qCtcsy6o8LjpRc64dcrVv2X6GBuYnTLdoe1XylwZP8YNAe1rwAVyVAO0OPAlO297Nk8KXW6uXWXDHiBJEW5e9161N2dF9KJJ+z7i20E5BcQaJskfqaa0cV5zVXq01ZAIRNztW8xWsVx3XEGaUaL8jqh2DBquiqdC3HdtHfbEyGR39MmoaHObyCLMLg1Hul3Hxbc0lolZwFcge68d+gokIC1WI6ImC823rSXDXYJ85evM8KTOzDrodIYriS3dKOLdo59XHew2/BwZH0SJhx8AfP2nfW8uMmoR9hixWgQdbPvDhrncmyEDN+mcHs1hjiFAjNdoBff5Qv1X/UAO05qdlmEu0nzajX2IeBvQVz8mEmc8/loD44/NcMC6DfntCO8p+siJkti6BJ329pOmFVMdeGAKSyFVtuZxPZZZimC3aMy9Dwkj1BC9LbXZXSyceGFEsESZd58WQN/gHdp5CXFOPYo67TnLllkw0u/CXN4439zfNWqsFPtV4awgR3/2/4viJxc4F90pSeJ+HEj0UoeiKYKoCxJf2AQPvPEZEPezeu04UEa1V9F0iFJOS7YCAlpTLRGX216pkKhDZLNAF2K4HIgtQaWytBSTTHDUIJU4KZ7gzU8V8aQ14gFLx96tJXTFyu04WSqeVABk59Rczu/ 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:(4636009)(346002)(396003)(376002)(136003)(39850400004)(366004)(8676002)(83380400001)(6666004)(1076003)(478600001)(6506007)(36756003)(5660300002)(8936002)(186003)(4326008)(52116002)(38100700002)(44832011)(38350700002)(110136005)(86362001)(66946007)(956004)(66476007)(2906002)(66556008)(316002)(6486002)(2616005)(6512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atF9SoqnYFYjNq9oWtVAPf9CjJLNzVeB60W5NJQD5TOrZvyu/iAfHglXb1H30bbWt9MwfYaVEpnuloBPmdTlBw0Hf/wCq3rkJuSboBaCE+kkqZn71Ep750708mcitJKKFr/pKuLekozxM8HunHta1GmWVfQ+XCgIH/pFRmsznjrMhHqkkU1co9qkpdz7kQTAs/FMp3Y8/wiDO0PuPUiey9hu3eGF05RF9LxxyRomxSRnhhG9+d8i4I3qpRXCAxvqJvSNwPh03GmxnGm1hkhCf1J52aI2Gmmjb2Fh6pDmxWtAAdOwn+3T6YqKTf5MVMO155QU7cjiXeU9NFk+84FpQM7o43BTue X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6bed2898-33f4-4caa-45ee-08d95eaec11e X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2021 23:04:50.8721 (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: EtohcVT9u14+Wgr9n6AclmKWFkVUr2dQ6n/ELGQDEEFqwpzV1sv0l0+zwPI7/hJVbC6AZzCxopxPMqJ0F4SM/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5504 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org During the development of the blamed patch, the "bool broadcast" argument of dsa_port_tag_8021q_vlan_{add,del} was originally called "bool local", and the meaning was the exact opposite. Due to a rookie mistake where the patch was modified at the last minute without retesting, the instances of dsa_port_tag_8021q_vlan_{add,del} are called with the wrong values. During setup and teardown, cross-chip notifiers should not be broadcast to all DSA trees, while during bridging, they should. Fixes: 724395f4dc95 ("net: dsa: tag_8021q: don't broadcast during setup/teardown") Signed-off-by: Vladimir Oltean --- net/dsa/tag_8021q.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/dsa/tag_8021q.c b/net/dsa/tag_8021q.c index e6d5f3b4fd89..f8f7b7c34e7d 100644 --- a/net/dsa/tag_8021q.c +++ b/net/dsa/tag_8021q.c @@ -362,12 +362,12 @@ int dsa_tag_8021q_bridge_join(struct dsa_switch *ds, continue; /* Install the RX VID of the targeted port in our VLAN table */ - err = dsa_port_tag_8021q_vlan_add(dp, targeted_rx_vid, false); + err = dsa_port_tag_8021q_vlan_add(dp, targeted_rx_vid, true); if (err) return err; /* Install our RX VID into the targeted port's VLAN table */ - err = dsa_port_tag_8021q_vlan_add(targeted_dp, rx_vid, false); + err = dsa_port_tag_8021q_vlan_add(targeted_dp, rx_vid, true); if (err) return err; } @@ -451,7 +451,7 @@ static int dsa_tag_8021q_port_setup(struct dsa_switch *ds, int port) * L2 forwarding rules still take precedence when there are no VLAN * restrictions, so there are no concerns about leaking traffic. */ - err = dsa_port_tag_8021q_vlan_add(dp, rx_vid, true); + err = dsa_port_tag_8021q_vlan_add(dp, rx_vid, false); if (err) { dev_err(ds->dev, "Failed to apply RX VID %d to port %d: %pe\n", @@ -463,7 +463,7 @@ static int dsa_tag_8021q_port_setup(struct dsa_switch *ds, int port) vlan_vid_add(master, ctx->proto, rx_vid); /* Finally apply the TX VID on this port and on the CPU port */ - err = dsa_port_tag_8021q_vlan_add(dp, tx_vid, true); + err = dsa_port_tag_8021q_vlan_add(dp, tx_vid, false); if (err) { dev_err(ds->dev, "Failed to apply TX VID %d on port %d: %pe\n",