lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <IA3PR11MB89861F9E74B15B19734A12A1E5D6A@IA3PR11MB8986.namprd11.prod.outlook.com>
Date: Tue, 18 Nov 2025 07:27:03 +0000
From: "Loktionov, Aleksandr" <aleksandr.loktionov@...el.com>
To: Daniel Zahka <daniel.zahka@...il.com>, Jiri Pirko <jiri@...nulli.us>,
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, "Simon
 Horman" <horms@...nel.org>, Jonathan Corbet <corbet@....net>, Srujana Challa
	<schalla@...vell.com>, Bharat Bhushan <bbhushan2@...vell.com>, Herbert Xu
	<herbert@...dor.apana.org.au>, Brett Creeley <brett.creeley@....com>, "Andrew
 Lunn" <andrew+netdev@...n.ch>, Michael Chan <michael.chan@...adcom.com>,
	Pavan Chebbi <pavan.chebbi@...adcom.com>, "Nguyen, Anthony L"
	<anthony.l.nguyen@...el.com>, "Kitszel, Przemyslaw"
	<przemyslaw.kitszel@...el.com>, "Goutham, Sunil Kovvuri"
	<sgoutham@...vell.com>, Linu Cherian <lcherian@...vell.com>, Geetha sowjanya
	<gakula@...vell.com>, Jerin Jacob <jerinj@...vell.com>, hariprasad
	<hkelam@...vell.com>, Subbaraya Sundeep <sbhatta@...vell.com>, Tariq Toukan
	<tariqt@...dia.com>, Saeed Mahameed <saeedm@...dia.com>, Leon Romanovsky
	<leon@...nel.org>, Mark Bloch <mbloch@...dia.com>, Ido Schimmel
	<idosch@...dia.com>, Petr Machata <petrm@...dia.com>, Manish Chopra
	<manishc@...vell.com>, Maxime Coquelin <mcoquelin.stm32@...il.com>, Alexandre
 Torgue <alexandre.torgue@...s.st.com>, Siddharth Vadapalli
	<s-vadapalli@...com>, Roger Quadros <rogerq@...nel.org>, Loic Poulain
	<loic.poulain@....qualcomm.com>, Sergey Ryazanov <ryazanov.s.a@...il.com>,
	Johannes Berg <johannes@...solutions.net>, Vladimir Oltean
	<olteanv@...il.com>, Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>,
	"Ertman, David M" <david.m.ertman@...el.com>, Vlad Dumitrescu
	<vdumitrescu@...dia.com>, "Russell King (Oracle)"
	<rmk+kernel@...linux.org.uk>, Alexander Sverdlin
	<alexander.sverdlin@...il.com>, Lorenzo Bianconi <lorenzo@...nel.org>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	"linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>
Subject: RE: [PATCH net-next v4 3/6] devlink: support default values for
 param-get and param-set



> -----Original Message-----
> From: Daniel Zahka <daniel.zahka@...il.com>
> Sent: Tuesday, November 18, 2025 1:24 AM
> To: Jiri Pirko <jiri@...nulli.us>; David S. Miller
> <davem@...emloft.net>; Eric Dumazet <edumazet@...gle.com>; Jakub
> Kicinski <kuba@...nel.org>; Paolo Abeni <pabeni@...hat.com>; Simon
> Horman <horms@...nel.org>; Jonathan Corbet <corbet@....net>; Srujana
> Challa <schalla@...vell.com>; Bharat Bhushan <bbhushan2@...vell.com>;
> Herbert Xu <herbert@...dor.apana.org.au>; Brett Creeley
> <brett.creeley@....com>; Andrew Lunn <andrew+netdev@...n.ch>; Michael
> Chan <michael.chan@...adcom.com>; Pavan Chebbi
> <pavan.chebbi@...adcom.com>; Nguyen, Anthony L
> <anthony.l.nguyen@...el.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@...el.com>; Goutham, Sunil Kovvuri
> <sgoutham@...vell.com>; Linu Cherian <lcherian@...vell.com>; Geetha
> sowjanya <gakula@...vell.com>; Jerin Jacob <jerinj@...vell.com>;
> hariprasad <hkelam@...vell.com>; Subbaraya Sundeep
> <sbhatta@...vell.com>; Tariq Toukan <tariqt@...dia.com>; Saeed
> Mahameed <saeedm@...dia.com>; Leon Romanovsky <leon@...nel.org>; Mark
> Bloch <mbloch@...dia.com>; Ido Schimmel <idosch@...dia.com>; Petr
> Machata <petrm@...dia.com>; Manish Chopra <manishc@...vell.com>;
> Maxime Coquelin <mcoquelin.stm32@...il.com>; Alexandre Torgue
> <alexandre.torgue@...s.st.com>; Siddharth Vadapalli <s-
> vadapalli@...com>; Roger Quadros <rogerq@...nel.org>; Loic Poulain
> <loic.poulain@....qualcomm.com>; Sergey Ryazanov
> <ryazanov.s.a@...il.com>; Johannes Berg <johannes@...solutions.net>;
> Vladimir Oltean <olteanv@...il.com>; Michal Swiatkowski
> <michal.swiatkowski@...ux.intel.com>; Loktionov, Aleksandr
> <aleksandr.loktionov@...el.com>; Ertman, David M
> <david.m.ertman@...el.com>; Vlad Dumitrescu <vdumitrescu@...dia.com>;
> Russell King (Oracle) <rmk+kernel@...linux.org.uk>; Alexander Sverdlin
> <alexander.sverdlin@...il.com>; Lorenzo Bianconi <lorenzo@...nel.org>
> Cc: netdev@...r.kernel.org; linux-doc@...r.kernel.org; linux-
> rdma@...r.kernel.org
> Subject: [PATCH net-next v4 3/6] devlink: support default values for
> param-get and param-set
> 
> Support querying and resetting to default param values.
> 
> Introduce two new devlink netlink attrs:
> DEVLINK_ATTR_PARAM_VALUE_DEFAULT and
> DEVLINK_ATTR_PARAM_RESET_DEFAULT. The former is used to contain an
> optional parameter value inside of the param_value nested attribute.
> The latter is used in param-set requests from userspace to indicate
> that the driver should reset the param to its default value.
> 
> To implement this, two new functions are added to the devlink driver
> api: devlink_param::get_default() and
> devlink_param::reset_default(). These callbacks allow drivers to
> implement default param actions for runtime and permanent cmodes. For
> driverinit params, the core latches the last value set by a driver via
> devl_param_driverinit_value_set(), and uses that as the default value
> for a param.
> 
> Because default parameter values are optional, it would be impossible
> to discern whether or not a param of type bool has default value of
> false or not provided if the default value is encoded using a netlink
> flag type. For this reason, when a DEVLINK_PARAM_TYPE_BOOL has an
> associated default value, the default value is encoded using a u8
> type.
> 
> Signed-off-by: Daniel Zahka <daniel.zahka@...il.com>
> ---
>  Documentation/netlink/specs/devlink.yaml      |   9 ++
>  .../networking/devlink/devlink-params.rst     |  10 ++
>  include/net/devlink.h                         |  42 +++++++
>  include/uapi/linux/devlink.h                  |   3 +
>  net/devlink/netlink_gen.c                     |   5 +-
>  net/devlink/param.c                           | 105 ++++++++++++++++-
> -
>  6 files changed, 160 insertions(+), 14 deletions(-)
> 
> diff --git a/Documentation/netlink/specs/devlink.yaml
> b/Documentation/netlink/specs/devlink.yaml
> index 426d5aa7d955..837112da6738 100644
> --- a/Documentation/netlink/specs/devlink.yaml
> +++ b/Documentation/netlink/specs/devlink.yaml
> @@ -859,6 +859,14 @@ attribute-sets:
>          name: health-reporter-burst-period
>          type: u64
>          doc: Time (in msec) for recoveries before starting the grace
> period.
> +

...

> diff --git a/include/uapi/linux/devlink.h
> b/include/uapi/linux/devlink.h index 157f11d3fb72..e7d6b6d13470 100644
> --- a/include/uapi/linux/devlink.h
> +++ b/include/uapi/linux/devlink.h
> @@ -639,6 +639,9 @@ enum devlink_attr {
> 
>  	DEVLINK_ATTR_HEALTH_REPORTER_BURST_PERIOD,	/* u64 */
> 
> +	DEVLINK_ATTR_PARAM_VALUE_DEFAULT,	/* dynamic */
> +	DEVLINK_ATTR_PARAM_RESET_DEFAULT,	/* flag */
> +
The patch introduces a new UAPI attribute DEVLINK_ATTR_PARAM_VALUE_DEFAULT but Documentation/netlink/specs/devlink.yaml only documents param-reset-default.
The spec should also describe the output attribute that appears in the nested param-value dump ("default" value), otherwise the generated tooling/specs are out of sync with UAPI and the committed generated C (netlink_gen.c).

I'm afraid you forgot to add a YAML entry for the nested attribute (e.g. under the param-value attribute set, typically alongside param-value-data and param-value-cmode), describing its type per param and the bool/u8 encoding rule covered in the commit message.
Am I right?

With the best regards
Alex

> --
> 2.47.3


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ