diff options
author | Roi Dayan <roid@nvidia.com> | 2023-03-22 13:27:43 +0200 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2023-05-19 10:50:29 -0700 |
commit | c511822fe2c96478d86b6bc3404bb45ebad7556b (patch) | |
tree | 6704e3e57af8b5d4af207958e07941f11e828cce | |
parent | 20d5e0ef252a151ea6585cfccf32def81a624666 (diff) |
net/mlx5: Remove redundant esw multiport validate function
The function didn't validate the value and doesn't require value
validation as it will always be valid true or false values.
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Maor Dickman <maord@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c index 4b607785d694..0e07971e024a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c @@ -464,27 +464,6 @@ static int mlx5_devlink_esw_multiport_get(struct devlink *devlink, u32 id, ctx->val.vbool = mlx5_lag_is_mpesw(dev); return 0; } - -static int mlx5_devlink_esw_multiport_validate(struct devlink *devlink, u32 id, - union devlink_param_value val, - struct netlink_ext_ack *extack) -{ - struct mlx5_core_dev *dev = devlink_priv(devlink); - - if (!MLX5_ESWITCH_MANAGER(dev)) { - NL_SET_ERR_MSG_MOD(extack, "E-Switch is unsupported"); - return -EOPNOTSUPP; - } - - if (mlx5_eswitch_mode(dev) != MLX5_ESWITCH_OFFLOADS) { - NL_SET_ERR_MSG_MOD(extack, - "E-Switch must be in switchdev mode"); - return -EBUSY; - } - - return 0; -} - #endif static int mlx5_devlink_eq_depth_validate(struct devlink *devlink, u32 id, @@ -563,7 +542,7 @@ static const struct devlink_param mlx5_devlink_params[] = { BIT(DEVLINK_PARAM_CMODE_RUNTIME), mlx5_devlink_esw_multiport_get, mlx5_devlink_esw_multiport_set, - mlx5_devlink_esw_multiport_validate), + NULL), #endif DEVLINK_PARAM_GENERIC(IO_EQ_SIZE, BIT(DEVLINK_PARAM_CMODE_DRIVERINIT), NULL, NULL, mlx5_devlink_eq_depth_validate), |