• Scott Feldman's avatar
    switchdev: add new switchdev bridge setlink · 47f8328b
    Scott Feldman authored
    Add new switchdev_port_bridge_setlink that can be used by drivers
    implementing .ndo_bridge_setlink to set switchdev bridge attributes.
    Basically turn the raw rtnl_bridge_setlink netlink into switchdev attr
    sets.  Proper netlink attr policy checking is done on the protinfo part of
    the netlink msg.
    
    Currently, for protinfo, only bridge port attrs BR_LEARNING and
    BR_LEARNING_SYNC are parsed and passed to port driver.
    
    For afspec, VLAN objs are passed so switchdev driver can set VLANs assigned
    to SELF.  To illustrate with iproute2 cmd, we have:
    
    	bridge vlan add vid 10 dev sw1p1 self master
    
    To add VLAN 10 to port sw1p1 for both the bridge (master) and the device
    (self).
    Signed-off-by: default avatarScott Feldman <sfeldma@gmail.com>
    Acked-by: default avatarJiri Pirko <jiri@resnulli.us>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    47f8328b
switchdev.c 18.7 KB