mbox series

[net-next,v3,0/7] mv88e6xxx: Add per port devlink regions

Message ID 20201004161257.13945-1-andrew@lunn.ch
Headers show
Series mv88e6xxx: Add per port devlink regions | expand

Message

Andrew Lunn Oct. 4, 2020, 4:12 p.m. UTC
This patchset extends devlink regions to support per port regions, and
them makes use of them to support the ports of the mv88e6xxx switches.

root@rap:~# devlink region show
mdio_bus/gpio-0:00/global1: size 64 snapshot []
mdio_bus/gpio-0:00/global2: size 64 snapshot []
mdio_bus/gpio-0:00/atu: size 49152 snapshot []
mdio_bus/gpio-0:00/0/port: size 64 snapshot []
mdio_bus/gpio-0:00/1/port: size 64 snapshot []
mdio_bus/gpio-0:00/2/port: size 64 snapshot []
mdio_bus/gpio-0:00/3/port: size 64 snapshot []
mdio_bus/gpio-0:00/4/port: size 64 snapshot []
mdio_bus/gpio-0:00/5/port: size 64 snapshot []
mdio_bus/gpio-0:00/6/port: size 64 snapshot []
mdio_bus/gpio-0:00/7/port: size 64 snapshot []
mdio_bus/gpio-0:00/8/port: size 64 snapshot []
mdio_bus/gpio-0:00/9/port: size 64 snapshot []
mdio_bus/gpio-0:00/10/port: size 64 snapshot []

root@rap:~# devlink region new mdio_bus/gpio-0:00/1/port snapshot 42
root@rap:~# devlink region dump mdio_bus/gpio-0:00/1/port snapshot 42
0000000000000000 4f 1e 3e 20 00 01 01 39 3f 05 00 00 fd 07 00 00
0000000000000010 80 00 01 00 00 00 00 00 00 00 00 00 00 00 00 91
0000000000000020 00 00 00 00 00 00 00 00 00 00 00 00 22 00 00 00
0000000000000030 07 3e 00 00 00 00 00 80 00 00 00 00 00 00 5b 00

In order to support all ports of the switch, a new devlink flavour has
been added for unused ports:

mdio_bus/gpio-0:00/0: type notset flavour unused splittable false
mdio_bus/gpio-0:00/1: type notset flavour cpu port 1 splittable false
mdio_bus/gpio-0:00/2: type eth netdev red flavour physical port 2 splittable fae
mdio_bus/gpio-0:00/3: type eth netdev blue flavour physical port 3 splittable fe
mdio_bus/gpio-0:00/4: type eth netdev green flavour physical port 4 splittable e
mdio_bus/gpio-0:00/5: type notset flavour unused splittable false
mdio_bus/gpio-0:00/6: type notset flavour unused splittable false
mdio_bus/gpio-0:00/7: type notset flavour unused splittable false
mdio_bus/gpio-0:00/8: type eth netdev waic0 flavour physical port 8 splittable e
mdio_bus/gpio-0:00/9: type notset flavour unused splittable false
mdio_bus/gpio-0:00/10: type notset flavour unused splittable false

The DSA core now creates the devlink port instances earlier, so that
the driver setup function can make use of them.

v3:
Whitespace cleanup
Added justification for devlink unused flavour
Added Tested-by, Reviewed-by:

Andrew Lunn (7):
  net: devlink: Add unused port flavour
  net: dsa: Make use of devlink port flavour unused
  net: dsa: Register devlink ports before calling DSA driver setup()
  net: devlink: Add support for port regions
  net: dsa: Add devlink port regions support to DSA
  net: dsa: Add helper for converting devlink port to ds and port
  net: dsa: mv88e6xxx: Add per port devlink regions

 drivers/net/dsa/mv88e6xxx/devlink.c | 109 +++++++++++-
 include/net/devlink.h               |  27 +++
 include/net/dsa.h                   |  20 +++
 include/uapi/linux/devlink.h        |   3 +
 net/core/devlink.c                  | 254 +++++++++++++++++++++++++---
 net/dsa/dsa.c                       |  14 ++
 net/dsa/dsa2.c                      | 115 ++++++++-----
 7 files changed, 468 insertions(+), 74 deletions(-)

Comments

David Miller Oct. 4, 2020, 9:39 p.m. UTC | #1
From: Andrew Lunn <andrew@lunn.ch>
Date: Sun,  4 Oct 2020 18:12:50 +0200

> This patchset extends devlink regions to support per port regions, and
> them makes use of them to support the ports of the mv88e6xxx switches.
 ...

Series applied, thanks!