Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Linus Walleij
Thu, 12 Nov 2026 20:25
Re: [PATCH net-next v10 07/12] net: dsa: realtek: rtl8365mb: set and get vlan 4k for family D
Author: Linus Walleij
Date: Thu, 12 Nov 2026 20:25
Date: Thu, 12 Nov 2026 20:25
44 lines
11072 bytes
11072 bytes
On Thu, Nov 12, 2026 at 6:37 PM Mieczyslaw Nalewaj <namiltd@yahoo.com> wrote: > The hardware structure of 4K VLAN table entries has changed between > silicon families. Family D's CVLAN entry is two 16-bit words rather > than three: there is no third word extending member/untag past bit 7, > and no priority/meter fields at all. The FID field is restricted to a > narrower 2-bit width. The chip itself supports both IVL and SVL. > > IVL_EN (bit 3, versus bit 14 on family C) follows vlan4k->ivl_en. On > family D, rtl8365mb_vlan_4k_port_set() enables it while any user port > has VLAN filtering enabled (dsa_port_is_vlan_filtering()), so that > static and learned FDB/MDB entries use the same key. Family C keeps IVL > always enabled, as before. > > The stored IVL_EN is refreshed on the next port_vlan_add/del for the > VID, not on a vlan_filtering change. > > Reusing the three-word family C layout on family D would read a third > word that does not exist as a distinct table word on family D's die. > Whatever data happens to be in that register would be folded into > member/untag bits [10:8] on read, and written back on every > read-modify-write cycle in rtl8365mb_vlan_4k_port_set(). Give family D > its own two-word pack/unpack instead: add rtl8365mb_d_vlan_4k_read() and > rtl8365mb_d_vlan_4k_write(). The shared code reaches them through the > vlan_4k_read and vlan_4k_write pointers in struct rtl8365mb_family_info, > so the pack/unpack code needs no is_d() check. > > The two-word layout matches the vendor switch API for this chip > family, which writes only 0x0510/0x0511 for a CVLAN entry. > > Nothing points to them until the family D info is added together with > the chip table entry in the last patch. Until then they are not static > and are declared in rtl8365mb_vlan.h, so that the build does not warn > about unused functions. > > Tested-by: Gustavo Foletto Mora <gusfmora@gmail.com> > Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com> Reviewed-by: Linus Walleij <linusw@kernel.org> Yours, Linus Walleij
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads