summaryrefslogtreecommitdiff
path: root/drivers/net/netdevsim/dev.c
diff options
context:
space:
mode:
authorRatheesh Kannoth <rkannoth@marvell.com>2026-05-21 15:22:57 +0530
committerJakub Kicinski <kuba@kernel.org>2026-05-25 14:03:06 -0700
commitd603517771d8e08a2d8fc9e1f7682ce393d3973a (patch)
treed897f11904b5bc3fa34638e846a9b9df7c00abcf /drivers/net/netdevsim/dev.c
parente57516529a5bd9e228d1cd80b460fbc1c34bbea4 (diff)
downloadlinux-next-d603517771d8e08a2d8fc9e1f7682ce393d3973a.tar.gz
linux-next-d603517771d8e08a2d8fc9e1f7682ce393d3973a.zip
devlink: pass param values by pointer
union devlink_param_value grows substantially once U64 array parameters are added to devlink (from 32 bytes to over 264 bytes). devlink_nl_param_value_fill_one() and devlink_nl_param_value_put() copy the union by value in several places. Passing two instances as value arguments alone consumes over 528 bytes of stack; combined with deeper call chains the parameter stack can approach 800 bytes and trip CONFIG_FRAME_WARN more easily. Switch internal helpers and exported driver APIs to pass pointers to union devlink_param_value rather than passing the union by value. Reviewed-by: Petr Machata <petrm@nvidia.com> # for mlxsw Acked-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Reviewed-by: Arthur Kiyanovski <akiyano@amazon.com> #for ena Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com> Link: https://patch.msgid.link/20260521095303.2395584-4-rkannoth@marvell.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/netdevsim/dev.c')
-rw-r--r--drivers/net/netdevsim/dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c
index f00fc2f9ebde..aed9ad5f1b43 100644
--- a/drivers/net/netdevsim/dev.c
+++ b/drivers/net/netdevsim/dev.c
@@ -597,11 +597,11 @@ static void nsim_devlink_set_params_init_values(struct nsim_dev *nsim_dev,
value.vu32 = nsim_dev->max_macs;
devl_param_driverinit_value_set(devlink,
DEVLINK_PARAM_GENERIC_ID_MAX_MACS,
- value);
+ &value);
value.vbool = nsim_dev->test1;
devl_param_driverinit_value_set(devlink,
NSIM_DEVLINK_PARAM_ID_TEST1,
- value);
+ &value);
}
static void nsim_devlink_param_load_driverinit_values(struct devlink *devlink)