From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: [patch net-next 0/5] devlink: introduce port flavours and common phys_port_name generation Date: Fri, 18 May 2018 20:34:25 -0700 Message-ID: References: <20180518072904.29523-1-jiri@resnulli.us> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: davem@davemloft.net, idosch@mellanox.com, jakub.kicinski@netronome.com, mlxsw@mellanox.com, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, michael.chan@broadcom.com, ganeshgr@chelsio.com, saeedm@mellanox.com, simon.horman@netronome.com, pieter.jansenvanvuuren@netronome.com, john.hurley@netronome.com, dirk.vandermerwe@netronome.com, alexander.h.duyck@intel.com, ogerlitz@mellanox.com, dsahern@gmail.com, vijaya.guvva@cavium.com, satananda.burla@cavium.com, raghu.vatsavayi@cavium.com, felix.manlunas@cavium.com, gospo@broadcom.com, sathya.perla@broadcom.com, vasundhara-v.volam@broadcom.com, tariqt@mellanox.com, eranbe@mellanox.com, jeffrey.t.kirsher@intel.com, roopa@cumulusnetworks.com To: Jiri Pirko , netdev@vger.kernel.org Return-path: Received: from mail-oi0-f41.google.com ([209.85.218.41]:34551 "EHLO mail-oi0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752129AbeESDeb (ORCPT ); Fri, 18 May 2018 23:34:31 -0400 Received: by mail-oi0-f41.google.com with SMTP id l1-v6so8833200oii.1 for ; Fri, 18 May 2018 20:34:31 -0700 (PDT) In-Reply-To: <20180518072904.29523-1-jiri@resnulli.us> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 05/18/2018 12:28 AM, Jiri Pirko wrote: > From: Jiri Pirko > > 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 Reviewed-by: Florian Fainelli Tested-by: Florian Fainelli Thanks! -- Florian