diff options
author | Michael Guralnik <michaelgur@mellanox.com> | 2019-11-09 02:45:24 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2019-11-11 23:15:29 +0300 |
commit | cc9defcbb8fae52810f7795b039223edae51ef95 (patch) | |
tree | 4ee11cf42b8e8b8fdbd03414c93a2a74e5a587dd /include/linux/mlx5 | |
parent | e90cde0d76f01fd3b60da0a983d2e93c5c35bedc (diff) | |
download | linux-cc9defcbb8fae52810f7795b039223edae51ef95.tar.xz |
net/mlx5: Handle "enable_roce" devlink param
Register "enable_roce" param, default value is RoCE enabled.
Current configuration is stored on mlx5_core_dev and exposed to user
through the cmode runtime devlink param.
Changing configuration requires changing the cmode driverinit devlink
param and calling devlink reload.
Signed-off-by: Michael Guralnik <michaelgur@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'include/linux/mlx5')
-rw-r--r-- | include/linux/mlx5/driver.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 7b4801e96feb..1884513aac90 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -1191,4 +1191,15 @@ enum { MLX5_TRIGGERED_CMD_COMP = (u64)1 << 32, }; +static inline bool mlx5_is_roce_enabled(struct mlx5_core_dev *dev) +{ + struct devlink *devlink = priv_to_devlink(dev); + union devlink_param_value val; + + devlink_param_driverinit_value_get(devlink, + DEVLINK_PARAM_GENERIC_ID_ENABLE_ROCE, + &val); + return val.vbool; +} + #endif /* MLX5_DRIVER_H */ |