Skip to content

devlink: net/mlx5: implement swp_l4_csum_mode via devlink params

Daniel Zahka linux-doc linux-rdma netdev 5 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. v5 Latest6 patches 0 repliesApplied 6/6
  2. v46 patches 7 repliesSuperseded
  3. v32 patches 17 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches9 repliesSuperseded
v11 patch6 repliesSuperseded

Changes in v5 from the cover letter

- use define instead of magic value for test2 param default handlers
v4: https://lore.kernel.org/netdev/[email protected]/
- add test case for default params.
- add new cmode runtime test param to netdevsim.
- introduce uapi and driver api for supporting default param values.
- rename device_default to default in mlx5 patch.
v3: https://lore.kernel.org/netdev/[email protected]/
- fix warnings about undocumented param in intel ice driver
v2: https://lore.kernel.org/netdev/[email protected]/
- fix indentation issue in new mlx5.rst entry
- use extack in mlx5_nv_param_devlink_swp_l4_csum_mode_get()
- introduce extack patch.
v1: https://lore.kernel.org/netdev/[email protected]/

Patches in v5 All 6 applied

#Subject and filesSizeRepliesApplied
1/6devlink: pass extack through to devlink_param::get()drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c drivers/net/ethernet/amd/pds_core/core.h drivers/net/ethernet/amd/pds_core/devlink.c +22 more+89 -460 repliesApplied
2/6devlink: refactor devlink_nl_param_value_fill_one()net/devlink/param.c+39 -310 repliesApplied
3/6devlink: support default values for param-get and param-setDocumentation/netlink/specs/devlink.yaml Documentation/networking/devlink/devlink-params.rst include/net/devlink.h +3 more+160 -140 repliesApplied
4/6net/mlx5: implement swp_l4_csum_mode via devlink paramsDocumentation/networking/devlink/mlx5.rst drivers/net/ethernet/mellanox/mlx5/core/devlink.h drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c+245 -10 repliesApplied
5/6netdevsim: register a new devlink param with default value interfacedrivers/net/netdevsim/dev.c drivers/net/netdevsim/netdevsim.h+57 -00 repliesApplied
6/6selftest: netdevsim: test devlink default paramstools/testing/selftests/drivers/net/netdevsim/devlink.sh+110 -60 repliesApplied

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by.

PatchSaeed MahameedAleksandr Loktionov
1/6R-b R-b
2/6
3/6
4/6R-b
5/6R-b
6/6

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

Read the v5 thread

Cover letter [PATCH net-next v5 0/6] devlink: net/mlx5: implement swp_l4_csum_mode via devlink params

This series introduces a new devlink feature for querying param default values, and resetting params to their default values. This feature is then used to implement a new mlx5 driver param.

The series starts with two pure refactor patches: one that passes through the extack to devlink_param::get() implementations. And a second small refactor that prepares the netlink tlv handling code in the devlink_param::get() path to better handle default parameter values.

The third patch introduces the uapi and driver api for default parameter values. The driver api is opt-in, and both the uapi and driver api preserve existing behavior when not used by drivers or userspace.

The fourth patch introduces a new mlx5 driver param, swp_l4_csum_mode, for controlling tx csum behavior. The "l4_only" value of this param is a dependency for PSP initialization on CX7 NICs.

Lastly, the series introduces a new driver param with cmode runtime to netdevsim, and then uses this param in a new testcase for netdevsim devlink params.

Here are some examples of using the default param uapi with the devlink cli. Note the devlink cli binary I am using has changes which I am posting in accompanying series targeting iproute2-next:

  # netdevsim
./devlink dev param show netdevsim/netdevsim0
netdevsim/netdevsim0:
  name max_macs type generic
    values:
      cmode driverinit value 32 default 32
  name test1 type driver-specific
    values:
      cmode driverinit value true default true
  # set to false
./devlink dev param set netdevsim/netdevsim0 name test1 value false cmode driverinit
./devlink dev param show netdevsim/netdevsim0
netdevsim/netdevsim0:
  name max_macs type generic
    values:
      cmode driverinit value 32 default 32
  name test1 type driver-specific
    values:
      cmode driverinit value false default true
  # set back to default
./devlink dev param set netdevsim/netdevsim0 name test1 default cmode driverinit
./devlink dev param show netdevsim/netdevsim0
netdevsim/netdevsim0:
  name max_macs type generic
    values:
      cmode driverinit value 32 default 32
  name test1 type driver-specific
    values:
      cmode driverinit value true default true
 # mlx5 params on cx7
./devlink dev param show pci/0000:01:00.0
pci/0000:01:00.0:
  name max_macs type generic
    values:
      cmode driverinit value 128 default 128
...
  name swp_l4_csum_mode type driver-specific
    values:
      cmode permanent value default default default
  # set to l4_only
./devlink dev param set pci/0000:01:00.0 name swp_l4_csum_mode value l4_only cmode permanent
./devlink dev param show pci/0000:01:00.0 name swp_l4_csum_mode
pci/0000:01:00.0:
  name swp_l4_csum_mode type driver-specific
    values:
      cmode permanent value l4_only default default
  # reset to default
./devlink dev param set pci/0000:01:00.0 name swp_l4_csum_mode default cmode permanent
./devlink dev param show pci/0000:01:00.0 name swp_l4_csum_mode
pci/0000:01:00.0:
  name swp_l4_csum_mode type driver-specific
    values:
      cmode permanent value default default default

CHANGES:
v5:
- use define instead of magic value for test2 param default handlers
v4: https://lore.kernel.org/netdev/[email protected]/
- add test case for default params.
- add new cmode runtime test param to netdevsim.
- introduce uapi and driver api for supporting default param values.
- rename device_default to default in mlx5 patch.
v3: https://lore.kernel.org/netdev/[email protected]/
- fix warnings about undocumented param in intel ice driver
v2: https://lore.kernel.org/netdev/[email protected]/
- fix indentation issue in new mlx5.rst entry
- use extack in mlx5_nv_param_devlink_swp_l4_csum_mode_get()
- introduce extack patch.
v1: https://lore.kernel.org/netdev/[email protected]/

Daniel Zahka (6):
devlink: pass extack through to devlink_param::get()
devlink: refactor devlink_nl_param_value_fill_one()
devlink: support default values for param-get and param-set net/mlx5: implement swp_l4_csum_mode via devlink params
netdevsim: register a new devlink param with default value interface
selftest: netdevsim: test devlink default params

 Documentation/netlink/specs/devlink.yaml      |   9 +
 .../networking/devlink/devlink-params.rst     |  10 +
 Documentation/networking/devlink/mlx5.rst     |  14 ++
 .../marvell/octeontx2/otx2_cpt_devlink.c      |   6 +-
 drivers/net/ethernet/amd/pds_core/core.h      |   3 +-
 drivers/net/ethernet/amd/pds_core/devlink.c   |   3 +-
 .../net/ethernet/broadcom/bnxt/bnxt_devlink.c |   6 +-
 .../net/ethernet/intel/i40e/i40e_devlink.c    |   3 +-
 .../net/ethernet/intel/ice/devlink/devlink.c  |  14 +-
 .../marvell/octeontx2/af/rvu_devlink.c        |  15 +-
 .../marvell/octeontx2/nic/otx2_devlink.c      |   6 +-
 drivers/net/ethernet/mellanox/mlx4/main.c     |   6 +-
 .../net/ethernet/mellanox/mlx5/core/devlink.h |   3 +-
 .../net/ethernet/mellanox/mlx5/core/eswitch.c |   3 +-
 .../mellanox/mlx5/core/eswitch_offloads.c     |   3 +-
 .../net/ethernet/mellanox/mlx5/core/fs_core.c |   3 +-
 .../ethernet/mellanox/mlx5/core/fw_reset.c    |   3 +-
 .../mellanox/mlx5/core/lib/nv_param.c         | 238 +++++++++++++++++-
 .../mellanox/mlxsw/spectrum_acl_tcam.c        |   3 +-
 .../ethernet/netronome/nfp/devlink_param.c    |   3 +-
 drivers/net/ethernet/qlogic/qed/qed_devlink.c |   3 +-
 .../net/ethernet/stmicro/stmmac/stmmac_main.c |   3 +-
 drivers/net/ethernet/ti/am65-cpsw-nuss.c      |   3 +-
 drivers/net/ethernet/ti/cpsw_new.c            |   6 +-
 drivers/net/netdevsim/dev.c                   |  56 +++++
 drivers/net/netdevsim/netdevsim.h             |   1 +
 drivers/net/wwan/iosm/iosm_ipc_devlink.c      |   3 +-
 include/net/devlink.h                         |  45 +++-
 include/net/dsa.h                             |   3 +-
 include/uapi/linux/devlink.h                  |   3 +
 net/devlink/netlink_gen.c                     |   5 +-
 net/devlink/param.c                           | 180 +++++++++----
 net/dsa/devlink.c                             |   3 +-
 .../drivers/net/netdevsim/devlink.sh          | 116 ++++++++-
 34 files changed, 693 insertions(+), 91 deletions(-)
Signature · 1 line
2.47.3