net/mlx5: Disallow RoCE on lag device
authorShay Drory <shayd@nvidia.com>
Sun, 3 Jan 2021 08:09:59 +0000 (10:09 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Fri, 12 Feb 2021 02:50:15 +0000 (18:50 -0800)
In lag mode, setting roce enabled/disable of lag device have no effect.
e.g.: bond device (roce/vf_lag) roce status remain unchanged.
Therefore disable it and add an error message.

Fixes: cc9defcbb8fa ("net/mlx5: Handle "enable_roce" devlink param")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/devlink.c

index 317ce6b80b23be257a5aee27558a937b3f9b9fc4..c7073193db1407b3df79327a6ce92cc5ab4568a8 100644 (file)
@@ -273,8 +273,8 @@ static int mlx5_devlink_enable_roce_validate(struct devlink *devlink, u32 id,
                NL_SET_ERR_MSG_MOD(extack, "Device doesn't support RoCE");
                return -EOPNOTSUPP;
        }
-       if (mlx5_core_is_mp_slave(dev)) {
-               NL_SET_ERR_MSG_MOD(extack, "Multi port slave device can't configure RoCE");
+       if (mlx5_core_is_mp_slave(dev) || mlx5_lag_is_active(dev)) {
+               NL_SET_ERR_MSG_MOD(extack, "Multi port slave/Lag device can't configure RoCE");
                return -EOPNOTSUPP;
        }