Skip to content

Commit 5625ca5

Browse files
halfboy93anguy11
authored andcommitted
devlink: extend devlink_param *set pointer
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 <[email protected]> Reviewed-by: Przemek Kitszel <[email protected]> Signed-off-by: Mateusz Polchlopek <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent c51db4a commit 5625ca5

File tree

22 files changed

+66
-37
lines changed

22 files changed

+66
-37
lines changed

drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
#include "otx2_cpt_devlink.h"
55

66
static int otx2_cpt_dl_egrp_create(struct devlink *dl, u32 id,
7-
struct devlink_param_gset_ctx *ctx)
7+
struct devlink_param_gset_ctx *ctx,
8+
struct netlink_ext_ack *extack)
89
{
910
struct otx2_cpt_devlink *cpt_dl = devlink_priv(dl);
1011
struct otx2_cptpf_dev *cptpf = cpt_dl->cptpf;
@@ -13,7 +14,8 @@ static int otx2_cpt_dl_egrp_create(struct devlink *dl, u32 id,
1314
}
1415

1516
static int otx2_cpt_dl_egrp_delete(struct devlink *dl, u32 id,
16-
struct devlink_param_gset_ctx *ctx)
17+
struct devlink_param_gset_ctx *ctx,
18+
struct netlink_ext_ack *extack)
1719
{
1820
struct otx2_cpt_devlink *cpt_dl = devlink_priv(dl);
1921
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,
4547
}
4648

4749
static int otx2_cpt_dl_t106_mode_set(struct devlink *dl, u32 id,
48-
struct devlink_param_gset_ctx *ctx)
50+
struct devlink_param_gset_ctx *ctx,
51+
struct netlink_ext_ack *extack)
4952
{
5053
struct otx2_cpt_devlink *cpt_dl = devlink_priv(dl);
5154
struct otx2_cptpf_dev *cptpf = cpt_dl->cptpf;

drivers/net/ethernet/amd/pds_core/core.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ int pdsc_dl_flash_update(struct devlink *dl,
256256
int pdsc_dl_enable_get(struct devlink *dl, u32 id,
257257
struct devlink_param_gset_ctx *ctx);
258258
int pdsc_dl_enable_set(struct devlink *dl, u32 id,
259-
struct devlink_param_gset_ctx *ctx);
259+
struct devlink_param_gset_ctx *ctx,
260+
struct netlink_ext_ack *extack);
260261
int pdsc_dl_enable_validate(struct devlink *dl, u32 id,
261262
union devlink_param_value val,
262263
struct netlink_ext_ack *extack);

drivers/net/ethernet/amd/pds_core/devlink.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ int pdsc_dl_enable_get(struct devlink *dl, u32 id,
3737
}
3838

3939
int pdsc_dl_enable_set(struct devlink *dl, u32 id,
40-
struct devlink_param_gset_ctx *ctx)
40+
struct devlink_param_gset_ctx *ctx,
41+
struct netlink_ext_ack *extack)
4142
{
4243
struct pdsc *pdsc = devlink_priv(dl);
4344
struct pdsc_viftype *vt_entry;

drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,8 @@ static int bnxt_dl_nvm_param_get(struct devlink *dl, u32 id,
10961096
}
10971097

10981098
static int bnxt_dl_nvm_param_set(struct devlink *dl, u32 id,
1099-
struct devlink_param_gset_ctx *ctx)
1099+
struct devlink_param_gset_ctx *ctx,
1100+
struct netlink_ext_ack *extack)
11001101
{
11011102
struct bnxt *bp = bnxt_get_bp_from_dl(dl);
11021103
struct hwrm_nvm_set_variable_input *req;
@@ -1145,7 +1146,8 @@ static int bnxt_remote_dev_reset_get(struct devlink *dl, u32 id,
11451146
}
11461147

11471148
static int bnxt_remote_dev_reset_set(struct devlink *dl, u32 id,
1148-
struct devlink_param_gset_ctx *ctx)
1149+
struct devlink_param_gset_ctx *ctx,
1150+
struct netlink_ext_ack *extack)
11491151
{
11501152
struct bnxt *bp = bnxt_get_bp_from_dl(dl);
11511153
int rc;

drivers/net/ethernet/intel/ice/devlink/devlink.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,9 +1144,9 @@ ice_devlink_enable_roce_get(struct devlink *devlink, u32 id,
11441144
return 0;
11451145
}
11461146

1147-
static int
1148-
ice_devlink_enable_roce_set(struct devlink *devlink, u32 id,
1149-
struct devlink_param_gset_ctx *ctx)
1147+
static int ice_devlink_enable_roce_set(struct devlink *devlink, u32 id,
1148+
struct devlink_param_gset_ctx *ctx,
1149+
struct netlink_ext_ack *extack)
11501150
{
11511151
struct ice_pf *pf = devlink_priv(devlink);
11521152
bool roce_ena = ctx->val.vbool;
@@ -1195,9 +1195,9 @@ ice_devlink_enable_iw_get(struct devlink *devlink, u32 id,
11951195
return 0;
11961196
}
11971197

1198-
static int
1199-
ice_devlink_enable_iw_set(struct devlink *devlink, u32 id,
1200-
struct devlink_param_gset_ctx *ctx)
1198+
static int ice_devlink_enable_iw_set(struct devlink *devlink, u32 id,
1199+
struct devlink_param_gset_ctx *ctx,
1200+
struct netlink_ext_ack *extack)
12011201
{
12021202
struct ice_pf *pf = devlink_priv(devlink);
12031203
bool iw_ena = ctx->val.vbool;

drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,8 @@ static int rvu_af_dl_dwrr_mtu_validate(struct devlink *devlink, u32 id,
12021202
}
12031203

12041204
static int rvu_af_dl_dwrr_mtu_set(struct devlink *devlink, u32 id,
1205-
struct devlink_param_gset_ctx *ctx)
1205+
struct devlink_param_gset_ctx *ctx,
1206+
struct netlink_ext_ack *extack)
12061207
{
12071208
struct rvu_devlink *rvu_dl = devlink_priv(devlink);
12081209
struct rvu *rvu = rvu_dl->rvu;
@@ -1256,7 +1257,8 @@ static int rvu_af_npc_exact_feature_get(struct devlink *devlink, u32 id,
12561257
}
12571258

12581259
static int rvu_af_npc_exact_feature_disable(struct devlink *devlink, u32 id,
1259-
struct devlink_param_gset_ctx *ctx)
1260+
struct devlink_param_gset_ctx *ctx,
1261+
struct netlink_ext_ack *extack)
12601262
{
12611263
struct rvu_devlink *rvu_dl = devlink_priv(devlink);
12621264
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
13101312
}
13111313

13121314
static int rvu_af_dl_npc_mcam_high_zone_percent_set(struct devlink *devlink, u32 id,
1313-
struct devlink_param_gset_ctx *ctx)
1315+
struct devlink_param_gset_ctx *ctx,
1316+
struct netlink_ext_ack *extack)
13141317
{
13151318
struct rvu_devlink *rvu_dl = devlink_priv(devlink);
13161319
struct rvu *rvu = rvu_dl->rvu;
@@ -1367,7 +1370,8 @@ static int rvu_af_dl_nix_maxlf_get(struct devlink *devlink, u32 id,
13671370
}
13681371

13691372
static int rvu_af_dl_nix_maxlf_set(struct devlink *devlink, u32 id,
1370-
struct devlink_param_gset_ctx *ctx)
1373+
struct devlink_param_gset_ctx *ctx,
1374+
struct netlink_ext_ack *extack)
13711375
{
13721376
struct rvu_devlink *rvu_dl = devlink_priv(devlink);
13731377
struct rvu *rvu = rvu_dl->rvu;

drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ static int otx2_dl_mcam_count_validate(struct devlink *devlink, u32 id,
3232
}
3333

3434
static int otx2_dl_mcam_count_set(struct devlink *devlink, u32 id,
35-
struct devlink_param_gset_ctx *ctx)
35+
struct devlink_param_gset_ctx *ctx,
36+
struct netlink_ext_ack *extack)
3637
{
3738
struct otx2_devlink *otx2_dl = devlink_priv(devlink);
3839
struct otx2_nic *pfvf = otx2_dl->pfvf;

drivers/net/ethernet/mellanox/mlx4/main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ static int mlx4_devlink_ierr_reset_get(struct devlink *devlink, u32 id,
185185
}
186186

187187
static int mlx4_devlink_ierr_reset_set(struct devlink *devlink, u32 id,
188-
struct devlink_param_gset_ctx *ctx)
188+
struct devlink_param_gset_ctx *ctx,
189+
struct netlink_ext_ack *extack)
189190
{
190191
mlx4_internal_err_reset = ctx->val.vbool;
191192
return 0;
@@ -202,7 +203,8 @@ static int mlx4_devlink_crdump_snapshot_get(struct devlink *devlink, u32 id,
202203
}
203204

204205
static int mlx4_devlink_crdump_snapshot_set(struct devlink *devlink, u32 id,
205-
struct devlink_param_gset_ctx *ctx)
206+
struct devlink_param_gset_ctx *ctx,
207+
struct netlink_ext_ack *extack)
206208
{
207209
struct mlx4_priv *priv = devlink_priv(devlink);
208210
struct mlx4_dev *dev = &priv->dev;

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,8 @@ static int mlx5_esw_vports_init(struct mlx5_eswitch *esw)
18051805
}
18061806

18071807
static int mlx5_devlink_esw_multiport_set(struct devlink *devlink, u32 id,
1808-
struct devlink_param_gset_ctx *ctx)
1808+
struct devlink_param_gset_ctx *ctx,
1809+
struct netlink_ext_ack *extack)
18091810
{
18101811
struct mlx5_core_dev *dev = devlink_priv(devlink);
18111812

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2413,7 +2413,8 @@ static int esw_offloads_init_reps(struct mlx5_eswitch *esw)
24132413
}
24142414

24152415
static int esw_port_metadata_set(struct devlink *devlink, u32 id,
2416-
struct devlink_param_gset_ctx *ctx)
2416+
struct devlink_param_gset_ctx *ctx,
2417+
struct netlink_ext_ack *extack)
24172418
{
24182419
struct mlx5_core_dev *dev = devlink_priv(devlink);
24192420
struct mlx5_eswitch *esw = dev->priv.eswitch;

0 commit comments

Comments
 (0)