devlink: net/mlx5: implement swp_l4_csum_mode via devlink params
Subsystems (23)
v2 cover devlink: net/mlx5: implement swp_l4_csum_mode via devlink params
This series contains two patches. The first is a pure refactor that passes through the extack to devlink_param::get() implementations. The second introduces a permanent devlink param to the mlx5 driver for controlling tx csum behavior.
Enabling extack for devlink_param::get() allows drivers to provide more information in cases when reading parameters from hardware can result in errors or unexpected values.
The mlx5 swp_l4_csum_mode devlink param is necessary for initializing PSP on CX7 NICs.
CHANGES:
v2:
- fix indentation issue in new mlx5.rst entry
- use extack in mlx5_nv_param_devlink_swp_l4_csum_mode_get()
- introduce extack patch.
v1: https://lore.kernel.org/netdev/[email protected]/
Daniel Zahka (2):
devlink: pass extack through to devlink_param::get() net/mlx5: implement swp_l4_csum_mode via devlink params
Documentation/networking/devlink/mlx5.rst | 9 + .../marvell/octeontx2/otx2_cpt_devlink.c | 6 +- drivers/net/ethernet/amd/pds_core/core.h | 3 +- drivers/net/ethernet/amd/pds_core/devlink.c | 3 +- .../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 6 +- .../net/ethernet/intel/ice/devlink/devlink.c | 12 +- .../marvell/octeontx2/af/rvu_devlink.c | 15 +- .../marvell/octeontx2/nic/otx2_devlink.c | 6 +- drivers/net/ethernet/mellanox/mlx4/main.c | 6 +- .../net/ethernet/mellanox/mlx5/core/devlink.h | 3 +- .../net/ethernet/mellanox/mlx5/core/eswitch.c | 3 +- .../mellanox/mlx5/core/eswitch_offloads.c | 3 +- .../net/ethernet/mellanox/mlx5/core/fs_core.c | 3 +- .../ethernet/mellanox/mlx5/core/fw_reset.c | 3 +- .../mellanox/mlx5/core/lib/nv_param.c | 170 +++++++++++++++++- .../mellanox/mlxsw/spectrum_acl_tcam.c | 3 +- .../ethernet/netronome/nfp/devlink_param.c | 3 +- drivers/net/ethernet/qlogic/qed/qed_devlink.c | 3 +- .../net/ethernet/stmicro/stmmac/stmmac_main.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 | 19 +- net/dsa/devlink.c | 3 +- 26 files changed, 257 insertions(+), 46 deletions(-)
Signature · 1 line
2.47.3
PATCH v2 1/2 devlink: pass extack through to devlink_param::get()
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.
--- .../marvell/octeontx2/otx2_cpt_devlink.c | 6 ++++-- drivers/net/ethernet/amd/pds_core/core.h | 3 ++- drivers/net/ethernet/amd/pds_core/devlink.c | 3 ++- .../net/ethernet/broadcom/bnxt/bnxt_devlink.c | 6 ++++-- .../net/ethernet/intel/ice/devlink/devlink.c | 12 ++++++++---- .../marvell/octeontx2/af/rvu_devlink.c | 15 ++++++++++----- .../marvell/octeontx2/nic/otx2_devlink.c | 6 ++++-- drivers/net/ethernet/mellanox/mlx4/main.c | 6 ++++-- .../net/ethernet/mellanox/mlx5/core/eswitch.c | 3 ++- .../mellanox/mlx5/core/eswitch_offloads.c | 3 ++- .../net/ethernet/mellanox/mlx5/core/fs_core.c | 3 ++- .../ethernet/mellanox/mlx5/core/fw_reset.c | 3 ++- .../mellanox/mlx5/core/lib/nv_param.c | 9 ++++++--- .../mellanox/mlxsw/spectrum_acl_tcam.c | 3 ++- .../ethernet/netronome/nfp/devlink_param.c | 3 ++- drivers/net/ethernet/qlogic/qed/qed_devlink.c | 3 ++- .../net/ethernet/stmicro/stmmac/stmmac_main.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 | 19 +++++++++++-------- net/dsa/devlink.c | 3 ++- 24 files changed, 85 insertions(+), 45 deletions(-)
drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c +4 -2
@@ -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;
drivers/net/ethernet/amd/pds_core/core.h +2 -1
@@ -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);
drivers/net/ethernet/amd/pds_core/devlink.c +2 -1
@@ -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;
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +4 -2
@@ -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);
drivers/net/ethernet/intel/ice/devlink/devlink.c +8 -4
@@ -614,7 +614,8 @@ static int ice_update_tx_topo_user_sel(struct ice_pf *pf, int layers)* 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 +1350,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 +1417,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;
@@ -1526,7 +1529,8 @@ static int ice_devlink_local_fwd_str_to_mode(const char *mode_str)* 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;
drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c +10 -5
@@ -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;
drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c +4 -2
@@ -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;
drivers/net/ethernet/mellanox/mlx4/main.c +4 -2
@@ -174,7 +174,8 @@ MODULE_PARM_DESC(port_type_array, "Array of port types: HW_DEFAULT (0) is defaulstatic 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;
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +2 -1
@@ -1978,7 +1978,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);
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +2 -1
@@ -2492,7 +2492,8 @@ static int esw_port_metadata_set(struct devlink *devlink, u32 id, }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);
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +2 -1
@@ -3774,7 +3774,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);
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c +2 -1
@@ -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;
drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c +6 -3
@@ -200,7 +200,8 @@ static const char *conststatic 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)] = {};
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c +2 -1
@@ -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;
drivers/net/ethernet/netronome/nfp/devlink_param.c +2 -1
@@ -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);
drivers/net/ethernet/qlogic/qed/qed_devlink.c +2 -1
@@ -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;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +2 -1
@@ -7434,7 +7434,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;
drivers/net/ethernet/ti/am65-cpsw-nuss.c +2 -1
@@ -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;
drivers/net/ethernet/ti/cpsw_new.c +4 -2
@@ -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 @@ static int cpsw_dl_switch_mode_set(struct devlink *dl, u32 id, }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;
drivers/net/wwan/iosm/iosm_ipc_devlink.c +2 -1
@@ -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);
include/net/devlink.h +2 -1
@@ -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);
include/net/dsa.h +2 -1
@@ -1249,7 +1249,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);
net/devlink/param.c +11 -8
@@ -169,11 +169,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,
@@ -245,7 +246,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 ] = {};
@@ -270,7 +272,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;
@@ -352,7 +354,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 ;
@@ -395,7 +397,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) {
@@ -504,8 +507,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;
net/dsa/devlink.c +2 -1
@@ -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);
Signature · 1 line
2.47.3
Jakub Kicinski
maintainerRe: [PATCH net-next v2 1/2] devlink: pass extack through to devlink_param::get()
Quoted 9 lines · On Mon, 3 Nov 2025 11:45:52 -0800 Daniel Zahka wrote:
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 fromparam_get_doitorparam_get_dumpitcontexts, pass the extack through so that drivers can report errors when retrieving param values.devlink_param::get()is called from the context ofdevlink_param_notify(), pass NULL in for the extack.
Warning: drivers/net/ethernet/intel/ice/devlink/devlink.c:618 function parameter 'extack' not described in 'ice_devlink_tx_sched_layers_get'
Warning: drivers/net/ethernet/intel/ice/devlink/devlink.c:1533 function parameter 'extack' not described in 'ice_devlink_local_fwd_get'
Signature · 1 line
pw-bot: cr
kernel test robot
build botRe: [PATCH net-next v2 1/2] devlink: pass extack through to devlink_param::get()
In reply to Daniel Zahkakernel test robot noticed the following build warnings:
Hi Daniel,
kernel test robot noticed the following build warnings:
[auto build test WARNING on net-next/main]
url: https://github.com/intel-lab-lkp/linux/commits/Daniel-Zahka/devlink-pass-extack-through-to-devlink_param-get/20251104-034818 base: net-next/main patch link: https://lore.kernel.org/r/20251103194554.3203178-2-daniel.zahka%40gmail.com patch subject: [PATCH net-next v2 1/2] devlink: pass extack through to devlink_param::get() config: x86_64-rhel-9.4-bpf (https://download.01.org/0day-ci/archive/20251105/[email protected]/config) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251105/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All warnings (new ones prefixed by >>):
>> Warning: drivers/net/ethernet/intel/ice/devlink/devlink.c:618 function parameter 'extack' not described in 'ice_devlink_tx_sched_layers_get' >> Warning: drivers/net/ethernet/intel/ice/devlink/devlink.c:1533 function parameter 'extack' not described in 'ice_devlink_local_fwd_get'
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
PATCH v2 2/2 net/mlx5: implement swp_l4_csum_mode via devlink params
In reply to Daniel Zahkaswp_l4_csum_mode controls how L4 transmit checksums are computed when using Software Parser (SWP) hints for header locations.
Supported values:
1. device_default: use device default setting.
2. full_csum: calculate L4 checksum with the pseudo-header.
3. l4_only: calculate L4 checksum without the pseudo-header. Only available when swp_l4_csum_mode_l4_only is set in mlx5_ifc_nv_sw_offload_cap_bits.
The l4_only setting is a dependency for PSP initialization in mlx5e_psp_init().
---
Notes:
v2:
- use extack in mlx5_nv_param_devlink_swp_l4_csum_mode_get()
- fix indentation issue in mlx5.rst entry
Documentation/networking/devlink/mlx5.rst | 9 + .../net/ethernet/mellanox/mlx5/core/devlink.h | 3 +- .../mellanox/mlx5/core/lib/nv_param.c | 161 ++++++++++++++++++ 3 files changed, 172 insertions(+), 1 deletion(-)
Documentation/networking/devlink/mlx5.rst +9 -0
@@ -218,6 +218,15 @@ parameters. * ``balanced`` : Merges fewer CQEs, resulting in a moderate compression ratio but maintaining a balance between bandwidth savings and performance * ``aggressive`` : Merges more CQEs into a single entry, achieving a higher compression rate and maximizing performance, particularly under high traffic loads + * - ``swp_l4_csum_mode`` + - string + - permanent + - Configure how the L4 checksum is calculated by the device when using + Software Parser (SWP) hints for header locations. + * ``device_default`` : Use the device's default checksum calculation mode + * ``full_csum`` : Calculate full checksum including the pseudo-header + * ``l4_only`` : Calculate L4-only checksum, excluding the pseudo-header + The ``mlx5`` driver supports reloading via ``DEVLINK_CMD_RELOAD`` Info versions
drivers/net/ethernet/mellanox/mlx5/core/devlink.h +2 -1
@@ -26,7 +26,8 @@ enum mlx5_devlink_param_id {MLX5_DEVLINK_PARAM_ID_PCIE_CONG_IN_HIGH ,MLX5_DEVLINK_PARAM_ID_PCIE_CONG_OUT_LOW ,MLX5_DEVLINK_PARAM_ID_PCIE_CONG_OUT_HIGH , -MLX5_DEVLINK_PARAM_ID_CQE_COMPRESSION_TYPE +MLX5_DEVLINK_PARAM_ID_CQE_COMPRESSION_TYPE , + MLX5_DEVLINK_PARAM_ID_SWP_L4_CSUM_MODE, }; struct mlx5_trap_ctx {
drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c +161 -0
191 lines not on this page · raw message
Signature · 1 line
2.47.3
Jiri Pirko
maintainerRe: [PATCH net-next v2 2/2] net/mlx5: implement swp_l4_csum_mode via devlink params
Quoted 210 lines · Mon, Nov 03, 2025 at 08:45:53PM +0100, [email protected] wrote:
swp_l4_csum_modecontrols how L4 transmit checksums are computed when using Software Parser (SWP) hints for header locations.Supported values:
1.device_default: use device default setting.
2.full_csum: calculate L4 checksum with the pseudo-header.
3.l4_only: calculate L4 checksum without the pseudo-header. Only available whenswp_l4_csum_mode_l4_onlyis set inmlx5_ifc_nv_sw_offload_cap_bits.The
l4_onlysetting is a dependency for PSP initialization inmlx5e_psp_init().Signed-off-by Daniel Zahka <[email protected]>---
Notes:
v2:
- use extack inmlx5_nv_param_devlink_swp_l4_csum_mode_get()
- fix indentation issue inmlx5.rstentryDocumentation/networking/devlink/mlx5.rst | 9 + .../net/ethernet/mellanox/mlx5/core/devlink.h | 3 +- .../mellanox/mlx5/core/lib/nv_param.c | 161 ++++++++++++++++++ 3 files changed, 172 insertions(+), 1 deletion(-)Documentation/networking/devlink/mlx5.rst +9
-0@@ -218,6 +218,15 @@ parameters. * ``balanced`` : Merges fewer CQEs, resulting in a moderate compression ratio but maintaining a balance between bandwidth savings and performance * ``aggressive`` : Merges more CQEs into a single entry, achieving a higher compression rate and maximizing performance, particularly under high traffic loads + * - ``swp_l4_csum_mode`` + - string + - permanent + - Configure how the L4 checksum is calculated by the device when using + Software Parser (SWP) hints for header locations. + * ``device_default`` : Use the device's default checksum calculation mode + * ``full_csum`` : Calculate full checksum including the pseudo-header + * ``l4_only`` : Calculate L4-only checksum, excluding the pseudo-header +The ``mlx5`` driver supports reloading via ``DEVLINK_CMD_RELOAD``
Info versions
drivers/net/ethernet/mellanox/mlx5/core/devlink.h +2
-1@@ -26,7 +26,8 @@ enum mlx5_devlink_param_id {MLX5_DEVLINK_PARAM_ID_PCIE_CONG_IN_HIGH ,MLX5_DEVLINK_PARAM_ID_PCIE_CONG_OUT_LOW ,MLX5_DEVLINK_PARAM_ID_PCIE_CONG_OUT_HIGH , -MLX5_DEVLINK_PARAM_ID_CQE_COMPRESSION_TYPE +MLX5_DEVLINK_PARAM_ID_CQE_COMPRESSION_TYPE , + MLX5_DEVLINK_PARAM_ID_SWP_L4_CSUM_MODE, }; struct mlx5_trap_ctx {drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c +37
-0@@ -8,6 +8,8 @@ enum {MLX5_CLASS_0_CTRL_ID_NV_GLOBAL_PCI_CONF =0x80 ,MLX5_CLASS_0_CTRL_ID_NV_GLOBAL_PCI_CAP =0x81 ,MLX5_CLASS_0_CTRL_ID_NV_SW_OFFLOAD_CONFIG =0x10a , +MLX5_CLASS_0_CTRL_ID_NV_SW_OFFLOAD_CAP =0x10b , +MLX5_CLASS_0_CTRL_ID_NV_SW_ACCELERATE_CONF =0x11d , MLX5_CLASS_3_CTRL_ID_NV_PF_PCI_CONF = 0x80, };@@ -123,6 +125,17 @@ struct mlx5_ifc_nv_sw_offload_conf_bits {u8 lro_log_timeout0[0x4 ]; }; +struct mlx5_ifc_nv_sw_offload_cap_bits { +u8 reserved_at_0[0x19 ]; +u8 swp_l4_csum_mode_l4_only[0x1 ]; +u8 reserved_at_1a[0x6 ]; +}; + +struct mlx5_ifc_nv_sw_accelerate_conf_bits { +u8 swp_l4_csum_mode[0x2 ]; +u8 reserved_at_2[0x3e ]; +}; +#define MNVDA_HDR_SZ \ (MLX5_ST_SZ_BYTES(mnvda_reg) - \ MLX5_BYTE_OFF(mnvda_reg, configuration_item_data))@@ -195,6 +208,30 @@ mlx5_nv_param_read_sw_offload_conf(struct mlx5_core_dev *dev, void *mnvda,return mlx5_nv_param_read (dev, mnvda, len); } +static int +mlx5_nv_param_read_sw_offload_cap (struct mlx5_core_dev *dev,void *mnvda, +size_t len) +{ +MLX5_SET_CFG_ITEM_TYPE (global, mnvda, type_class,0 ); +MLX5_SET_CFG_ITEM_TYPE (global, mnvda, parameter_index, +MLX5_CLASS_0_CTRL_ID_NV_SW_OFFLOAD_CAP ); +MLX5_SET_CFG_HDR_LEN (mnvda, nv_sw_offload_cap); + +return mlx5_nv_param_read (dev, mnvda, len); +} + +static int +mlx5_nv_param_read_sw_accelerate_conf (struct mlx5_core_dev *dev,void *mnvda, +size_t len) +{ +MLX5_SET_CFG_ITEM_TYPE (global, mnvda, type_class,0 ); +MLX5_SET_CFG_ITEM_TYPE (global, mnvda, parameter_index, +MLX5_CLASS_0_CTRL_ID_NV_SW_ACCELERATE_CONF ); +MLX5_SET_CFG_HDR_LEN (mnvda, nv_sw_accelerate_conf); + +return mlx5_nv_param_read (dev, mnvda, len); +} +static const char *const
cqe_compress_str[] = { "balanced", "aggressive" };drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c +84
-0@@ -269,6 +306,124 @@ mlx5_nv_param_devlink_cqe_compress_set(struct devlink *devlink, u32 id,return mlx5_nv_param_write (dev, mnvda,sizeof (mnvda)); } +enum swp_l4_csum_mode { +SWP_L4_CSUM_MODE_DEVICE_DEFAULT =0 , +SWP_L4_CSUM_MODE_FULL_CSUM =1 , +SWP_L4_CSUM_MODE_L4_ONLY =2 , +}; + +static const char *const + swp_l4_csum_mode_str[] = {"device_default" ,"full_csum" ,"l4_only" }; + +static int +mlx5_nv_param_devlink_swp_l4_csum_mode_get (struct devlink *devlink,u32 id, +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)] = {}; +u8 value =U8_MAX ; +void *data; +int err; + + err =mlx5_nv_param_read_sw_accelerate_conf (dev, mnvda,sizeof (mnvda)); +if (err) { +NL_SET_ERR_MSG_MOD (extack, +"Failed to read sw_accelerate_conf mnvda reg" ); +return err; + } + + data =MLX5_ADDR_OF (mnvda_reg, mnvda, configuration_item_data); + value =MLX5_GET (nv_sw_accelerate_conf, data, swp_l4_csum_mode); + +if (value >=ARRAY_SIZE (swp_l4_csum_mode_str)) { +NL_SET_ERR_MSG_FMT_MOD (extack, +"Invalid swp_l4_csum_mode value %u read from device" , + value); +return -EINVAL ; + } + +strscpy (ctx->val.vstr, swp_l4_csum_mode_str[value], +sizeof (ctx->val.vstr)); +return 0 ; +} + +static int +mlx5_nv_param_devlink_swp_l4_csum_mode_validate (struct devlink *devlink,u32 id, +union devlink_param_value val, +struct netlink_ext_ack *extack) +{ +struct mlx5_core_dev *dev =devlink_priv (devlink); +u32 cap[MLX5_ST_SZ_DW (mnvda_reg)] = {}; +void *data; +int err, i; + +for (i =0 ; i <ARRAY_SIZE (swp_l4_csum_mode_str); i++) { +if (!strcmp (val.vstr, swp_l4_csum_mode_str[i])) +break ; + } + +if (i >=ARRAY_SIZE (swp_l4_csum_mode_str)) { +NL_SET_ERR_MSG_MOD (extack, +"Invalid value, supported values are device_default/full_csum/l4_only" ); +return -EINVAL ; + } + +if (i ==SWP_L4_CSUM_MODE_L4_ONLY ) { + err =mlx5_nv_param_read_sw_offload_cap (dev, cap,sizeof (cap)); +if (err) { +NL_SET_ERR_MSG_MOD (extack, +"Failed to read sw_offload_cap" ); +return err; + } + + data =MLX5_ADDR_OF (mnvda_reg, cap, configuration_item_data); +if (!MLX5_GET (nv_sw_offload_cap, data, swp_l4_csum_mode_l4_only)) { +NL_SET_ERR_MSG_MOD (extack, +"l4_only mode is not supported on this device" ); +return -EOPNOTSUPP ; + } + } + +return 0 ; +} + +static int +mlx5_nv_param_devlink_swp_l4_csum_mode_set(struct devlink *devlink, u32 id,
drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c mlx5_nv_param_devlink_cqe_compress_set(struct devlink *devlink, u32 id, · line 402
Quoted 10 lines
drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c +10
-0+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)] = {}; +void *data; +u8 value; +int err; + +if (!strcmp (ctx->val.vstr,"device_default" ))
I did some research. 0/DEVICE_DEFAULT should not be ever reported back from FW. It's purpose is for user to reset to default FW configuration. What's the usecase for that? I think you could just avoid 0/DEVICE_DEFAULT entirely, for both get and set.
But ff you find a need to allow user to set FW default, it should be most likely done differently, perhaps by a new devlink command, rather than per-param free-form string.
Quoted 28 lines
drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c +24
-0+ value =SWP_L4_CSUM_MODE_DEVICE_DEFAULT ; + else if (!strcmp(ctx->val.vstr, "full_csum")) + value =SWP_L4_CSUM_MODE_FULL_CSUM ; + else + value =SWP_L4_CSUM_MODE_L4_ONLY ; + + err =mlx5_nv_param_read_sw_accelerate_conf (dev, mnvda,sizeof (mnvda)); +if (err) { +NL_SET_ERR_MSG_MOD (extack, +"Failed to read sw_accelerate_conf mnvda reg" ); +return err; + } + + data =MLX5_ADDR_OF (mnvda_reg, mnvda, configuration_item_data); +MLX5_SET (nv_sw_accelerate_conf, data, swp_l4_csum_mode, value); + + err =mlx5_nv_param_write (dev, mnvda,sizeof (mnvda)); +if (err) +NL_SET_ERR_MSG_MOD (extack, +"Failed to write sw_accelerate_conf mnvda reg" ); + +return err; +} +static int mlx5_nv_param_read_global_pci_conf (struct mlx5_core_dev *dev,void *mnvda,size_t len) {
drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c static const struct devlink_param mlx5_nv_param_devlink_params[] = { · line 707
Quoted 5 lines
drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c +2
-0@@ -548,6 +703,12 @@ static const struct devlink_param mlx5_nv_param_devlink_params[] = { mlx5_nv_param_devlink_cqe_compress_get, mlx5_nv_param_devlink_cqe_compress_set, mlx5_nv_param_devlink_cqe_compress_validate), + DEVLINK_PARAM_DRIVER(MLX5_DEVLINK_PARAM_ID_SWP_L4_CSUM_MODE, + "swp_l4_csum_mode", DEVLINK_PARAM_TYPE_STRING,
I still think that even unlikely this will be implemented in other driver, it is generic param. Could you please treat it as such?
Quoted 10 lines
drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c +4
-0+BIT (DEVLINK_PARAM_CMODE_PERMANENT ), + mlx5_nv_param_devlink_swp_l4_csum_mode_get, + mlx5_nv_param_devlink_swp_l4_csum_mode_set, + mlx5_nv_param_devlink_swp_l4_csum_mode_validate), };int mlx5_nv_param_register_dl_params (struct devlink *devlink)Signature · 1 line
2.47.3
Re: [PATCH net-next v2 2/2] net/mlx5: implement swp_l4_csum_mode via devlink params
Quoted 4 lines · Jiri Pirko
I did some research. 0/DEVICE_DEFAULT should not be ever reported back from FW. It's purpose is for user to reset to default FW configuration. What's the usecase for that? I think you could just avoid 0/DEVICE_DEFAULT entirely, for both get and set.
I find that 0/DEVICE_DEFAULT is reported back on my device. I have observed this same behavior when using the mstconfig tool for setting the parameter too.
Re: [PATCH net-next v2 2/2] net/mlx5: implement swp_l4_csum_mode via devlink params
Quoted 9 lines · Daniel Zahka
Quoted 4 lines · Jiri Pirko
I did some research. 0/DEVICE_DEFAULT should not be ever reported back from FW. It's purpose is for user to reset to default FW configuration. What's the usecase for that? I think you could just avoid 0/DEVICE_DEFAULT entirely, for both get and set.
I find that 0/DEVICE_DEFAULT is reported back on my device. I have observed this same behavior when using the mstconfig tool for setting the parameter too.
e.g.
$ dmesg | grep -i mlx | grep -i firmware [ 10.165767] mlx5_core 0000:01:00.0: firmware version: 28.46.1006
$ ./mstconfig -d 01:00.0 -b ./mlxconfig_host.db query SWP_L4_CHECKSUM_MODE
Device #1:
----------
Device type: ConnectX7
Name: CX71143DMC-CDAE_FB_Ax
Description: ConnectX-7 Ethernet adapter card; 100 GbE OCP3.0; Single-port QSFP; Multi Host; 2 Host; PCIe 4.0 x16; Crypto and Secure Boot Device: 01:00.0
Configurations: Next Boot SWP_L4_CHECKSUM_MODE DEVICE_DEFAULT(0)
Jiri Pirko
maintainerRe: [PATCH net-next v2 2/2] net/mlx5: implement swp_l4_csum_mode via devlink params
Quoted 24 lines · Tue, Nov 04, 2025 at 01:51:16PM +0100, [email protected] wrote:
Quoted 11 lines · Daniel Zahka
Quoted 4 lines · Jiri Pirko
I did some research. 0/DEVICE_DEFAULT should not be ever reported back from FW. It's purpose is for user to reset to default FW configuration. What's the usecase for that? I think you could just avoid 0/DEVICE_DEFAULT entirely, for both get and set.
I find that 0/DEVICE_DEFAULT is reported back on my device. I have observed this same behavior when using the mstconfig tool for setting the parameter too.
e.g.
$ dmesg | grep -i mlx | grep -i firmware [ 10.165767] mlx5_core 0000:01:00.0: firmware version: 28.46.1006$ ./mstconfig -d 01:00.0 -b ./mlxconfig_host.db query SWP_L4_CHECKSUM_MODEDevice #1:
----------
Quoted 8 lines
Device type: ConnectX7
Name: CX71143DMC-CDAE_FB_Ax
Description: ConnectX-7 Ethernet adapter card; 100 GbE OCP3.0; Single-port QSFP; Multi Host; 2 Host; PCIe 4.0 x16; Crypto and Secure Boot Device: 01:00.0Configurations: Next Boot
SWP_L4_CHECKSUM_MODEDEVICE_DEFAULT(0)
This is next-boot value. You should query current (--enable_verbosity) to show in param get.
Re: [PATCH net-next v2 2/2] net/mlx5: implement swp_l4_csum_mode via devlink params
Quoted 27 lines · Jiri Pirko
Quoted 26 lines · Tue, Nov 04, 2025 at 01:51:16PM +0100, [email protected] wrote:
Quoted 9 lines · Daniel Zahka
Quoted 4 lines · Jiri Pirko
I did some research. 0/DEVICE_DEFAULT should not be ever reported back from FW. It's purpose is for user to reset to default FW configuration. What's the usecase for that? I think you could just avoid 0/DEVICE_DEFAULT entirely, for both get and set.
I find that 0/DEVICE_DEFAULT is reported back on my device. I have observed this same behavior when using the mstconfig tool for setting the parameter too.
e.g.
$ dmesg | grep -i mlx | grep -i firmware [ 10.165767] mlx5_core 0000:01:00.0: firmware version: 28.46.1006$ ./mstconfig -d 01:00.0 -b ./mlxconfig_host.db query SWP_L4_CHECKSUM_MODEDevice #1:
----------Device type: ConnectX7
Name: CX71143DMC-CDAE_FB_Ax
Description: ConnectX-7 Ethernet adapter card; 100 GbE OCP3.0; Single-port QSFP; Multi Host; 2 Host; PCIe 4.0 x16; Crypto and Secure Boot Device: 01:00.0
Quoted 4 lines
Quoted 2 lines
Configurations: Next Boot
SWP_L4_CHECKSUM_MODEDEVICE_DEFAULT(0)This is next-boot value. You should query current (--enable_verbosity) to show in param get.
I am still seeing that DEVICE_DEFAULT(0) is read back:
$ ./mstconfig --enable_verbosity -d 01:00.0 -b ./mlxconfig_host.db query SWP_L4_CHECKSUM_MODE
Device #1:
----------
Device type: ConnectX7
Name: CX71143DMC-CDAE_FB_Ax
Description: ConnectX-7 Ethernet adapter card; 100 GbE OCP3.0; Single-port QSFP; Multi Host; 2 Host; PCIe 4.0 x16; Crypto and Secure Boot Device: 01:00.0
Configurations: Default Current Next Boot SWP_L4_CHECKSUM_MODE DEVICE_DEFAULT(0) DEVICE_DEFAULT(0) DEVICE_DEFAULT(0)
Re: [PATCH net-next v2 2/2] net/mlx5: implement swp_l4_csum_mode via devlink params
Quoted 42 lines · Daniel Zahka
Quoted 27 lines · Jiri Pirko
Quoted 26 lines · Tue, Nov 04, 2025 at 01:51:16PM +0100, [email protected] wrote:
Quoted 9 lines · Daniel Zahka
Quoted 4 lines · Jiri Pirko
I did some research. 0/DEVICE_DEFAULT should not be ever reported back from FW. It's purpose is for user to reset to default FW configuration. What's the usecase for that? I think you could just avoid 0/DEVICE_DEFAULT entirely, for both get and set.
I find that 0/DEVICE_DEFAULT is reported back on my device. I have observed this same behavior when using the mstconfig tool for setting the parameter too.
e.g.
$ dmesg | grep -i mlx | grep -i firmware [ 10.165767] mlx5_core 0000:01:00.0: firmware version: 28.46.1006$ ./mstconfig -d 01:00.0 -b ./mlxconfig_host.db query SWP_L4_CHECKSUM_MODEDevice #1:
----------Device type: ConnectX7
Name: CX71143DMC-CDAE_FB_Ax
Description: ConnectX-7 Ethernet adapter card; 100 GbE OCP3.0; Single-port QSFP; Multi Host; 2 Host; PCIe 4.0 x16; Crypto and Secure Boot Device: 01:00.0Quoted 4 lines
Quoted 2 lines
Configurations: Next Boot
SWP_L4_CHECKSUM_MODEDEVICE_DEFAULT(0)This is next-boot value. You should query current (--enable_verbosity) to show in param get.
I am still seeing that
DEVICE_DEFAULT(0)is read back:$ ./mstconfig --enable_verbosity -d 01:00.0 -b ./mlxconfig_host.db query SWP_L4_CHECKSUM_MODEDevice #1:
----------
Quoted 8 lines
Device type: ConnectX7
Name: CX71143DMC-CDAE_FB_Ax
Description: ConnectX-7 Ethernet adapter card; 100 GbE OCP3.0; Single-port QSFP; Multi Host; 2 Host; PCIe 4.0 x16; Crypto and Secure Boot Device: 01:00.0Configurations: Default Current Next Boot
SWP_L4_CHECKSUM_MODEDEVICE_DEFAULT(0)DEVICE_DEFAULT(0)DEVICE_DEFAULT(0)
When default value of nvconfig is managed by FW, 0 will always mean DEVICE_DEFAULT, and it is a way for the driver to reset back to default on write, but on read FW should never return it, so this is a FW bug.
But this shouldn't block this series so just return 'default', from the driver perspective we should return 'default' when we know 0 means that.
Jiri Pirko
maintainerRe: [PATCH net-next v2 2/2] net/mlx5: implement swp_l4_csum_mode via devlink params
Quoted 51 lines · Sat, Nov 08, 2025 at 06:38:32AM +0100, [email protected] wrote:
Quoted 50 lines · Daniel Zahka
Quoted 27 lines · Jiri Pirko
Quoted 26 lines · Tue, Nov 04, 2025 at 01:51:16PM +0100, [email protected] wrote:
Quoted 9 lines · Daniel Zahka
Quoted 4 lines · Jiri Pirko
I did some research. 0/DEVICE_DEFAULT should not be ever reported back from FW. It's purpose is for user to reset to default FW configuration. What's the usecase for that? I think you could just avoid 0/DEVICE_DEFAULT entirely, for both get and set.
I find that 0/DEVICE_DEFAULT is reported back on my device. I have observed this same behavior when using the mstconfig tool for setting the parameter too.
e.g.
$ dmesg | grep -i mlx | grep -i firmware [ 10.165767] mlx5_core 0000:01:00.0: firmware version: 28.46.1006$ ./mstconfig -d 01:00.0 -b ./mlxconfig_host.db query SWP_L4_CHECKSUM_MODEDevice #1:
----------Device type: ConnectX7
Name: CX71143DMC-CDAE_FB_Ax
Description: ConnectX-7 Ethernet adapter card; 100 GbE OCP3.0; Single-port QSFP; Multi Host; 2 Host; PCIe 4.0 x16; Crypto and Secure Boot Device: 01:00.0Quoted 4 lines
Quoted 2 lines
Configurations: Next Boot
SWP_L4_CHECKSUM_MODEDEVICE_DEFAULT(0)This is next-boot value. You should query current (--enable_verbosity) to show in param get.
I am still seeing that
DEVICE_DEFAULT(0)is read back:$ ./mstconfig --enable_verbosity -d 01:00.0 -b ./mlxconfig_host.db query SWP_L4_CHECKSUM_MODEDevice #1:
----------Device type: ConnectX7
Name: CX71143DMC-CDAE_FB_Ax
Description: ConnectX-7 Ethernet adapter card; 100 GbE OCP3.0; Single-port QSFP; Multi Host; 2 Host; PCIe 4.0 x16; Crypto and Secure Boot
Device: 01:00.0
Quoted 8 lines
Quoted 4 lines
Configurations: Default Current Next Boot
SWP_L4_CHECKSUM_MODEDEVICE_DEFAULT(0)DEVICE_DEFAULT(0)DEVICE_DEFAULT(0)When default value of nvconfig is managed by FW, 0 will always mean
DEVICE_DEFAULT, and it is a way for the driver to reset back to default on write, but on read FW should never return it, so this is a FW bug.
What I understand is that 0 is still okay to be read back after writing it. I don't think it is a fw bug. Also, I don't think we should expose "default" as devlink param value.
Quoted 4 lines
But this shouldn't block this series so just return 'default', from the driver perspective we should return 'default' when we know 0 means that.
Jakub Kicinski
maintainerRe: [PATCH net-next v2 2/2] net/mlx5: implement swp_l4_csum_mode via devlink params
In reply to Jiri PirkoQuoted 9 lines · On Tue, 4 Nov 2025 11:14:03 +0100 Jiri Pirko wrote:
drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c static const struct devlink_param mlx5_nv_param_devlink_params[] = { · line 707
Quoted 6 lines
drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c +2
-0@@ -548,6 +703,12 @@ static const struct devlink_param mlx5_nv_param_devlink_params[] = { mlx5_nv_param_devlink_cqe_compress_get, mlx5_nv_param_devlink_cqe_compress_set, mlx5_nv_param_devlink_cqe_compress_validate), + DEVLINK_PARAM_DRIVER(MLX5_DEVLINK_PARAM_ID_SWP_L4_CSUM_MODE, + "swp_l4_csum_mode", DEVLINK_PARAM_TYPE_STRING,I still think that even unlikely this will be implemented in other driver, it is generic param. Could you please treat it as such?
We need a clearer definition of what this does then.
Is it basically disabling silicon validation of L4 checksum and allows for the FW to compute the L4 checksum? Which may negatively impact performance? (hence disabled by default?)