# RE: \[PATCH net-next v4 0/6\] devlink: net/mlx5: implement swp\_l4\_csum\_mode via devlink params

- From: Loktionov, Aleksandr \<hidden\>
- Date: 2025-11-18 07:28:56 
- List: netdev
- Page: https://ratatoskr.run/netdev/2025/11/8534892
- Thread: https://ratatoskr.run/netdev/2025/11/8534876/t.md

```text


> -----Original Message-----
> From: Daniel Zahka <daniel.zahka@gmail.com>
> Sent: Tuesday, November 18, 2025 1:24 AM
> To: Jiri Pirko <jiri@resnulli.us>; David S. Miller
> [ref]; Eric Dumazet [ref]; Jakub
> Kicinski [ref]; Paolo Abeni [ref]; Simon
> Horman [ref]; Jonathan Corbet [ref]; Srujana
> Challa [ref]; Bharat Bhushan [ref];
> Herbert Xu [ref]; Brett Creeley
> [ref]; Andrew Lunn [ref]; Michael
> Chan [ref]; Pavan Chebbi
> [ref]; Nguyen, Anthony L
> [ref]; Kitszel, Przemyslaw
> [ref]; Goutham, Sunil Kovvuri
> [ref]; Linu Cherian [ref]; Geetha
> sowjanya [ref]; Jerin Jacob [ref];
> hariprasad [ref]; Subbaraya Sundeep
> [ref]; Tariq Toukan [ref]; Saeed
> Mahameed [ref]; Leon Romanovsky [ref]; Mark
> Bloch [ref]; Ido Schimmel [ref]; Petr
> Machata [ref]; Manish Chopra [ref];
> Maxime Coquelin [ref]; Alexandre Torgue
> [ref]; Siddharth Vadapalli <s-
> vadapalli@ti.com>; Roger Quadros [ref]; Loic Poulain
> [ref]; Sergey Ryazanov
> [ref]; Johannes Berg [ref];
> Vladimir Oltean [ref]; Michal Swiatkowski
> [ref]; Loktionov, Aleksandr
> [ref]; Ertman, David M
> [ref]; Vlad Dumitrescu [ref];
> Russell King (Oracle) [ref]; Alexander Sverdlin
> [ref]; Lorenzo Bianconi [ref]
> Cc: <redacted>; <redacted>; linux-
> rdma@vger.kernel.org
> Subject: [PATCH net-next v4 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
> older userapace binaries.

“older userapace binaries” → userspace.
“introduces the a new mlx5 driver param” → the (or drop “the”)
 
It's minor, but trivial to fix before applying; also helps searchability in lore.

With the best regards
Alex

> The fourth patch introduces the 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:
> v4:
>   - 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/20251107204347.4060542-1-
> daniel.zahka@gmail.com/
>   - fix warnings about undocumented param in intel ice driver
> v2: https://lore.kernel.org/netdev/20251103194554.3203178-1-
> daniel.zahka@gmail.com/
>   - 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/20251022190932.1073898-1-
> daniel.zahka@gmail.com/
> 
> 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                   |  55 ++++
>  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          | 113 ++++++++-
>  34 files changed, 689 insertions(+), 91 deletions(-)
> 
> --
> 2.47.3

```
