Skip to content

Commit a13fc7e

Browse files
Amit Cohenkuba-moo
authored andcommitted
mlxsw: spectrum: Call mlxsw_sp_bridge_vxlan_{join, leave}() for VLAN-aware bridge
mlxsw_sp_bridge_vxlan_{join,leave}() are not called when a VXLAN device joins or leaves a VLAN-aware bridge. As mentioned in the comment - when the bridge is VLAN-aware, the VNI of the VXLAN device needs to be mapped to a VLAN, but at this point no VLANs are configured on the VxLAN device. This means that we can call the APIs, but there is no point to do that, as they do not configure anything in such cases. Next patch will extend mlxsw_sp_bridge_vxlan_{join,leave}() to set hardware domain for VXLAN, this should be done also when a VXLAN device joins or leaves a VLAN-aware bridge. Call the APIs, which for now do not do anything in these flows. Align the call to mlxsw_sp_bridge_vxlan_leave() to be called like mlxsw_sp_bridge_vxlan_join(), only in case that the VXLAN device is up, so move the check to be done before calling mlxsw_sp_bridge_vxlan_{join,leave}(). This does not change the existing behavior, as there is a similar check inside mlxsw_sp_bridge_vxlan_leave(). Signed-off-by: Amit Cohen <[email protected]> Reviewed-by: Petr Machata <[email protected]> Reviewed-by: Ido Schimmel <[email protected]> Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/994c1ea93520f9ea55d1011cd47dc2180d526484.1742224300.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6d627a2 commit a13fc7e

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5230,25 +5230,13 @@ static int mlxsw_sp_netdevice_vxlan_event(struct mlxsw_sp *mlxsw_sp,
52305230
return 0;
52315231
if (!mlxsw_sp_bridge_vxlan_is_valid(upper_dev, extack))
52325232
return -EOPNOTSUPP;
5233-
if (cu_info->linking) {
5234-
if (!netif_running(dev))
5235-
return 0;
5236-
/* When the bridge is VLAN-aware, the VNI of the VxLAN
5237-
* device needs to be mapped to a VLAN, but at this
5238-
* point no VLANs are configured on the VxLAN device
5239-
*/
5240-
if (br_vlan_enabled(upper_dev))
5241-
return 0;
5233+
if (!netif_running(dev))
5234+
return 0;
5235+
if (cu_info->linking)
52425236
return mlxsw_sp_bridge_vxlan_join(mlxsw_sp, upper_dev,
52435237
dev, 0, extack);
5244-
} else {
5245-
/* VLANs were already flushed, which triggered the
5246-
* necessary cleanup
5247-
*/
5248-
if (br_vlan_enabled(upper_dev))
5249-
return 0;
5238+
else
52505239
mlxsw_sp_bridge_vxlan_leave(mlxsw_sp, dev);
5251-
}
52525240
break;
52535241
case NETDEV_PRE_UP:
52545242
upper_dev = netdev_master_upper_dev_get(dev);

0 commit comments

Comments
 (0)