netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch net-next 0/5] devlink: introduce port flavours and common phys_port_name generation
@ 2018-05-18  7:28 Jiri Pirko
  2018-05-18  7:29 ` [patch net-next 1/5] devlink: introduce devlink_port_attrs_set Jiri Pirko
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Jiri Pirko @ 2018-05-18  7:28 UTC (permalink / raw)
  To: netdev
  Cc: davem, idosch, jakub.kicinski, mlxsw, andrew, vivien.didelot,
	f.fainelli, michael.chan, ganeshgr, saeedm, simon.horman,
	pieter.jansenvanvuuren, john.hurley, dirk.vandermerwe,
	alexander.h.duyck, ogerlitz, dsahern, vijaya.guvva,
	satananda.burla, raghu.vatsavayi, felix.manlunas, gospo,
	sathya.perla, vasundhara-v.volam, tariqt, eranbe,
	jeffrey.t.kirsher, roopa

From: Jiri Pirko <jiri@mellanox.com>

This patchset resolves 2 issues we have right now:
1) There are many netdevices / ports in the system, for port, pf, vf
   represenatation but the user has no way to see which is which
2) The ndo_get_phys_port_name is implemented in each driver separatelly,
   which may lead to inconsistent names between drivers.

This patchset introduces port flavours which should address the first
problem. In this initial patchset, I focus on DSA and their port
flavours. As a follow-up, I plan to add PF and VF representor flavours.
However, that needs additional dependencies in drivers (nfp, mlx5).

The common phys_port_name generation is used by mlxsw. An example output
for mlxsw looks like this:

# devlink port
...
pci/0000:03:00.0/59: type eth netdev enp3s0np4 flavour physical number 4
pci/0000:03:00.0/61: type eth netdev enp3s0np1 flavour physical number 1
pci/0000:03:00.0/63: type eth netdev enp3s0np2 flavour physical number 2
pci/0000:03:00.0/49: type eth netdev enp3s0np8s0 flavour physical number 8 split_group 8 subport 0
pci/0000:03:00.0/50: type eth netdev enp3s0np8s1 flavour physical number 8 split_group 8 subport 1
pci/0000:03:00.0/51: type eth netdev enp3s0np8s2 flavour physical number 8 split_group 8 subport 2
pci/0000:03:00.0/52: type eth netdev enp3s0np8s3 flavour physical number 8 split_group 8 subport 3

As you can see, the netdev names are generated according to the flavour
and port number. In case the port is split, the split subnumber is also
included.

An example output for dsa_loop testing module looks like this:
# devlink port
mdio_bus/fixed-0:1f/0: type eth netdev lan1 flavour physical number 0
mdio_bus/fixed-0:1f/1: type eth netdev lan2 flavour physical number 1
mdio_bus/fixed-0:1f/2: type eth netdev lan3 flavour physical number 2
mdio_bus/fixed-0:1f/3: type eth netdev lan4 flavour physical number 3
mdio_bus/fixed-0:1f/4: type notset
mdio_bus/fixed-0:1f/5: type notset flavour cpu number 5
mdio_bus/fixed-0:1f/6: type notset
mdio_bus/fixed-0:1f/7: type notset
mdio_bus/fixed-0:1f/8: type notset
mdio_bus/fixed-0:1f/9: type notset
mdio_bus/fixed-0:1f/10: type notset
mdio_bus/fixed-0:1f/11: type notset

---
RFC->v1:
-removed nfp patches, removed DSA patch that used name generation helper
-patch 1:
 - Reduced the nfp change just to simply use newly created attr_set func
-patch 2:
 - rebased
 - removed pf/vf reps flavours
-patch 3:
 - rebased
-patch 4:
 - added missing break pointed out by Andrew

Jiri Pirko (5):
  devlink: introduce devlink_port_attrs_set
  devlink: extend attrs_set for setting port flavours
  devlink: introduce a helper to generate physical port names
  dsa: set devlink port attrs for dsa ports
  mlxsw: use devlink helper to generate physical port name

 drivers/net/ethernet/mellanox/mlxsw/core.c       | 18 ++++-
 drivers/net/ethernet/mellanox/mlxsw/core.h       |  5 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c   | 21 ++----
 drivers/net/ethernet/mellanox/mlxsw/switchx2.c   | 11 ++-
 drivers/net/ethernet/netronome/nfp/nfp_devlink.c |  5 +-
 include/net/devlink.h                            | 32 +++++++--
 include/uapi/linux/devlink.h                     | 14 ++++
 net/core/devlink.c                               | 86 +++++++++++++++++++++---
 net/dsa/dsa2.c                                   | 24 +++++++
 9 files changed, 170 insertions(+), 46 deletions(-)

-- 
2.14.3

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

end of thread, other threads:[~2018-05-19 20:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-18  7:28 [patch net-next 0/5] devlink: introduce port flavours and common phys_port_name generation Jiri Pirko
2018-05-18  7:29 ` [patch net-next 1/5] devlink: introduce devlink_port_attrs_set Jiri Pirko
2018-05-18  7:29 ` [patch net-next 2/5] devlink: extend attrs_set for setting port flavours Jiri Pirko
2018-05-18  7:29 ` [patch net-next 3/5] devlink: introduce a helper to generate physical port names Jiri Pirko
2018-05-18  7:29 ` [patch net-next 4/5] dsa: set devlink port attrs for dsa ports Jiri Pirko
2018-05-18  7:29 ` [patch net-next 5/5] mlxsw: use devlink helper to generate physical port name Jiri Pirko
2018-05-18 21:16 ` [patch net-next 0/5] devlink: introduce port flavours and common phys_port_name generation Jakub Kicinski
2018-05-19  3:34 ` Florian Fainelli
2018-05-19 20: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).