All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch net-next RFC 00/12] devlink: introduce port flavours and common phys_port_name generation
@ 2018-03-22 10:55 Jiri Pirko
  2018-03-22 10:55 ` [patch net-next RFC 01/12] devlink: introduce devlink_port_attrs_set Jiri Pirko
                   ` (18 more replies)
  0 siblings, 19 replies; 74+ messages in thread
From: Jiri Pirko @ 2018-03-22 10:55 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

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. I'm testing this with Netronome nfp hardware. When the user
has 2 physical ports, 1 pf, and 4 vfs, he should see something like this:
# devlink port
pci/0000:05:00.0/0: type eth netdev enp5s0np0 flavour physical number 0
pci/0000:05:00.0/268435456: type eth netdev eth0 flavour physical number 0
pci/0000:05:00.0/268435460: type eth netdev enp5s0np1 flavour physical number 1
pci/0000:05:00.0/536875008: type eth netdev eth2 flavour pf_rep number 536875008
pci/0000:05:00.0/536870912: type eth netdev eth1 flavour vf_rep number 0
pci/0000:05:00.0/536870976: type eth netdev eth3 flavour vf_rep number 1
pci/0000:05:00.0/536871040: type eth netdev eth4 flavour vf_rep number 2
pci/0000:05:00.0/536871104: type eth netdev eth5 flavour vf_rep number 3

The indexes are weird numbers now. That needs to be fixed. Also, netdev
renaming does not work correctly for me now for some reason.
Also, there is one extra port that I don't understand what
is the purpose for it - something nfp specific perhaps.

The desired output should look like this:
# devlink port
pci/0000:05:00.0/0: type eth netdev enp5s0np0 flavour physical number 0
pci/0000:05:00.0/1: type eth netdev enp5s0np1 flavour physical number 1
pci/0000:05:00.0/2: type eth netdev enp5s0npf0 flavour pf_rep number 0
pci/0000:05:00.0/3: type eth netdev enp5s0nvf0 flavour vf_rep number 0
pci/0000:05:00.0/4: type eth netdev enp5s0nvf1 flavour vf_rep number 1
pci/0000:05:00.0/5: type eth netdev enp5s0nvf2 flavour vf_rep number 2
pci/0000:05:00.0/6: type eth netdev enp5s0nvf3 flavour vf_rep number 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.

I tested this for mlxsw and nfp. I have no way to test this on DSA hw,
I would really appretiate DSA guys to test this. Thanks!

Jiri Pirko (12):
  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
  dsa: use devlink helper to generate physical port name
  mlxsw: use devlink helper to generate physical port name
  nfp: flower: fix error path during representor creation
  nfp: set eth_id for representors to avoid port index conflict
  nfp: register devlink port for VF/PF representors
  nfp: flower: create port for flower vnic
  nfp: use devlink helper to generate physical port name
  nfp: flower: set sysfs link to device for representors

 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/flower/main.c  | 17 ++++-
 drivers/net/ethernet/netronome/nfp/nfp_devlink.c  | 45 +++++++++--
 drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 19 ++++-
 drivers/net/ethernet/netronome/nfp/nfp_net_repr.h |  1 +
 drivers/net/ethernet/netronome/nfp/nfp_port.c     | 30 +-------
 include/net/devlink.h                             | 32 ++++++--
 include/uapi/linux/devlink.h                      | 22 ++++++
 net/core/devlink.c                                | 92 ++++++++++++++++++++---
 net/dsa/dsa2.c                                    | 23 ++++++
 net/dsa/slave.c                                   |  6 +-
 14 files changed, 252 insertions(+), 90 deletions(-)

-- 
2.14.3

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

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

Thread overview: 74+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-22 10:55 [patch net-next RFC 00/12] devlink: introduce port flavours and common phys_port_name generation Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 01/12] devlink: introduce devlink_port_attrs_set Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 02/12] devlink: extend attrs_set for setting port flavours Jiri Pirko
2018-03-23  3:36   ` Jakub Kicinski
2018-03-23  6:30     ` Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 03/12] devlink: introduce a helper to generate physical port names Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 04/12] dsa: set devlink port attrs for dsa ports Jiri Pirko
2018-03-23 13:19   ` Andrew Lunn
2018-03-23 13:30   ` Andrew Lunn
2018-03-23 14:49     ` Jiri Pirko
2018-03-23 17:09       ` Florian Fainelli
2018-03-24  7:28         ` Jiri Pirko
2018-05-17 14:02         ` Jiri Pirko
2018-05-17 14:08           ` Florian Fainelli
2018-05-17 14:30             ` Jiri Pirko
2018-05-17 14:48               ` Andrew Lunn
2018-05-17 16:37                 ` Jiri Pirko
2018-05-17 14:51               ` Florian Fainelli
2018-05-17 17:39                 ` Jiri Pirko
2018-05-17 19:14                   ` Florian Fainelli
2018-05-17 20:28                     ` Andrew Lunn
2018-05-17 20:48                     ` Jiri Pirko
2018-05-17 21:08                       ` Andrew Lunn
2018-05-17 22:06                         ` Florian Fainelli
2018-05-17 22:40                           ` Andrew Lunn
2018-05-17 22:45                             ` Florian Fainelli
2018-05-18  1:41                               ` Andrew Lunn
2018-05-18  6:37                                 ` Jiri Pirko
2018-05-18 13:45                                   ` Andrew Lunn
2018-05-19  3:11                                     ` Florian Fainelli
2018-05-18  6:55                             ` Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 05/12] dsa: use devlink helper to generate physical port name Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 06/12] mlxsw: " Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 07/12] nfp: flower: fix error path during representor creation Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 08/12] nfp: set eth_id for representors to avoid port index conflict Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 09/12] nfp: register devlink port for VF/PF representors Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 10/12] nfp: flower: create port for flower vnic Jiri Pirko
2018-03-23  3:38   ` Jakub Kicinski
2018-03-23  6:29     ` Jiri Pirko
2018-03-24  3:32       ` Jakub Kicinski
2018-03-24  7:41         ` Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 11/12] nfp: use devlink helper to generate physical port name Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 12/12] nfp: flower: set sysfs link to device for representors Jiri Pirko
2018-03-22 14:40 ` [patch net-next RFC 00/12] devlink: introduce port flavours and common phys_port_name generation Roopa Prabhu
2018-03-22 14:58   ` Jiri Pirko
2018-03-22 15:34 ` David Ahern
2018-03-22 15:51   ` Roopa Prabhu
2018-03-22 17:49   ` Jiri Pirko
2018-03-22 19:10     ` David Ahern
2018-03-22 19:25       ` Andy Gospodarek
2018-05-17  8:47         ` Jiri Pirko
2018-03-23  6:34       ` Jiri Pirko
2018-03-22 23:35 ` Andrew Lunn
2018-03-23  6:35   ` [patch iproute2 rfc 1/2] devlink: introduce support for showing port flavours Jiri Pirko
2018-03-27 15:28     ` Stephen Hemminger
2018-03-23  6:35   ` [patch iproute2 rfc 2/2] devlink: introduce support for showing port number and split subport number Jiri Pirko
2018-03-23  3:34 ` [patch net-next RFC 00/12] devlink: introduce port flavours and common phys_port_name generation Jakub Kicinski
2018-03-23  6:37   ` Jiri Pirko
2018-03-23 13:43 ` Andrew Lunn
2018-03-23 14:59   ` Jiri Pirko
2018-03-23 15:24     ` Andrew Lunn
2018-03-24  7:45       ` Jiri Pirko
2018-03-24 14:35         ` Florian Fainelli
2018-03-24 16:07           ` Jiri Pirko
2018-03-24 17:07             ` Florian Fainelli
2018-03-24 17:42               ` Jiri Pirko
2018-03-24 19:00                 ` Andrew Lunn
2018-03-24 20:05                   ` Florian Fainelli
2018-03-24 14:40         ` Andrew Lunn
2018-03-24 16:04           ` Jiri Pirko
2018-03-28  5:02 ` Stephen Hemminger
2018-03-28  6:17   ` Jiri Pirko
2018-04-17 13:23 ` Or Gerlitz
2018-04-17 23:42   ` Jakub Kicinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.