From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796468445; b=bVhDJui5Y6P6rUlNROAiJAtRuXyaXAEukfegG2hgO87yv3VmvXlsfS9l3KVr3AHi9TOu JJHeMAEo4wBWO7EBASoQnj0GBcm4LAM/qzmySrg7NjW/Fw+E8L78kjQU+ufS8mkKEA0Ls Q2TRojphXiiW3tXSozWkN16k9VNX9j3zEim9rWPkSeEmISVIHoPxQ4hBwWYATZ174Ixa/ o9dmKYkYfZcMLx31QBZqgxKaOPGqHxCCE4EoLKJdhVk5EPyEJjijeb8VOZ3ul4v+KaZ6I l0kF1r+dUoM1OLxPSNM9j/XuD1CFzp7yf7A5GeXcky64kVCgy7mMDH68kSj7c4JE9fg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796468445; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=9yKdBiXYHqKGGMUu6+fYL2dey+a/8ehAvmoaupffy7k=; b=nyKsY6eLRlGUsPuVJ0q1deGkBkeXWyCqWTcgLIVH2m28dcO0skXN4ioKBpIOlcV3jxcb GbbXbF4OxFqg+idWV727A5KE8Od6kohi49078ESyOTB2RtmPHV9w8LF5gYT1P/KaeYBU0 ppANxaOqulQlX2WUH1iVkRV4l506aypDlS3bJ2GkRHap8f7KSAC1K8ZEhSe+y/fDFHMft 155lbfSTioeeyrvrEAyF4tgGl78Kz+46ytn84fLymphqKN6Vg3tWIB/ugDg6DbO/g1cJZ xfzWG5kaixl2pPE/n8Zmxe0dka4bT59YZraa17pBbEwQOm5B48/PtXZWI2/WxNu9Dkg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DoWmyFDV; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAFE2606A322 for ; Sat, 5 Dec 2026 11:00:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DoWmyFDV Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2DE251F00A07; Sat, 5 Dec 2026 11:00:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796468445; bh=9yKdBiXYHqKGGMUu6+fYL2dey+a/8ehAvmoaupffy7k=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=DoWmyFDVy/27VWWuj8gYv0Fut3U3BJa9tGuU0rvNPuPyZ9ChqSYjOyRAj9MdfHsfu NKfB97g42fdQvAOGdOYq22jmJC/VVVu5xL39NwX2p13lXbCd/rZ/u4z4s6rT8X1tjt OyaFZEB0rLFvyX/vL7xo0fCElSN1PQre+F1oEmdNglso6o+CHrDsozfttg9TjdXBsU w4ACUl0hKNi8+YUTu7z+hr6UUtAwxDADMANZoaFnX+YEPhxRfCcG4/uy70Eu9XFbxO 63D729kqyPTBb3vh4XuJ9ldN/drVt8VlbQDjw8Twf3a6IU9BeWgFisujUeu6PUd6Dy STMvUj0/jw0KQ== Subject: Re: [PATCH net-next v4 2/6] net: dsa: motorcomm: Do not block hairpins on standalone ports From: netdev-bot+sashiko@kernel.org To: mmyangfl@gmail.com Cc: netdev@vger.kernel.org, andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com Date: Sat, 05 Dec 2026 11:00:44 +0000 Message-ID: <179646844468.3146.971259533328458467@kernel.org> In-Reply-To: <20261204101300.3680838-3-mmyangfl@gmail.com> References: <20261204101300.3680838-3-mmyangfl@gmail.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 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 drivers/net/dsa/motorcomm/chip.c, yt921x_userport_standalone() now writes YT921X_PORTn_ISOLATION(port) =… -- net: dsa: motorcomm: Do not block hairpins on standalone ports The patch clears the port's own bit in YT921X_PORTn_ISOLATION(port) for standalone user ports. The goal is to allow ACL rules that redirect a frame back to its ingress port. The commit message says port isolation is applied after the REDIR decision, so these rules were blocked before. > diff --git a/drivers/net/dsa/motorcomm/chip.c b/drivers/net/dsa/motorcomm/chip.c > index c96512faeca25..6e57c9262c681 100644 > --- a/drivers/net/dsa/motorcomm/chip.c > +++ b/drivers/net/dsa/motorcomm/chip.c > @@ -1261,7 +1261,7 @@ static int yt921x_userport_standalone(struct yt921x_priv *priv, int port) > u32 ctrl; > int res; > > - ctrl = ~dsa_cpu_ports(ds); > + ctrl = ~(dsa_cpu_ports(ds) | BIT(port)); > res = yt921x_reg_write(priv, YT921X_PORTn_ISOLATION(port), ctrl); [Severity: Medium] Does this change turn on hairpin for all hardware-forwarded traffic on standalone ports, and not only for ACL redirect-to-self? The driver already uses this same bit as its general hairpin control in yt921x_bridge(): /* to itself when non-hairpin */ if (!pp->hairpin) ctrl |= BIT(port); else ctrl &= ~BIT(port); Broadcasts don't seem to be trapped on this switch. yt921x_chip_setup_dsa() programs YT921X_ACT_UNK_ACTn_TRAP only for unknown unicast and unknown multicast. YT921X_FILTER_BCAST is never written, and yt921x_bridge_flags() notes: /* BR_BCAST_FLOOD: we can filter bcast, but cannot trap them */ This means the comment further down in yt921x_userport_standalone() doesn't hold for broadcasts: /* Unrelated since learning is off and all packets are trapped; * set it anyway */ So a broadcast arriving on a standalone port is flooded in hardware, limited only by the isolation register. Before this patch it could only reach the CPU port. With the self bit cleared, could the switch also send ARP or DHCP broadcasts back out of the port they arrived on? If that happens, an upstream switch would see the sender's MAC arrive from the yt921x link and could move its FDB entry there, which would blackhole that host. Two such ports in a loop could also cause a broadcast storm. This path runs at port setup and on every yt921x_bridge_leave(). Also, yt921x_isolate() only sets this port's bit in other ports' registers, never in the port's own register. All of this depends on how the hardware floods. The reflection only happens if the switch has no separate source-port suppression for flooded frames. The BR_HAIRPIN_MODE offload in yt921x_bridge() seems to assume there is none. Later patches in the series keep the same behaviour. The new helper yt921x_isolation_calc_ports() also computes the standalone mask as: isolation_masks[port] = ~(BIT(port) | cpu_ports_mask); Could the self bit stay set for normal forwarding, and redirect-to-self be handled another way? One option is trapping it to the CPU, as the later commit "net: dsa: motorcomm: Reject isolated redirect targets" does for other isolated targets. > if (res) > return res; -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204101300.3680838-1-mmyangfl%40gmail.com