From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1214D606A322 for ; Wed, 2 Dec 2026 23:40:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=mVYcCxTu; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dvJFuAjR DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Message-ID:Date :Cc:To:From:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=pBOxxnYbXipW7OZZUwaiFqEmpbSA/MtOdsGDBGa4NUY=; b=mVYcCxTu52nlDMUco7Gji4JzwL xvc2cLhBsFFEMPWN0bpom+37qhfMBw2crzz8VQ2UaNNhhwNyhfIY+WZbgnCd+0ljCXpcr0L7/x4JA ufXmpgi4lvH0A5KHAaIeHnChqTWm9pLbM8W4QqYco9OQ4Xj3HqiZ8Rv+ZfmjlHwX/AUUfldFFJvvA Y3XQXUHVahwI1tRJOYwM/cj+WiVNx7GchY8UBpvTnDTqxzvkGYbZfijK8j9OkKvsHYVxBABl1D+sD ABID08mUhGQpLaix6BYolGboRA+YG1WVDkTllebGfQAi7wfzEd76+8TlwnRPTNS7NWJvpHILfgMfZ cDXO+svg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYtw4-0000000D0w4-2rpm; Wed, 02 Dec 2026 23:40:28 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYtw3-0000000D0vy-1i2r for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2026 23:40:27 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 0933340375; Wed, 2 Dec 2026 23:40:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42EB31F000C1; Wed, 2 Dec 2026 23:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796254825; bh=pBOxxnYbXipW7OZZUwaiFqEmpbSA/MtOdsGDBGa4NUY=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=dvJFuAjRbQwTlN221iIErU3S9NYnCE9F5V6a14Lm/Tsuh+Vkf9bEkh6O5aG8WMRhX /iNDREBqfPOTWhMleF94RKHcEzzhPSyQYJszArenoONPu/zgzNpYCtD2/MYMEChZe2 //8ETQh0EEmhHfpgpyZXXVHH1H4ihPv96EmgL82VyeSi7iuj/PB38YlfyCleecbINL bSAiM1B6x2pJCoVnKEY9Oba/3pmKTy8zkXnUCVt5Dw5z8Ww+cfL2c1dpnwHzZ8Nh7g 2wztRINEghAd/HVMVraUXuPBr1gNMiIPL6PDSYmF0f3htKMqdHB3wo5SOTWbynJmDW hF6eiO3IMSkQQ== Subject: Re: [PATCH net v2] net: sparx5/lan969x: remove MDB entries on last bridge leave From: netdev-bot+sashiko@kernel.org To: daniel.machon@microchip.com Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, Steen.Hegelund@microchip.com, UNGLinuxDriver@microchip.com, casper.casan@gmail.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, haoxiang_li2024@163.com Date: Wed, 02 Dec 2026 23:40:24 +0000 Message-ID: <179625482476.3146.10404666530979450675@kernel.org> In-Reply-To: <20261201-sparx5-mdb-bridge-leave-v2-1-127cacfcba6d@microchip.com> References: <20261201-sparx5-mdb-bridge-leave-v2-1-127cacfcba6d@microchip.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Archived-By: MIME-Version: 1.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 0 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] In sparx5_port_bridge_join(), the patch now passes &sparx5->switchdev_blocking_nb as the blocking_nb argument to… -- net: sparx5/lan969x: remove MDB entries on last bridge leave When the last port leaves the bridge, this patch flushes all MDB entries before hw_bridge_dev is cleared. MDB adds and deletes are ignored while no bridge is offloaded. To get host groups offloaded again on rejoin, the bridge is now asked to replay its objects through the blocking switchdev notifier when a port joins. > diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c b/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c > index dac4dd833127a..e52e6a7fbe64e 100644 > --- a/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c > +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_switchdev.c [ ... ] > @@ -193,7 +217,8 @@ static int sparx5_port_bridge_join(struct sparx5_port *port, > > set_bit(port->portno, sparx5->bridge_mask); > > - err = switchdev_bridge_port_offload(ndev, ndev, NULL, NULL, NULL, > + err = switchdev_bridge_port_offload(ndev, ndev, port, NULL, > + &sparx5->switchdev_blocking_nb, > false, extack); [Severity: Medium] Can this call through a NULL notifier_call during probe? The bridge replay helpers do not go through the notifier chain. They call the nb passed here directly, and they only check that the nb pointer is non-NULL: net/bridge/br_switchdev.c:br_switchdev_vlan_replay_one() { ... err = nb->notifier_call(nb, action, &obj_info); return notifier_to_errno(err); } In sparx5_start(), the port netdevs are registered before the notifier blocks are set up: err = sparx5_register_netdevs(sparx5); ... err = sparx5_register_notifier_blocks(sparx5); Inside sparx5_register_notifier_blocks(), the netdevice notifier goes live before switchdev_blocking_nb.notifier_call is assigned: s5->netdevice_nb.notifier_call = sparx5_netdevice_event; err = register_netdevice_notifier(&s5->netdevice_nb); ... s5->switchdev_nb.notifier_call = sparx5_switchdev_event; err = register_switchdev_notifier(&s5->switchdev_nb); ... s5->switchdev_blocking_nb.notifier_call = sparx5_switchdev_blocking_event; The sparx5 struct is zero-allocated, so notifier_call stays NULL until that last assignment. If something like udev or networkd enslaves a port during that window, after register_netdevice_notifier() has dropped rtnl, the path would be: br_add_if() sparx5_netdevice_event() (NETDEV_CHANGEUPPER) sparx5_port_changeupper() sparx5_port_bridge_join() switchdev_bridge_port_offload() nbp_switchdev_sync_objs() br_switchdev_vlan_replay() br_switchdev_vlan_replay_one() nb->notifier_call(...) <-- NULL With CONFIG_BRIDGE_VLAN_FILTERING, the bridge always has its default VLAN 1 entry, so this call is reached for any bridge. It would happen with rtnl held. Before this patch, blocking_nb was NULL and every replay helper returned early. Would it make sense to assign the notifier_call fields before register_netdevice_notifier(), or to initialize them statically? > if (err) > goto err_switchdev_offload; [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201-sparx5-mdb-bridge-leave-v2-1-127cacfcba6d%40microchip.com