* [PATCH net-next v4 0/6] devlink: net/mlx5: implement swp_l4_csum_mode via devlink params
@ 2025-11-18 0:24 Daniel Zahka
2025-11-18 0:24 ` [PATCH net-next v4 1/6] devlink: pass extack through to devlink_param::get() Daniel Zahka
` (6 more replies)
0 siblings, 7 replies; 14+ messages in thread
From: Daniel Zahka @ 2025-11-18 0:24 UTC (permalink / raw)
To: Jiri Pirko, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Jonathan Corbet, Srujana Challa,
Bharat Bhushan, Herbert Xu, Brett Creeley, Andrew Lunn,
Michael Chan, Pavan Chebbi, Tony Nguyen, Przemek Kitszel,
Sunil Goutham, Linu Cherian, Geetha sowjanya, Jerin Jacob,
hariprasad, Subbaraya Sundeep, Tariq Toukan, Saeed Mahameed,
Leon Romanovsky, Mark Bloch, Ido Schimmel, Petr Machata,
Manish Chopra, Maxime Coquelin, Alexandre Torgue,
Siddharth Vadapalli, Roger Quadros, Loic Poulain, Sergey Ryazanov,
Johannes Berg, Vladimir Oltean, Michal Swiatkowski,
Aleksandr Loktionov, Dave Ertman, Vlad Dumitrescu,
Russell King (Oracle), Alexander Sverdlin, Lorenzo Bianconi
Cc: netdev, linux-doc, linux-rdma
This series introduces a new devlink feature for querying param
default values, and resetting params to their default values. This
feature is then used to implement a new mlx5 driver param.
The series starts with two pure refactor patches: one that passes
through the extack to devlink_param::get() implementations. And a
second small refactor that prepares the netlink tlv handling code in
the devlink_param::get() path to better handle default parameter
values.
The third patch introduces the uapi and driver api for default
parameter values. The driver api is opt-in, and both the uapi and
driver api preserve existing behavior when not used by drivers or
older userapace binaries.
The fourth patch introduces the a new mlx5 driver param,
swp_l4_csum_mode, for controlling tx csum behavior. The "l4_only"
value of this param is a dependency for PSP initialization on CX7
NICs.
Lastly, the series introduces a new driver param with cmode runtime to
netdevsim, and then uses this param in a new testcase for netdevsim
devlink params.
Here are some examples of using the default param uapi with the devlink
cli. Note the devlink cli binary I am using has changes which I am
posting in accompanying series targeting iproute2-next:
# netdevsim
./devlink dev param show netdevsim/netdevsim0
netdevsim/netdevsim0:
name max_macs type generic
values:
cmode driverinit value 32 default 32
name test1 type driver-specific
values:
cmode driverinit value true default true
# set to false
./devlink dev param set netdevsim/netdevsim0 name test1 value false cmode driverinit
./devlink dev param show netdevsim/netdevsim0
netdevsim/netdevsim0:
name max_macs type generic
values:
cmode driverinit value 32 default 32
name test1 type driver-specific
values:
cmode driverinit value false default true
# set back to default
./devlink dev param set netdevsim/netdevsim0 name test1 default cmode driverinit
./devlink dev param show netdevsim/netdevsim0
netdevsim/netdevsim0:
name max_macs type generic
values:
cmode driverinit value 32 default 32
name test1 type driver-specific
values:
cmode driverinit value true default true
# mlx5 params on cx7
./devlink dev param show pci/0000:01:00.0
pci/0000:01:00.0:
name max_macs type generic
values:
cmode driverinit value 128 default 128
...
name swp_l4_csum_mode type driver-specific
values:
cmode permanent value default default default
# set to l4_only
./devlink dev param set pci/0000:01:00.0 name swp_l4_csum_mode value l4_only cmode permanent
./devlink dev param show pci/0000:01:00.0 name swp_l4_csum_mode
pci/0000:01:00.0:
name swp_l4_csum_mode type driver-specific
values:
cmode permanent value l4_only default default
# reset to default
./devlink dev param set pci/0000:01:00.0 name swp_l4_csum_mode default cmode permanent
./devlink dev param show pci/0000:01:00.0 name swp_l4_csum_mode
pci/0000:01:00.0:
name swp_l4_csum_mode type driver-specific
values:
cmode permanent value default default default
CHANGES:
v4:
- add test case for default params.
- add new cmode runtime test param to netdevsim.
- introduce uapi and driver api for supporting default param values.
- rename device_default to default in mlx5 patch.
v3: https://lore.kernel.org/netdev/20251107204347.4060542-1-daniel.zahka@gmail.com/
- fix warnings about undocumented param in intel ice driver
v2: https://lore.kernel.org/netdev/20251103194554.3203178-1-daniel.zahka@gmail.com/
- 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/20251022190932.1073898-1-daniel.zahka@gmail.com/
Daniel Zahka (6):
devlink: pass extack through to devlink_param::get()
devlink: refactor devlink_nl_param_value_fill_one()
devlink: support default values for param-get and param-set
net/mlx5: implement swp_l4_csum_mode via devlink params
netdevsim: register a new devlink param with default value interface
selftest: netdevsim: test devlink default params
Documentation/netlink/specs/devlink.yaml | 9 +
.../networking/devlink/devlink-params.rst | 10 +
Documentation/networking/devlink/mlx5.rst | 14 ++
.../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/i40e/i40e_devlink.c | 3 +-
.../net/ethernet/intel/ice/devlink/devlink.c | 14 +-
.../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 | 238 +++++++++++++++++-
.../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/netdevsim/dev.c | 55 ++++
drivers/net/netdevsim/netdevsim.h | 1 +
drivers/net/wwan/iosm/iosm_ipc_devlink.c | 3 +-
include/net/devlink.h | 45 +++-
include/net/dsa.h | 3 +-
include/uapi/linux/devlink.h | 3 +
net/devlink/netlink_gen.c | 5 +-
net/devlink/param.c | 180 +++++++++----
net/dsa/devlink.c | 3 +-
.../drivers/net/netdevsim/devlink.sh | 113 ++++++++-
34 files changed, 689 insertions(+), 91 deletions(-)
--
2.47.3
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net-next v4 1/6] devlink: pass extack through to devlink_param::get()
2025-11-18 0:24 [PATCH net-next v4 0/6] devlink: net/mlx5: implement swp_l4_csum_mode via devlink params Daniel Zahka
@ 2025-11-18 0:24 ` Daniel Zahka
2025-11-18 7:17 ` Loktionov, Aleksandr
2025-11-18 0:24 ` [PATCH net-next v4 2/6] devlink: refactor devlink_nl_param_value_fill_one() Daniel Zahka
` (5 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Daniel Zahka @ 2025-11-18 0:24 UTC (permalink / raw)
To: Jiri Pirko, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Jonathan Corbet, Srujana Challa,
Bharat Bhushan, Herbert Xu, Brett Creeley, Andrew Lunn,
Michael Chan, Pavan Chebbi, Tony Nguyen, Przemek Kitszel,
Sunil Goutham, Linu Cherian, Geetha sowjanya, Jerin Jacob,
hariprasad, Subbaraya Sundeep, Tariq Toukan, Saeed Mahameed,
Leon Romanovsky, Mark Bloch, Ido Schimmel, Petr Machata,
Manish Chopra, Maxime Coquelin, Alexandre Torgue,
Siddharth Vadapalli, Roger Quadros, Loic Poulain, Sergey Ryazanov,
Johannes Berg, Vladimir Oltean, Michal Swiatkowski,
Aleksandr Loktionov, Dave Ertman, Vlad Dumitrescu,
Russell King (Oracle), Alexander Sverdlin, Lorenzo Bianconi
Cc: netdev, linux-doc, linux-rdma
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>
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
---
Notes:
v3:
- fix warnings about undocumented param in intel ice driver
.../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/i40e/i40e_devlink.c | 3 ++-
.../net/ethernet/intel/ice/devlink/devlink.c | 14 ++++++++++----
.../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 ++-
25 files changed, 89 insertions(+), 46 deletions(-)
diff --git a/drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c b/drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c
index 215a1a8ba7e9..07a74f702c3a 100644
--- a/drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c
+++ b/drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c
@@ -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;
diff --git a/drivers/net/ethernet/amd/pds_core/core.h b/drivers/net/ethernet/amd/pds_core/core.h
index 0b53a1fab46d..4a6b35c84dab 100644
--- a/drivers/net/ethernet/amd/pds_core/core.h
+++ b/drivers/net/ethernet/amd/pds_core/core.h
@@ -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);
diff --git a/drivers/net/ethernet/amd/pds_core/devlink.c b/drivers/net/ethernet/amd/pds_core/devlink.c
index d8dc39da4161..b576be626a29 100644
--- a/drivers/net/ethernet/amd/pds_core/devlink.c
+++ b/drivers/net/ethernet/amd/pds_core/devlink.c
@@ -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;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
index 67ca02d84c97..15de802bbac4 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
@@ -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);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_devlink.c b/drivers/net/ethernet/intel/i40e/i40e_devlink.c
index bc205e3077c7..229179ccc131 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_devlink.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_devlink.c
@@ -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);
diff --git a/drivers/net/ethernet/intel/ice/devlink/devlink.c b/drivers/net/ethernet/intel/ice/devlink/devlink.c
index 938914abbe06..d88b7f3fd1f9 100644
--- a/drivers/net/ethernet/intel/ice/devlink/devlink.c
+++ b/drivers/net/ethernet/intel/ice/devlink/devlink.c
@@ -610,11 +610,13 @@ static int ice_update_tx_topo_user_sel(struct ice_pf *pf, int layers)
* @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;
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
index 3735372539bd..0f9953eaf1b0 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
@@ -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;
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c
index e13ae5484c19..a72694219df4 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c
@@ -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;
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 03d2fc7d9b09..2de226951e19 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -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;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index 25af8bd7f077..90643ddae099 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -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);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 8ebca0d17f65..8de6c7f6c294 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -2618,7 +2618,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);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index 2b755a0035ce..0a6031a64c6f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -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);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
index 89e399606877..2bceb42c98cc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
@@ -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;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c
index f0ab5ef95fc2..3d2195338d39 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c
@@ -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)] = {};
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
index b1d08e958bf9..69f9da9fb305 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
@@ -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;
diff --git a/drivers/net/ethernet/netronome/nfp/devlink_param.c b/drivers/net/ethernet/netronome/nfp/devlink_param.c
index 0e1a3800f371..85e3b19e6165 100644
--- a/drivers/net/ethernet/netronome/nfp/devlink_param.c
+++ b/drivers/net/ethernet/netronome/nfp/devlink_param.c
@@ -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);
diff --git a/drivers/net/ethernet/qlogic/qed/qed_devlink.c b/drivers/net/ethernet/qlogic/qed/qed_devlink.c
index 94c5689b5abd..0c5278c0598c 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_devlink.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_devlink.c
@@ -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;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index d202f604161e..df949104f1f5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -7489,7 +7489,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;
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index d5f358ec9820..5924db6be3fe 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -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;
diff --git a/drivers/net/ethernet/ti/cpsw_new.c b/drivers/net/ethernet/ti/cpsw_new.c
index 8b9e2078c602..ab88d4c02cbd 100644
--- a/drivers/net/ethernet/ti/cpsw_new.c
+++ b/drivers/net/ethernet/ti/cpsw_new.c
@@ -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;
diff --git a/drivers/net/wwan/iosm/iosm_ipc_devlink.c b/drivers/net/wwan/iosm/iosm_ipc_devlink.c
index 33d6342124bc..301a9d294d30 100644
--- a/drivers/net/wwan/iosm/iosm_ipc_devlink.c
+++ b/drivers/net/wwan/iosm/iosm_ipc_devlink.c
@@ -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);
diff --git a/include/net/devlink.h b/include/net/devlink.h
index d01046ef0577..5f479227144d 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -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);
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 97d5f401cfcf..e40cdc12f7f3 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -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);
diff --git a/net/devlink/param.c b/net/devlink/param.c
index 6b233b13b69a..3dbd023e4c36 100644
--- a/net/devlink/param.c
+++ b/net/devlink/param.c
@@ -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;
diff --git a/net/dsa/devlink.c b/net/dsa/devlink.c
index f41f9fc2194e..ed342f345692 100644
--- a/net/dsa/devlink.c
+++ b/net/dsa/devlink.c
@@ -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);
--
2.47.3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next v4 2/6] devlink: refactor devlink_nl_param_value_fill_one()
2025-11-18 0:24 [PATCH net-next v4 0/6] devlink: net/mlx5: implement swp_l4_csum_mode via devlink params Daniel Zahka
2025-11-18 0:24 ` [PATCH net-next v4 1/6] devlink: pass extack through to devlink_param::get() Daniel Zahka
@ 2025-11-18 0:24 ` Daniel Zahka
2025-11-18 7:18 ` Loktionov, Aleksandr
2025-11-18 0:24 ` [PATCH net-next v4 3/6] devlink: support default values for param-get and param-set Daniel Zahka
` (4 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Daniel Zahka @ 2025-11-18 0:24 UTC (permalink / raw)
To: Jiri Pirko, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Jonathan Corbet, Srujana Challa,
Bharat Bhushan, Herbert Xu, Brett Creeley, Andrew Lunn,
Michael Chan, Pavan Chebbi, Tony Nguyen, Przemek Kitszel,
Sunil Goutham, Linu Cherian, Geetha sowjanya, Jerin Jacob,
hariprasad, Subbaraya Sundeep, Tariq Toukan, Saeed Mahameed,
Leon Romanovsky, Mark Bloch, Ido Schimmel, Petr Machata,
Manish Chopra, Maxime Coquelin, Alexandre Torgue,
Siddharth Vadapalli, Roger Quadros, Loic Poulain, Sergey Ryazanov,
Johannes Berg, Vladimir Oltean, Michal Swiatkowski,
Aleksandr Loktionov, Dave Ertman, Vlad Dumitrescu,
Russell King (Oracle), Alexander Sverdlin, Lorenzo Bianconi
Cc: netdev, linux-doc, linux-rdma
Lift the param type demux and value attr placement into a separate
function. This new function, devlink_nl_param_put(), can be used to
place additional types values in the value array, e.g., default,
current, next values. This commit has no functional change.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
---
net/devlink/param.c | 70 +++++++++++++++++++++++++--------------------
1 file changed, 39 insertions(+), 31 deletions(-)
diff --git a/net/devlink/param.c b/net/devlink/param.c
index 3dbd023e4c36..3aa14ef345f0 100644
--- a/net/devlink/param.c
+++ b/net/devlink/param.c
@@ -193,58 +193,66 @@ static int devlink_param_set(struct devlink *devlink,
}
static int
-devlink_nl_param_value_fill_one(struct sk_buff *msg,
- enum devlink_param_type type,
- enum devlink_param_cmode cmode,
- union devlink_param_value val)
+devlink_nl_param_value_put(struct sk_buff *msg, enum devlink_param_type type,
+ int nla_type, union devlink_param_value val)
{
- struct nlattr *param_value_attr;
-
- param_value_attr = nla_nest_start_noflag(msg,
- DEVLINK_ATTR_PARAM_VALUE);
- if (!param_value_attr)
- goto nla_put_failure;
-
- if (nla_put_u8(msg, DEVLINK_ATTR_PARAM_VALUE_CMODE, cmode))
- goto value_nest_cancel;
-
switch (type) {
case DEVLINK_PARAM_TYPE_U8:
- if (nla_put_u8(msg, DEVLINK_ATTR_PARAM_VALUE_DATA, val.vu8))
- goto value_nest_cancel;
+ if (nla_put_u8(msg, nla_type, val.vu8))
+ return -EMSGSIZE;
break;
case DEVLINK_PARAM_TYPE_U16:
- if (nla_put_u16(msg, DEVLINK_ATTR_PARAM_VALUE_DATA, val.vu16))
- goto value_nest_cancel;
+ if (nla_put_u16(msg, nla_type, val.vu16))
+ return -EMSGSIZE;
break;
case DEVLINK_PARAM_TYPE_U32:
- if (nla_put_u32(msg, DEVLINK_ATTR_PARAM_VALUE_DATA, val.vu32))
- goto value_nest_cancel;
+ if (nla_put_u32(msg, nla_type, val.vu32))
+ return -EMSGSIZE;
break;
case DEVLINK_PARAM_TYPE_U64:
- if (devlink_nl_put_u64(msg, DEVLINK_ATTR_PARAM_VALUE_DATA,
- val.vu64))
- goto value_nest_cancel;
+ if (devlink_nl_put_u64(msg, nla_type, val.vu64))
+ return -EMSGSIZE;
break;
case DEVLINK_PARAM_TYPE_STRING:
- if (nla_put_string(msg, DEVLINK_ATTR_PARAM_VALUE_DATA,
- val.vstr))
- goto value_nest_cancel;
+ if (nla_put_string(msg, nla_type, val.vstr))
+ return -EMSGSIZE;
break;
case DEVLINK_PARAM_TYPE_BOOL:
- if (val.vbool &&
- nla_put_flag(msg, DEVLINK_ATTR_PARAM_VALUE_DATA))
- goto value_nest_cancel;
+ if (val.vbool && nla_put_flag(msg, nla_type))
+ return -EMSGSIZE;
break;
}
+ return 0;
+}
+
+static int
+devlink_nl_param_value_fill_one(struct sk_buff *msg,
+ enum devlink_param_type type,
+ enum devlink_param_cmode cmode,
+ union devlink_param_value val)
+{
+ struct nlattr *param_value_attr;
+ int err = -EMSGSIZE;
+
+ param_value_attr = nla_nest_start_noflag(msg,
+ DEVLINK_ATTR_PARAM_VALUE);
+ if (!param_value_attr)
+ return -EMSGSIZE;
+
+ if (nla_put_u8(msg, DEVLINK_ATTR_PARAM_VALUE_CMODE, cmode))
+ goto value_nest_cancel;
+
+ err = devlink_nl_param_value_put(msg, type,
+ DEVLINK_ATTR_PARAM_VALUE_DATA, val);
+ if (err)
+ goto value_nest_cancel;
nla_nest_end(msg, param_value_attr);
return 0;
value_nest_cancel:
nla_nest_cancel(msg, param_value_attr);
-nla_put_failure:
- return -EMSGSIZE;
+ return err;
}
static int devlink_nl_param_fill(struct sk_buff *msg, struct devlink *devlink,
--
2.47.3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next v4 3/6] devlink: support default values for param-get and param-set
2025-11-18 0:24 [PATCH net-next v4 0/6] devlink: net/mlx5: implement swp_l4_csum_mode via devlink params Daniel Zahka
2025-11-18 0:24 ` [PATCH net-next v4 1/6] devlink: pass extack through to devlink_param::get() Daniel Zahka
2025-11-18 0:24 ` [PATCH net-next v4 2/6] devlink: refactor devlink_nl_param_value_fill_one() Daniel Zahka
@ 2025-11-18 0:24 ` Daniel Zahka
2025-11-18 7:27 ` Loktionov, Aleksandr
2025-11-18 0:24 ` [PATCH net-next v4 4/6] net/mlx5: implement swp_l4_csum_mode via devlink params Daniel Zahka
` (3 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Daniel Zahka @ 2025-11-18 0:24 UTC (permalink / raw)
To: Jiri Pirko, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Jonathan Corbet, Srujana Challa,
Bharat Bhushan, Herbert Xu, Brett Creeley, Andrew Lunn,
Michael Chan, Pavan Chebbi, Tony Nguyen, Przemek Kitszel,
Sunil Goutham, Linu Cherian, Geetha sowjanya, Jerin Jacob,
hariprasad, Subbaraya Sundeep, Tariq Toukan, Saeed Mahameed,
Leon Romanovsky, Mark Bloch, Ido Schimmel, Petr Machata,
Manish Chopra, Maxime Coquelin, Alexandre Torgue,
Siddharth Vadapalli, Roger Quadros, Loic Poulain, Sergey Ryazanov,
Johannes Berg, Vladimir Oltean, Michal Swiatkowski,
Aleksandr Loktionov, Dave Ertman, Vlad Dumitrescu,
Russell King (Oracle), Alexander Sverdlin, Lorenzo Bianconi
Cc: netdev, linux-doc, linux-rdma
Support querying and resetting to default param values.
Introduce two new devlink netlink attrs:
DEVLINK_ATTR_PARAM_VALUE_DEFAULT and
DEVLINK_ATTR_PARAM_RESET_DEFAULT. The former is used to contain an
optional parameter value inside of the param_value nested
attribute. The latter is used in param-set requests from userspace to
indicate that the driver should reset the param to its default value.
To implement this, two new functions are added to the devlink driver
api: devlink_param::get_default() and
devlink_param::reset_default(). These callbacks allow drivers to
implement default param actions for runtime and permanent cmodes. For
driverinit params, the core latches the last value set by a driver via
devl_param_driverinit_value_set(), and uses that as the default value
for a param.
Because default parameter values are optional, it would be impossible
to discern whether or not a param of type bool has default value of
false or not provided if the default value is encoded using a netlink
flag type. For this reason, when a DEVLINK_PARAM_TYPE_BOOL has an
associated default value, the default value is encoded using a u8
type.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
---
Documentation/netlink/specs/devlink.yaml | 9 ++
.../networking/devlink/devlink-params.rst | 10 ++
include/net/devlink.h | 42 +++++++
include/uapi/linux/devlink.h | 3 +
net/devlink/netlink_gen.c | 5 +-
net/devlink/param.c | 105 ++++++++++++++++--
6 files changed, 160 insertions(+), 14 deletions(-)
diff --git a/Documentation/netlink/specs/devlink.yaml b/Documentation/netlink/specs/devlink.yaml
index 426d5aa7d955..837112da6738 100644
--- a/Documentation/netlink/specs/devlink.yaml
+++ b/Documentation/netlink/specs/devlink.yaml
@@ -859,6 +859,14 @@ attribute-sets:
name: health-reporter-burst-period
type: u64
doc: Time (in msec) for recoveries before starting the grace period.
+
+ # TODO: fill in the attributes in between
+
+ -
+ name: param-reset-default
+ type: flag
+ doc: Request restoring parameter to its default value.
+ value: 183
-
name: dl-dev-stats
subset-of: devlink
@@ -1793,6 +1801,7 @@ operations:
- param-type
# param-value-data is missing here as the type is variable
- param-value-cmode
+ - param-reset-default
-
name: region-get
diff --git a/Documentation/networking/devlink/devlink-params.rst b/Documentation/networking/devlink/devlink-params.rst
index c0597d456641..ea17756dcda6 100644
--- a/Documentation/networking/devlink/devlink-params.rst
+++ b/Documentation/networking/devlink/devlink-params.rst
@@ -41,6 +41,16 @@ In order for ``driverinit`` parameters to take effect, the driver must
support reloading via the ``devlink-reload`` command. This command will
request a reload of the device driver.
+Default parameter values
+=========================
+
+Drivers may optionally export default values for parameters of cmode
+``runtime`` and ``permanent``. For ``driverinit`` parameters, the last
+value set by the driver will be used as the default value. Drivers can
+also support resetting params with cmode ``runtime`` and ``permanent``
+to their default values. Resetting ``driverinit`` params is supported
+by devlink core without additional driver support needed.
+
.. _devlink_params_generic:
Generic configuration parameters
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 5f479227144d..cb839e0435a1 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -479,6 +479,10 @@ struct devlink_flash_notify {
* @set: set parameter value, used for runtime and permanent
* configuration modes
* @validate: validate input value is applicable (within value range, etc.)
+ * @get_default: get parameter default value, used for runtime and permanent
+ * configuration modes
+ * @reset_default: reset parameter to default value, used for runtime and permanent
+ * configuration modes
*
* This struct should be used by the driver to fill the data for
* a parameter it registers.
@@ -498,6 +502,12 @@ struct devlink_param {
int (*validate)(struct devlink *devlink, u32 id,
union devlink_param_value val,
struct netlink_ext_ack *extack);
+ int (*get_default)(struct devlink *devlink, u32 id,
+ struct devlink_param_gset_ctx *ctx,
+ struct netlink_ext_ack *extack);
+ int (*reset_default)(struct devlink *devlink, u32 id,
+ enum devlink_param_cmode cmode,
+ struct netlink_ext_ack *extack);
};
struct devlink_param_item {
@@ -509,6 +519,7 @@ struct devlink_param_item {
* until reload.
*/
bool driverinit_value_new_valid;
+ union devlink_param_value driverinit_default;
};
enum devlink_param_generic_id {
@@ -630,6 +641,37 @@ enum devlink_param_generic_id {
.validate = _validate, \
}
+#define DEVLINK_PARAM_GENERIC_WITH_DEFAULTS(_id, _cmodes, _get, _set, \
+ _validate, _get_default, \
+ _reset_default) \
+{ \
+ .id = DEVLINK_PARAM_GENERIC_ID_##_id, \
+ .name = DEVLINK_PARAM_GENERIC_##_id##_NAME, \
+ .type = DEVLINK_PARAM_GENERIC_##_id##_TYPE, \
+ .generic = true, \
+ .supported_cmodes = _cmodes, \
+ .get = _get, \
+ .set = _set, \
+ .validate = _validate, \
+ .get_default = _get_default, \
+ .reset_default = _reset_default, \
+}
+
+#define DEVLINK_PARAM_DRIVER_WITH_DEFAULTS(_id, _name, _type, _cmodes, \
+ _get, _set, _validate, \
+ _get_default, _reset_default) \
+{ \
+ .id = _id, \
+ .name = _name, \
+ .type = _type, \
+ .supported_cmodes = _cmodes, \
+ .get = _get, \
+ .set = _set, \
+ .validate = _validate, \
+ .get_default = _get_default, \
+ .reset_default = _reset_default, \
+}
+
/* Identifier of board design */
#define DEVLINK_INFO_VERSION_GENERIC_BOARD_ID "board.id"
/* Revision of board design */
diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h
index 157f11d3fb72..e7d6b6d13470 100644
--- a/include/uapi/linux/devlink.h
+++ b/include/uapi/linux/devlink.h
@@ -639,6 +639,9 @@ enum devlink_attr {
DEVLINK_ATTR_HEALTH_REPORTER_BURST_PERIOD, /* u64 */
+ DEVLINK_ATTR_PARAM_VALUE_DEFAULT, /* dynamic */
+ DEVLINK_ATTR_PARAM_RESET_DEFAULT, /* flag */
+
/* Add new attributes above here, update the spec in
* Documentation/netlink/specs/devlink.yaml and re-generate
* net/devlink/netlink_gen.c.
diff --git a/net/devlink/netlink_gen.c b/net/devlink/netlink_gen.c
index 5ad435aee29d..580985025f49 100644
--- a/net/devlink/netlink_gen.c
+++ b/net/devlink/netlink_gen.c
@@ -301,12 +301,13 @@ static const struct nla_policy devlink_param_get_dump_nl_policy[DEVLINK_ATTR_DEV
};
/* DEVLINK_CMD_PARAM_SET - do */
-static const struct nla_policy devlink_param_set_nl_policy[DEVLINK_ATTR_PARAM_VALUE_CMODE + 1] = {
+static const struct nla_policy devlink_param_set_nl_policy[DEVLINK_ATTR_PARAM_RESET_DEFAULT + 1] = {
[DEVLINK_ATTR_BUS_NAME] = { .type = NLA_NUL_STRING, },
[DEVLINK_ATTR_DEV_NAME] = { .type = NLA_NUL_STRING, },
[DEVLINK_ATTR_PARAM_NAME] = { .type = NLA_NUL_STRING, },
[DEVLINK_ATTR_PARAM_TYPE] = NLA_POLICY_VALIDATE_FN(NLA_U8, &devlink_attr_param_type_validate),
[DEVLINK_ATTR_PARAM_VALUE_CMODE] = NLA_POLICY_MAX(NLA_U8, 2),
+ [DEVLINK_ATTR_PARAM_RESET_DEFAULT] = { .type = NLA_FLAG, },
};
/* DEVLINK_CMD_REGION_GET - do */
@@ -919,7 +920,7 @@ const struct genl_split_ops devlink_nl_ops[74] = {
.doit = devlink_nl_param_set_doit,
.post_doit = devlink_nl_post_doit,
.policy = devlink_param_set_nl_policy,
- .maxattr = DEVLINK_ATTR_PARAM_VALUE_CMODE,
+ .maxattr = DEVLINK_ATTR_PARAM_RESET_DEFAULT,
.flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DO,
},
{
diff --git a/net/devlink/param.c b/net/devlink/param.c
index 3aa14ef345f0..e0ea93eded43 100644
--- a/net/devlink/param.c
+++ b/net/devlink/param.c
@@ -192,9 +192,32 @@ static int devlink_param_set(struct devlink *devlink,
return param->set(devlink, param->id, ctx, extack);
}
+static int devlink_param_get_default(struct devlink *devlink,
+ const struct devlink_param *param,
+ struct devlink_param_gset_ctx *ctx,
+ struct netlink_ext_ack *extack)
+{
+ if (!param->get_default)
+ return -EOPNOTSUPP;
+
+ return param->get_default(devlink, param->id, ctx, extack);
+}
+
+static int devlink_param_reset_default(struct devlink *devlink,
+ const struct devlink_param *param,
+ enum devlink_param_cmode cmode,
+ struct netlink_ext_ack *extack)
+{
+ if (!param->reset_default)
+ return -EOPNOTSUPP;
+
+ return param->reset_default(devlink, param->id, cmode, extack);
+}
+
static int
devlink_nl_param_value_put(struct sk_buff *msg, enum devlink_param_type type,
- int nla_type, union devlink_param_value val)
+ int nla_type, union devlink_param_value val,
+ bool flag_as_u8)
{
switch (type) {
case DEVLINK_PARAM_TYPE_U8:
@@ -218,8 +241,16 @@ devlink_nl_param_value_put(struct sk_buff *msg, enum devlink_param_type type,
return -EMSGSIZE;
break;
case DEVLINK_PARAM_TYPE_BOOL:
- if (val.vbool && nla_put_flag(msg, nla_type))
- return -EMSGSIZE;
+ /* default values of type bool are encoded with u8, so that
+ * false can be distinguished from not present
+ */
+ if (flag_as_u8) {
+ if (nla_put_u8(msg, nla_type, val.vbool))
+ return -EMSGSIZE;
+ } else {
+ if (val.vbool && nla_put_flag(msg, nla_type))
+ return -EMSGSIZE;
+ }
break;
}
return 0;
@@ -229,7 +260,9 @@ static int
devlink_nl_param_value_fill_one(struct sk_buff *msg,
enum devlink_param_type type,
enum devlink_param_cmode cmode,
- union devlink_param_value val)
+ union devlink_param_value val,
+ union devlink_param_value default_val,
+ bool has_default)
{
struct nlattr *param_value_attr;
int err = -EMSGSIZE;
@@ -243,10 +276,19 @@ devlink_nl_param_value_fill_one(struct sk_buff *msg,
goto value_nest_cancel;
err = devlink_nl_param_value_put(msg, type,
- DEVLINK_ATTR_PARAM_VALUE_DATA, val);
+ DEVLINK_ATTR_PARAM_VALUE_DATA,
+ val, false);
if (err)
goto value_nest_cancel;
+ if (has_default) {
+ err = devlink_nl_param_value_put(msg, type,
+ DEVLINK_ATTR_PARAM_VALUE_DEFAULT,
+ default_val, true);
+ if (err)
+ goto value_nest_cancel;
+ }
+
nla_nest_end(msg, param_value_attr);
return 0;
@@ -262,7 +304,9 @@ static int devlink_nl_param_fill(struct sk_buff *msg, struct devlink *devlink,
u32 portid, u32 seq, int flags,
struct netlink_ext_ack *extack)
{
+ union devlink_param_value default_value[DEVLINK_PARAM_CMODE_MAX + 1];
union devlink_param_value param_value[DEVLINK_PARAM_CMODE_MAX + 1];
+ bool default_value_set[DEVLINK_PARAM_CMODE_MAX + 1] = {};
bool param_value_set[DEVLINK_PARAM_CMODE_MAX + 1] = {};
const struct devlink_param *param = param_item->param;
struct devlink_param_gset_ctx ctx;
@@ -283,12 +327,26 @@ static int devlink_nl_param_fill(struct sk_buff *msg, struct devlink *devlink,
param_value[i] = param_item->driverinit_value;
else
return -EOPNOTSUPP;
+
+ if (param_item->driverinit_value_valid) {
+ default_value[i] = param_item->driverinit_default;
+ default_value_set[i] = true;
+ }
} else {
ctx.cmode = i;
err = devlink_param_get(devlink, param, &ctx, extack);
if (err)
return err;
param_value[i] = ctx.val;
+
+ err = devlink_param_get_default(devlink, param, &ctx,
+ extack);
+ if (!err) {
+ default_value[i] = ctx.val;
+ default_value_set[i] = true;
+ } else if (err != -EOPNOTSUPP) {
+ return err;
+ }
}
param_value_set[i] = true;
}
@@ -325,7 +383,9 @@ static int devlink_nl_param_fill(struct sk_buff *msg, struct devlink *devlink,
if (!param_value_set[i])
continue;
err = devlink_nl_param_value_fill_one(msg, param->type,
- i, param_value[i]);
+ i, param_value[i],
+ default_value[i],
+ default_value_set[i]);
if (err)
goto values_list_nest_cancel;
}
@@ -542,6 +602,7 @@ static int __devlink_nl_cmd_param_set_doit(struct devlink *devlink,
struct devlink_param_item *param_item;
const struct devlink_param *param;
union devlink_param_value value;
+ bool reset_default;
int err = 0;
param_item = devlink_param_get_from_info(params, info);
@@ -553,13 +614,18 @@ static int __devlink_nl_cmd_param_set_doit(struct devlink *devlink,
return err;
if (param_type != param->type)
return -EINVAL;
- err = devlink_param_value_get_from_info(param, info, &value);
- if (err)
- return err;
- if (param->validate) {
- err = param->validate(devlink, param->id, value, info->extack);
+
+ reset_default = info->attrs[DEVLINK_ATTR_PARAM_RESET_DEFAULT];
+ if (!reset_default) {
+ err = devlink_param_value_get_from_info(param, info, &value);
if (err)
return err;
+ if (param->validate) {
+ err = param->validate(devlink, param->id, value,
+ info->extack);
+ if (err)
+ return err;
+ }
}
if (GENL_REQ_ATTR_CHECK(info, DEVLINK_ATTR_PARAM_VALUE_CMODE))
@@ -569,6 +635,15 @@ static int __devlink_nl_cmd_param_set_doit(struct devlink *devlink,
return -EOPNOTSUPP;
if (cmode == DEVLINK_PARAM_CMODE_DRIVERINIT) {
+ if (reset_default) {
+ if (!param_item->driverinit_value_valid) {
+ NL_SET_ERR_MSG(info->extack,
+ "Default value not available");
+ return -EOPNOTSUPP;
+ }
+ value = param_item->driverinit_default;
+ }
+
param_item->driverinit_value_new = value;
param_item->driverinit_value_new_valid = true;
} else {
@@ -576,7 +651,12 @@ 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, info->extack);
+ if (reset_default)
+ err = devlink_param_reset_default(devlink, param, cmode,
+ info->extack);
+ else
+ err = devlink_param_set(devlink, param, &ctx,
+ info->extack);
if (err)
return err;
}
@@ -824,6 +904,7 @@ void devl_param_driverinit_value_set(struct devlink *devlink, u32 param_id,
param_item->driverinit_value = init_val;
param_item->driverinit_value_valid = true;
+ param_item->driverinit_default = init_val;
devlink_param_notify(devlink, 0, param_item, DEVLINK_CMD_PARAM_NEW);
}
--
2.47.3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next v4 4/6] net/mlx5: implement swp_l4_csum_mode via devlink params
2025-11-18 0:24 [PATCH net-next v4 0/6] devlink: net/mlx5: implement swp_l4_csum_mode via devlink params Daniel Zahka
` (2 preceding siblings ...)
2025-11-18 0:24 ` [PATCH net-next v4 3/6] devlink: support default values for param-get and param-set Daniel Zahka
@ 2025-11-18 0:24 ` Daniel Zahka
2025-11-18 7:18 ` Loktionov, Aleksandr
2025-11-18 0:24 ` [PATCH net-next v4 5/6] netdevsim: register a new devlink param with default value interface Daniel Zahka
` (2 subsequent siblings)
6 siblings, 1 reply; 14+ messages in thread
From: Daniel Zahka @ 2025-11-18 0:24 UTC (permalink / raw)
To: Jiri Pirko, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Jonathan Corbet, Srujana Challa,
Bharat Bhushan, Herbert Xu, Brett Creeley, Andrew Lunn,
Michael Chan, Pavan Chebbi, Tony Nguyen, Przemek Kitszel,
Sunil Goutham, Linu Cherian, Geetha sowjanya, Jerin Jacob,
hariprasad, Subbaraya Sundeep, Tariq Toukan, Saeed Mahameed,
Leon Romanovsky, Mark Bloch, Ido Schimmel, Petr Machata,
Manish Chopra, Maxime Coquelin, Alexandre Torgue,
Siddharth Vadapalli, Roger Quadros, Loic Poulain, Sergey Ryazanov,
Johannes Berg, Vladimir Oltean, Michal Swiatkowski,
Aleksandr Loktionov, Dave Ertman, Vlad Dumitrescu,
Russell King (Oracle), Alexander Sverdlin, Lorenzo Bianconi
Cc: netdev, linux-doc, linux-rdma
swp_l4_csum_mode controls how L4 transmit checksums are computed when
using Software Parser (SWP) hints for header locations.
Supported values:
1. default: device will choose between full_csum or l4_only. Driver
will discover the device's choice during initialization.
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.
Note that 'default' might be returned from the device and passed to
userspace, and it might also be set during a
devlink_param::reset_default() call, but attempts to set a value of
default directly with param-set will be rejected.
The l4_only setting is a dependency for PSP initialization in
mlx5e_psp_init().
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
---
Notes:
v4:
- rename device_default to default
- implement get_default and reset_default handlers
- don't allow user to request "default" in set cmd
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 | 14 ++
.../net/ethernet/mellanox/mlx5/core/devlink.h | 3 +-
.../mellanox/mlx5/core/lib/nv_param.c | 229 ++++++++++++++++++
3 files changed, 245 insertions(+), 1 deletion(-)
diff --git a/Documentation/networking/devlink/mlx5.rst b/Documentation/networking/devlink/mlx5.rst
index 0e5f9c76e514..4bba4d780a4a 100644
--- a/Documentation/networking/devlink/mlx5.rst
+++ b/Documentation/networking/devlink/mlx5.rst
@@ -218,6 +218,20 @@ 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.
+
+ * ``default`` : Use the device's default checksum calculation
+ mode. The driver will discover during init whether or
+ full_csum or l4_only is in use. Setting this value explicitly
+ from userspace is not allowed, but some firmware versions may
+ return this value on param read.
+ * ``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
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.h b/drivers/net/ethernet/mellanox/mlx5/core/devlink.h
index c9555119a661..43b9bf8829cf 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.h
@@ -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 {
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c
index 3d2195338d39..2dfc3fc367c0 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/nv_param.c
@@ -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,
};
@@ -32,6 +34,12 @@ union mlx5_ifc_config_item_type_auto_bits {
u8 reserved_at_0[0x20];
};
+enum {
+ MLX5_ACCESS_MODE_NEXT = 0,
+ MLX5_ACCESS_MODE_CURRENT,
+ MLX5_ACCESS_MODE_DEFAULT,
+};
+
struct mlx5_ifc_config_item_bits {
u8 valid[0x2];
u8 priority[0x2];
@@ -123,6 +131,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 +214,32 @@ 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, int access_mode)
+{
+ 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);
+ MLX5_SET(mnvda_reg, mnvda, configuration_item_header.access_mode,
+ access_mode);
+
+ return mlx5_nv_param_read(dev, mnvda, len);
+}
+
static const char *const
cqe_compress_str[] = { "balanced", "aggressive" };
@@ -269,6 +314,182 @@ 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_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[] = { "default", "full_csum", "l4_only" };
+
+static int
+mlx5_swp_l4_csum_mode_get(struct devlink *devlink, u32 id,
+ int access_mode, u8 *value,
+ struct netlink_ext_ack *extack)
+{
+ struct mlx5_core_dev *dev = devlink_priv(devlink);
+ u32 mnvda[MLX5_ST_SZ_DW(mnvda_reg)] = {};
+ void *data;
+ int err;
+
+ err = mlx5_nv_param_read_sw_accelerate_conf(dev, mnvda, sizeof(mnvda),
+ access_mode);
+ 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;
+ }
+
+ return 0;
+}
+
+static int
+mlx5_devlink_swp_l4_csum_mode_get(struct devlink *devlink, u32 id,
+ struct devlink_param_gset_ctx *ctx,
+ struct netlink_ext_ack *extack)
+{
+ u8 value;
+ int err;
+
+ err = mlx5_swp_l4_csum_mode_get(devlink, id, MLX5_ACCESS_MODE_NEXT,
+ &value, extack);
+ if (err)
+ return err;
+
+ strscpy(ctx->val.vstr, swp_l4_csum_mode_str[value],
+ sizeof(ctx->val.vstr));
+ return 0;
+}
+
+static int
+mlx5_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) ||
+ i == SWP_L4_CSUM_MODE_DEFAULT) {
+ NL_SET_ERR_MSG_MOD(extack,
+ "Invalid value, supported values are 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_swp_l4_csum_mode_set(struct devlink *devlink, u32 id, u8 value,
+ struct netlink_ext_ack *extack)
+{
+ struct mlx5_core_dev *dev = devlink_priv(devlink);
+ u32 mnvda[MLX5_ST_SZ_DW(mnvda_reg)] = {};
+ void *data;
+ int err;
+
+ err = mlx5_nv_param_read_sw_accelerate_conf(dev, mnvda, sizeof(mnvda),
+ MLX5_ACCESS_MODE_NEXT);
+ 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_devlink_swp_l4_csum_mode_set(struct devlink *devlink, u32 id,
+ struct devlink_param_gset_ctx *ctx,
+ struct netlink_ext_ack *extack)
+{
+ u8 value;
+
+ if (!strcmp(ctx->val.vstr, "full_csum"))
+ value = SWP_L4_CSUM_MODE_FULL_CSUM;
+ else
+ value = SWP_L4_CSUM_MODE_L4_ONLY;
+
+ return mlx5_swp_l4_csum_mode_set(devlink, id, value, extack);
+}
+
+static int
+mlx5_devlink_swp_l4_csum_mode_get_default(struct devlink *devlink, u32 id,
+ struct devlink_param_gset_ctx *ctx,
+ struct netlink_ext_ack *extack)
+{
+ u8 value;
+ int err;
+
+ err = mlx5_swp_l4_csum_mode_get(devlink, id, MLX5_ACCESS_MODE_DEFAULT,
+ &value, extack);
+ if (err)
+ return err;
+
+ strscpy(ctx->val.vstr, swp_l4_csum_mode_str[value],
+ sizeof(ctx->val.vstr));
+ return 0;
+}
+
+static int
+mlx5_devlink_swp_l4_csum_mode_set_default(struct devlink *devlink, u32 id,
+ enum devlink_param_cmode cmode,
+ struct netlink_ext_ack *extack)
+{
+ u8 value;
+ int err;
+
+ err = mlx5_swp_l4_csum_mode_get(devlink, id, MLX5_ACCESS_MODE_DEFAULT,
+ &value, extack);
+ if (err)
+ return err;
+
+ return mlx5_swp_l4_csum_mode_set(devlink, id, value, extack);
+}
+
static int mlx5_nv_param_read_global_pci_conf(struct mlx5_core_dev *dev,
void *mnvda, size_t len)
{
@@ -548,6 +769,14 @@ 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_WITH_DEFAULTS(MLX5_DEVLINK_PARAM_ID_SWP_L4_CSUM_MODE,
+ "swp_l4_csum_mode", DEVLINK_PARAM_TYPE_STRING,
+ BIT(DEVLINK_PARAM_CMODE_PERMANENT),
+ mlx5_devlink_swp_l4_csum_mode_get,
+ mlx5_devlink_swp_l4_csum_mode_set,
+ mlx5_devlink_swp_l4_csum_mode_validate,
+ mlx5_devlink_swp_l4_csum_mode_get_default,
+ mlx5_devlink_swp_l4_csum_mode_set_default),
};
int mlx5_nv_param_register_dl_params(struct devlink *devlink)
--
2.47.3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next v4 5/6] netdevsim: register a new devlink param with default value interface
2025-11-18 0:24 [PATCH net-next v4 0/6] devlink: net/mlx5: implement swp_l4_csum_mode via devlink params Daniel Zahka
` (3 preceding siblings ...)
2025-11-18 0:24 ` [PATCH net-next v4 4/6] net/mlx5: implement swp_l4_csum_mode via devlink params Daniel Zahka
@ 2025-11-18 0:24 ` Daniel Zahka
2025-11-18 7:22 ` Loktionov, Aleksandr
2025-11-18 0:24 ` [PATCH net-next v4 6/6] selftest: netdevsim: test devlink default params Daniel Zahka
2025-11-18 7:28 ` [PATCH net-next v4 0/6] devlink: net/mlx5: implement swp_l4_csum_mode via devlink params Loktionov, Aleksandr
6 siblings, 1 reply; 14+ messages in thread
From: Daniel Zahka @ 2025-11-18 0:24 UTC (permalink / raw)
To: Jiri Pirko, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Jonathan Corbet, Srujana Challa,
Bharat Bhushan, Herbert Xu, Brett Creeley, Andrew Lunn,
Michael Chan, Pavan Chebbi, Tony Nguyen, Przemek Kitszel,
Sunil Goutham, Linu Cherian, Geetha sowjanya, Jerin Jacob,
hariprasad, Subbaraya Sundeep, Tariq Toukan, Saeed Mahameed,
Leon Romanovsky, Mark Bloch, Ido Schimmel, Petr Machata,
Manish Chopra, Maxime Coquelin, Alexandre Torgue,
Siddharth Vadapalli, Roger Quadros, Loic Poulain, Sergey Ryazanov,
Johannes Berg, Vladimir Oltean, Michal Swiatkowski,
Aleksandr Loktionov, Dave Ertman, Vlad Dumitrescu,
Russell King (Oracle), Alexander Sverdlin, Lorenzo Bianconi
Cc: netdev, linux-doc, linux-rdma
Create a new devlink param, test2, that supports default param actions
via the devlink_param::get_default() and
devlink_param::reset_default() functions.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
---
drivers/net/netdevsim/dev.c | 55 +++++++++++++++++++++++++++++++
drivers/net/netdevsim/netdevsim.h | 1 +
2 files changed, 56 insertions(+)
diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c
index 95f66c1f59db..3aeb3abfec83 100644
--- a/drivers/net/netdevsim/dev.c
+++ b/drivers/net/netdevsim/dev.c
@@ -320,6 +320,8 @@ static int nsim_dev_debugfs_init(struct nsim_dev *nsim_dev)
&nsim_dev->max_macs);
debugfs_create_bool("test1", 0600, nsim_dev->ddir,
&nsim_dev->test1);
+ debugfs_create_u32("test2", 0600, nsim_dev->ddir,
+ &nsim_dev->test2);
nsim_dev->take_snapshot = debugfs_create_file("take_snapshot",
0200,
nsim_dev->ddir,
@@ -521,8 +523,51 @@ static int nsim_dev_resources_register(struct devlink *devlink)
enum nsim_devlink_param_id {
NSIM_DEVLINK_PARAM_ID_BASE = DEVLINK_PARAM_GENERIC_ID_MAX,
NSIM_DEVLINK_PARAM_ID_TEST1,
+ NSIM_DEVLINK_PARAM_ID_TEST2,
};
+static int
+nsim_devlink_param_test2_get(struct devlink *devlink, u32 id,
+ struct devlink_param_gset_ctx *ctx,
+ struct netlink_ext_ack *extack)
+{
+ struct nsim_dev *nsim_dev = devlink_priv(devlink);
+
+ ctx->val.vu32 = nsim_dev->test2;
+ return 0;
+}
+
+static int
+nsim_devlink_param_test2_set(struct devlink *devlink, u32 id,
+ struct devlink_param_gset_ctx *ctx,
+ struct netlink_ext_ack *extack)
+{
+ struct nsim_dev *nsim_dev = devlink_priv(devlink);
+
+ nsim_dev->test2 = ctx->val.vu32;
+ return 0;
+}
+
+static int
+nsim_devlink_param_test2_get_default(struct devlink *devlink, u32 id,
+ struct devlink_param_gset_ctx *ctx,
+ struct netlink_ext_ack *extack)
+{
+ ctx->val.vu32 = 1234;
+ return 0;
+}
+
+static int
+nsim_devlink_param_test2_reset_default(struct devlink *devlink, u32 id,
+ enum devlink_param_cmode cmode,
+ struct netlink_ext_ack *extack)
+{
+ struct nsim_dev *nsim_dev = devlink_priv(devlink);
+
+ nsim_dev->test2 = 1234;
+ return 0;
+}
+
static const struct devlink_param nsim_devlink_params[] = {
DEVLINK_PARAM_GENERIC(MAX_MACS,
BIT(DEVLINK_PARAM_CMODE_DRIVERINIT),
@@ -531,6 +576,14 @@ static const struct devlink_param nsim_devlink_params[] = {
"test1", DEVLINK_PARAM_TYPE_BOOL,
BIT(DEVLINK_PARAM_CMODE_DRIVERINIT),
NULL, NULL, NULL),
+ DEVLINK_PARAM_DRIVER_WITH_DEFAULTS(NSIM_DEVLINK_PARAM_ID_TEST2,
+ "test2", DEVLINK_PARAM_TYPE_U32,
+ BIT(DEVLINK_PARAM_CMODE_RUNTIME),
+ nsim_devlink_param_test2_get,
+ nsim_devlink_param_test2_set,
+ NULL,
+ nsim_devlink_param_test2_get_default,
+ nsim_devlink_param_test2_reset_default),
};
static void nsim_devlink_set_params_init_values(struct nsim_dev *nsim_dev,
@@ -1396,6 +1449,7 @@ static const struct devlink_ops nsim_dev_devlink_ops = {
#define NSIM_DEV_MAX_MACS_DEFAULT 32
#define NSIM_DEV_TEST1_DEFAULT true
+#define NSIM_DEV_TEST2_DEFAULT 1234
static int __nsim_dev_port_add(struct nsim_dev *nsim_dev, enum nsim_dev_port_type type,
unsigned int port_index, u8 perm_addr[ETH_ALEN])
@@ -1590,6 +1644,7 @@ int nsim_drv_probe(struct nsim_bus_dev *nsim_bus_dev)
nsim_dev->fw_update_flash_chunk_time_ms = NSIM_DEV_FLASH_CHUNK_TIME_MS_DEFAULT;
nsim_dev->max_macs = NSIM_DEV_MAX_MACS_DEFAULT;
nsim_dev->test1 = NSIM_DEV_TEST1_DEFAULT;
+ nsim_dev->test2 = NSIM_DEV_TEST2_DEFAULT;
spin_lock_init(&nsim_dev->fa_cookie_lock);
dev_set_drvdata(&nsim_bus_dev->dev, nsim_dev);
diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h
index af6fcfcda8ba..d1a941e2b18f 100644
--- a/drivers/net/netdevsim/netdevsim.h
+++ b/drivers/net/netdevsim/netdevsim.h
@@ -331,6 +331,7 @@ struct nsim_dev {
u32 fw_update_flash_chunk_time_ms;
u32 max_macs;
bool test1;
+ u32 test2;
bool dont_allow_reload;
bool fail_reload;
struct devlink_region *dummy_region;
--
2.47.3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH net-next v4 6/6] selftest: netdevsim: test devlink default params
2025-11-18 0:24 [PATCH net-next v4 0/6] devlink: net/mlx5: implement swp_l4_csum_mode via devlink params Daniel Zahka
` (4 preceding siblings ...)
2025-11-18 0:24 ` [PATCH net-next v4 5/6] netdevsim: register a new devlink param with default value interface Daniel Zahka
@ 2025-11-18 0:24 ` Daniel Zahka
2025-11-18 7:28 ` [PATCH net-next v4 0/6] devlink: net/mlx5: implement swp_l4_csum_mode via devlink params Loktionov, Aleksandr
6 siblings, 0 replies; 14+ messages in thread
From: Daniel Zahka @ 2025-11-18 0:24 UTC (permalink / raw)
To: Jiri Pirko, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Jonathan Corbet, Srujana Challa,
Bharat Bhushan, Herbert Xu, Brett Creeley, Andrew Lunn,
Michael Chan, Pavan Chebbi, Tony Nguyen, Przemek Kitszel,
Sunil Goutham, Linu Cherian, Geetha sowjanya, Jerin Jacob,
hariprasad, Subbaraya Sundeep, Tariq Toukan, Saeed Mahameed,
Leon Romanovsky, Mark Bloch, Ido Schimmel, Petr Machata,
Manish Chopra, Maxime Coquelin, Alexandre Torgue,
Siddharth Vadapalli, Roger Quadros, Loic Poulain, Sergey Ryazanov,
Johannes Berg, Vladimir Oltean, Michal Swiatkowski,
Aleksandr Loktionov, Dave Ertman, Vlad Dumitrescu,
Russell King (Oracle), Alexander Sverdlin, Lorenzo Bianconi
Cc: netdev, linux-doc, linux-rdma
Test querying default values and resetting to default values for
netdevsim devlink params.
This should cover the basic paths of interest: driverinit and
non-driverinit cmodes, as well as bool and non-bool value
type. Default param values of type bool are encoded with u8 netlink
type as opposed to flag type, so that userspace can distinguish
"not-present" from false.
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
---
.../drivers/net/netdevsim/devlink.sh | 113 +++++++++++++++++-
1 file changed, 107 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/drivers/net/netdevsim/devlink.sh b/tools/testing/selftests/drivers/net/netdevsim/devlink.sh
index 030762b203d7..e642da9dd0c1 100755
--- a/tools/testing/selftests/drivers/net/netdevsim/devlink.sh
+++ b/tools/testing/selftests/drivers/net/netdevsim/devlink.sh
@@ -3,7 +3,8 @@
lib_dir=$(dirname $0)/../../../net/forwarding
-ALL_TESTS="fw_flash_test params_test regions_test reload_test \
+ALL_TESTS="fw_flash_test params_test \
+ params_default_test regions_test reload_test \
netns_reload_test resource_test dev_info_test \
empty_reporter_test dummy_reporter_test rate_test"
NUM_NETIFS=0
@@ -78,17 +79,28 @@ fw_flash_test()
param_get()
{
local name=$1
+ local attr=${2:-value}
+ local cmode=${3:-driverinit}
cmd_jq "devlink dev param show $DL_HANDLE name $name -j" \
- '.[][][].values[] | select(.cmode == "driverinit").value'
+ '.[][][].values[] | select(.cmode == "'"$cmode"'").'"$attr"
}
param_set()
{
local name=$1
local value=$2
+ local cmode=${3:-driverinit}
- devlink dev param set $DL_HANDLE name $name cmode driverinit value $value
+ devlink dev param set $DL_HANDLE name $name cmode $cmode value $value
+}
+
+param_set_default()
+{
+ local name=$1
+ local cmode=${2:-driverinit}
+
+ devlink dev param set $DL_HANDLE name $name default cmode $cmode
}
check_value()
@@ -97,12 +109,18 @@ check_value()
local phase_name=$2
local expected_param_value=$3
local expected_debugfs_value=$4
+ local cmode=${5:-driverinit}
local value
+ local attr="value"
- value=$(param_get $name)
- check_err $? "Failed to get $name param value"
+ if [[ "$phase_name" == *"default"* ]]; then
+ attr="default"
+ fi
+
+ value=$(param_get $name $attr $cmode)
+ check_err $? "Failed to get $name param $attr"
[ "$value" == "$expected_param_value" ]
- check_err $? "Unexpected $phase_name $name param value"
+ check_err $? "Unexpected $phase_name $name param $attr"
value=$(<$DEBUGFS_DIR/$name)
check_err $? "Failed to get $name debugfs value"
[ "$value" == "$expected_debugfs_value" ]
@@ -135,6 +153,89 @@ params_test()
log_test "params test"
}
+value_to_debugfs()
+{
+ local value=$1
+
+ case "$value" in
+ true)
+ echo "Y"
+ ;;
+ false)
+ echo "N"
+ ;;
+ *)
+ echo "$value"
+ ;;
+ esac
+}
+
+test_default()
+{
+ local param_name=$1
+ local new_value=$2
+ local expected_default=$3
+ local cmode=${4:-driverinit}
+ local default_debugfs=$(value_to_debugfs $expected_default)
+ local new_debugfs=$(value_to_debugfs $new_value)
+ local expected_debugfs
+
+ expected_debugfs=$default_debugfs
+ check_value $param_name initial-default $expected_default $expected_debugfs $cmode
+
+ param_set $param_name $new_value $cmode
+ check_err $? "Failed to set $param_name to $new_value"
+
+ expected_debugfs=$([ "$cmode" == "runtime" ] && echo "$new_debugfs" || echo "$default_debugfs")
+ check_value $param_name post-set $new_value $expected_debugfs $cmode
+
+ devlink dev reload $DL_HANDLE
+ check_err $? "Failed to reload device"
+
+ expected_debugfs=$new_debugfs
+ check_value $param_name post-reload-new-value $new_value $expected_debugfs $cmode
+
+ param_set_default $param_name $cmode
+ check_err $? "Failed to set $param_name to default"
+
+ expected_debugfs=$([ "$cmode" == "runtime" ] && echo "$default_debugfs" || echo "$new_debugfs")
+ check_value $param_name post-set-default $expected_default $expected_debugfs $cmode
+
+ devlink dev reload $DL_HANDLE
+ check_err $? "Failed to reload device"
+
+ expected_debugfs=$default_debugfs
+ check_value $param_name post-reload-default $expected_default $expected_debugfs $cmode
+}
+
+params_default_test()
+{
+ RET=0
+
+ if ! devlink dev param help 2>&1 | grep -q "value VALUE | default"; then
+ echo "SKIP: devlink cli missing default feature"
+ return
+ fi
+
+ # Remove side effects of previous tests. Use plain param_set, because
+ # param_set_default is a feature under test here.
+ param_set max_macs 32 driverinit
+ check_err $? "Failed to reset max_macs to default value"
+ param_set test1 true driverinit
+ check_err $? "Failed to reset test1 to default value"
+ param_set test2 1234 runtime
+ check_err $? "Failed to reset test2 to default value"
+
+ devlink dev reload $DL_HANDLE
+ check_err $? "Failed to reload device for clean state"
+
+ test_default max_macs 16 32 driverinit
+ test_default test1 false true driverinit
+ test_default test2 100 1234 runtime
+
+ log_test "params default test"
+}
+
check_region_size()
{
local name=$1
--
2.47.3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* RE: [PATCH net-next v4 1/6] devlink: pass extack through to devlink_param::get()
2025-11-18 0:24 ` [PATCH net-next v4 1/6] devlink: pass extack through to devlink_param::get() Daniel Zahka
@ 2025-11-18 7:17 ` Loktionov, Aleksandr
0 siblings, 0 replies; 14+ messages in thread
From: Loktionov, Aleksandr @ 2025-11-18 7:17 UTC (permalink / raw)
To: Daniel Zahka, Jiri Pirko, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Jonathan Corbet,
Srujana Challa, Bharat Bhushan, Herbert Xu, Brett Creeley,
Andrew Lunn, Michael Chan, Pavan Chebbi, Nguyen, Anthony L,
Kitszel, Przemyslaw, Goutham, Sunil Kovvuri, Linu Cherian,
Geetha sowjanya, Jerin Jacob, hariprasad, Subbaraya Sundeep,
Tariq Toukan, Saeed Mahameed, Leon Romanovsky, Mark Bloch,
Ido Schimmel, Petr Machata, Manish Chopra, Maxime Coquelin,
Alexandre Torgue, Siddharth Vadapalli, Roger Quadros,
Loic Poulain, Sergey Ryazanov, Johannes Berg, Vladimir Oltean,
Michal Swiatkowski, Ertman, David M, Vlad Dumitrescu,
Russell King (Oracle), Alexander Sverdlin, Lorenzo Bianconi
Cc: netdev@vger.kernel.org, linux-doc@vger.kernel.org,
linux-rdma@vger.kernel.org
> -----Original Message-----
> From: Daniel Zahka <daniel.zahka@gmail.com>
> Sent: Tuesday, November 18, 2025 1:24 AM
> To: Jiri Pirko <jiri@resnulli.us>; David S. Miller
> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub
> Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Simon
> Horman <horms@kernel.org>; Jonathan Corbet <corbet@lwn.net>; Srujana
> Challa <schalla@marvell.com>; Bharat Bhushan <bbhushan2@marvell.com>;
> Herbert Xu <herbert@gondor.apana.org.au>; Brett Creeley
> <brett.creeley@amd.com>; Andrew Lunn <andrew+netdev@lunn.ch>; Michael
> Chan <michael.chan@broadcom.com>; Pavan Chebbi
> <pavan.chebbi@broadcom.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Goutham, Sunil Kovvuri
> <sgoutham@marvell.com>; Linu Cherian <lcherian@marvell.com>; Geetha
> sowjanya <gakula@marvell.com>; Jerin Jacob <jerinj@marvell.com>;
> hariprasad <hkelam@marvell.com>; Subbaraya Sundeep
> <sbhatta@marvell.com>; Tariq Toukan <tariqt@nvidia.com>; Saeed
> Mahameed <saeedm@nvidia.com>; Leon Romanovsky <leon@kernel.org>; Mark
> Bloch <mbloch@nvidia.com>; Ido Schimmel <idosch@nvidia.com>; Petr
> Machata <petrm@nvidia.com>; Manish Chopra <manishc@marvell.com>;
> Maxime Coquelin <mcoquelin.stm32@gmail.com>; Alexandre Torgue
> <alexandre.torgue@foss.st.com>; Siddharth Vadapalli <s-
> vadapalli@ti.com>; Roger Quadros <rogerq@kernel.org>; Loic Poulain
> <loic.poulain@oss.qualcomm.com>; Sergey Ryazanov
> <ryazanov.s.a@gmail.com>; Johannes Berg <johannes@sipsolutions.net>;
> Vladimir Oltean <olteanv@gmail.com>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>; Loktionov, Aleksandr
> <aleksandr.loktionov@intel.com>; Ertman, David M
> <david.m.ertman@intel.com>; Vlad Dumitrescu <vdumitrescu@nvidia.com>;
> Russell King (Oracle) <rmk+kernel@armlinux.org.uk>; Alexander Sverdlin
> <alexander.sverdlin@gmail.com>; Lorenzo Bianconi <lorenzo@kernel.org>
> Cc: netdev@vger.kernel.org; linux-doc@vger.kernel.org; linux-
> rdma@vger.kernel.org
> Subject: [PATCH net-next v4 1/6] 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.
>
> Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
> Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
> ---
>
> Notes:
> v3:
> - fix warnings about undocumented param in intel ice driver
>
...
>
> --
> 2.47.3
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH net-next v4 2/6] devlink: refactor devlink_nl_param_value_fill_one()
2025-11-18 0:24 ` [PATCH net-next v4 2/6] devlink: refactor devlink_nl_param_value_fill_one() Daniel Zahka
@ 2025-11-18 7:18 ` Loktionov, Aleksandr
0 siblings, 0 replies; 14+ messages in thread
From: Loktionov, Aleksandr @ 2025-11-18 7:18 UTC (permalink / raw)
To: Daniel Zahka, Jiri Pirko, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Jonathan Corbet,
Srujana Challa, Bharat Bhushan, Herbert Xu, Brett Creeley,
Andrew Lunn, Michael Chan, Pavan Chebbi, Nguyen, Anthony L,
Kitszel, Przemyslaw, Goutham, Sunil Kovvuri, Linu Cherian,
Geetha sowjanya, Jerin Jacob, hariprasad, Subbaraya Sundeep,
Tariq Toukan, Saeed Mahameed, Leon Romanovsky, Mark Bloch,
Ido Schimmel, Petr Machata, Manish Chopra, Maxime Coquelin,
Alexandre Torgue, Siddharth Vadapalli, Roger Quadros,
Loic Poulain, Sergey Ryazanov, Johannes Berg, Vladimir Oltean,
Michal Swiatkowski, Ertman, David M, Vlad Dumitrescu,
Russell King (Oracle), Alexander Sverdlin, Lorenzo Bianconi
Cc: netdev@vger.kernel.org, linux-doc@vger.kernel.org,
linux-rdma@vger.kernel.org
> -----Original Message-----
> From: Daniel Zahka <daniel.zahka@gmail.com>
> Sent: Tuesday, November 18, 2025 1:24 AM
> To: Jiri Pirko <jiri@resnulli.us>; David S. Miller
> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub
> Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Simon
> Horman <horms@kernel.org>; Jonathan Corbet <corbet@lwn.net>; Srujana
> Challa <schalla@marvell.com>; Bharat Bhushan <bbhushan2@marvell.com>;
> Herbert Xu <herbert@gondor.apana.org.au>; Brett Creeley
> <brett.creeley@amd.com>; Andrew Lunn <andrew+netdev@lunn.ch>; Michael
> Chan <michael.chan@broadcom.com>; Pavan Chebbi
> <pavan.chebbi@broadcom.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Goutham, Sunil Kovvuri
> <sgoutham@marvell.com>; Linu Cherian <lcherian@marvell.com>; Geetha
> sowjanya <gakula@marvell.com>; Jerin Jacob <jerinj@marvell.com>;
> hariprasad <hkelam@marvell.com>; Subbaraya Sundeep
> <sbhatta@marvell.com>; Tariq Toukan <tariqt@nvidia.com>; Saeed
> Mahameed <saeedm@nvidia.com>; Leon Romanovsky <leon@kernel.org>; Mark
> Bloch <mbloch@nvidia.com>; Ido Schimmel <idosch@nvidia.com>; Petr
> Machata <petrm@nvidia.com>; Manish Chopra <manishc@marvell.com>;
> Maxime Coquelin <mcoquelin.stm32@gmail.com>; Alexandre Torgue
> <alexandre.torgue@foss.st.com>; Siddharth Vadapalli <s-
> vadapalli@ti.com>; Roger Quadros <rogerq@kernel.org>; Loic Poulain
> <loic.poulain@oss.qualcomm.com>; Sergey Ryazanov
> <ryazanov.s.a@gmail.com>; Johannes Berg <johannes@sipsolutions.net>;
> Vladimir Oltean <olteanv@gmail.com>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>; Loktionov, Aleksandr
> <aleksandr.loktionov@intel.com>; Ertman, David M
> <david.m.ertman@intel.com>; Vlad Dumitrescu <vdumitrescu@nvidia.com>;
> Russell King (Oracle) <rmk+kernel@armlinux.org.uk>; Alexander Sverdlin
> <alexander.sverdlin@gmail.com>; Lorenzo Bianconi <lorenzo@kernel.org>
> Cc: netdev@vger.kernel.org; linux-doc@vger.kernel.org; linux-
> rdma@vger.kernel.org
> Subject: [PATCH net-next v4 2/6] devlink: refactor
> devlink_nl_param_value_fill_one()
>
> Lift the param type demux and value attr placement into a separate
> function. This new function, devlink_nl_param_put(), can be used to
> place additional types values in the value array, e.g., default,
> current, next values. This commit has no functional change.
>
> Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
> ---
> net/devlink/param.c | 70 +++++++++++++++++++++++++-------------------
> -
> 1 file changed, 39 insertions(+), 31 deletions(-)
>
...
> --
> 2.47.3
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH net-next v4 4/6] net/mlx5: implement swp_l4_csum_mode via devlink params
2025-11-18 0:24 ` [PATCH net-next v4 4/6] net/mlx5: implement swp_l4_csum_mode via devlink params Daniel Zahka
@ 2025-11-18 7:18 ` Loktionov, Aleksandr
0 siblings, 0 replies; 14+ messages in thread
From: Loktionov, Aleksandr @ 2025-11-18 7:18 UTC (permalink / raw)
To: Daniel Zahka, Jiri Pirko, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Jonathan Corbet,
Srujana Challa, Bharat Bhushan, Herbert Xu, Brett Creeley,
Andrew Lunn, Michael Chan, Pavan Chebbi, Nguyen, Anthony L,
Kitszel, Przemyslaw, Goutham, Sunil Kovvuri, Linu Cherian,
Geetha sowjanya, Jerin Jacob, hariprasad, Subbaraya Sundeep,
Tariq Toukan, Saeed Mahameed, Leon Romanovsky, Mark Bloch,
Ido Schimmel, Petr Machata, Manish Chopra, Maxime Coquelin,
Alexandre Torgue, Siddharth Vadapalli, Roger Quadros,
Loic Poulain, Sergey Ryazanov, Johannes Berg, Vladimir Oltean,
Michal Swiatkowski, Ertman, David M, Vlad Dumitrescu,
Russell King (Oracle), Alexander Sverdlin, Lorenzo Bianconi
Cc: netdev@vger.kernel.org, linux-doc@vger.kernel.org,
linux-rdma@vger.kernel.org
> -----Original Message-----
> From: Daniel Zahka <daniel.zahka@gmail.com>
> Sent: Tuesday, November 18, 2025 1:25 AM
> To: Jiri Pirko <jiri@resnulli.us>; David S. Miller
> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub
> Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Simon
> Horman <horms@kernel.org>; Jonathan Corbet <corbet@lwn.net>; Srujana
> Challa <schalla@marvell.com>; Bharat Bhushan <bbhushan2@marvell.com>;
> Herbert Xu <herbert@gondor.apana.org.au>; Brett Creeley
> <brett.creeley@amd.com>; Andrew Lunn <andrew+netdev@lunn.ch>; Michael
> Chan <michael.chan@broadcom.com>; Pavan Chebbi
> <pavan.chebbi@broadcom.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Goutham, Sunil Kovvuri
> <sgoutham@marvell.com>; Linu Cherian <lcherian@marvell.com>; Geetha
> sowjanya <gakula@marvell.com>; Jerin Jacob <jerinj@marvell.com>;
> hariprasad <hkelam@marvell.com>; Subbaraya Sundeep
> <sbhatta@marvell.com>; Tariq Toukan <tariqt@nvidia.com>; Saeed
> Mahameed <saeedm@nvidia.com>; Leon Romanovsky <leon@kernel.org>; Mark
> Bloch <mbloch@nvidia.com>; Ido Schimmel <idosch@nvidia.com>; Petr
> Machata <petrm@nvidia.com>; Manish Chopra <manishc@marvell.com>;
> Maxime Coquelin <mcoquelin.stm32@gmail.com>; Alexandre Torgue
> <alexandre.torgue@foss.st.com>; Siddharth Vadapalli <s-
> vadapalli@ti.com>; Roger Quadros <rogerq@kernel.org>; Loic Poulain
> <loic.poulain@oss.qualcomm.com>; Sergey Ryazanov
> <ryazanov.s.a@gmail.com>; Johannes Berg <johannes@sipsolutions.net>;
> Vladimir Oltean <olteanv@gmail.com>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>; Loktionov, Aleksandr
> <aleksandr.loktionov@intel.com>; Ertman, David M
> <david.m.ertman@intel.com>; Vlad Dumitrescu <vdumitrescu@nvidia.com>;
> Russell King (Oracle) <rmk+kernel@armlinux.org.uk>; Alexander Sverdlin
> <alexander.sverdlin@gmail.com>; Lorenzo Bianconi <lorenzo@kernel.org>
> Cc: netdev@vger.kernel.org; linux-doc@vger.kernel.org; linux-
> rdma@vger.kernel.org
> Subject: [PATCH net-next v4 4/6] net/mlx5: implement swp_l4_csum_mode
> via devlink params
>
> swp_l4_csum_mode controls how L4 transmit checksums are computed when
> using Software Parser (SWP) hints for header locations.
>
> Supported values:
> 1. default: device will choose between full_csum or l4_only. Driver
> will discover the device's choice during initialization.
> 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.
>
> Note that 'default' might be returned from the device and passed to
> userspace, and it might also be set during a
> devlink_param::reset_default() call, but attempts to set a value of
> default directly with param-set will be rejected.
>
> The l4_only setting is a dependency for PSP initialization in
> mlx5e_psp_init().
>
> Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
> ---
>
> Notes:
> v4:
> - rename device_default to default
> - implement get_default and reset_default handlers
> - don't allow user to request "default" in set cmd
> 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 | 14 ++
> .../net/ethernet/mellanox/mlx5/core/devlink.h | 3 +-
> .../mellanox/mlx5/core/lib/nv_param.c | 229
> ++++++++++++++++++
> 3 files changed, 245 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/networking/devlink/mlx5.rst
> b/Documentation/networking/devlink/mlx5.rst
> index 0e5f9c76e514..4bba4d780a4a 100644
> --- a/Documentation/networking/devlink/mlx5.rst
> +++ b/Documentation/networking/devlink/mlx5.rst
> @@ -218,6 +218,20 @@ 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.
> +
> + * ``default`` : Use the device's default checksum calculation
> + mode. The driver will discover during init whether or
> + full_csum or l4_only is in use. Setting this value
> explicitly
> + from userspace is not allowed, but some firmware versions
> may
> + return this value on param read.
> + * ``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
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.h
> b/drivers/net/ethernet/mellanox/mlx5/core/devlink.h
> index c9555119a661..43b9bf8829cf 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.h
> @@ -26,7 +26,8 @@ enum mlx5_devlink_param_id {
...
> --
> 2.47.3
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH net-next v4 5/6] netdevsim: register a new devlink param with default value interface
2025-11-18 0:24 ` [PATCH net-next v4 5/6] netdevsim: register a new devlink param with default value interface Daniel Zahka
@ 2025-11-18 7:22 ` Loktionov, Aleksandr
0 siblings, 0 replies; 14+ messages in thread
From: Loktionov, Aleksandr @ 2025-11-18 7:22 UTC (permalink / raw)
To: Daniel Zahka, Jiri Pirko, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Jonathan Corbet,
Srujana Challa, Bharat Bhushan, Herbert Xu, Brett Creeley,
Andrew Lunn, Michael Chan, Pavan Chebbi, Nguyen, Anthony L,
Kitszel, Przemyslaw, Goutham, Sunil Kovvuri, Linu Cherian,
Geetha sowjanya, Jerin Jacob, hariprasad, Subbaraya Sundeep,
Tariq Toukan, Saeed Mahameed, Leon Romanovsky, Mark Bloch,
Ido Schimmel, Petr Machata, Manish Chopra, Maxime Coquelin,
Alexandre Torgue, Siddharth Vadapalli, Roger Quadros,
Loic Poulain, Sergey Ryazanov, Johannes Berg, Vladimir Oltean,
Michal Swiatkowski, Ertman, David M, Vlad Dumitrescu,
Russell King (Oracle), Alexander Sverdlin, Lorenzo Bianconi
Cc: netdev@vger.kernel.org, linux-doc@vger.kernel.org,
linux-rdma@vger.kernel.org
> -----Original Message-----
> From: Daniel Zahka <daniel.zahka@gmail.com>
> Sent: Tuesday, November 18, 2025 1:25 AM
> To: Jiri Pirko <jiri@resnulli.us>; David S. Miller
> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub
> Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Simon
> Horman <horms@kernel.org>; Jonathan Corbet <corbet@lwn.net>; Srujana
> Challa <schalla@marvell.com>; Bharat Bhushan <bbhushan2@marvell.com>;
> Herbert Xu <herbert@gondor.apana.org.au>; Brett Creeley
> <brett.creeley@amd.com>; Andrew Lunn <andrew+netdev@lunn.ch>; Michael
> Chan <michael.chan@broadcom.com>; Pavan Chebbi
> <pavan.chebbi@broadcom.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Goutham, Sunil Kovvuri
> <sgoutham@marvell.com>; Linu Cherian <lcherian@marvell.com>; Geetha
> sowjanya <gakula@marvell.com>; Jerin Jacob <jerinj@marvell.com>;
> hariprasad <hkelam@marvell.com>; Subbaraya Sundeep
> <sbhatta@marvell.com>; Tariq Toukan <tariqt@nvidia.com>; Saeed
> Mahameed <saeedm@nvidia.com>; Leon Romanovsky <leon@kernel.org>; Mark
> Bloch <mbloch@nvidia.com>; Ido Schimmel <idosch@nvidia.com>; Petr
> Machata <petrm@nvidia.com>; Manish Chopra <manishc@marvell.com>;
> Maxime Coquelin <mcoquelin.stm32@gmail.com>; Alexandre Torgue
> <alexandre.torgue@foss.st.com>; Siddharth Vadapalli <s-
> vadapalli@ti.com>; Roger Quadros <rogerq@kernel.org>; Loic Poulain
> <loic.poulain@oss.qualcomm.com>; Sergey Ryazanov
> <ryazanov.s.a@gmail.com>; Johannes Berg <johannes@sipsolutions.net>;
> Vladimir Oltean <olteanv@gmail.com>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>; Loktionov, Aleksandr
> <aleksandr.loktionov@intel.com>; Ertman, David M
> <david.m.ertman@intel.com>; Vlad Dumitrescu <vdumitrescu@nvidia.com>;
> Russell King (Oracle) <rmk+kernel@armlinux.org.uk>; Alexander Sverdlin
> <alexander.sverdlin@gmail.com>; Lorenzo Bianconi <lorenzo@kernel.org>
> Cc: netdev@vger.kernel.org; linux-doc@vger.kernel.org; linux-
> rdma@vger.kernel.org
> Subject: [PATCH net-next v4 5/6] netdevsim: register a new devlink
> param with default value interface
>
> Create a new devlink param, test2, that supports default param actions
> via the devlink_param::get_default() and
> devlink_param::reset_default() functions.
>
> Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
> ---
> drivers/net/netdevsim/dev.c | 55
> +++++++++++++++++++++++++++++++
> drivers/net/netdevsim/netdevsim.h | 1 +
> 2 files changed, 56 insertions(+)
>
...
> +static int
> +nsim_devlink_param_test2_get_default(struct devlink *devlink, u32 id,
> + struct devlink_param_gset_ctx *ctx,
> + struct netlink_ext_ack *extack) {
> + ctx->val.vu32 = 1234;
> + return 0;
> +}
> +
> +static int
> +nsim_devlink_param_test2_reset_default(struct devlink *devlink, u32
> id,
> + enum devlink_param_cmode cmode,
> + struct netlink_ext_ack *extack) {
> + struct nsim_dev *nsim_dev = devlink_priv(devlink);
> +
> + nsim_dev->test2 = 1234;
> + return 0;
> +}
> +
Duplicated magic value instead of the provided macro.
The default value 1234 is hard‑coded in two helpers even though NSIM_DEV_TEST2_DEFAULT is defined and already used for initialization.
Better use the same defined constant in both places.
Everything else looks good
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> --
> 2.47.3
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH net-next v4 3/6] devlink: support default values for param-get and param-set
2025-11-18 0:24 ` [PATCH net-next v4 3/6] devlink: support default values for param-get and param-set Daniel Zahka
@ 2025-11-18 7:27 ` Loktionov, Aleksandr
2025-11-18 14:05 ` Daniel Zahka
0 siblings, 1 reply; 14+ messages in thread
From: Loktionov, Aleksandr @ 2025-11-18 7:27 UTC (permalink / raw)
To: Daniel Zahka, Jiri Pirko, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Jonathan Corbet,
Srujana Challa, Bharat Bhushan, Herbert Xu, Brett Creeley,
Andrew Lunn, Michael Chan, Pavan Chebbi, Nguyen, Anthony L,
Kitszel, Przemyslaw, Goutham, Sunil Kovvuri, Linu Cherian,
Geetha sowjanya, Jerin Jacob, hariprasad, Subbaraya Sundeep,
Tariq Toukan, Saeed Mahameed, Leon Romanovsky, Mark Bloch,
Ido Schimmel, Petr Machata, Manish Chopra, Maxime Coquelin,
Alexandre Torgue, Siddharth Vadapalli, Roger Quadros,
Loic Poulain, Sergey Ryazanov, Johannes Berg, Vladimir Oltean,
Michal Swiatkowski, Ertman, David M, Vlad Dumitrescu,
Russell King (Oracle), Alexander Sverdlin, Lorenzo Bianconi
Cc: netdev@vger.kernel.org, linux-doc@vger.kernel.org,
linux-rdma@vger.kernel.org
> -----Original Message-----
> From: Daniel Zahka <daniel.zahka@gmail.com>
> Sent: Tuesday, November 18, 2025 1:24 AM
> To: Jiri Pirko <jiri@resnulli.us>; David S. Miller
> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub
> Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Simon
> Horman <horms@kernel.org>; Jonathan Corbet <corbet@lwn.net>; Srujana
> Challa <schalla@marvell.com>; Bharat Bhushan <bbhushan2@marvell.com>;
> Herbert Xu <herbert@gondor.apana.org.au>; Brett Creeley
> <brett.creeley@amd.com>; Andrew Lunn <andrew+netdev@lunn.ch>; Michael
> Chan <michael.chan@broadcom.com>; Pavan Chebbi
> <pavan.chebbi@broadcom.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Goutham, Sunil Kovvuri
> <sgoutham@marvell.com>; Linu Cherian <lcherian@marvell.com>; Geetha
> sowjanya <gakula@marvell.com>; Jerin Jacob <jerinj@marvell.com>;
> hariprasad <hkelam@marvell.com>; Subbaraya Sundeep
> <sbhatta@marvell.com>; Tariq Toukan <tariqt@nvidia.com>; Saeed
> Mahameed <saeedm@nvidia.com>; Leon Romanovsky <leon@kernel.org>; Mark
> Bloch <mbloch@nvidia.com>; Ido Schimmel <idosch@nvidia.com>; Petr
> Machata <petrm@nvidia.com>; Manish Chopra <manishc@marvell.com>;
> Maxime Coquelin <mcoquelin.stm32@gmail.com>; Alexandre Torgue
> <alexandre.torgue@foss.st.com>; Siddharth Vadapalli <s-
> vadapalli@ti.com>; Roger Quadros <rogerq@kernel.org>; Loic Poulain
> <loic.poulain@oss.qualcomm.com>; Sergey Ryazanov
> <ryazanov.s.a@gmail.com>; Johannes Berg <johannes@sipsolutions.net>;
> Vladimir Oltean <olteanv@gmail.com>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>; Loktionov, Aleksandr
> <aleksandr.loktionov@intel.com>; Ertman, David M
> <david.m.ertman@intel.com>; Vlad Dumitrescu <vdumitrescu@nvidia.com>;
> Russell King (Oracle) <rmk+kernel@armlinux.org.uk>; Alexander Sverdlin
> <alexander.sverdlin@gmail.com>; Lorenzo Bianconi <lorenzo@kernel.org>
> Cc: netdev@vger.kernel.org; linux-doc@vger.kernel.org; linux-
> rdma@vger.kernel.org
> Subject: [PATCH net-next v4 3/6] devlink: support default values for
> param-get and param-set
>
> Support querying and resetting to default param values.
>
> Introduce two new devlink netlink attrs:
> DEVLINK_ATTR_PARAM_VALUE_DEFAULT and
> DEVLINK_ATTR_PARAM_RESET_DEFAULT. The former is used to contain an
> optional parameter value inside of the param_value nested attribute.
> The latter is used in param-set requests from userspace to indicate
> that the driver should reset the param to its default value.
>
> To implement this, two new functions are added to the devlink driver
> api: devlink_param::get_default() and
> devlink_param::reset_default(). These callbacks allow drivers to
> implement default param actions for runtime and permanent cmodes. For
> driverinit params, the core latches the last value set by a driver via
> devl_param_driverinit_value_set(), and uses that as the default value
> for a param.
>
> Because default parameter values are optional, it would be impossible
> to discern whether or not a param of type bool has default value of
> false or not provided if the default value is encoded using a netlink
> flag type. For this reason, when a DEVLINK_PARAM_TYPE_BOOL has an
> associated default value, the default value is encoded using a u8
> type.
>
> Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
> ---
> Documentation/netlink/specs/devlink.yaml | 9 ++
> .../networking/devlink/devlink-params.rst | 10 ++
> include/net/devlink.h | 42 +++++++
> include/uapi/linux/devlink.h | 3 +
> net/devlink/netlink_gen.c | 5 +-
> net/devlink/param.c | 105 ++++++++++++++++-
> -
> 6 files changed, 160 insertions(+), 14 deletions(-)
>
> diff --git a/Documentation/netlink/specs/devlink.yaml
> b/Documentation/netlink/specs/devlink.yaml
> index 426d5aa7d955..837112da6738 100644
> --- a/Documentation/netlink/specs/devlink.yaml
> +++ b/Documentation/netlink/specs/devlink.yaml
> @@ -859,6 +859,14 @@ attribute-sets:
> name: health-reporter-burst-period
> type: u64
> doc: Time (in msec) for recoveries before starting the grace
> period.
> +
...
> diff --git a/include/uapi/linux/devlink.h
> b/include/uapi/linux/devlink.h index 157f11d3fb72..e7d6b6d13470 100644
> --- a/include/uapi/linux/devlink.h
> +++ b/include/uapi/linux/devlink.h
> @@ -639,6 +639,9 @@ enum devlink_attr {
>
> DEVLINK_ATTR_HEALTH_REPORTER_BURST_PERIOD, /* u64 */
>
> + DEVLINK_ATTR_PARAM_VALUE_DEFAULT, /* dynamic */
> + DEVLINK_ATTR_PARAM_RESET_DEFAULT, /* flag */
> +
The patch introduces a new UAPI attribute DEVLINK_ATTR_PARAM_VALUE_DEFAULT but Documentation/netlink/specs/devlink.yaml only documents param-reset-default.
The spec should also describe the output attribute that appears in the nested param-value dump ("default" value), otherwise the generated tooling/specs are out of sync with UAPI and the committed generated C (netlink_gen.c).
I'm afraid you forgot to add a YAML entry for the nested attribute (e.g. under the param-value attribute set, typically alongside param-value-data and param-value-cmode), describing its type per param and the bool/u8 encoding rule covered in the commit message.
Am I right?
With the best regards
Alex
> --
> 2.47.3
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [PATCH net-next v4 0/6] devlink: net/mlx5: implement swp_l4_csum_mode via devlink params
2025-11-18 0:24 [PATCH net-next v4 0/6] devlink: net/mlx5: implement swp_l4_csum_mode via devlink params Daniel Zahka
` (5 preceding siblings ...)
2025-11-18 0:24 ` [PATCH net-next v4 6/6] selftest: netdevsim: test devlink default params Daniel Zahka
@ 2025-11-18 7:28 ` Loktionov, Aleksandr
6 siblings, 0 replies; 14+ messages in thread
From: Loktionov, Aleksandr @ 2025-11-18 7:28 UTC (permalink / raw)
To: Daniel Zahka, Jiri Pirko, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Jonathan Corbet,
Srujana Challa, Bharat Bhushan, Herbert Xu, Brett Creeley,
Andrew Lunn, Michael Chan, Pavan Chebbi, Nguyen, Anthony L,
Kitszel, Przemyslaw, Goutham, Sunil Kovvuri, Linu Cherian,
Geetha sowjanya, Jerin Jacob, hariprasad, Subbaraya Sundeep,
Tariq Toukan, Saeed Mahameed, Leon Romanovsky, Mark Bloch,
Ido Schimmel, Petr Machata, Manish Chopra, Maxime Coquelin,
Alexandre Torgue, Siddharth Vadapalli, Roger Quadros,
Loic Poulain, Sergey Ryazanov, Johannes Berg, Vladimir Oltean,
Michal Swiatkowski, Ertman, David M, Vlad Dumitrescu,
Russell King (Oracle), Alexander Sverdlin, Lorenzo Bianconi
Cc: netdev@vger.kernel.org, linux-doc@vger.kernel.org,
linux-rdma@vger.kernel.org
> -----Original Message-----
> From: Daniel Zahka <daniel.zahka@gmail.com>
> Sent: Tuesday, November 18, 2025 1:24 AM
> To: Jiri Pirko <jiri@resnulli.us>; David S. Miller
> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub
> Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Simon
> Horman <horms@kernel.org>; Jonathan Corbet <corbet@lwn.net>; Srujana
> Challa <schalla@marvell.com>; Bharat Bhushan <bbhushan2@marvell.com>;
> Herbert Xu <herbert@gondor.apana.org.au>; Brett Creeley
> <brett.creeley@amd.com>; Andrew Lunn <andrew+netdev@lunn.ch>; Michael
> Chan <michael.chan@broadcom.com>; Pavan Chebbi
> <pavan.chebbi@broadcom.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Goutham, Sunil Kovvuri
> <sgoutham@marvell.com>; Linu Cherian <lcherian@marvell.com>; Geetha
> sowjanya <gakula@marvell.com>; Jerin Jacob <jerinj@marvell.com>;
> hariprasad <hkelam@marvell.com>; Subbaraya Sundeep
> <sbhatta@marvell.com>; Tariq Toukan <tariqt@nvidia.com>; Saeed
> Mahameed <saeedm@nvidia.com>; Leon Romanovsky <leon@kernel.org>; Mark
> Bloch <mbloch@nvidia.com>; Ido Schimmel <idosch@nvidia.com>; Petr
> Machata <petrm@nvidia.com>; Manish Chopra <manishc@marvell.com>;
> Maxime Coquelin <mcoquelin.stm32@gmail.com>; Alexandre Torgue
> <alexandre.torgue@foss.st.com>; Siddharth Vadapalli <s-
> vadapalli@ti.com>; Roger Quadros <rogerq@kernel.org>; Loic Poulain
> <loic.poulain@oss.qualcomm.com>; Sergey Ryazanov
> <ryazanov.s.a@gmail.com>; Johannes Berg <johannes@sipsolutions.net>;
> Vladimir Oltean <olteanv@gmail.com>; Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com>; Loktionov, Aleksandr
> <aleksandr.loktionov@intel.com>; Ertman, David M
> <david.m.ertman@intel.com>; Vlad Dumitrescu <vdumitrescu@nvidia.com>;
> Russell King (Oracle) <rmk+kernel@armlinux.org.uk>; Alexander Sverdlin
> <alexander.sverdlin@gmail.com>; Lorenzo Bianconi <lorenzo@kernel.org>
> Cc: netdev@vger.kernel.org; linux-doc@vger.kernel.org; linux-
> rdma@vger.kernel.org
> Subject: [PATCH net-next v4 0/6] devlink: net/mlx5: implement
> swp_l4_csum_mode via devlink params
>
> This series introduces a new devlink feature for querying param
> default values, and resetting params to their default values. This
> feature is then used to implement a new mlx5 driver param.
>
> The series starts with two pure refactor patches: one that passes
> through the extack to devlink_param::get() implementations. And a
> second small refactor that prepares the netlink tlv handling code in
> the devlink_param::get() path to better handle default parameter
> values.
>
> The third patch introduces the uapi and driver api for default
> parameter values. The driver api is opt-in, and both the uapi and
> driver api preserve existing behavior when not used by drivers or
> older userapace binaries.
“older userapace binaries” → userspace.
“introduces the a new mlx5 driver param” → the (or drop “the”)
It's minor, but trivial to fix before applying; also helps searchability in lore.
With the best regards
Alex
> The fourth patch introduces the a new mlx5 driver param,
> swp_l4_csum_mode, for controlling tx csum behavior. The "l4_only"
> value of this param is a dependency for PSP initialization on CX7
> NICs.
>
> Lastly, the series introduces a new driver param with cmode runtime to
> netdevsim, and then uses this param in a new testcase for netdevsim
> devlink params.
>
> Here are some examples of using the default param uapi with the
> devlink cli. Note the devlink cli binary I am using has changes which
> I am posting in accompanying series targeting iproute2-next:
>
> # netdevsim
> ./devlink dev param show netdevsim/netdevsim0
> netdevsim/netdevsim0:
> name max_macs type generic
> values:
> cmode driverinit value 32 default 32
> name test1 type driver-specific
> values:
> cmode driverinit value true default true
>
> # set to false
> ./devlink dev param set netdevsim/netdevsim0 name test1 value false
> cmode driverinit ./devlink dev param show netdevsim/netdevsim0
> netdevsim/netdevsim0:
> name max_macs type generic
> values:
> cmode driverinit value 32 default 32
> name test1 type driver-specific
> values:
> cmode driverinit value false default true
>
> # set back to default
> ./devlink dev param set netdevsim/netdevsim0 name test1 default cmode
> driverinit ./devlink dev param show netdevsim/netdevsim0
> netdevsim/netdevsim0:
> name max_macs type generic
> values:
> cmode driverinit value 32 default 32
> name test1 type driver-specific
> values:
> cmode driverinit value true default true
>
> # mlx5 params on cx7
> ./devlink dev param show pci/0000:01:00.0
> pci/0000:01:00.0:
> name max_macs type generic
> values:
> cmode driverinit value 128 default 128 ...
> name swp_l4_csum_mode type driver-specific
> values:
> cmode permanent value default default default
>
> # set to l4_only
> ./devlink dev param set pci/0000:01:00.0 name swp_l4_csum_mode value
> l4_only cmode permanent ./devlink dev param show pci/0000:01:00.0 name
> swp_l4_csum_mode
> pci/0000:01:00.0:
> name swp_l4_csum_mode type driver-specific
> values:
> cmode permanent value l4_only default default
>
> # reset to default
> ./devlink dev param set pci/0000:01:00.0 name swp_l4_csum_mode default
> cmode permanent ./devlink dev param show pci/0000:01:00.0 name
> swp_l4_csum_mode
> pci/0000:01:00.0:
> name swp_l4_csum_mode type driver-specific
> values:
> cmode permanent value default default default
>
> CHANGES:
> v4:
> - add test case for default params.
> - add new cmode runtime test param to netdevsim.
> - introduce uapi and driver api for supporting default param values.
> - rename device_default to default in mlx5 patch.
> v3: https://lore.kernel.org/netdev/20251107204347.4060542-1-
> daniel.zahka@gmail.com/
> - fix warnings about undocumented param in intel ice driver
> v2: https://lore.kernel.org/netdev/20251103194554.3203178-1-
> daniel.zahka@gmail.com/
> - 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/20251022190932.1073898-1-
> daniel.zahka@gmail.com/
>
> Daniel Zahka (6):
> devlink: pass extack through to devlink_param::get()
> devlink: refactor devlink_nl_param_value_fill_one()
> devlink: support default values for param-get and param-set
> net/mlx5: implement swp_l4_csum_mode via devlink params
> netdevsim: register a new devlink param with default value interface
> selftest: netdevsim: test devlink default params
>
> Documentation/netlink/specs/devlink.yaml | 9 +
> .../networking/devlink/devlink-params.rst | 10 +
> Documentation/networking/devlink/mlx5.rst | 14 ++
> .../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/i40e/i40e_devlink.c | 3 +-
> .../net/ethernet/intel/ice/devlink/devlink.c | 14 +-
> .../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 | 238
> +++++++++++++++++-
> .../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/netdevsim/dev.c | 55 ++++
> drivers/net/netdevsim/netdevsim.h | 1 +
> drivers/net/wwan/iosm/iosm_ipc_devlink.c | 3 +-
> include/net/devlink.h | 45 +++-
> include/net/dsa.h | 3 +-
> include/uapi/linux/devlink.h | 3 +
> net/devlink/netlink_gen.c | 5 +-
> net/devlink/param.c | 180 +++++++++----
> net/dsa/devlink.c | 3 +-
> .../drivers/net/netdevsim/devlink.sh | 113 ++++++++-
> 34 files changed, 689 insertions(+), 91 deletions(-)
>
> --
> 2.47.3
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net-next v4 3/6] devlink: support default values for param-get and param-set
2025-11-18 7:27 ` Loktionov, Aleksandr
@ 2025-11-18 14:05 ` Daniel Zahka
0 siblings, 0 replies; 14+ messages in thread
From: Daniel Zahka @ 2025-11-18 14:05 UTC (permalink / raw)
To: Loktionov, Aleksandr, Jiri Pirko, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Jonathan Corbet,
Srujana Challa, Bharat Bhushan, Herbert Xu, Brett Creeley,
Andrew Lunn, Michael Chan, Pavan Chebbi, Nguyen, Anthony L,
Kitszel, Przemyslaw, Goutham, Sunil Kovvuri, Linu Cherian,
Geetha sowjanya, Jerin Jacob, hariprasad, Subbaraya Sundeep,
Tariq Toukan, Saeed Mahameed, Leon Romanovsky, Mark Bloch,
Ido Schimmel, Petr Machata, Manish Chopra, Maxime Coquelin,
Alexandre Torgue, Siddharth Vadapalli, Roger Quadros,
Loic Poulain, Sergey Ryazanov, Johannes Berg, Vladimir Oltean,
Michal Swiatkowski, Ertman, David M, Vlad Dumitrescu,
Russell King (Oracle), Alexander Sverdlin, Lorenzo Bianconi
Cc: netdev@vger.kernel.org, linux-doc@vger.kernel.org,
linux-rdma@vger.kernel.org
On 11/18/25 2:27 AM, Loktionov, Aleksandr wrote:
>> diff --git a/include/uapi/linux/devlink.h
>> b/include/uapi/linux/devlink.h index 157f11d3fb72..e7d6b6d13470 100644
>> --- a/include/uapi/linux/devlink.h
>> +++ b/include/uapi/linux/devlink.h
>> @@ -639,6 +639,9 @@ enum devlink_attr {
>>
>> DEVLINK_ATTR_HEALTH_REPORTER_BURST_PERIOD, /* u64 */
>>
>> + DEVLINK_ATTR_PARAM_VALUE_DEFAULT, /* dynamic */
>> + DEVLINK_ATTR_PARAM_RESET_DEFAULT, /* flag */
>> +
> The patch introduces a new UAPI attribute DEVLINK_ATTR_PARAM_VALUE_DEFAULT but Documentation/netlink/specs/devlink.yaml only documents param-reset-default.
> The spec should also describe the output attribute that appears in the nested param-value dump ("default" value), otherwise the generated tooling/specs are out of sync with UAPI and the committed generated C (netlink_gen.c).
>
> I'm afraid you forgot to add a YAML entry for the nested attribute (e.g. under the param-value attribute set, typically alongside param-value-data and param-value-cmode), describing its type per param and the bool/u8 encoding rule covered in the commit message.
> Am I right?
Hello. Thank you for the review.
As I understand it, devlink.yaml omits entries of enum devlink_attr that
are annotated as "dynamic". This is what creates two of the holes in the
devlink attribute set in devlink.yaml where the "TODO: fill in the
attributes in between" comments appear. Dynamic types are basically
tagged unions, where the tag is held by a different attribute:
DEVLINK_ATTR_PARAM_TYPE. The netlink yaml schema doesn't have a good way
to encode this. That is why param-value-data, and now
param-value-default cannot be in devlink.yaml. The best that could be
done for now would probably be to add them with 'type: binary'.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2025-11-18 14:05 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-18 0:24 [PATCH net-next v4 0/6] devlink: net/mlx5: implement swp_l4_csum_mode via devlink params Daniel Zahka
2025-11-18 0:24 ` [PATCH net-next v4 1/6] devlink: pass extack through to devlink_param::get() Daniel Zahka
2025-11-18 7:17 ` Loktionov, Aleksandr
2025-11-18 0:24 ` [PATCH net-next v4 2/6] devlink: refactor devlink_nl_param_value_fill_one() Daniel Zahka
2025-11-18 7:18 ` Loktionov, Aleksandr
2025-11-18 0:24 ` [PATCH net-next v4 3/6] devlink: support default values for param-get and param-set Daniel Zahka
2025-11-18 7:27 ` Loktionov, Aleksandr
2025-11-18 14:05 ` Daniel Zahka
2025-11-18 0:24 ` [PATCH net-next v4 4/6] net/mlx5: implement swp_l4_csum_mode via devlink params Daniel Zahka
2025-11-18 7:18 ` Loktionov, Aleksandr
2025-11-18 0:24 ` [PATCH net-next v4 5/6] netdevsim: register a new devlink param with default value interface Daniel Zahka
2025-11-18 7:22 ` Loktionov, Aleksandr
2025-11-18 0:24 ` [PATCH net-next v4 6/6] selftest: netdevsim: test devlink default params Daniel Zahka
2025-11-18 7:28 ` [PATCH net-next v4 0/6] devlink: net/mlx5: implement swp_l4_csum_mode via devlink params Loktionov, Aleksandr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox