Skip to content

Commit e92df79

Browse files
cjubranPaolo Abeni
authored andcommitted
net/mlx5e: Prevent bridge link show failure for non-eswitch-allowed devices
mlx5_eswitch_get_vepa returns -EPERM if the device lacks eswitch_manager capability, blocking mlx5e_bridge_getlink from retrieving VEPA mode. Since mlx5e_bridge_getlink implements ndo_bridge_getlink, returning -EPERM causes bridge link show to fail instead of skipping devices without this capability. To avoid this, return -EOPNOTSUPP from mlx5e_bridge_getlink when mlx5_eswitch_get_vepa fails, ensuring the command continues processing other devices while ignoring those without the necessary capability. Fixes: 4b89251 ("net/mlx5: Support ndo bridge_setlink and getlink") Signed-off-by: Carolina Jubran <[email protected]> Reviewed-by: Jianbo Liu <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Reviewed-by: Michal Swiatkowski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 4b8eeed commit e92df79

File tree

1 file changed

+2
-4
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5132,11 +5132,9 @@ static int mlx5e_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
51325132
struct mlx5e_priv *priv = netdev_priv(dev);
51335133
struct mlx5_core_dev *mdev = priv->mdev;
51345134
u8 mode, setting;
5135-
int err;
51365135

5137-
err = mlx5_eswitch_get_vepa(mdev->priv.eswitch, &setting);
5138-
if (err)
5139-
return err;
5136+
if (mlx5_eswitch_get_vepa(mdev->priv.eswitch, &setting))
5137+
return -EOPNOTSUPP;
51405138
mode = setting ? BRIDGE_MODE_VEPA : BRIDGE_MODE_VEB;
51415139
return ndo_dflt_bridge_getlink(skb, pid, seq, dev,
51425140
mode,

0 commit comments

Comments
 (0)