Re: [PATCH net] net/mlx5: Bridge, fix bogus MDB offload errors
From: Jianbo Liu
Date: Tue Oct 27 2026 - 02:25:28 EST
On 10/24/2026 6:29 AM, netdev-bot+sashiko@xxxxxxxxxx wrote:
Thank you for your contribution! Sashiko AI review found 1 potential[...]
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] In drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c,
mlx5_esw_bridge_port_mdb_add() now returns 0 when the bridge port…
--
net/mlx5: Bridge, fix bogus MDB offload errors
This patch changes mlx5_esw_bridge_port_mdb_add() so that it returns 0
instead of -EINVAL when the bridge port or the port vlan cannot be found.
It also lowers the log level from warn to info. The goal is to stop the
error messages that appear when a 'bridge vlan del' overtakes a deferred
MDB add.
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c
index b4cf3c5ac0dde..7c32dc9db098e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c
@@ -1867,26 +1867,27 @@ int mlx5_esw_bridge_port_mdb_add(struct net_device *dev, u16 vport_num, u16 esw_
port = mlx5_esw_bridge_port_lookup(vport_num, esw_owner_vhca_id, br_offloads);
if (!port) {
- esw_warn(br_offloads->esw->dev,
+ /* MDB is added asynchronously from the switchdev deferred
+ * queue while port might have been deleted concurrently.
+ */
+ esw_info(br_offloads->esw->dev,
"Failed to lookup bridge port to add MDB (MAC=%pM,vport=%u)\n",
addr, vport_num);
- NL_SET_ERR_MSG_FMT_MOD(extack,
- "Failed to lookup bridge port to add MDB (MAC=%pM,vport=%u)",
- addr, vport_num);
- return -EINVAL;
+ return 0;
}
bridge = port->bridge;
if (bridge->flags & MLX5_ESW_BRIDGE_VLAN_FILTERING_FLAG && vid) {
vlan = mlx5_esw_bridge_vlan_lookup(vid, port);
if (!vlan) {
- esw_warn(br_offloads->esw->dev,
+ /* MDB is added asynchronously from the switchdev
+ * deferred queue while vlan might have been deleted
+ * concurrently.
+ */
+ esw_info(br_offloads->esw->dev,
"Failed to lookup bridge port vlan metadata to create MDB (MAC=%pM,vid=%u,vport=%u)\n",
addr, vid, vport_num);
- NL_SET_ERR_MSG_FMT_MOD(extack,
- "Failed to lookup vlan metadata for MDB (MAC=%pM,vid=%u,vport=%u)",
- addr, vid, vport_num);
- return -EINVAL;
+ return 0;
}
}
[Severity: Medium]
Both of these early exits now return 0. Will the bridge then report the
MDB entry as offloaded, even though nothing was programmed in the
eswitch?
Would returning -EOPNOTSUPP here work instead?
Right, the entry ends up flagged as offloaded without a hardware rule.
Will respin with -EOPNOTSUPP.