• Grygorii Strashko's avatar
    net: ethernet: ti: ale: fix seeing unreg mcast packets with promisc and allmulti disabled · 9d1f6447
    Grygorii Strashko authored
    On AM65xx MCU CPSW2G NUSS and 66AK2E/L NUSS the unregistered multicast
    packets are still can be received with promisc and allmulti disabled.
    
    This happens, because ALE VLAN entries on these SoCs do not contain port
    masks for reg/unreg mcast packets, but instead store indexes of
    ALE_VLAN_MASK_MUXx_REG registers which intended for store port masks for
    reg/unreg mcast packets.
    
    ALE VLAN entry:UNREG_MCAST_FLOOD_INDEX -> ALE_VLAN_MASK_MUXx
    ALE VLAN entry:REG_MCAST_FLOOD_INDEX -> ALE_VLAN_MASK_MUXy
    
    The commit b361da83 ("net: netcp: ale: add proper ale entry mask bits
    for netcp switch ALE") update ALE code to support such ALE entries, it is
    always used ALE_VLAN_MASK_MUX0_REG index in ALE VLAN entry for unreg mcast
    packets mask configuration, which is read-only, at least for AM65xx MCU
    CPSW2G NUSS and 66AK2E/L NUSS. As result unreg mcast packets are allowed
    always.
    
    Hence, update ALE code to use ALE_VLAN_MASK_MUX1_REG index for ALE VLAN
    entries to configure unreg mcast port mask.
    
    Fixes: b361da83 ("net: netcp: ale: add proper ale entry mask bits for netcp switch ALE")
    Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
    Tested-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
    Tested-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9d1f6447
cpsw_ale.c 25.4 KB