am5728 emac support switch and dual-mac mode , we use dual-mac way , and these are the address lookup table configurations
cpsw_ale_add_vlan(priv->ale, priv->data.default_vlan,ALE_ALL_PORTS << priv->host_port,ALE_ALL_PORTS << priv->host_port, 0, 0);
static inline void cpsw_add_dual_emac_def_ale_entries(
struct cpsw_priv *priv, struct cpsw_slave *slave,
u32 slave_port)
{
u32 port_mask = 1 << slave_port | 1 << priv->host_port;
if (priv->version == CPSW_VERSION_1)
slave_write(slave, slave->port_vlan, CPSW1_PORT_VLAN);
else
slave_write(slave, slave->port_vlan, CPSW2_PORT_VLAN);
cpsw_ale_add_vlan(priv->ale, slave->port_vlan, port_mask,port_mask, port_mask, 0);
cpsw_ale_add_mcast(priv->ale, priv->ndev->broadcast,port_mask, ALE_VLAN, slave->port_vlan, 0);
cpsw_ale_add_ucast(priv->ale, priv->mac_addr,priv->host_port, ALE_VLAN, slave->port_vlan);
}
when mac conflict happens , the emac will never receive unicast packet again! only when ifconfig down/up execute, the emac will resume again.
how can we resovle this ?? thank you!
there ars some tips:
1
when we change the unicast configuration as follow ,
cpsw_ale_add_ucast(priv->ale, priv->mac_addr,priv->host_port, ALE_VLAN|ALE_SECURE, slave->port_vlan);
then the boardcast packets from the mac conflict device , will be dropped ... that's the flag ALE_SECURE working。