Skip to content

Commit 4dda3d6

Browse files
authored
Add upstream fix for bridge link show failure (#510)
Backport torvalds/linux@e92df79 into sonic-linux-kernel On SmartSwitch we see the following error when hostside PF interfaces (for DPUs) created by mlx5_core driver are present. ``` root@sonic:/home/admin/# bridge vlan show port vlan-id *** *** RTNETLINK answers: Operation not permitted Dump terminated ``` Similar error is seen for bridge link show command as well. This backport is expected to fix these issues.
1 parent 44da908 commit 4dda3d6

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
From e92df790d07a8eea873efcb84776e7b71f81c7d5 Mon Sep 17 00:00:00 2001
2+
From: Carolina Jubran <[email protected]>
3+
Date: Tue, 11 Mar 2025 00:01:44 +0200
4+
Subject: [PATCH] net/mlx5e: Prevent bridge link show failure for
5+
non-eswitch-allowed devices
6+
7+
mlx5_eswitch_get_vepa returns -EPERM if the device lacks
8+
eswitch_manager capability, blocking mlx5e_bridge_getlink from
9+
retrieving VEPA mode. Since mlx5e_bridge_getlink implements
10+
ndo_bridge_getlink, returning -EPERM causes bridge link show to fail
11+
instead of skipping devices without this capability.
12+
13+
To avoid this, return -EOPNOTSUPP from mlx5e_bridge_getlink when
14+
mlx5_eswitch_get_vepa fails, ensuring the command continues processing
15+
other devices while ignoring those without the necessary capability.
16+
17+
Fixes: 4b89251de024 ("net/mlx5: Support ndo bridge_setlink and getlink")
18+
Signed-off-by: Carolina Jubran <[email protected]>
19+
Reviewed-by: Jianbo Liu <[email protected]>
20+
Signed-off-by: Tariq Toukan <[email protected]>
21+
Reviewed-by: Michal Swiatkowski <[email protected]>
22+
Link: https://patch.msgid.link/[email protected]
23+
Signed-off-by: Paolo Abeni <[email protected]>
24+
---
25+
drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 6 ++----
26+
1 file changed, 2 insertions(+), 4 deletions(-)
27+
28+
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
29+
index a814b63ed97e57..8fcaee381b0e09 100644
30+
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
31+
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
32+
@@ -5132,11 +5132,9 @@ static int mlx5e_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
33+
struct mlx5e_priv *priv = netdev_priv(dev);
34+
struct mlx5_core_dev *mdev = priv->mdev;
35+
u8 mode, setting;
36+
- int err;
37+
38+
- err = mlx5_eswitch_get_vepa(mdev->priv.eswitch, &setting);
39+
- if (err)
40+
- return err;
41+
+ if (mlx5_eswitch_get_vepa(mdev->priv.eswitch, &setting))
42+
+ return -EOPNOTSUPP;
43+
mode = setting ? BRIDGE_MODE_VEPA : BRIDGE_MODE_VEB;
44+
return ndo_dflt_bridge_getlink(skb, pid, seq, dev,
45+
mode,

patch/series

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ Support-for-fullcone-nat.patch
7171
#
7272

7373
0001-efi-memattr-Ignore-table-if-the-size-is-clearly-bogus.patch
74+
# Backport from v6.14 to v6.1.132 and v6.12.20
75+
0001-prevent-bridge-link-show-failure-for-non-eswitch-allowed-devices.patch
7476

7577
# Mellanox patches for 5.10
7678
###-> mellanox_sdk-start

0 commit comments

Comments
 (0)