RE: [PATCH v13 net-next 3/9] devlink: pass param values by pointer

From: Kiyanovski, Arthur

Date: Mon May 11 2026 - 21:50:55 EST


> -----Original Message-----
> From: Ratheesh Kannoth <rkannoth@xxxxxxxxxxx>
> Sent: Sunday, May 10, 2026 8:39 PM
>
> 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.
>
> Signed-off-by: Ratheesh Kannoth <rkannoth@xxxxxxxxxxx>
>
>
> diff --git a/drivers/net/ethernet/amazon/ena/ena_devlink.c
> b/drivers/net/ethernet/amazon/ena/ena_devlink.c
> index 4772185e669d..5ea9fef149aa 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_devlink.c
> +++ b/drivers/net/ethernet/amazon/ena/ena_devlink.c
> @@ -8,12 +8,12 @@
> #include "ena_phc.h"
>
> static int ena_devlink_enable_phc_validate(struct devlink *devlink, u32 id,
> - union devlink_param_value val,
> + union devlink_param_value
> + *val,
> struct netlink_ext_ack *extack) {
> struct ena_adapter *adapter = ENA_DEVLINK_PRIV(devlink);
>
> - if (!val.vbool)
> + if (!val->vbool)
> return 0;
>
> if (!ena_com_phc_supported(adapter->ena_dev)) { @@ -57,7 +57,7 @@
> void ena_devlink_disable_phc_param(struct devlink *devlink)
> value.vbool = false;
> devl_param_driverinit_value_set(devlink,
> DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC,
> - value);
> + &value);
> devl_unlock(devlink);
> }
>
> @@ -151,7 +151,7 @@ static int ena_devlink_configure_params(struct
> devlink *devlink)
> value.vbool = ena_phc_is_enabled(adapter);
> devl_param_driverinit_value_set(devlink,
> DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC,
> - value);
> + &value);
> devl_unlock(devlink);
>
> return 0;

Reviewed-by: Arthur Kiyanovski <akiyano@xxxxxxxxxx> #for ena

Thank you for the patch!