• Vladimir Oltean's avatar
    net: bridge: switchdev: differentiate new VLANs from changed ones · 8d23a54f
    Vladimir Oltean authored
    br_switchdev_port_vlan_add() currently emits a SWITCHDEV_PORT_OBJ_ADD
    event with a SWITCHDEV_OBJ_ID_PORT_VLAN for 2 distinct cases:
    
    - a struct net_bridge_vlan got created
    - an existing struct net_bridge_vlan was modified
    
    This makes it impossible for switchdev drivers to properly balance
    PORT_OBJ_ADD with PORT_OBJ_DEL events, so if we want to allow that to
    happen, we must provide a way for drivers to distinguish between a
    VLAN with changed flags and a new one.
    
    Annotate struct switchdev_obj_port_vlan with a "bool changed" that
    distinguishes the 2 cases above.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    8d23a54f
br_vlan.c 54 KB