• Scott Feldman's avatar
    rocker: implement L2 bridge offloading · 6c707945
    Scott Feldman authored
    Add L2 bridge offloading support to rocker driver.  Here, the Linux bridge
    driver is used to collect swdev ports into a tagged (or untagged) VLAN
    bridge.  The switchdev will offload from the bridge driver the following L2
    bridging functions:
    
     - Learning of neighbor MAC addresses on VLAN X  Learned mac/vlan is
    installed in bridge FDB.  (And removed when device unlearns mac/vlan).
    Learning must be turned off on each bridge port to disable the feature in
    the bridge driver.
    
    - Flooding of multicast/broadcast and unknown unicast pkts to (STP)
    active ports in bridge.  The bridge driver is unaware of the flooding happening
    at the device level.  Flooding must be turned off on each bridge port to
    disable the feature on the bridge driver.
    
    - STP port state is pushed down to driver/device.  The bridge still processes
    STP BDPUs and maintains port STP state (for all VLANs in bridge), but
    the driver/device must be notified of port STP state change to program
    the device.
    
    Multiple (VLAN) bridges are supported.  The device (implemented per
    the OF-DPA spec) must use a portion of the VLAN namespace for
    internal VLANs.  Right now, the upper 255 VLANs (0xf00 to 0xffe) are
    used as internal VLAN IDs for untagged traffic and are not available
    as port VLANs.
    
    The driver uses the following interfaces:
    
    1. To track VLAN add/del on ports in bridge:
    
    .ndo_vlan_rx_add_vid
    .ndo_vlan_rx_kill_vid
    
    2. To track port add/del membership in bridge:
    
    NETDEV_CHANGEUPPER netdevice notifier
    
    3. To catch static FDB entries installed on bridge/vlan by user using netlink:
    
    .ndo_fdb_add
    .ndo_fdb_del
    
    4. To be notified on port STP state change:
    
    .ndo_switch_port_stp_update
    
    5. To notify bridge driver on learned/forgotten mac/vlans on bridge port:
    
    br_fdb_external_learn_add
    br_fdb_external_learn_del
    Signed-off-by: default avatarScott Feldman <sfeldma@gmail.com>
    Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    6c707945
rocker.c 111 KB