1. 07 Feb, 2017 33 commits
  2. 06 Feb, 2017 7 commits
    • David S. Miller's avatar
      Merge branch 'dsa-add-fabric-notifier' · 9172d2a0
      David S. Miller authored
      Vivien Didelot says:
      
      ====================
      net: dsa: add fabric notifier
      
      When a switch fabric is composed of multiple switch chips, these chips
      must be programmed accordingly when an event occurred on one of them.
      
      Examples of such event include hardware bridging: when a Linux bridge
      spans interconnected chips, they must be programmed to allow external
      ports to ingress frames on their internal ports.
      
      Another example is cross-chip hardware VLANs. Switch chips in-between
      interconnected bridge ports must also configure a given VLAN to allow
      packets to pass through them.
      
      In order to support that, this patchset introduces a non-intrusive
      notifier mechanism. It adds a notifier head in every DSA switch tree
      (the said fabric), and a notifier block in every DSA switch chip.
      
      When an even occurs, it is chained to all notifiers of the fabric.
      Switch chips can react accordingly if they are cross-chip capable.
      
      On a dynamic debug enabled system, bridging a port in a multi-chip
      fabric will print something like this (ZII Rev B board):
      
          # brctl addif br0 lan3
          mv88e6085 0.1:00: crosschip DSA port 1.0 bridged to br0
          mv88e6085 0.4:00: crosschip DSA port 1.0 bridged to br0
          # brctl delif br0 lan3
          mv88e6085 0.1:00: crosschip DSA port 1.0 unbridged from br0
          mv88e6085 0.4:00: crosschip DSA port 1.0 unbridged from br0
      
      Currently only bridging events are added. A patchset introducing support
      for cross-chip hardware bridging configuration in mv88e6xxx will follow
      right after. Then events for switchdev operations are next on the line.
      
      We should note that non-switchdev events do not support rolling-back
      switch-wide operations. We'll have to work on closer integration with
      switchdev for that, like introducing new attributes or objects, to
      benefit from the prepare and commit phases.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9172d2a0
    • Vivien Didelot's avatar
      net: dsa: introduce bridge notifier · 04d3a4c6
      Vivien Didelot authored
      A slave device will now notify the switch fabric once its port is
      bridged or unbridged, instead of calling directly its switch operations.
      
      This code allows propagating cross-chip bridging events in the fabric.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      04d3a4c6
    • Vivien Didelot's avatar
      net: dsa: add switch notifier · f515f192
      Vivien Didelot authored
      Add a notifier block per DSA switch, registered against a notifier head
      in the switch fabric they belong to.
      
      This infrastructure will allow to propagate fabric-wide events such as
      port bridging, VLAN configuration, etc. If a DSA switch driver cares
      about cross-chip configuration, such events can be caught.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f515f192
    • Vivien Didelot's avatar
      net: dsa: change state setter scope · c5d35cb3
      Vivien Didelot authored
      The scope of the functions inside net/dsa/slave.c must be the slave
      net_device pointer. Change to state setter helper accordingly to
      simplify callers.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c5d35cb3
    • Vivien Didelot's avatar
      net: dsa: rollback bridging on error · 9c265426
      Vivien Didelot authored
      When an error is returned during the bridging of a port in a
      NETDEV_CHANGEUPPER event, net/core/dev.c rolls back the operation.
      
      Be consistent and unassign dp->bridge_dev when this happens.
      
      In the meantime, add comments to document this behavior.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9c265426
    • Vivien Didelot's avatar
      net: dsa: simplify netdevice events handling · 8e92ab3a
      Vivien Didelot authored
      Simplify the code handling the slave netdevice notifier call by
      providing a dsa_slave_changeupper helper for NETDEV_CHANGEUPPER, and so
      on (only this event is supported at the moment.)
      
      Return NOTIFY_DONE when we did not care about an event, and NOTIFY_OK
      when we were concerned but no error occurred, as the API suggests.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8e92ab3a
    • Vivien Didelot's avatar
      net: dsa: move netdevice notifier registration · 88e4f0ca
      Vivien Didelot authored
      Move the netdevice notifier block register code in slave.c and provide
      helpers for dsa.c to register and unregister it.
      
      At the same time, check for errors since (un)register_netdevice_notifier
      may fail.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      88e4f0ca