• Vladimir Oltean's avatar
    net: dsa: tag_8021q: add VLANs to the master interface too · bbed0bbd
    Vladimir Oltean authored
    The whole purpose of tag_8021q is to send VLAN-tagged traffic to the
    CPU, from which the driver can decode the source port and switch id.
    
    Currently this only works if the VLAN filtering on the master is
    disabled. Change that by explicitly adding code to tag_8021q.c to add
    the VLANs corresponding to the tags to the filter of the master
    interface.
    
    Because we now need to call vlan_vid_add, then we also need to hold the
    RTNL mutex. Propagate that requirement to the callers of dsa_8021q_setup
    and modify the existing call sites as appropriate. Note that one call
    path, sja1105_best_effort_vlan_filtering_set -> sja1105_vlan_filtering
    -> sja1105_setup_8021q_tagging, was already holding this lock.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    bbed0bbd
sja1105_main.c 100 KB