diff options
author | Jiri Pirko <jiri@nvidia.com> | 2023-02-10 11:01:26 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-02-13 09:49:14 +0000 |
commit | afd888c3e19ceb5247158fe2fabbf7234937a515 (patch) | |
tree | 6ee81524048814d2708e1997aaf29f55c9444dcf /include/net | |
parent | fa2f921f3bf1ed98956ad341b920a55aab69bc35 (diff) |
devlink: make sure driver does not read updated driverinit param before reload
The driverinit param purpose is to serve the driver during init/reload
time to provide a value, either default or set by user.
Make sure that driver does not read value updated by user before the
reload is performed. Hold the new value in a separate struct and switch
it during reload.
Note that this is required to be eventually possible to call
devl_param_driverinit_value_get() without holding instance lock.
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/devlink.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h index 2e85a5970a32..8ed960345f37 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -489,6 +489,10 @@ struct devlink_param_item { const struct devlink_param *param; union devlink_param_value driverinit_value; bool driverinit_value_valid; + union devlink_param_value driverinit_value_new; /* Not reachable + * until reload. + */ + bool driverinit_value_new_valid; }; enum devlink_param_generic_id { |