netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/20] net: dsa: distribute switch events
@ 2017-05-19 21:00 Vivien Didelot
  2017-05-19 21:00 ` [PATCH net-next 01/20] net: dsa: change scope of STP state setter Vivien Didelot
                   ` (21 more replies)
  0 siblings, 22 replies; 46+ messages in thread
From: Vivien Didelot @ 2017-05-19 21:00 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
	Andrew Lunn, Vivien Didelot

DSA is by nature the support for a switch fabric, which can be composed
of a single, or multiple interconnected Ethernet switch chips.

The current DSA core behavior is to identify the slave port targeted by
a request (e.g. adding a VLAN entry), and program the switch chip to
which it belongs accordingly.

This is problematic in a multi-chip environment, since all chips of a
fabric must be aware of most configuration changes. Here are some
concrete examples in a 3-chip environment:

         [CPU].................... (mdio)
    (eth0) |   :       :          :
          _|_____    _______    _______
         [__sw0__]--[__sw1__]--[__sw2__]
          |  |  |    |  |  |    |  |  |
          v  v  v    v  v  v    v  v  v
          p1 p2 p3   p4 p5 p6   p7 p8 p9

If you add a VLAN entry on p7, sw2 gets programmed, but frames won't
reach the CPU interface in a VLAN filtered setup. sw0 and sw1 also need
to be programmed. The same problem comes with MAC addresses (FDB, MDB),
or ageing time changes for instance.

This patch series uses the notification chain introduced for bridging,
to notify not only bridge, but switchdev attributes and objects events
to all switch chips of the fabric.

An ugly debug message printing the ignored event and switch info in the
code handling the switch VLAN events would give us:

    # bridge vlan add dev p7 vid 42
    sw0: ignoring DSA_NOTIFIER_VLAN_ADD for sw2 (prepare phase)
    sw1: ignoring DSA_NOTIFIER_VLAN_ADD for sw2 (prepare phase)
    sw0: ignoring DSA_NOTIFIER_VLAN_ADD for sw2 (commit phase)
    sw1: ignoring DSA_NOTIFIER_VLAN_ADD for sw2 (commit phase)

To achieve that, patches 1-8 change the scope of the bridge and
switchdev callbacks from the DSA slave device to the generic DSA port,
so that the port-wide API can be used later for switch ports not exposed
to userspace, such as CPU and DSA links.

Patches 9-15 move the DSA port specific functions in a new port.c file.

Patches 16-20 introduce new events to notify the fabric about switchdev
attributes and objects manipulation.

This patch series only adds the plumbing to support a distributed
configuration, but for the moment, each switch chip ignores events from
other chips of the fabric, to keep the current behavior.

The next patch series will add support for cross-chip configuration of
bridge ageing time, VLAN and MAC address databases operations, etc.


Vivien Didelot (20):
  net: dsa: change scope of STP state setter
  net: dsa: change scope of notifier call chain
  net: dsa: change scope of bridging code
  net: dsa: change scope of FDB handlers
  net: dsa: change scope of MDB handlers
  net: dsa: change scope of VLAN handlers
  net: dsa: change scope of VLAN filtering setter
  net: dsa: change scope of ageing time setter
  net: dsa: move port state setters
  net: dsa: move bridging routines
  net: dsa: move VLAN filtering setter
  net: dsa: move ageing time setter
  net: dsa: move FDB handlers
  net: dsa: move MDB handlers
  net: dsa: move VLAN handlers
  net: dsa: move notifier info to private header
  net: dsa: add notifier for ageing time
  net: dsa: add FDB notifier
  net: dsa: add MDB notifier
  net: dsa: add VLAN notifier

 include/net/dsa.h  |  10 --
 net/dsa/Makefile   |   2 +-
 net/dsa/dsa_priv.h |  83 +++++++++++++
 net/dsa/port.c     | 260 +++++++++++++++++++++++++++++++++++++++
 net/dsa/slave.c    | 354 +++++------------------------------------------------
 net/dsa/switch.c   | 175 ++++++++++++++++++++++++++
 6 files changed, 547 insertions(+), 337 deletions(-)
 create mode 100644 net/dsa/port.c

-- 
2.13.0

^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2017-05-22 23:31 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-19 21:00 [PATCH net-next 00/20] net: dsa: distribute switch events Vivien Didelot
2017-05-19 21:00 ` [PATCH net-next 01/20] net: dsa: change scope of STP state setter Vivien Didelot
2017-05-22 19:23   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 02/20] net: dsa: change scope of notifier call chain Vivien Didelot
2017-05-22 19:24   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 03/20] net: dsa: change scope of bridging code Vivien Didelot
2017-05-22 19:24   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 04/20] net: dsa: change scope of FDB handlers Vivien Didelot
2017-05-22 19:25   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 05/20] net: dsa: change scope of MDB handlers Vivien Didelot
2017-05-22 19:26   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 06/20] net: dsa: change scope of VLAN handlers Vivien Didelot
2017-05-22 19:27   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 07/20] net: dsa: change scope of VLAN filtering setter Vivien Didelot
2017-05-22 19:27   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 08/20] net: dsa: change scope of ageing time setter Vivien Didelot
2017-05-22 19:29   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 09/20] net: dsa: move port state setters Vivien Didelot
2017-05-22 19:31   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 10/20] net: dsa: move bridging routines Vivien Didelot
2017-05-22 19:32   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 11/20] net: dsa: move VLAN filtering setter Vivien Didelot
2017-05-22 19:33   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 12/20] net: dsa: move ageing time setter Vivien Didelot
2017-05-22 19:34   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 13/20] net: dsa: move FDB handlers Vivien Didelot
2017-05-22 19:34   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 14/20] net: dsa: move MDB handlers Vivien Didelot
2017-05-22 19:35   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 15/20] net: dsa: move VLAN handlers Vivien Didelot
2017-05-22 19:36   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 16/20] net: dsa: move notifier info to private header Vivien Didelot
2017-05-22 19:37   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 17/20] net: dsa: add notifier for ageing time Vivien Didelot
2017-05-22 19:38   ` Florian Fainelli
2017-05-22 20:45     ` Vivien Didelot
2017-05-19 21:00 ` [PATCH net-next 18/20] net: dsa: add FDB notifier Vivien Didelot
2017-05-22 19:39   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 19/20] net: dsa: add MDB notifier Vivien Didelot
2017-05-22 19:39   ` Florian Fainelli
2017-05-19 21:00 ` [PATCH net-next 20/20] net: dsa: add VLAN notifier Vivien Didelot
2017-05-22 19:41   ` Florian Fainelli
2017-05-22 14:45 ` [PATCH net-next 00/20] net: dsa: distribute switch events David Miller
2017-05-22 14:48   ` Andrew Lunn
2017-05-22 20:01 ` Florian Fainelli
2017-05-22 23:31   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).