diff mbox series

[net-next,1/6] devlink: extend devlink_param *set pointer

Message ID 20240422203913.225151-2-anthony.l.nguyen@intel.com (mailing list archive)
State Accepted
Commit 5625ca5640caa3fb797f155601d56379d260d6ba
Delegated to: Netdev Maintainers
Headers show
Series ice: Support 5 layer Tx scheduler topology | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1298 this patch: 1298
netdev/build_tools success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 37 maintainers not CCed: ryazanov.s.a@gmail.com linux-rdma@vger.kernel.org loic.poulain@linaro.org jpanis@baylibre.com manishc@marvell.com idosch@nvidia.com tariqt@nvidia.com andrew@lunn.ch linux-crypto@vger.kernel.org michael.chan@broadcom.com hkelam@marvell.com aelior@marvell.com s-vadapalli@ti.com arno@natisbad.org leon@kernel.org oss-drivers@corigine.com shannon.nelson@amd.com herbert@gondor.apana.org.au petrm@nvidia.com gakula@marvell.com linux-omap@vger.kernel.org rogerq@kernel.org olteanv@gmail.com u.kleine-koenig@pengutronix.de johannes@sipsolutions.net jerinj@marvell.com brett.creeley@amd.com bbrezillon@kernel.org schalla@marvell.com lcherian@marvell.com horms@kernel.org r-gunasekaran@ti.com sbhatta@marvell.com saeedm@nvidia.com louis.peens@corigine.com f.fainelli@gmail.com sgoutham@marvell.com
netdev/build_clang success Errors and warnings before: 945 this patch: 945
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1473 this patch: 1473
netdev/checkpatch warning WARNING: line length of 83 exceeds 80 columns WARNING: line length of 84 exceeds 80 columns WARNING: line length of 87 exceeds 80 columns WARNING: line length of 88 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 24 this patch: 24
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-04-24--15-00 (tests: 995)

Commit Message

Tony Nguyen April 22, 2024, 8:39 p.m. UTC
From: Mateusz Polchlopek <mateusz.polchlopek@intel.com>

Extend devlink_param *set function pointer to take extack as a param.
Sometimes it is needed to pass information to the end user from set
function. It is more proper to use for that netlink instead of passing
message to dmesg.

Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c  |  9 ++++++---
 drivers/net/ethernet/amd/pds_core/core.h             |  3 ++-
 drivers/net/ethernet/amd/pds_core/devlink.c          |  3 ++-
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c    |  6 ++++--
 drivers/net/ethernet/intel/ice/devlink/devlink.c     | 12 ++++++------
 .../net/ethernet/marvell/octeontx2/af/rvu_devlink.c  | 12 ++++++++----
 .../ethernet/marvell/octeontx2/nic/otx2_devlink.c    |  3 ++-
 drivers/net/ethernet/mellanox/mlx4/main.c            |  6 ++++--
 drivers/net/ethernet/mellanox/mlx5/core/eswitch.c    |  3 ++-
 .../ethernet/mellanox/mlx5/core/eswitch_offloads.c   |  3 ++-
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c    |  3 ++-
 drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c   |  3 ++-
 .../net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c  |  3 ++-
 drivers/net/ethernet/netronome/nfp/devlink_param.c   |  3 ++-
 drivers/net/ethernet/qlogic/qed/qed_devlink.c        |  3 ++-
 drivers/net/ethernet/ti/am65-cpsw-nuss.c             |  3 ++-
 drivers/net/ethernet/ti/cpsw_new.c                   |  6 ++++--
 drivers/net/wwan/iosm/iosm_ipc_devlink.c             |  3 ++-
 include/net/devlink.h                                |  3 ++-
 include/net/dsa.h                                    |  3 ++-
 net/devlink/param.c                                  |  7 ++++---
 net/dsa/devlink.c                                    |  3 ++-
 22 files changed, 66 insertions(+), 37 deletions(-)

Comments

Alexander Lobakin April 24, 2024, 9:05 a.m. UTC | #1
From: Tony Nguyen <anthony.l.nguyen@intel.com>
Date: Mon, 22 Apr 2024 13:39:06 -0700

> From: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
> 
> Extend devlink_param *set function pointer to take extack as a param.
> Sometimes it is needed to pass information to the end user from set
> function. It is more proper to use for that netlink instead of passing
> message to dmesg.
> 
> Reviewed-by: Jiri Pirko <jiri@nvidia.com>
> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Signed-off-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>

[...]

> diff --git a/include/net/devlink.h b/include/net/devlink.h
> index d31769a116ce..35eb0f884386 100644
> --- a/include/net/devlink.h
> +++ b/include/net/devlink.h
> @@ -483,7 +483,8 @@ struct devlink_param {
>  	int (*get)(struct devlink *devlink, u32 id,
>  		   struct devlink_param_gset_ctx *ctx);
>  	int (*set)(struct devlink *devlink, u32 id,
> -		   struct devlink_param_gset_ctx *ctx);
> +		   struct devlink_param_gset_ctx *ctx,
> +		   struct netlink_ext_ack *extack);

Sorry for the late comment. Can't we embed extack to
devlink_param_gset_ctx instead? It would take much less lines.

>  	int (*validate)(struct devlink *devlink, u32 id,
>  			union devlink_param_value val,
>  			struct netlink_ext_ack *extack);
> diff --git a/include/net/dsa.h b/include/net/dsa.h
> index 7edfd8de8882..a6ef7e4c503f 100644
> --- a/include/net/dsa.h
> +++ b/include/net/dsa.h
> @@ -1258,7 +1258,8 @@ struct dsa_switch_ops {
>  int dsa_devlink_param_get(struct devlink *dl, u32 id,
>  			  struct devlink_param_gset_ctx *ctx);
>  int dsa_devlink_param_set(struct devlink *dl, u32 id,
> -			  struct devlink_param_gset_ctx *ctx);
> +			  struct devlink_param_gset_ctx *ctx,
> +			  struct netlink_ext_ack *extack);
>  int dsa_devlink_params_register(struct dsa_switch *ds,
>  				const struct devlink_param *params,
>  				size_t params_count);
> diff --git a/net/devlink/param.c b/net/devlink/param.c
> index 22bc3b500518..dcf0d1ccebba 100644
> --- a/net/devlink/param.c
> +++ b/net/devlink/param.c
> @@ -158,11 +158,12 @@ static int devlink_param_get(struct devlink *devlink,
>  
>  static int devlink_param_set(struct devlink *devlink,
>  			     const struct devlink_param *param,
> -			     struct devlink_param_gset_ctx *ctx)
> +			     struct devlink_param_gset_ctx *ctx,
> +			     struct netlink_ext_ack *extack)
>  {
>  	if (!param->set)
>  		return -EOPNOTSUPP;
> -	return param->set(devlink, param->id, ctx);
> +	return param->set(devlink, param->id, ctx, extack);
>  }
>  
>  static int
> @@ -571,7 +572,7 @@ static int __devlink_nl_cmd_param_set_doit(struct devlink *devlink,
>  			return -EOPNOTSUPP;
>  		ctx.val = value;
>  		ctx.cmode = cmode;
> -		err = devlink_param_set(devlink, param, &ctx);
> +		err = devlink_param_set(devlink, param, &ctx, info->extack);
>  		if (err)
>  			return err;
>  	}
> diff --git a/net/dsa/devlink.c b/net/dsa/devlink.c
> index 431bf52290a1..0aac887d0098 100644
> --- a/net/dsa/devlink.c
> +++ b/net/dsa/devlink.c
> @@ -194,7 +194,8 @@ int dsa_devlink_param_get(struct devlink *dl, u32 id,
>  EXPORT_SYMBOL_GPL(dsa_devlink_param_get);
>  
>  int dsa_devlink_param_set(struct devlink *dl, u32 id,
> -			  struct devlink_param_gset_ctx *ctx)
> +			  struct devlink_param_gset_ctx *ctx,
> +			  struct netlink_ext_ack *extack)
>  {
>  	struct dsa_switch *ds = dsa_devlink_to_ds(dl);

Thanks,
Olek
Przemek Kitszel April 24, 2024, 9:20 a.m. UTC | #2
On 4/24/24 11:05, Alexander Lobakin wrote:
> From: Tony Nguyen <anthony.l.nguyen@intel.com>
> Date: Mon, 22 Apr 2024 13:39:06 -0700
> 
>> From: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
>>
>> Extend devlink_param *set function pointer to take extack as a param.
>> Sometimes it is needed to pass information to the end user from set
>> function. It is more proper to use for that netlink instead of passing
>> message to dmesg.
>>
>> Reviewed-by: Jiri Pirko <jiri@nvidia.com>
>> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
>> Signed-off-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
>> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> 
> [...]
> 
>> diff --git a/include/net/devlink.h b/include/net/devlink.h
>> index d31769a116ce..35eb0f884386 100644
>> --- a/include/net/devlink.h
>> +++ b/include/net/devlink.h
>> @@ -483,7 +483,8 @@ struct devlink_param {
>>   	int (*get)(struct devlink *devlink, u32 id,
>>   		   struct devlink_param_gset_ctx *ctx);
>>   	int (*set)(struct devlink *devlink, u32 id,
>> -		   struct devlink_param_gset_ctx *ctx);
>> +		   struct devlink_param_gset_ctx *ctx,
>> +		   struct netlink_ext_ack *extack);
> 
> Sorry for the late comment. Can't we embed extack to
> devlink_param_gset_ctx instead? It would take much less lines.

But then we will want to remove the extack param from .validate() too:

> 
>>   	int (*validate)(struct devlink *devlink, u32 id,
>>   			union devlink_param_value val,
>>   			struct netlink_ext_ack *extack);

right there.
This would amount to roughly the same scope for changes, but would spare
us yet another round when someone would like to extend .get(), so I like
this idea.

>> diff --git a/include/net/dsa.h b/include/net/dsa.h
>> index 7edfd8de8882..a6ef7e4c503f 100644
>> --- a/include/net/dsa.h
>> +++ b/include/net/dsa.h
>> @@ -1258,7 +1258,8 @@ struct dsa_switch_ops {
>>   int dsa_devlink_param_get(struct devlink *dl, u32 id,
>>   			  struct devlink_param_gset_ctx *ctx);
>>   int dsa_devlink_param_set(struct devlink *dl, u32 id,
>> -			  struct devlink_param_gset_ctx *ctx);
>> +			  struct devlink_param_gset_ctx *ctx,
>> +			  struct netlink_ext_ack *extack);
>>   int dsa_devlink_params_register(struct dsa_switch *ds,
>>   				const struct devlink_param *params,
>>   				size_t params_count);
>> diff --git a/net/devlink/param.c b/net/devlink/param.c
>> index 22bc3b500518..dcf0d1ccebba 100644
>> --- a/net/devlink/param.c
>> +++ b/net/devlink/param.c
>> @@ -158,11 +158,12 @@ static int devlink_param_get(struct devlink *devlink,
>>   
>>   static int devlink_param_set(struct devlink *devlink,
>>   			     const struct devlink_param *param,
>> -			     struct devlink_param_gset_ctx *ctx)
>> +			     struct devlink_param_gset_ctx *ctx,
>> +			     struct netlink_ext_ack *extack)
>>   {
>>   	if (!param->set)
>>   		return -EOPNOTSUPP;
>> -	return param->set(devlink, param->id, ctx);
>> +	return param->set(devlink, param->id, ctx, extack);
>>   }
>>   
>>   static int
>> @@ -571,7 +572,7 @@ static int __devlink_nl_cmd_param_set_doit(struct devlink *devlink,
>>   			return -EOPNOTSUPP;
>>   		ctx.val = value;
>>   		ctx.cmode = cmode;
>> -		err = devlink_param_set(devlink, param, &ctx);
>> +		err = devlink_param_set(devlink, param, &ctx, info->extack);
>>   		if (err)
>>   			return err;
>>   	}
>> diff --git a/net/dsa/devlink.c b/net/dsa/devlink.c
>> index 431bf52290a1..0aac887d0098 100644
>> --- a/net/dsa/devlink.c
>> +++ b/net/dsa/devlink.c
>> @@ -194,7 +194,8 @@ int dsa_devlink_param_get(struct devlink *dl, u32 id,
>>   EXPORT_SYMBOL_GPL(dsa_devlink_param_get);
>>   
>>   int dsa_devlink_param_set(struct devlink *dl, u32 id,
>> -			  struct devlink_param_gset_ctx *ctx)
>> +			  struct devlink_param_gset_ctx *ctx,
>> +			  struct netlink_ext_ack *extack)
>>   {
>>   	struct dsa_switch *ds = dsa_devlink_to_ds(dl);
> 
> Thanks,
> Olek
Alexander Lobakin April 24, 2024, 9:24 a.m. UTC | #3
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Date: Wed, 24 Apr 2024 11:20:49 +0200

> On 4/24/24 11:05, Alexander Lobakin wrote:
>> From: Tony Nguyen <anthony.l.nguyen@intel.com>
>> Date: Mon, 22 Apr 2024 13:39:06 -0700
>>
>>> From: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
>>>
>>> Extend devlink_param *set function pointer to take extack as a param.
>>> Sometimes it is needed to pass information to the end user from set
>>> function. It is more proper to use for that netlink instead of passing
>>> message to dmesg.
>>>
>>> Reviewed-by: Jiri Pirko <jiri@nvidia.com>
>>> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
>>> Signed-off-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
>>> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
>>
>> [...]
>>
>>> diff --git a/include/net/devlink.h b/include/net/devlink.h
>>> index d31769a116ce..35eb0f884386 100644
>>> --- a/include/net/devlink.h
>>> +++ b/include/net/devlink.h
>>> @@ -483,7 +483,8 @@ struct devlink_param {
>>>       int (*get)(struct devlink *devlink, u32 id,
>>>              struct devlink_param_gset_ctx *ctx);
>>>       int (*set)(struct devlink *devlink, u32 id,
>>> -           struct devlink_param_gset_ctx *ctx);
>>> +           struct devlink_param_gset_ctx *ctx,
>>> +           struct netlink_ext_ack *extack);
>>
>> Sorry for the late comment. Can't we embed extack to
>> devlink_param_gset_ctx instead? It would take much less lines.
> 
> But then we will want to remove the extack param from .validate() too:
> 
>>
>>>       int (*validate)(struct devlink *devlink, u32 id,
>>>               union devlink_param_value val,
>>>               struct netlink_ext_ack *extack);
> 
> right there.

We don't have &devlink_param_gset_ctx here, only the union.
Extending this union with the extack requires converting it to a struct
(which would have extack + this union), which is again a conversion of
all the drivers :z

> This would amount to roughly the same scope for changes, but would spare
> us yet another round when someone would like to extend .get(), so I like
> this idea.

Thanks,
Olek
Przemek Kitszel April 24, 2024, 9:40 a.m. UTC | #4
On 4/24/24 11:24, Alexander Lobakin wrote:
> From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Date: Wed, 24 Apr 2024 11:20:49 +0200
> 
>> On 4/24/24 11:05, Alexander Lobakin wrote:
>>> From: Tony Nguyen <anthony.l.nguyen@intel.com>
>>> Date: Mon, 22 Apr 2024 13:39:06 -0700
>>>
>>>> From: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
>>>>
>>>> Extend devlink_param *set function pointer to take extack as a param.
>>>> Sometimes it is needed to pass information to the end user from set
>>>> function. It is more proper to use for that netlink instead of passing
>>>> message to dmesg.
>>>>
>>>> Reviewed-by: Jiri Pirko <jiri@nvidia.com>
>>>> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
>>>> Signed-off-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
>>>> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
>>>
>>> [...]
>>>
>>>> diff --git a/include/net/devlink.h b/include/net/devlink.h
>>>> index d31769a116ce..35eb0f884386 100644
>>>> --- a/include/net/devlink.h
>>>> +++ b/include/net/devlink.h
>>>> @@ -483,7 +483,8 @@ struct devlink_param {
>>>>        int (*get)(struct devlink *devlink, u32 id,
>>>>               struct devlink_param_gset_ctx *ctx);
>>>>        int (*set)(struct devlink *devlink, u32 id,
>>>> -           struct devlink_param_gset_ctx *ctx);
>>>> +           struct devlink_param_gset_ctx *ctx,
>>>> +           struct netlink_ext_ack *extack);
>>>
>>> Sorry for the late comment. Can't we embed extack to
>>> devlink_param_gset_ctx instead? It would take much less lines.

So this one still makes sense.

>>
>> But then we will want to remove the extack param from .validate() too:
>>
>>>
>>>>        int (*validate)(struct devlink *devlink, u32 id,
>>>>                union devlink_param_value val,
>>>>                struct netlink_ext_ack *extack);
>>
>> right there.
> 
> We don't have &devlink_param_gset_ctx here, only the union.
> Extending this union with the extack requires converting it to a struct
> (which would have extack + this union), which is again a conversion of
> all the drivers :z

I see, perhaps when there will be a need for that, for now there is none

> 
>> This would amount to roughly the same scope for changes, but would spare
>> us yet another round when someone would like to extend .get(), so I like
>> this idea.
> 
> Thanks,
> Olek
Mateusz Polchlopek April 24, 2024, 9:52 a.m. UTC | #5
On 4/24/2024 11:24 AM, Alexander Lobakin wrote:
> From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
> Date: Wed, 24 Apr 2024 11:20:49 +0200
> 
>> On 4/24/24 11:05, Alexander Lobakin wrote:
>>> From: Tony Nguyen <anthony.l.nguyen@intel.com>
>>> Date: Mon, 22 Apr 2024 13:39:06 -0700
>>>
>>>> From: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
>>>>
>>>> Extend devlink_param *set function pointer to take extack as a param.
>>>> Sometimes it is needed to pass information to the end user from set
>>>> function. It is more proper to use for that netlink instead of passing
>>>> message to dmesg.
>>>>
>>>> Reviewed-by: Jiri Pirko <jiri@nvidia.com>
>>>> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
>>>> Signed-off-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
>>>> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
>>>
>>> [...]
>>>
>>>> diff --git a/include/net/devlink.h b/include/net/devlink.h
>>>> index d31769a116ce..35eb0f884386 100644
>>>> --- a/include/net/devlink.h
>>>> +++ b/include/net/devlink.h
>>>> @@ -483,7 +483,8 @@ struct devlink_param {
>>>>        int (*get)(struct devlink *devlink, u32 id,
>>>>               struct devlink_param_gset_ctx *ctx);
>>>>        int (*set)(struct devlink *devlink, u32 id,
>>>> -           struct devlink_param_gset_ctx *ctx);
>>>> +           struct devlink_param_gset_ctx *ctx,
>>>> +           struct netlink_ext_ack *extack);
>>>
>>> Sorry for the late comment. Can't we embed extack to
>>> devlink_param_gset_ctx instead? It would take much less lines.
>>
>> But then we will want to remove the extack param from .validate() too:
>>
>>>
>>>>        int (*validate)(struct devlink *devlink, u32 id,
>>>>                union devlink_param_value val,
>>>>                struct netlink_ext_ack *extack);
>>
>> right there.
> 
> We don't have &devlink_param_gset_ctx here, only the union.
> Extending this union with the extack requires converting it to a struct
> (which would have extack + this union), which is again a conversion of
> all the drivers : >

Makes sense. I also have to take a look on docs issue reported, so
Your's suggestion I will add in the next version too.

>> This would amount to roughly the same scope for changes, but would spare
>> us yet another round when someone would like to extend .get(), so I like
>> this idea.
> 
> Thanks,
> Olek
Jakub Kicinski April 25, 2024, 3:08 a.m. UTC | #6
On Wed, 24 Apr 2024 11:05:58 +0200 Alexander Lobakin wrote:
> >  	int (*set)(struct devlink *devlink, u32 id,
> > -		   struct devlink_param_gset_ctx *ctx);
> > +		   struct devlink_param_gset_ctx *ctx,
> > +		   struct netlink_ext_ack *extack);  
> 
> Sorry for the late comment. Can't we embed extack to
> devlink_param_gset_ctx instead? It would take much less lines.

I think the way Mateusz wrote this is more prevalent today.
Also feels a tiny bit cleaner to me, because if we embed
extack why is devlink and id not embedded?

We've seen this series enough times, let me apply this as is..
Please follow up with the doc adjustments if you'd like, separately.
diff mbox series

Patch

diff --git a/drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c b/drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c
index d2b8d26db968..215a1a8ba7e9 100644
--- a/drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c
+++ b/drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c
@@ -4,7 +4,8 @@ 
 #include "otx2_cpt_devlink.h"
 
 static int otx2_cpt_dl_egrp_create(struct devlink *dl, u32 id,
-				   struct devlink_param_gset_ctx *ctx)
+				   struct devlink_param_gset_ctx *ctx,
+				   struct netlink_ext_ack *extack)
 {
 	struct otx2_cpt_devlink *cpt_dl = devlink_priv(dl);
 	struct otx2_cptpf_dev *cptpf = cpt_dl->cptpf;
@@ -13,7 +14,8 @@  static int otx2_cpt_dl_egrp_create(struct devlink *dl, u32 id,
 }
 
 static int otx2_cpt_dl_egrp_delete(struct devlink *dl, u32 id,
-				   struct devlink_param_gset_ctx *ctx)
+				   struct devlink_param_gset_ctx *ctx,
+				   struct netlink_ext_ack *extack)
 {
 	struct otx2_cpt_devlink *cpt_dl = devlink_priv(dl);
 	struct otx2_cptpf_dev *cptpf = cpt_dl->cptpf;
@@ -45,7 +47,8 @@  static int otx2_cpt_dl_t106_mode_get(struct devlink *dl, u32 id,
 }
 
 static int otx2_cpt_dl_t106_mode_set(struct devlink *dl, u32 id,
-				     struct devlink_param_gset_ctx *ctx)
+				     struct devlink_param_gset_ctx *ctx,
+				     struct netlink_ext_ack *extack)
 {
 	struct otx2_cpt_devlink *cpt_dl = devlink_priv(dl);
 	struct otx2_cptpf_dev *cptpf = cpt_dl->cptpf;
diff --git a/drivers/net/ethernet/amd/pds_core/core.h b/drivers/net/ethernet/amd/pds_core/core.h
index a3e17a0c187a..14522d6d5f86 100644
--- a/drivers/net/ethernet/amd/pds_core/core.h
+++ b/drivers/net/ethernet/amd/pds_core/core.h
@@ -256,7 +256,8 @@  int pdsc_dl_flash_update(struct devlink *dl,
 int pdsc_dl_enable_get(struct devlink *dl, u32 id,
 		       struct devlink_param_gset_ctx *ctx);
 int pdsc_dl_enable_set(struct devlink *dl, u32 id,
-		       struct devlink_param_gset_ctx *ctx);
+		       struct devlink_param_gset_ctx *ctx,
+		       struct netlink_ext_ack *extack);
 int pdsc_dl_enable_validate(struct devlink *dl, u32 id,
 			    union devlink_param_value val,
 			    struct netlink_ext_ack *extack);
diff --git a/drivers/net/ethernet/amd/pds_core/devlink.c b/drivers/net/ethernet/amd/pds_core/devlink.c
index 54864f27c87a..2681889162a2 100644
--- a/drivers/net/ethernet/amd/pds_core/devlink.c
+++ b/drivers/net/ethernet/amd/pds_core/devlink.c
@@ -37,7 +37,8 @@  int pdsc_dl_enable_get(struct devlink *dl, u32 id,
 }
 
 int pdsc_dl_enable_set(struct devlink *dl, u32 id,
-		       struct devlink_param_gset_ctx *ctx)
+		       struct devlink_param_gset_ctx *ctx,
+		       struct netlink_ext_ack *extack)
 {
 	struct pdsc *pdsc = devlink_priv(dl);
 	struct pdsc_viftype *vt_entry;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
index ae4529c043f0..d9ea6fa23923 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -1096,7 +1096,8 @@  static int bnxt_dl_nvm_param_get(struct devlink *dl, u32 id,
 }
 
 static int bnxt_dl_nvm_param_set(struct devlink *dl, u32 id,
-				 struct devlink_param_gset_ctx *ctx)
+				 struct devlink_param_gset_ctx *ctx,
+				 struct netlink_ext_ack *extack)
 {
 	struct bnxt *bp = bnxt_get_bp_from_dl(dl);
 	struct hwrm_nvm_set_variable_input *req;
@@ -1145,7 +1146,8 @@  static int bnxt_remote_dev_reset_get(struct devlink *dl, u32 id,
 }
 
 static int bnxt_remote_dev_reset_set(struct devlink *dl, u32 id,
-				     struct devlink_param_gset_ctx *ctx)
+				     struct devlink_param_gset_ctx *ctx,
+				     struct netlink_ext_ack *extack)
 {
 	struct bnxt *bp = bnxt_get_bp_from_dl(dl);
 	int rc;
diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c b/drivers/net/ethernet/intel/ice/devlink/devlink.c
index be9244bb8bbc..acbace240977 100644
--- a/drivers/net/ethernet/intel/ice/devlink/devlink.c
+++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c
@@ -1144,9 +1144,9 @@  ice_devlink_enable_roce_get(struct devlink *devlink, u32 id,
 	return 0;
 }
 
-static int
-ice_devlink_enable_roce_set(struct devlink *devlink, u32 id,
-			    struct devlink_param_gset_ctx *ctx)
+static int ice_devlink_enable_roce_set(struct devlink *devlink, u32 id,
+				       struct devlink_param_gset_ctx *ctx,
+				       struct netlink_ext_ack *extack)
 {
 	struct ice_pf *pf = devlink_priv(devlink);
 	bool roce_ena = ctx->val.vbool;
@@ -1195,9 +1195,9 @@  ice_devlink_enable_iw_get(struct devlink *devlink, u32 id,
 	return 0;
 }
 
-static int
-ice_devlink_enable_iw_set(struct devlink *devlink, u32 id,
-			  struct devlink_param_gset_ctx *ctx)
+static int ice_devlink_enable_iw_set(struct devlink *devlink, u32 id,
+				     struct devlink_param_gset_ctx *ctx,
+				     struct netlink_ext_ack *extack)
 {
 	struct ice_pf *pf = devlink_priv(devlink);
 	bool iw_ena = ctx->val.vbool;
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
index 96c04f7d93f8..7498ab429963 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
@@ -1202,7 +1202,8 @@  static int rvu_af_dl_dwrr_mtu_validate(struct devlink *devlink, u32 id,
 }
 
 static int rvu_af_dl_dwrr_mtu_set(struct devlink *devlink, u32 id,
-				  struct devlink_param_gset_ctx *ctx)
+				  struct devlink_param_gset_ctx *ctx,
+				  struct netlink_ext_ack *extack)
 {
 	struct rvu_devlink *rvu_dl = devlink_priv(devlink);
 	struct rvu *rvu = rvu_dl->rvu;
@@ -1256,7 +1257,8 @@  static int rvu_af_npc_exact_feature_get(struct devlink *devlink, u32 id,
 }
 
 static int rvu_af_npc_exact_feature_disable(struct devlink *devlink, u32 id,
-					    struct devlink_param_gset_ctx *ctx)
+					    struct devlink_param_gset_ctx *ctx,
+					    struct netlink_ext_ack *extack)
 {
 	struct rvu_devlink *rvu_dl = devlink_priv(devlink);
 	struct rvu *rvu = rvu_dl->rvu;
@@ -1310,7 +1312,8 @@  static int rvu_af_dl_npc_mcam_high_zone_percent_get(struct devlink *devlink, u32
 }
 
 static int rvu_af_dl_npc_mcam_high_zone_percent_set(struct devlink *devlink, u32 id,
-						    struct devlink_param_gset_ctx *ctx)
+						    struct devlink_param_gset_ctx *ctx,
+						    struct netlink_ext_ack *extack)
 {
 	struct rvu_devlink *rvu_dl = devlink_priv(devlink);
 	struct rvu *rvu = rvu_dl->rvu;
@@ -1367,7 +1370,8 @@  static int rvu_af_dl_nix_maxlf_get(struct devlink *devlink, u32 id,
 }
 
 static int rvu_af_dl_nix_maxlf_set(struct devlink *devlink, u32 id,
-				   struct devlink_param_gset_ctx *ctx)
+				   struct devlink_param_gset_ctx *ctx,
+				   struct netlink_ext_ack *extack)
 {
 	struct rvu_devlink *rvu_dl = devlink_priv(devlink);
 	struct rvu *rvu = rvu_dl->rvu;
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c
index 4e1130496573..99ddf31269d9 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c
@@ -32,7 +32,8 @@  static int otx2_dl_mcam_count_validate(struct devlink *devlink, u32 id,
 }
 
 static int otx2_dl_mcam_count_set(struct devlink *devlink, u32 id,
-				  struct devlink_param_gset_ctx *ctx)
+				  struct devlink_param_gset_ctx *ctx,
+				  struct netlink_ext_ack *extack)
 {
 	struct otx2_devlink *otx2_dl = devlink_priv(devlink);
 	struct otx2_nic *pfvf = otx2_dl->pfvf;
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 7b02ff61126d..98688e4dbec5 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -185,7 +185,8 @@  static int mlx4_devlink_ierr_reset_get(struct devlink *devlink, u32 id,
 }
 
 static int mlx4_devlink_ierr_reset_set(struct devlink *devlink, u32 id,
-				       struct devlink_param_gset_ctx *ctx)
+				       struct devlink_param_gset_ctx *ctx,
+				       struct netlink_ext_ack *extack)
 {
 	mlx4_internal_err_reset = ctx->val.vbool;
 	return 0;
@@ -202,7 +203,8 @@  static int mlx4_devlink_crdump_snapshot_get(struct devlink *devlink, u32 id,
 }
 
 static int mlx4_devlink_crdump_snapshot_set(struct devlink *devlink, u32 id,
-					    struct devlink_param_gset_ctx *ctx)
+					    struct devlink_param_gset_ctx *ctx,
+					    struct netlink_ext_ack *extack)
 {
 	struct mlx4_priv *priv = devlink_priv(devlink);
 	struct mlx4_dev *dev = &priv->dev;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 1789800faaeb..17f78091ad30 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -1805,7 +1805,8 @@  static int mlx5_esw_vports_init(struct mlx5_eswitch *esw)
 }
 
 static int mlx5_devlink_esw_multiport_set(struct devlink *devlink, u32 id,
-					  struct devlink_param_gset_ctx *ctx)
+					  struct devlink_param_gset_ctx *ctx,
+					  struct netlink_ext_ack *extack)
 {
 	struct mlx5_core_dev *dev = devlink_priv(devlink);
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index dfcc7e85e0a3..f378b8176e47 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -2413,7 +2413,8 @@  static int esw_offloads_init_reps(struct mlx5_eswitch *esw)
 }
 
 static int esw_port_metadata_set(struct devlink *devlink, u32 id,
-				 struct devlink_param_gset_ctx *ctx)
+				 struct devlink_param_gset_ctx *ctx,
+				 struct netlink_ext_ack *extack)
 {
 	struct mlx5_core_dev *dev = devlink_priv(devlink);
 	struct mlx5_eswitch *esw = dev->priv.eswitch;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index cf085a478e3e..32cdacc34a0d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -3332,7 +3332,8 @@  static int mlx5_fs_mode_validate(struct devlink *devlink, u32 id,
 }
 
 static int mlx5_fs_mode_set(struct devlink *devlink, u32 id,
-			    struct devlink_param_gset_ctx *ctx)
+			    struct devlink_param_gset_ctx *ctx,
+			    struct netlink_ext_ack *extack)
 {
 	struct mlx5_core_dev *dev = devlink_priv(devlink);
 	enum mlx5_flow_steering_mode mode;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
index 2911aa34a5be..979c49ae6b5c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
@@ -52,7 +52,8 @@  static void mlx5_set_fw_rst_ack(struct mlx5_core_dev *dev)
 }
 
 static int mlx5_fw_reset_enable_remote_dev_reset_set(struct devlink *devlink, u32 id,
-						     struct devlink_param_gset_ctx *ctx)
+						     struct devlink_param_gset_ctx *ctx,
+						     struct netlink_ext_ack *extack)
 {
 	struct mlx5_core_dev *dev = devlink_priv(devlink);
 	struct mlx5_fw_reset *fw_reset;
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
index f20052776b3f..baedf0d45e85 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
@@ -1465,7 +1465,8 @@  mlxsw_sp_acl_tcam_region_rehash_intrvl_get(struct devlink *devlink, u32 id,
 
 static int
 mlxsw_sp_acl_tcam_region_rehash_intrvl_set(struct devlink *devlink, u32 id,
-					   struct devlink_param_gset_ctx *ctx)
+					   struct devlink_param_gset_ctx *ctx,
+					   struct netlink_ext_ack *extack)
 {
 	struct mlxsw_core *mlxsw_core = devlink_priv(devlink);
 	struct mlxsw_sp_acl_tcam_vregion *vregion;
diff --git a/drivers/net/ethernet/netronome/nfp/devlink_param.c b/drivers/net/ethernet/netronome/nfp/devlink_param.c
index a655f9e69a7b..0e1a3800f371 100644
--- a/drivers/net/ethernet/netronome/nfp/devlink_param.c
+++ b/drivers/net/ethernet/netronome/nfp/devlink_param.c
@@ -132,7 +132,8 @@  nfp_devlink_param_u8_get(struct devlink *devlink, u32 id,
 
 static int
 nfp_devlink_param_u8_set(struct devlink *devlink, u32 id,
-			 struct devlink_param_gset_ctx *ctx)
+			 struct devlink_param_gset_ctx *ctx,
+			 struct netlink_ext_ack *extack)
 {
 	const struct nfp_devlink_param_u8_arg *arg;
 	struct nfp_pf *pf = devlink_priv(devlink);
diff --git a/drivers/net/ethernet/qlogic/qed/qed_devlink.c b/drivers/net/ethernet/qlogic/qed/qed_devlink.c
index dad8e617c393..1adc7fbb3f2f 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_devlink.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_devlink.c
@@ -132,7 +132,8 @@  static int qed_dl_param_get(struct devlink *dl, u32 id,
 }
 
 static int qed_dl_param_set(struct devlink *dl, u32 id,
-			    struct devlink_param_gset_ctx *ctx)
+			    struct devlink_param_gset_ctx *ctx,
+			    struct netlink_ext_ack *extack)
 {
 	struct qed_devlink *qed_dl = devlink_priv(dl);
 	struct qed_dev *cdev;
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index a7dbbbe3ff5d..bf3df86554d1 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -3061,7 +3061,8 @@  static void am65_cpsw_init_port_switch_ale(struct am65_cpsw_port *port)
 }
 
 static int am65_cpsw_dl_switch_mode_set(struct devlink *dl, u32 id,
-					struct devlink_param_gset_ctx *ctx)
+					struct devlink_param_gset_ctx *ctx,
+					struct netlink_ext_ack *extack)
 {
 	struct am65_cpsw_devlink *dl_priv = devlink_priv(dl);
 	struct am65_cpsw_common *cpsw = dl_priv->common;
diff --git a/drivers/net/ethernet/ti/cpsw_new.c b/drivers/net/ethernet/ti/cpsw_new.c
index 087dcb67505a..2baa198ebfa0 100644
--- a/drivers/net/ethernet/ti/cpsw_new.c
+++ b/drivers/net/ethernet/ti/cpsw_new.c
@@ -1625,7 +1625,8 @@  static int cpsw_dl_switch_mode_get(struct devlink *dl, u32 id,
 }
 
 static int cpsw_dl_switch_mode_set(struct devlink *dl, u32 id,
-				   struct devlink_param_gset_ctx *ctx)
+				   struct devlink_param_gset_ctx *ctx,
+				   struct netlink_ext_ack *extack)
 {
 	struct cpsw_devlink *dl_priv = devlink_priv(dl);
 	struct cpsw_common *cpsw = dl_priv->cpsw;
@@ -1762,7 +1763,8 @@  static int cpsw_dl_ale_ctrl_get(struct devlink *dl, u32 id,
 }
 
 static int cpsw_dl_ale_ctrl_set(struct devlink *dl, u32 id,
-				struct devlink_param_gset_ctx *ctx)
+				struct devlink_param_gset_ctx *ctx,
+				struct netlink_ext_ack *extack)
 {
 	struct cpsw_devlink *dl_priv = devlink_priv(dl);
 	struct cpsw_common *cpsw = dl_priv->cpsw;
diff --git a/drivers/net/wwan/iosm/iosm_ipc_devlink.c b/drivers/net/wwan/iosm/iosm_ipc_devlink.c
index 2fe724d623c0..bef6819986e9 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_devlink.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_devlink.c
@@ -33,7 +33,8 @@  static int ipc_devlink_get_param(struct devlink *dl, u32 id,
 
 /* Set the param values for the specific param ID's */
 static int ipc_devlink_set_param(struct devlink *dl, u32 id,
-				 struct devlink_param_gset_ctx *ctx)
+				 struct devlink_param_gset_ctx *ctx,
+				 struct netlink_ext_ack *extack)
 {
 	struct iosm_devlink *ipc_devlink = devlink_priv(dl);
 
diff --git a/include/net/devlink.h b/include/net/devlink.h
index d31769a116ce..35eb0f884386 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -483,7 +483,8 @@  struct devlink_param {
 	int (*get)(struct devlink *devlink, u32 id,
 		   struct devlink_param_gset_ctx *ctx);
 	int (*set)(struct devlink *devlink, u32 id,
-		   struct devlink_param_gset_ctx *ctx);
+		   struct devlink_param_gset_ctx *ctx,
+		   struct netlink_ext_ack *extack);
 	int (*validate)(struct devlink *devlink, u32 id,
 			union devlink_param_value val,
 			struct netlink_ext_ack *extack);
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 7edfd8de8882..a6ef7e4c503f 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -1258,7 +1258,8 @@  struct dsa_switch_ops {
 int dsa_devlink_param_get(struct devlink *dl, u32 id,
 			  struct devlink_param_gset_ctx *ctx);
 int dsa_devlink_param_set(struct devlink *dl, u32 id,
-			  struct devlink_param_gset_ctx *ctx);
+			  struct devlink_param_gset_ctx *ctx,
+			  struct netlink_ext_ack *extack);
 int dsa_devlink_params_register(struct dsa_switch *ds,
 				const struct devlink_param *params,
 				size_t params_count);
diff --git a/net/devlink/param.c b/net/devlink/param.c
index 22bc3b500518..dcf0d1ccebba 100644
--- a/net/devlink/param.c
+++ b/net/devlink/param.c
@@ -158,11 +158,12 @@  static int devlink_param_get(struct devlink *devlink,
 
 static int devlink_param_set(struct devlink *devlink,
 			     const struct devlink_param *param,
-			     struct devlink_param_gset_ctx *ctx)
+			     struct devlink_param_gset_ctx *ctx,
+			     struct netlink_ext_ack *extack)
 {
 	if (!param->set)
 		return -EOPNOTSUPP;
-	return param->set(devlink, param->id, ctx);
+	return param->set(devlink, param->id, ctx, extack);
 }
 
 static int
@@ -571,7 +572,7 @@  static int __devlink_nl_cmd_param_set_doit(struct devlink *devlink,
 			return -EOPNOTSUPP;
 		ctx.val = value;
 		ctx.cmode = cmode;
-		err = devlink_param_set(devlink, param, &ctx);
+		err = devlink_param_set(devlink, param, &ctx, info->extack);
 		if (err)
 			return err;
 	}
diff --git a/net/dsa/devlink.c b/net/dsa/devlink.c
index 431bf52290a1..0aac887d0098 100644
--- a/net/dsa/devlink.c
+++ b/net/dsa/devlink.c
@@ -194,7 +194,8 @@  int dsa_devlink_param_get(struct devlink *dl, u32 id,
 EXPORT_SYMBOL_GPL(dsa_devlink_param_get);
 
 int dsa_devlink_param_set(struct devlink *dl, u32 id,
-			  struct devlink_param_gset_ctx *ctx)
+			  struct devlink_param_gset_ctx *ctx,
+			  struct netlink_ext_ack *extack)
 {
 	struct dsa_switch *ds = dsa_devlink_to_ds(dl);