Skip to content

devlink: move port ops into separate structure

Jiri Pirko netdev 2 versions – 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 · linked by author and title

  1. v2 Latest15 patches 14 repliesApplied 15/15
  2. v115 patches 19 repliesSuperseded

Changes in v2 from the cover letter

- see individual patches, there are 2 cosmetical changes basically:
- fixed function names in kdoc comments
- use dummy empty ops in case ops is null

Patches in v2 All 15 applied

#Subject and filesSizeRepliesApplied
1/15devlink: introduce port ops placeholderinclude/net/devlink.h net/devlink/leftover.c+54 -170 repliesApplied
2/15ice: register devlink port for PF with opsdrivers/net/ethernet/intel/ice/ice_devlink.c+5 -12 repliesApplied
3/15mlxsw_core: register devlink port with opsdrivers/net/ethernet/mellanox/mlxsw/core.c+5 -10 repliesApplied
4/15nfp: devlink: register devlink port with opsdrivers/net/ethernet/netronome/nfp/nfp_devlink.c+5 -10 repliesApplied
5/15devlink: move port_split/unsplit() ops into devlink_port_opsdrivers/net/ethernet/intel/ice/ice_devlink.c drivers/net/ethernet/mellanox/mlxsw/core.c drivers/net/ethernet/netronome/nfp/nfp_devlink.c +2 more+18 -150 repliesApplied
6/15mlx4: register devlink port with opsdrivers/net/ethernet/mellanox/mlx4/main.c+5 -10 repliesApplied
7/15devlink: move port_type_set() op into devlink_port_opsdrivers/net/ethernet/mellanox/mlx4/main.c include/net/devlink.h net/devlink/leftover.c+31 -310 repliesApplied
8/15sfc: register devlink port with opsdrivers/net/ethernet/sfc/efx_devlink.c+7 -11 replyApplied
9/15mlx5: register devlink ports with opsdrivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c+10 -20 repliesApplied
10/15devlink: move port_fn_hw_addr_get/set() to devlink_port_opsdrivers/net/ethernet/mellanox/mlx5/core/devlink.c drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +4 more+80 -891 replyApplied
11/15devlink: move port_fn_roce_get/set() to devlink_port_opsdrivers/net/ethernet/mellanox/mlx5/core/devlink.c drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c include/net/devlink.h +1 more+25 -290 repliesApplied
12/15devlink: move port_fn_migratable_get/set() to devlink_port_opsdrivers/net/ethernet/mellanox/mlx5/core/devlink.c drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c include/net/devlink.h +1 more+26 -360 repliesApplied
13/15devlink: move port_fn_state_get/set() to devlink_port_opsdrivers/net/ethernet/mellanox/mlx5/core/devlink.c drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c include/net/devlink.h +1 more+26 -440 repliesApplied
14/15devlink: move port_del() to devlink_port_opsdrivers/net/ethernet/mellanox/mlx5/core/devlink.c drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c include/net/devlink.h +1 more+11 -2110 repliesApplied
15/15devlink: save devlink_port_ops into a variable in devlink_port_function_validate()net/devlink/leftover.c+5 -50 repliesApplied

Reviews trailers per patch

4 of 15 patches have a Reviewed-by or Acked-by.

PatchJesse BrandeburgPetr MachataMichal WilczynskiMartin Habets
1/15
2/15R-b R-b
3/15R-b T-b
4/15
5/15
6/15
7/15
8/15A-b
9/15
10/15A-b
11/15
12/15
13/15
14/15
15/15

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [patch net-next v2 00/15] devlink: move port ops into separate structure

From: Jiri Pirko <[email protected]>

In devlink, some of the objects have separate ops registered alongside with the object itself. Port however have ops in devlink_ops structure. For drivers what register multiple kinds of ports with different ops this is not convenient.

This patchset changes does following changes:
1) Introduces devlink_port_ops with functions that allow devlink port to be registered passing a pointer to driver port ops. (patch #1)
2) Converts drivers to define port_ops and register ports passing the ops pointer. (patches #2, #3, #4, #6, #8, and #9)
3) Moves ops from devlink_ops struct to devlink_port_ops. (patches #5, #7, #10-15)

No functional changes.

---
v1->v2:
- see individual patches, there are 2 cosmetical changes basically:
- fixed function names in kdoc comments
- use dummy empty ops in case ops is null

Jiri Pirko (15):
devlink: introduce port ops placeholder
ice: register devlink port for PF with ops
mlxsw_core: register devlink port with ops
nfp: devlink: register devlink port with ops
devlink: move port_split/unsplit() ops into devlink_port_ops
mlx4: register devlink port with ops
devlink: move port_type_set() op into devlink_port_ops
sfc: register devlink port with ops
mlx5: register devlink ports with ops
devlink: move port_fn_hw_addr_get/set() to devlink_port_ops
devlink: move port_fn_roce_get/set() to devlink_port_ops
devlink: move port_fn_migratable_get/set() to devlink_port_ops
devlink: move port_fn_state_get/set() to devlink_port_ops
devlink: move port_del() to devlink_port_ops
devlink: save devlink_port_ops into a variable in
devlink_port_function_validate()

 drivers/net/ethernet/intel/ice/ice_devlink.c  |  10 +-
 drivers/net/ethernet/mellanox/mlx4/main.c     |  58 ++---
 .../net/ethernet/mellanox/mlx5/core/devlink.c |   9 -
 .../mellanox/mlx5/core/esw/devlink_port.c     |  29 ++-
 .../net/ethernet/mellanox/mlx5/core/eswitch.h |  12 +-
 .../mellanox/mlx5/core/eswitch_offloads.c     |  12 +-
 drivers/net/ethernet/mellanox/mlxsw/core.c    |  10 +-
 .../net/ethernet/netronome/nfp/nfp_devlink.c  |  10 +-
 drivers/net/ethernet/sfc/efx_devlink.c        |  80 +++---
 include/net/devlink.h                         | 228 +++++++++---------
 net/devlink/leftover.c                        | 119 +++++----
 11 files changed, 298 insertions(+), 279 deletions(-)
Signature · 1 line
2.39.2