• Alexandra Winter's avatar
    s390/qeth: Translate address events into switchdev notifiers · 10a6cfc0
    Alexandra Winter authored
    A qeth-l2 HiperSockets card can show switch-ish behaviour in the sense,
    that it can report all MACs that are reachable via this interface. Just
    like a switch device, it can notify the software bridge about changes
    to its fdb. This patch exploits this device-to-bridge-notification and
    extracts the relevant information from the hardware events to generate
    notifications to an attached software bridge.
    
    There are 2 sources for this information:
    1) The reply message of Perform-Network-Subchannel-Operations (PNSO)
    (operation code ADDR_INFO) reports all addresses that are currently
    reachable (implemented in a later patch).
    2) As long as device-to-bridge-notification is enabled, hardware will
    generate address change notification events, whenever the content of
    the hardware fdb changes (this patch).
    
    The bridge_hostnotify feature (PNSO operation code BRIDGE_INFO) uses
    the same address change notification events. We need to distinguish
    between qeth_pnso_mode QETH_PNSO_BRIDGEPORT and QETH_PNSO_ADDR_INFO
    and call a different handler. In both cases deadlocks must be
    prevented, if the workqueue is drained under lock and QETH_PNSO_NONE,
    when notification is disabled.
    
    bridge_hostnotify generates udev events, there is no intend to do the same
    for dev2br. Instead this patch will generate SWITCHDEV_FDB_ADD_TO_BRIDGE
    and SWITCHDEV_FDB_DEL_TO_BRIDGE notifications, that will cause the
    software bridge to add (or delete) entries to its fdb as 'extern_learn
    offload'.
    
    Documentation/networking/switchdev.txt proposes to add
    "depends NET_SWITCHDEV" to driver's Kconfig. This is not done here,
    so even in absence of the NET_SWITCHDEV module, the QETH_L2 module will
    still be built, but then the switchdev notifiers will have no effect.
    
    No VLAN filtering is done on the entries and VLAN information is not
    passed on to the bridge fdb entries. This could be added later.
    For now VLAN interfaces can be defined on the upper bridge interface.
    
    Multicast entries are not passed on to the bridge fdb.
    This could be added later. For now mcast flooding can be used in the
    bridge.
    
    The card reports all MACs that are in its FDB, but we must not pass on
    MACs that are registered for this interface.
    Signed-off-by: default avatarAlexandra Winter <wintera@linux.ibm.com>
    Reviewed-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
    Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    10a6cfc0
qeth_l2_main.c 57.9 KB