Skip to content

Commit 7772dc7

Browse files
Tariq Toukankuba-moo
authored andcommitted
net/mlx5: Disallow SRIOV switchdev mode when in multi-PF netdev
Adaptations need to be made for the auxiliary device management in the core driver level. Block this combination for now. Fixes: 678eb44 ("net/mlx5: SD, Implement basic query and instantiation") Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com> Reviewed-by: Gal Pressman <gal@nvidia.com> Link: https://lore.kernel.org/r/20240409190820.227554-12-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 49e6c93 commit 7772dc7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "rdma.h"
4444
#include "en.h"
4545
#include "fs_core.h"
46+
#include "lib/mlx5.h"
4647
#include "lib/devcom.h"
4748
#include "lib/eq.h"
4849
#include "lib/fs_chains.h"
@@ -3711,6 +3712,12 @@ int mlx5_devlink_eswitch_mode_set(struct devlink *devlink, u16 mode,
37113712
if (esw_mode_from_devlink(mode, &mlx5_mode))
37123713
return -EINVAL;
37133714

3715+
if (mode == DEVLINK_ESWITCH_MODE_SWITCHDEV && mlx5_get_sd(esw->dev)) {
3716+
NL_SET_ERR_MSG_MOD(extack,
3717+
"Can't change E-Switch mode to switchdev when multi-PF netdev (Socket Direct) is configured.");
3718+
return -EPERM;
3719+
}
3720+
37143721
mlx5_lag_disable_change(esw->dev);
37153722
err = mlx5_esw_try_lock(esw);
37163723
if (err < 0) {

0 commit comments

Comments
 (0)