• Vladimir Oltean's avatar
    net: dsa: make cross-chip notifiers more efficient for host events · 726816a1
    Vladimir Oltean authored
    To determine whether a given port should react to the port targeted by
    the notifier, dsa_port_host_vlan_match() and dsa_port_host_address_match()
    look at the positioning of the switch port currently executing the
    notifier relative to the switch port for which the notifier was emitted.
    
    To maintain stylistic compatibility with the other match functions from
    switch.c, the host address and host VLAN match functions take the
    notifier information about targeted port, switch and tree indices as
    argument. However, these functions only use that information to retrieve
    the struct dsa_port *targeted_dp, which is an invariant for the outer
    loop that calls them. So it makes more sense to calculate the targeted
    dp only once, and pass it to them as argument.
    
    But furthermore, the targeted dp is actually known at the time the call
    to dsa_port_notify() is made. It is just that we decide to only save the
    indices of the port, switch and tree in the notifier...
    726816a1
tag_8021q.c 12.9 KB