Re: [PATCH net-next v10 4/9] net: dsa: lan9645x: add basic dsa driver for LAN9645X
<[email protected]> Mon, 3 Aug 2026 13:28:50 +0000
| Newsgroups | org.kernel.vger.linux-devicetree,dev.linux.lists.sashiko-reviews |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 2026-07-14 at 14:43 +0000, [email protected] wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > - [High] Missing FDB operations and omission of the CPU port in PGID_UC breaks unicast IP traffic to the CPU. > -- > > --- Patch [4]: [PATCH net-next v10 4/9] net: dsa: lan9645x: add basic dsa driver for LAN9645X --- > commit 996cf37c0fe28c352442c3b82c0b401974b8f66a > Author: Jens Emil Schulz Østergaard <[email protected]> > > net: dsa: lan9645x: add basic dsa driver for LAN9645X > > Add the LAN9645X basic DSA driver with initialization, parent regmap requests, > port module initialization for NPI, CPU ports and front ports, and phylink > integration for MAC side configuration. > > > diff --git a/drivers/net/dsa/microchip/lan9645x/lan9645x_main.c b/drivers/net/dsa/microchip/lan9645x/lan9645x_main.c > > new file mode 100644 > > index 0000000000000..b253813518c20 > > --- /dev/null > > +++ b/drivers/net/dsa/microchip/lan9645x/lan9645x_main.c > > [ ... ] > > > @@ -0,0 +1,447 @@ > > [ ... ] > > > +static int lan9645x_setup(struct dsa_switch *ds) > > +{ > > [ ... ] > > > + /* Multicast to all front ports */ > > + lan_wr(front_ports, lan9645x, ANA_PGID(PGID_MC)); > > + > > + /* IP multicast to all front ports */ > > + lan_wr(front_ports, lan9645x, ANA_PGID(PGID_MCIPV4)); > > + lan_wr(front_ports, lan9645x, ANA_PGID(PGID_MCIPV6)); > > + > > + /* Unicast to all front ports */ > > + lan_wr(front_ports, lan9645x, ANA_PGID(PGID_UC)); > > [Severity: High] > Does omitting the CPU port module (BIT(lan9645x->num_phys_ports)) from the > unknown unicast flooding mask (PGID_UC) prevent unicast traffic from reaching > the CPU? > > Since hardware learning is disabled in lan9645x_port_setup() via > ANA_PORT_CFG_LEARN_ENA_SET(0), and the lan9645x_switch_ops struct lacks a > port_fdb_add callback to statically program the CPU's MAC address, unicast > frames destined for the CPU will be treated as unknown unicast. > > Because PGID_UC only includes front_ports, it appears these unknown unicast > frames will be flooded to the front ports but not to the CPU, effectively > breaking unicast IP connectivity (such as ARP replies) to the host. > I think this is a false positive. I have split the patches to make review easier. The callbacks port_fdb_add port_mdb_add port_set_host_flood are added in later patches in the same series. These handle unknown and known traffic toward the CPU. For standalone ports flooding of unknown traffic to the cpu can be configured with promiscuous mode and all_multi. > > + > > + /* Broadcast to cpu and all front ports */ > > + lan_wr(BIT(lan9645x->num_phys_ports) | front_ports, lan9645x, > > + ANA_PGID(PGID_BC)); > > [ ... ] > > -- > Sashiko AI review · https://sashiko.dev/#/patchset/20260713-dsa_lan9645x_switch_driver_base-v10-0-a4886a08fb15@microchip.com?part=4