Skip to content

Commit 9d1f644

Browse files
grygoriySdavem330
authored andcommitted
net: ethernet: ti: ale: fix seeing unreg mcast packets with promisc and allmulti disabled
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 b361da8 ("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: b361da8 ("net: netcp: ale: add proper ale entry mask bits for netcp switch ALE") Signed-off-by: Grygorii Strashko <[email protected]> Tested-by: Murali Karicheri <[email protected]> Tested-by: Peter Ujfalusi <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 738a269 commit 9d1f644

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/ethernet/ti/cpsw_ale.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ DEFINE_ALE_FIELD(mcast, 40, 1)
122122
DEFINE_ALE_FIELD(vlan_unreg_mcast_idx, 20, 3)
123123
DEFINE_ALE_FIELD(vlan_reg_mcast_idx, 44, 3)
124124

125+
#define NU_VLAN_UNREG_MCAST_IDX 1
126+
125127
/* The MAC address field in the ALE entry cannot be macroized as above */
126128
static inline void cpsw_ale_get_addr(u32 *ale_entry, u8 *addr)
127129
{
@@ -455,6 +457,8 @@ int cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port_mask, int untag,
455457
cpsw_ale_set_vlan_unreg_mcast(ale_entry, unreg_mcast,
456458
ale->vlan_field_bits);
457459
} else {
460+
cpsw_ale_set_vlan_unreg_mcast_idx(ale_entry,
461+
NU_VLAN_UNREG_MCAST_IDX);
458462
cpsw_ale_set_vlan_mcast(ale, ale_entry, reg_mcast, unreg_mcast);
459463
}
460464
cpsw_ale_set_vlan_member_list(ale_entry, port_mask,

0 commit comments

Comments
 (0)