Re: [RFC PATCH net-next] net: dsa: microchip: implement multi-bridge support

From: Vladimir Oltean
Date: Tue Nov 16 2021 - 08:53:45 EST


On Tue, Nov 16, 2021 at 02:40:06PM +0100, Andrew Lunn wrote:
> > > What logging noise?
> >
> > I get this with current ksz driver:
> > [ 40.185928] br0: port 2(lan2) entered blocking state
> > [ 40.190924] br0: port 2(lan2) entered listening state
> > [ 41.043186] br0: port 2(lan2) entered blocking state
> > [ 55.512832] br0: port 1(lan1) entered learning state
> > [ 61.272802] br0: port 2(lan2) neighbor 8000.ae:1b:91:58:77:8b lost
> > [ 61.279192] br0: port 2(lan2) entered listening state
> > [ 63.113236] br0: received packet on lan1 with own address as source address (addr:00:0e:cd:00:cd:be, vlan:0)
>
> I would guess that transmission from the CPU is broken in this
> case. It could be looking up the destination address in the
> translation table and not finding an entry. So it floods the packet
> out all interfaces, including the CPU. So the CPU receives its own
> packet and gives this warning.
>
> Flooding should exclude where the frame came from.

I interpret this very differently. If Oleksij is looping lan1 with lan2
and he keeps the MAC addresses the way DSA sets them up by default, i.e.
equal and inherited from the DSA master, then receiving a packet with a
MAC SA (lan2) equal with the address of the receiving interface (lan1)
is absolutely natural. What is not natural is that the bridge attempts
to learn from this packet (the message is printed from br_fdb_update),
which in turn is caused by the fact that the port is allowed to proceed
to the LEARNING state despite there being a loop (which is not detected
by STP because STP is broken as Oleksij describes).