]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
devlink: pass extack through to devlink_param::get()
authorDaniel Zahka <daniel.zahka@gmail.com>
Wed, 19 Nov 2025 02:50:31 +0000 (18:50 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 21 Nov 2025 03:01:22 +0000 (19:01 -0800)
Allow devlink_param::get() handlers to report error messages via
extack. This function is called in a few different contexts, but not
all of them will have an valid extack to use.

When devlink_param::get() is called from param_get_doit or
param_get_dumpit contexts, pass the extack through so that drivers can
report errors when retrieving param values. devlink_param::get() is
called from the context of devlink_param_notify(), pass NULL in for
the extack.

Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
Link: https://patch.msgid.link/20251119025038.651131-2-daniel.zahka@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
25 files changed:
drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c
drivers/net/ethernet/amd/pds_core/core.h
drivers/net/ethernet/amd/pds_core/devlink.c
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
drivers/net/ethernet/intel/i40e/i40e_devlink.c
drivers/net/ethernet/intel/ice/devlink/devlink.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c
drivers/net/ethernet/mellanox/mlx4/main.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
drivers/net/ethernet/netronome/nfp/devlink_param.c
drivers/net/ethernet/qlogic/qed/qed_devlink.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/ti/am65-cpsw-nuss.c
drivers/net/ethernet/ti/cpsw_new.c
drivers/net/wwan/iosm/iosm_ipc_devlink.c
include/net/devlink.h
include/net/dsa.h
net/devlink/param.c
net/dsa/devlink.c

index 215a1a8ba7e9f568262fea176a1dcd8d3a4bf46e..07a74f702c3ab669f3e65fb91cd075c68fd0b27e 100644 (file)
@@ -24,7 +24,8 @@ static int otx2_cpt_dl_egrp_delete(struct devlink *dl, u32 id,
 }
 
 static int otx2_cpt_dl_uc_info(struct devlink *dl, u32 id,
-                              struct devlink_param_gset_ctx *ctx)
+                              struct devlink_param_gset_ctx *ctx,
+                              struct netlink_ext_ack *extack)
 {
        ctx->val.vstr[0] = '\0';
 
@@ -32,7 +33,8 @@ static int otx2_cpt_dl_uc_info(struct devlink *dl, u32 id,
 }
 
 static int otx2_cpt_dl_t106_mode_get(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;
index 0b53a1fab46d020737d33d2169b2d7cbd0e223ab..4a6b35c84dabebc18393a6876e819921eb6a2b6f 100644 (file)
@@ -255,7 +255,8 @@ int pdsc_dl_flash_update(struct devlink *dl,
                         struct devlink_flash_update_params *params,
                         struct netlink_ext_ack *extack);
 int pdsc_dl_enable_get(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_set(struct devlink *dl, u32 id,
                       struct devlink_param_gset_ctx *ctx,
                       struct netlink_ext_ack *extack);
index d8dc39da4161fb5701d80ba2b7a96e7065f7397d..b576be626a2948986e454676d57e92edd62d2cb7 100644 (file)
@@ -22,7 +22,8 @@ pdsc_viftype *pdsc_dl_find_viftype_by_id(struct pdsc *pdsc,
 }
 
 int pdsc_dl_enable_get(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;
index 67ca02d84c9793c293ad75bb0abefe108c00c801..15de802bbac48e421b3964de547022c017f315a6 100644 (file)
@@ -1086,7 +1086,8 @@ static int bnxt_hwrm_nvm_req(struct bnxt *bp, u32 param_id, void *msg,
 }
 
 static int bnxt_dl_nvm_param_get(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_get_variable_input *req;
@@ -1168,7 +1169,8 @@ static int bnxt_dl_msix_validate(struct devlink *dl, u32 id,
 }
 
 static int bnxt_remote_dev_reset_get(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);
 
index bc205e3077c7f9253d791ee9e1f22f20cd28a1a9..229179ccc1319ee223cfb1f3c6a2611b3d2dd3fa 100644 (file)
@@ -24,7 +24,8 @@ static int i40e_max_mac_per_vf_set(struct devlink *devlink,
 
 static int i40e_max_mac_per_vf_get(struct devlink *devlink,
                                   u32 id,
-                                  struct devlink_param_gset_ctx *ctx)
+                                  struct devlink_param_gset_ctx *ctx,
+                                  struct netlink_ext_ack *extack)
 {
        struct i40e_pf *pf = devlink_priv(devlink);
 
index 938914abbe06675ccc68c7a18a64e63992ac1164..d88b7f3fd1f9730cc33afc54b75a80c45c5543c0 100644 (file)
@@ -610,11 +610,13 @@ exit_release_res:
  * @devlink: pointer to the devlink instance
  * @id: the parameter ID to set
  * @ctx: context to store the parameter value
+ * @extack: netlink extended ACK structure
  *
  * Return: zero on success and negative value on failure.
  */
 static int ice_devlink_tx_sched_layers_get(struct devlink *devlink, u32 id,
-                                          struct devlink_param_gset_ctx *ctx)
+                                          struct devlink_param_gset_ctx *ctx,
+                                          struct netlink_ext_ack *extack)
 {
        struct ice_pf *pf = devlink_priv(devlink);
        int err;
@@ -1349,7 +1351,8 @@ static const struct devlink_ops ice_sf_devlink_ops;
 
 static int
 ice_devlink_enable_roce_get(struct devlink *devlink, u32 id,
-                           struct devlink_param_gset_ctx *ctx)
+                           struct devlink_param_gset_ctx *ctx,
+                           struct netlink_ext_ack *extack)
 {
        struct ice_pf *pf = devlink_priv(devlink);
        struct iidc_rdma_core_dev_info *cdev;
@@ -1415,7 +1418,8 @@ ice_devlink_enable_roce_validate(struct devlink *devlink, u32 id,
 
 static int
 ice_devlink_enable_iw_get(struct devlink *devlink, u32 id,
-                         struct devlink_param_gset_ctx *ctx)
+                         struct devlink_param_gset_ctx *ctx,
+                         struct netlink_ext_ack *extack)
 {
        struct ice_pf *pf = devlink_priv(devlink);
        struct iidc_rdma_core_dev_info *cdev;
@@ -1522,11 +1526,13 @@ static int ice_devlink_local_fwd_str_to_mode(const char *mode_str)
  * @devlink: Pointer to the devlink instance.
  * @id: The parameter ID to set.
  * @ctx: Context to store the parameter value.
+ * @extack: netlink extended ACK structure
  *
  * Return: Zero.
  */
 static int ice_devlink_local_fwd_get(struct devlink *devlink, u32 id,
-                                    struct devlink_param_gset_ctx *ctx)
+                                    struct devlink_param_gset_ctx *ctx,
+                                    struct netlink_ext_ack *extack)
 {
        struct ice_pf *pf = devlink_priv(devlink);
        struct ice_port_info *pi;
index 3735372539bd9a5149a09d820536aeb37962d890..0f9953eaf1b09f6dd74a9ffe8c6675ac72b55b26 100644 (file)
@@ -1233,7 +1233,8 @@ static int rvu_af_dl_dwrr_mtu_set(struct devlink *devlink, u32 id,
 }
 
 static int rvu_af_dl_dwrr_mtu_get(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;
@@ -1259,7 +1260,8 @@ enum rvu_af_dl_param_id {
 };
 
 static int rvu_af_npc_exact_feature_get(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;
@@ -1314,7 +1316,8 @@ static int rvu_af_npc_exact_feature_validate(struct devlink *devlink, u32 id,
 }
 
 static int rvu_af_dl_npc_mcam_high_zone_percent_get(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;
@@ -1376,7 +1379,8 @@ static int rvu_af_dl_npc_mcam_high_zone_percent_validate(struct devlink *devlink
 }
 
 static int rvu_af_dl_npc_def_rule_cntr_get(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;
@@ -1402,7 +1406,8 @@ static int rvu_af_dl_npc_def_rule_cntr_set(struct devlink *devlink, u32 id,
 }
 
 static int rvu_af_dl_nix_maxlf_get(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;
index e13ae5484c19cbb52dd3845aa37d2e98abac3d99..a72694219df49b2dac988c3fb05ca455f6675d86 100644 (file)
@@ -48,7 +48,8 @@ static int otx2_dl_mcam_count_set(struct devlink *devlink, u32 id,
 }
 
 static int otx2_dl_mcam_count_get(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;
@@ -84,7 +85,8 @@ static int otx2_dl_ucast_flt_cnt_set(struct devlink *devlink, u32 id,
 }
 
 static int otx2_dl_ucast_flt_cnt_get(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;
index 03d2fc7d9b09f8293501ecbcec79e55265bd4087..2de226951e19d7217e93c00b30aaa80f6d4ff5f3 100644 (file)
@@ -174,7 +174,8 @@ MODULE_PARM_DESC(port_type_array, "Array of port types: HW_DEFAULT (0) is defaul
 static atomic_t pf_loading = ATOMIC_INIT(0);
 
 static int mlx4_devlink_ierr_reset_get(struct devlink *devlink, u32 id,
-                                      struct devlink_param_gset_ctx *ctx)
+                                      struct devlink_param_gset_ctx *ctx,
+                                      struct netlink_ext_ack *extack)
 {
        ctx->val.vbool = !!mlx4_internal_err_reset;
        return 0;
@@ -189,7 +190,8 @@ static int mlx4_devlink_ierr_reset_set(struct devlink *devlink, u32 id,
 }
 
 static int mlx4_devlink_crdump_snapshot_get(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;
index 3adf2b1cd26accfad150d2d162047f121254456e..4b7a1ce7f406b1161162e8435cdea3da0432159a 100644 (file)
@@ -1969,7 +1969,8 @@ static int mlx5_devlink_esw_multiport_set(struct devlink *devlink, u32 id,
 }
 
 static int mlx5_devlink_esw_multiport_get(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);
 
index 8ebca0d17f6551b6066db8b28e77235b4aa719a4..8de6c7f6c2944d166f411ef83041d587320d8ade 100644 (file)
@@ -2618,7 +2618,8 @@ done:
 }
 
 static int esw_port_metadata_get(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);
 
index 2b755a0035ced48680a586e21cb03b9e0c93fd96..0a6031a64c6f469e9f4cdb0de351adb311a9cd5e 100644 (file)
@@ -3833,7 +3833,8 @@ static int mlx5_fs_mode_set(struct devlink *devlink, u32 id,
 }
 
 static int mlx5_fs_mode_get(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);
 
index 89e399606877ba2cdefb2d9e40256627707e9972..2bceb42c98cc2e53aa92414c97473ff5d7c5a545 100644 (file)
@@ -73,7 +73,8 @@ static int mlx5_fw_reset_enable_remote_dev_reset_set(struct devlink *devlink, u3
 }
 
 static int mlx5_fw_reset_enable_remote_dev_reset_get(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;
index 459a0b4d08e657121db5d46bb35c8f6245c30687..70cb22fa96dbfbbc66bf054a4d77ddc33f0c824f 100644 (file)
@@ -200,7 +200,8 @@ static const char *const
 
 static int
 mlx5_nv_param_devlink_cqe_compress_get(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);
        u32 mnvda[MLX5_ST_SZ_DW(mnvda_reg)] = {};
@@ -302,7 +303,8 @@ static int mlx5_nv_param_read_per_host_pf_conf(struct mlx5_core_dev *dev,
 }
 
 static int mlx5_devlink_enable_sriov_get(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);
        u32 mnvda[MLX5_ST_SZ_DW(mnvda_reg)] = {};
@@ -413,7 +415,8 @@ static int mlx5_devlink_enable_sriov_set(struct devlink *devlink, u32 id,
 }
 
 static int mlx5_devlink_total_vfs_get(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);
        u32 mnvda[MLX5_ST_SZ_DW(mnvda_reg)] = {};
index b1d08e958bf9efacfabe8e92fc9a3ef8b75ca3e5..69f9da9fb30500e64cfcec646c532d8a8e9aac65 100644 (file)
@@ -1489,7 +1489,8 @@ mlxsw_sp_acl_tcam_vregion_rehash(struct mlxsw_sp *mlxsw_sp,
 
 static int
 mlxsw_sp_acl_tcam_region_rehash_intrvl_get(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 *tcam;
index 0e1a3800f371cff722f322e8640dca66b573ba31..85e3b19e6165b65ac011b28ed38ccd01b67e9a51 100644 (file)
@@ -81,7 +81,8 @@ static const struct nfp_devlink_param_u8_arg nfp_devlink_u8_args[] = {
 
 static int
 nfp_devlink_param_u8_get(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);
index 94c5689b5abde9f0acad37bd825bec62fd2739ab..0c5278c0598ce73ae91079f97a12716e3b98dcb2 100644 (file)
@@ -121,7 +121,8 @@ void qed_fw_reporters_destroy(struct devlink *devlink)
 }
 
 static int qed_dl_param_get(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;
index b1aa236d80513cfa71f50eee2529639fed6c87c5..6cacedb2c9b3fefdd4c9ec8ba98d389443d21ebd 100644 (file)
@@ -7531,7 +7531,8 @@ static int stmmac_dl_ts_coarse_set(struct devlink *dl, u32 id,
 }
 
 static int stmmac_dl_ts_coarse_get(struct devlink *dl, u32 id,
-                                  struct devlink_param_gset_ctx *ctx)
+                                  struct devlink_param_gset_ctx *ctx,
+                                  struct netlink_ext_ack *extack)
 {
        struct stmmac_devlink_priv *dl_priv = devlink_priv(dl);
        struct stmmac_priv *priv = dl_priv->stmmac_priv;
index d5f358ec982050751a63039e73887bf6e7f684e7..5924db6be3feaf8a7566a0ee82e6cec225110729 100644 (file)
@@ -3068,7 +3068,8 @@ static void am65_cpsw_init_host_port_emac(struct am65_cpsw_common *common)
 }
 
 static int am65_cpsw_dl_switch_mode_get(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 *common = dl_priv->common;
index 8b9e2078c6025a099e0f90d4d80395b7622cf0f6..ab88d4c02cbde76207f89cf433e2b383dcde6a83 100644 (file)
@@ -1618,7 +1618,8 @@ static const struct devlink_ops cpsw_devlink_ops = {
 };
 
 static int cpsw_dl_switch_mode_get(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;
@@ -1753,7 +1754,8 @@ exit:
 }
 
 static int cpsw_dl_ale_ctrl_get(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;
index 33d6342124bc339ab403c3046c32db10573aabf9..301a9d294d30f06f32afa1ef50547f83f9ee0e52 100644 (file)
@@ -21,7 +21,8 @@ static struct iosm_coredump_file_info list[IOSM_NOF_CD_REGION] = {
 
 /* Get the param values for the specific param ID's */
 static int ipc_devlink_get_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);
 
index d01046ef0577c740b01167b5db19e3dc8381fe10..5f479227144d765436e8ba31986200698bb8354e 100644 (file)
@@ -490,7 +490,8 @@ struct devlink_param {
        enum devlink_param_type type;
        unsigned long supported_cmodes;
        int (*get)(struct devlink *devlink, u32 id,
-                  struct devlink_param_gset_ctx *ctx);
+                  struct devlink_param_gset_ctx *ctx,
+                  struct netlink_ext_ack *extack);
        int (*set)(struct devlink *devlink, u32 id,
                   struct devlink_param_gset_ctx *ctx,
                   struct netlink_ext_ack *extack);
index 97d5f401cfcf99ac5f0773b41ac4e2515f7c68f4..e40cdc12f7f397865cab9fe602302ba481549b5e 100644 (file)
@@ -1251,7 +1251,8 @@ struct dsa_switch_ops {
                             dsa_devlink_param_get, dsa_devlink_param_set, NULL)
 
 int dsa_devlink_param_get(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_param_set(struct devlink *dl, u32 id,
                          struct devlink_param_gset_ctx *ctx,
                          struct netlink_ext_ack *extack);
index 6b233b13b69ae3878906fa7ff562ce76609bc7e3..3dbd023e4c36c25ca04712c146ba7c7d5639a7fd 100644 (file)
@@ -174,11 +174,12 @@ devlink_param_cmode_is_supported(const struct devlink_param *param,
 
 static int devlink_param_get(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->get)
                return -EOPNOTSUPP;
-       return param->get(devlink, param->id, ctx);
+       return param->get(devlink, param->id, ctx, extack);
 }
 
 static int devlink_param_set(struct devlink *devlink,
@@ -250,7 +251,8 @@ static int devlink_nl_param_fill(struct sk_buff *msg, struct devlink *devlink,
                                 unsigned int port_index,
                                 struct devlink_param_item *param_item,
                                 enum devlink_command cmd,
-                                u32 portid, u32 seq, int flags)
+                                u32 portid, u32 seq, int flags,
+                                struct netlink_ext_ack *extack)
 {
        union devlink_param_value param_value[DEVLINK_PARAM_CMODE_MAX + 1];
        bool param_value_set[DEVLINK_PARAM_CMODE_MAX + 1] = {};
@@ -275,7 +277,7 @@ static int devlink_nl_param_fill(struct sk_buff *msg, struct devlink *devlink,
                                return -EOPNOTSUPP;
                } else {
                        ctx.cmode = i;
-                       err = devlink_param_get(devlink, param, &ctx);
+                       err = devlink_param_get(devlink, param, &ctx, extack);
                        if (err)
                                return err;
                        param_value[i] = ctx.val;
@@ -357,7 +359,7 @@ static void devlink_param_notify(struct devlink *devlink,
        if (!msg)
                return;
        err = devlink_nl_param_fill(msg, devlink, port_index, param_item, cmd,
-                                   0, 0, 0);
+                                   0, 0, 0, NULL);
        if (err) {
                nlmsg_free(msg);
                return;
@@ -400,7 +402,8 @@ static int devlink_nl_param_get_dump_one(struct sk_buff *msg,
                err = devlink_nl_param_fill(msg, devlink, 0, param_item,
                                            DEVLINK_CMD_PARAM_GET,
                                            NETLINK_CB(cb->skb).portid,
-                                           cb->nlh->nlmsg_seq, flags);
+                                           cb->nlh->nlmsg_seq, flags,
+                                           cb->extack);
                if (err == -EOPNOTSUPP) {
                        err = 0;
                } else if (err) {
@@ -509,8 +512,8 @@ int devlink_nl_param_get_doit(struct sk_buff *skb,
                return -ENOMEM;
 
        err = devlink_nl_param_fill(msg, devlink, 0, param_item,
-                                   DEVLINK_CMD_PARAM_GET,
-                                   info->snd_portid, info->snd_seq, 0);
+                                   DEVLINK_CMD_PARAM_GET, info->snd_portid,
+                                   info->snd_seq, 0, info->extack);
        if (err) {
                nlmsg_free(msg);
                return err;
index f41f9fc2194e570bf0a52fc9964d9b63b863be5b..ed342f345692bb7006a76764145993baf640f750 100644 (file)
@@ -182,7 +182,8 @@ static const struct devlink_ops dsa_devlink_ops = {
 };
 
 int dsa_devlink_param_get(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);