Skip to content

Commit 8dafb48

Browse files
shayshyigregkh
authored andcommitted
net/mlx5: Disallow RoCE on multi port slave device
[ Upstream commit c70f859 ] In dual port mode, setting roce enabled/disable for the slave device have no effect. e.g.: the slave device roce status remain unchanged. Therefore disable it and add an error message. Enable or disable roce of the master device affect both master and slave devices. Fixes: cc9defc ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent efb1aa6 commit 8dafb48

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

drivers/net/ethernet/mellanox/mlx5/core/devlink.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,10 @@ static int mlx5_devlink_enable_roce_validate(struct devlink *devlink, u32 id,
282282
NL_SET_ERR_MSG_MOD(extack, "Device doesn't support RoCE");
283283
return -EOPNOTSUPP;
284284
}
285+
if (mlx5_core_is_mp_slave(dev)) {
286+
NL_SET_ERR_MSG_MOD(extack, "Multi port slave device can't configure RoCE");
287+
return -EOPNOTSUPP;
288+
}
285289

286290
return 0;
287291
}

0 commit comments

Comments
 (0)