public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Zahka <daniel.zahka@gmail.com>
To: Jiri Pirko <jiri@resnulli.us>,
	"David S. Miller" <davem@davemloft.net>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,  Simon Horman <horms@kernel.org>,
	Donald Hunter <donald.hunter@gmail.com>,
	 David Ahern <dsahern@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Daniel Zahka <daniel.zahka@gmail.com>
Subject: [PATCH iproute2-next v2 0/2] devlink: support default flag attr for param-get and param-set commands
Date: Fri, 06 Feb 2026 13:11:28 -0800	[thread overview]
Message-ID: <20260206-param-defaults-v2-0-1ce78e2c5a31@gmail.com> (raw)

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>


             reply	other threads:[~2026-02-06 21:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 21:11 Daniel Zahka [this message]
2026-02-06 21:11 ` [PATCH iproute2-next v2 1/2] devlink: Pull the value printing logic out of pr_out_param_value() Daniel Zahka
2026-02-06 21:11 ` [PATCH iproute2-next v2 2/2] devlink: support displaying and resetting to default params Daniel Zahka
2026-02-19 17:00 ` [PATCH iproute2-next v2 0/2] devlink: support default flag attr for param-get and param-set commands patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260206-param-defaults-v2-0-1ce78e2c5a31@gmail.com \
    --to=daniel.zahka@gmail.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=horms@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox