Skip to content

expose devlink instances relationships

Jiri Pirko netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest12 patches 1 replyApplied 12/12

Patches in v2 All 12 applied

#Subject and filesSizeRepliesApplied
1/12devlink: move linecard struct into linecard.cnet/devlink/devl_internal.h net/devlink/linecard.c net/devlink/port.c+22 -150 repliesApplied
2/12net/mlx5: Disable eswitch as the first thing in mlx5_unload()drivers/net/ethernet/mellanox/mlx5/core/main.c+1 -10 repliesApplied
3/12net/mlx5: Lift reload limitation when SFs are presentdrivers/net/ethernet/mellanox/mlx5/core/devlink.c+0 -110 repliesApplied
4/12devlink: put netnsid to nested handlenet/devlink/linecard.c+11 -20 repliesApplied
5/12devlink: move devlink_nl_put_nested_handle() into netlink.cnet/devlink/devl_internal.h net/devlink/linecard.c net/devlink/netlink.c+28 -260 repliesApplied
6/12devlink: extend devlink_nl_put_nested_handle() with attrtype argnet/devlink/devl_internal.h net/devlink/linecard.c net/devlink/netlink.c+5 -40 repliesApplied
7/12devlink: introduce object and nested devlink relationship infranet/devlink/core.c net/devlink/dev.c net/devlink/devl_internal.h+233 -00 repliesApplied
8/12devlink: expose peer SF devlink instanceinclude/net/devlink.h include/uapi/linux/devlink.h net/devlink/port.c+55 -00 repliesApplied
9/12net/mlx5: SF, Implement peer devlink set for SF representor devlink portdrivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.h drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c +1 more+67 -00 repliesApplied
10/12devlink: convert linecard nested devlink to new rel infrastructuredrivers/net/ethernet/mellanox/mlxsw/core_linecard_dev.c include/net/devlink.h net/devlink/linecard.c+42 -180 repliesApplied
11/12devlink: introduce possibility to expose info about nested devlinksinclude/net/devlink.h net/devlink/core.c net/devlink/dev.c +1 more+54 -00 repliesApplied
12/12net/mlx5e: Set en auxiliary devlink instance as nesteddrivers/net/ethernet/mellanox/mlx5/core/en/devlink.c+8 -00 repliesApplied

Reviews trailers per patch

None of the 12 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchSimon Horman
SeriesR-b
1/12
2/12
3/12
4/12
5/12
6/12
7/12
8/12
9/12
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [patch net-next v2 00/12] expose devlink instances relationships

From: Jiri Pirko <[email protected]>

Currently, the user can instantiate new SF using "devlink port add" command. That creates an E-switch representor devlink port.

When user activates this SF, there is an auxiliary device created and probed for it which leads to SF devlink instance creation.

There is 1:1 relationship between E-switch representor devlink port and the SF auxiliary device devlink instance.

Also, for example in mlx5, one devlink instance is created for PCI device and one is created for an auxiliary device that represents the uplink port. The relation between these is invisible to the user.

Patches #1-#3 and #5 are small preparations.

Patch #4 adds netnsid attribute for nested devlink if that in a different namespace.

Patch #5 is the main one in this set, introduces the relationship tracking infrastructure later on used to track SFs, linecards and devlink instance relationships with nested devlink instances.

Expose the relation to the user by introducing new netlink attribute DEVLINK_PORT_FN_ATTR_DEVLINK which contains the devlink instance related to devlink port function. This is done by patch #8.
Patch #9 implements this in mlx5 driver.

Patch #10 converts the linecard nested devlink handling to the newly introduced rel infrastructure.

Patch #11 benefits from the rel infra and introduces possiblitily to have relation between devlink instances.
Patch #12 implements this in mlx5 driver.

Examples:

$ devlink dev
pci/0000:08:00.0: nested_devlink auxiliary/mlx5_core.eth.0
pci/0000:08:00.1: nested_devlink auxiliary/mlx5_core.eth.1
auxiliary/mlx5_core.eth.1
auxiliary/mlx5_core.eth.0
$ devlink port add pci/0000:08:00.0 flavour pcisf pfnum 0 sfnum 106
pci/0000:08:00.0/32768: type eth netdev eth4 flavour pcisf controller 0 pfnum 0 sfnum 106 splittable false
  function:
    hw_addr 00:00:00:00:00:00 state inactive opstate detached roce enable
$ devlink port function set pci/0000:08:00.0/32768 state active
$ devlink port show pci/0000:08:00.0/32768
pci/0000:08:00.0/32768: type eth netdev eth4 flavour pcisf controller 0 pfnum 0 sfnum 106 splittable false
  function:
    hw_addr 00:00:00:00:00:00 state active opstate attached roce enable nested_devlink auxiliary/mlx5_core.sf.2
# devlink dev reload auxiliary/mlx5_core.sf.2 netns ns1
$ devlink port show pci/0000:08:00.0/32768
pci/0000:08:00.0/32768: type eth netdev eth4 flavour pcisf controller 0 pfnum 0 sfnum 106 splittable false
  function:
    hw_addr 00:00:00:00:00:00 state active opstate attached roce enable nested_devlink auxiliary/mlx5_core.sf.2 nested_devlink_netns ns1

Jiri Pirko (12):
devlink: move linecard struct into linecard.c
net/mlx5: Disable eswitch as the first thing in mlx5_unload() net/mlx5: Lift reload limitation when SFs are present
devlink: put netnsid to nested handle
devlink: move devlink_nl_put_nested_handle() into netlink.c
devlink: extend devlink_nl_put_nested_handle() with attrtype arg
devlink: introduce object and nested devlink relationship infra
devlink: expose peer SF devlink instance
net/mlx5: SF, Implement peer devlink set for SF representor devlink
port
devlink: convert linecard nested devlink to new rel infrastructure
devlink: introduce possibility to expose info about nested devlinks net/mlx5e: Set en auxiliary devlink instance as nested

 .../net/ethernet/mellanox/mlx5/core/devlink.c |  11 -
 .../ethernet/mellanox/mlx5/core/en/devlink.c  |   8 +
 .../net/ethernet/mellanox/mlx5/core/main.c    |   2 +-
 .../ethernet/mellanox/mlx5/core/sf/dev/dev.h  |   6 +
 .../mellanox/mlx5/core/sf/dev/driver.c        |  26 +++
 .../ethernet/mellanox/mlx5/core/sf/devlink.c  |  34 +++
 .../mellanox/mlxsw/core_linecard_dev.c        |   9 +-
 include/linux/mlx5/device.h                   |   1 +
 include/net/devlink.h                         |   9 +-
 include/uapi/linux/devlink.h                  |   1 +
 net/devlink/core.c                            | 217 ++++++++++++++++++
 net/devlink/dev.c                             |  50 ++++
 net/devlink/devl_internal.h                   |  34 +--
 net/devlink/linecard.c                        |  80 ++++---
 net/devlink/netlink.c                         |  26 +++
 net/devlink/port.c                            |  55 ++++-
 16 files changed, 509 insertions(+), 60 deletions(-)
Signature · 1 line
2.41.0