• Vladimir Oltean's avatar
    net: dsa: sja1105: offload bridge port flags to device · 4d942354
    Vladimir Oltean authored
    The chip can configure unicast flooding, broadcast flooding and learning.
    Learning is per port, while flooding is per {ingress, egress} port pair
    and we need to configure the same value for all possible ingress ports
    towards the requested one.
    
    While multicast flooding is not officially supported, we can hack it by
    using a feature of the second generation (P/Q/R/S) devices, which is that
    FDB entries are maskable, and multicast addresses always have an odd
    first octet. So by putting a match-all for 00:01:00:00:00:00 addr and
    00:01:00:00:00:00 mask at the end of the FDB, we make sure that it is
    always checked last, and does not take precedence in front of any other
    MDB. So it behaves effectively as an unknown multicast entry.
    
    For the first generation switches, this feature is not available, so
    unknown multicast will always be treated the same as unknown unicast.
    So the only thing we can do is request the user to offload the settings
    for these 2 flags in tandem, i.e.
    
    ip link set swp2 type bridge_slave flood off
    Error: sja1105: This chip cannot configure multicast flooding independently of unicast.
    ip link set swp2 type bridge_slave flood off mcast_flood off
    ip link set swp2 type bridge_slave mcast_flood on
    Error: sja1105: This chip cannot configure multicast flooding independently of unicast.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    4d942354
sja1105.h 9.74 KB