1. 19 May, 2018 6 commits
    • David S. Miller's avatar
      Merge branch 'devlink-port-flavours-and-phys_port_name' · 9d108841
      David S. Miller authored
      Jiri Pirko says:
      
      ====================
      devlink: introduce port flavours and common phys_port_name generation
      
      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:
      
      ...
      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:
      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
      ====================
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Tested-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9d108841
    • Jiri Pirko's avatar
      mlxsw: use devlink helper to generate physical port name · ec932fbd
      Jiri Pirko authored
      Since devlink knows the info needed to generate the physical port name
      in a generic way for all devlink users, use the helper to do the job.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ec932fbd
    • Jiri Pirko's avatar
      dsa: set devlink port attrs for dsa ports · da077392
      Jiri Pirko authored
      Set the attrs and allow to expose port flavour to user via devlink.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      da077392
    • Jiri Pirko's avatar
      devlink: introduce a helper to generate physical port names · 08474c1a
      Jiri Pirko authored
      Each driver implements physical port name generation by itself. However
      as devlink has all needed info, it can easily do the job for all its
      users. So implement this helper in devlink.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      08474c1a
    • Jiri Pirko's avatar
      devlink: extend attrs_set for setting port flavours · 5ec1380a
      Jiri Pirko authored
      Devlink ports can have specific flavour according to the purpose of use.
      This patch extend attrs_set so the driver can say which flavour port
      has. Initial flavours are:
      physical, cpu, dsa
      User can query this to see right away what is the purpose of each port.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5ec1380a
    • Jiri Pirko's avatar
      devlink: introduce devlink_port_attrs_set · b9ffcbaf
      Jiri Pirko authored
      Change existing setter for split port information into more generic
      attrs setter. Alongside with that, allow to set port number and subport
      number for split ports.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b9ffcbaf
  2. 18 May, 2018 34 commits