[PATCH iproute2-next v2 0/2] devlink: support default flag attr for param-get and param-set commands

Daniel Zahka posted 2 patches 14 hours ago
devlink/devlink.c      | 127 +++++++++++++++++++++++++++++++++++--------------
man/man8/devlink-dev.8 |  22 ++++++++-
2 files changed, 111 insertions(+), 38 deletions(-)
[PATCH iproute2-next v2 0/2] devlink: support default flag attr for param-get and param-set commands
Posted by Daniel Zahka 14 hours ago
Add cli support for default param values introduced in the
accompanying kernel series [1]. Here is some sample usage:

[1]: https://lore.kernel.org/netdev/20251119025038.651131-1-daniel.zahka@gmail.com/

 # dump params with defaults
./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

Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
---
Changes in v2:
- don't create format strings with snprintf()
- delete dead code for default handling of port params
- split uapi change into separate commit (this was already committed so not appearing here)
- Link to v1: https://lore.kernel.org/r/20251117-param-defaults-v1-0-c99604175d09@gmail.com

---
Daniel Zahka (2):
      devlink: Pull the value printing logic out of pr_out_param_value()
      devlink: support displaying and resetting to default params

 devlink/devlink.c      | 127 +++++++++++++++++++++++++++++++++++--------------
 man/man8/devlink-dev.8 |  22 ++++++++-
 2 files changed, 111 insertions(+), 38 deletions(-)
---
base-commit: cd01762163b719361ff7aeaa7f433ee94363497f
change-id: 20251112-param-defaults-d796ffdb572b

Best regards,
-- 
Daniel Zahka <daniel.zahka@gmail.com>