Re: [PATCH net 1/2] net: dsa: realtek: rtl8365mb: use IVL in VLAN 0
From: Luiz Angelo Daros de Luca
Date: Mon Nov 09 2026 - 16:20:42 EST
> > Yes, all this makes sense. I actually remember doing basically the same
> > thing back when I was working on this, but it seems not to have survived
> > the final work by Luiz. It would be good to get his input on why.
>
> Luiz, do you remember a reason the IVL setup of VID 0 was dropped? I
> could not find one, and the switch only matches the driver's VID 0
> entries with it.
Yes, it was there:
/* Add all ports to VLAN0. Not sure if needed. But at least for
* learning, we need to set the ivl_en bit to 1 so that the switch
* learns with {VID, MAC, EFID} rather than {FID, MAC, EFID}.
*/
// TODO find right place for this
{
struct rtl8365mb_vlan4k vlan4k = { 0 };
ret = rtl8365mb_vlan_get_vlan4k(priv, 0, &vlan4k);
if (ret)
return ret;
vlan4k.member |= RTL8365MB_PORTMASK;
vlan4k.ivl_en = true;
ret = rtl8365mb_vlan_set_vlan4k(priv, &vlan4k);
if (ret)
return ret;
}
I missed that one. I might have focused too much on filtered VLAN and
missed the vlan unaware bridges.
On any vlan4k write, IVL is always enabled. It is just vlan ID 0 was
never written by the driver. We would just need to write it once.
Another way (untested) to get the same result would be to call
rtl8365mb_vlan_4k_port_del() on any port for VID=0 during setup.
Reviewed-by: Luiz Angelo Daros de Luca <luizluca@xxxxxxxxx>
Best regards,
Luiz
> > So I'm not sure I like this function being added to the vlan.c
> > library. Semantically it makes more sense to me for the main.c driver to
> > actually call rtl8365mb_vlan4k_port_add() for each port, so as to
> > explicitly say: "all ports are, one way or another, members of this
> > neutral VLAN". Then you would get IVL automatically.
>
> I kept it out of rtl8365mb_vlan_4k_port_add() on purpose: making every
> port a member of VID 0 also sets the member mask, which the ingress
> filter of a VLAN-aware port then checks. I only wanted to change the
> learning mode, not which frames a filtering port accepts.