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=1796374417; b=R26yBg8ad5pYa52jtsHwUxmkrY0cS7nsKOQgkgYg5Qy5IUjWM4/UKuiDqzwxxhgAEutz 1AaQfpqbBt7dljo3WSwLXj8UN+0RCljLiOGigNwTU4yJRovBesZJySKLTH+U/lz0J3tng LtCzPQ/QRYzMzU5kX8PjBL6i7QG95HyWdZgOmuaooWq1esW6HtZWSYbjMvBfo5lOQrbyJ iLCPNQVxTzGmF8lY+SGGy9umdwa2pxlft6E/gbdG/5p7Ozz5fMIGTQVms0bg+B2fFrvs0 vqD4n1UmS00z/AJby2pE8ksr2mprMNTYin6dPUfjy+CjvR6rdUfenPpKrGIL7lohfXw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796374417; 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=UF/IgZxEwtImoVRWhODP2cujyUKLLZ5VTjGFH9F+uQk=; b=ijb81JpGh8hhwxI1pORqknIuVVZ6rPMMJ2NhRNDk6segR7paMzpWtgMT2rD3zkUTmq9w wJ3Nx5YQKdZREWK4hO95Nr2Gw6vzOAbcNAEB9LlgRMrbr0yYS1f9saPVGhPD0G0c0uHh1 XR/UCTbRJIoh3aVgabzgHo/+HMLoJLdV45HEWctihCB4CdVg8dF1dzrWBvdvxELGnE8jS Y8TK+JQ+Op1QCsMSovF0gxLU5AhSosdPLobo3wDokiOM57axwdzX18atjP3EPwBAIjxpz eJzMNBMex9ri4piBhOZQor6gTJkZctZuUm9PqAjjlv1sFwERCAXO7u8kPQTwmjCBbrA== 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=NiQb1cos; 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 CCE43606A33C; Fri, 4 Dec 2026 08:53:37 +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=NiQb1cos Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5C001F000CE; Fri, 4 Dec 2026 08:53:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796374417; bh=UF/IgZxEwtImoVRWhODP2cujyUKLLZ5VTjGFH9F+uQk=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=NiQb1cosZXcsnyQN6lWDPoQAWSsGLf9zgXtlb3QesEExwgbludKOLvzv5igQ5p2Me FwY6KBqoT1BiMbzcIWJNVKP3Gd5Q+rRm+L4ICFJP2CF8aWLYfWV4U9F7fZSrU6NPvD By5U5oOdQpcbQvtYfHEzRpKupthSWWad5Fe0M7I0dxA/1ue1bD52QRj6EL4nzl5X0Q Jiv8JyWgE2XslKruHst0cMvOipLKTINbr/aeYa/iPhgZ9D1gM6VYE9RdDzWK0aEXhr 8NOSIQp9+TL18ai2IzioNJ3NI8A7a/C0hjNn+g0IfaQPgmI0XOMfzaf4z2hikv/cNI gLEWeuv4zzMSg== Subject: Re: [PATCH net-next 2/3] net: ethernet: ti: cpsw: forward unknown VLANs in promiscuous switch mode From: netdev-bot+sashiko@kernel.org To: alexander.sverdlin@siemens.com Cc: netdev@vger.kernel.org, s-vadapalli@ti.com, rogerq@kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, kmehltretter@gmail.com, haokexin@gmail.com, lgs201920130244@gmail.com, aleksandr.loktionov@intel.com, ilias.apalodimas@linaro.org, m-karicheri2@ti.com, grygorii.strashko@ti.com, mugunthanvnm@ti.com, linux-omap@vger.kernel.org, lukas.stockmann@siemens.com Date: Fri, 04 Dec 2026 08:53:36 +0000 Message-ID: <179637441631.3146.10682708359159776909@kernel.org> In-Reply-To: <20261203080514.577407-3-alexander.sverdlin@siemens.com> References: <20261203080514.577407-3-alexander.sverdlin@siemens.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: linux-omap@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 2 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 2 · 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] The patch may not fix what it says it fixes. - [Medium] Suppose the Unknown VLAN register does control forwarding of unknown VIDs, as the commit message assumes. -- net: ethernet: ti: cpsw: forward unknown VLANs in promiscuous switch mode In legacy cpsw switch mode, this commit sets the ALE unknown VLAN member list and the unknown and registered multicast flood masks to all ports while the interface is promiscuous. It clears them again when promiscuity is turned off. The goal is to let frames from VLAN-tagging DSA switches such as LAN9303 reach the host. > diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c > index 14350ec5b7d0c..1390bf5ecba8c 100644 > --- a/drivers/net/ethernet/ti/cpsw.c > +++ b/drivers/net/ethernet/ti/cpsw.c > @@ -150,11 +150,27 @@ static void cpsw_set_promiscious(struct net_device *ndev, bool enable) > > /* Flood All Unicast Packets to Host port */ > cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 1); > + > + /* Forward packets of VLANs unknown to the ALE */ > + cpsw_ale_control_set(ale, 0, ALE_PORT_UNKNOWN_VLAN_MEMBER, > + ALE_ALL_PORTS); > + cpsw_ale_control_set(ale, 0, ALE_PORT_UNKNOWN_MCAST_FLOOD, > + ALE_ALL_PORTS); > + cpsw_ale_control_set(ale, 0, > + ALE_PORT_UNKNOWN_REG_MCAST_FLOOD, > + ALE_ALL_PORTS); [Severity: Medium] Are these writes enough on their own while the ALE is still VLAN-aware? In switch mode, cpsw_init_host_port() does this: drivers/net/ethernet/ti/cpsw.c:cpsw_init_host_port() { ... cpsw_ale_control_set(cpsw->ale, HOST_PORT_NUM, ALE_VLAN_AWARE, CPSW_ALE_VLAN_AWARE); ... } CPSW_ALE_VLAN_AWARE is 1, and this patch does not change ALE_CONTROL bit 2. As I recall, the CPSW TRM describes ALE_VLAN_AWARE as "0 = flood if VLAN not found, 1 = drop packet if VLAN not found". I have not been able to re-check that against the TRM. If the hardware works that way, the unknown VLAN masks only apply in the VLAN-unaware case. The LAN9303 source port VIDs would then still be dropped while the conduit is promiscuous. cpsw.c never sets default_vlan, so the ALE only knows VID 0 and the VIDs the host adds. Two other things point the same way: - gbe_init_host_port() in netcp_ethss.c is the only other in-tree user of these masks. It sets ALE_PORT_UNKNOWN_VLAN_MEMBER and never sets ALE_VLAN_AWARE. - The sibling commit "net: ethernet: ti: cpsw_new: bypass ALE in promiscuous mode" fixes the same symptom with ALE_BYPASS, which works whatever VLAN_AWARE is set to. That commit has a Tested-by. This one does not, and the rest of the series seems to have been tested in dual_emac mode, which never reaches this branch. Has legacy cpsw switch mode with only this patch been shown on hardware to receive LAN9303-tagged frames? If not, the fix may need to clear ALE_VLAN_AWARE or enable ALE_BYPASS while promiscuous. If so, this part of the commit message would also need updating: "In switch mode the ALE is VLAN-aware and the Unknown VLAN register is left at its reset value, so frames tagged with a VID the ALE doesn't know are dropped even if the interface is promiscuous." [Severity: Medium] If these masks do take effect, does writing ALE_ALL_PORTS here also forward unknown-VID frames between the two external slave ports, and not just to the host? ALE_ALL_PORTS is 0x7, which covers the host, port 1 and port 2. The ALE_UNKNOWNVLAN fields are global (port_offset and port_shift are 0 in ale_controls[]), so they apply to every ingress port. This branch also sets ALE_PORT_NOLEARN and ALE_PORT_NO_SA_UPDATE on all ports, so unknown-VID unicast is always flooded to every port in the member list. With LAN9303 on slave port 1, this seems to have three effects: - Every frame LAN9303 sends to the CPU with a source-port VID is also flooded out slave port 2. DSA keeps the conduit promiscuous, so in practice this happens all the time. - Host TX in switch mode is non-directed and goes through the ALE lookup, so DSA-tagged frames from the host also go out port 2. - A device on slave port 2 can send frames with LAN9303 management VIDs. Those now reach the LAN9303 CPU port; before this patch they were dropped. Some context makes this less of a change. Switch mode already gives known VLANs ALE_ALL_PORTS membership through cpsw_add_vlan_ale_entry() and cpsw_add_default_vlan(). Promiscuous mode already floods known-VLAN unicast to both ports. So this extends an existing design choice. Is it intended that VLAN filtering between the external ports stops whenever the host is promiscuous, for example under tcpdump or DSA? If so, could the commit message mention this side effect? > dev_dbg(&ndev->dev, "promiscuity enabled\n"); > } else { [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261203080514.577407-1-alexander.sverdlin%40siemens.com