Commit ff99324d authored by Dmytro Linkin's avatar Dmytro Linkin Committed by David S. Miller

devlink: Remove eswitch mode check for mode set call

When eswitch is disabled, querying its current mode results in error.
Due to this when trying to set the eswitch mode for mlx5 devices, it
fails to set the eswitch switchdev mode.
Hence remove such check.

Fixes: a8ecb93e ("devlink: Introduce rate nodes")
Signed-off-by: default avatarDmytro Linkin <dlinkin@nvidia.com>
Reviewed-by: default avatarParav Pandit <parav@nvidia.com>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1321ed5e
...@@ -2709,17 +2709,6 @@ static int devlink_rate_nodes_check(struct devlink *devlink, u16 mode, ...@@ -2709,17 +2709,6 @@ static int devlink_rate_nodes_check(struct devlink *devlink, u16 mode,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
struct devlink_rate *devlink_rate; struct devlink_rate *devlink_rate;
u16 old_mode;
int err;
if (!devlink->ops->eswitch_mode_get)
return -EOPNOTSUPP;
err = devlink->ops->eswitch_mode_get(devlink, &old_mode);
if (err)
return err;
if (old_mode == mode)
return 0;
list_for_each_entry(devlink_rate, &devlink->rate_list, list) list_for_each_entry(devlink_rate, &devlink->rate_list, list)
if (devlink_rate_is_node(devlink_rate)) { if (devlink_rate_is_node(devlink_rate)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment