Skip to content

Commit f11e5bd

Browse files
mkowalskiPaolo Abeni
authored andcommitted
bonding: support balance-alb with openvswitch
Commit d5410ac ("net:bonding:support balance-alb interface with vlan to bridge") introduced a support for balance-alb mode for interfaces connected to the linux bridge by fixing missing matching of MAC entry in FDB. In our testing we discovered that it still does not work when the bond is connected to the OVS bridge as show in diagram below: eth1(mac:eth1_mac)--bond0(balance-alb,mac:eth0_mac)--eth0(mac:eth0_mac) | bond0.150(mac:eth0_mac) | ovs_bridge(ip:bridge_ip,mac:eth0_mac) This patch fixes it by checking not only if the device is a bridge but also if it is an openvswitch. Signed-off-by: Mateusz Kowalski <mko@redhat.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/9fe7297c-609e-208b-c77b-3ceef6eb51a4@redhat.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent b23ec2b commit f11e5bd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/net/bonding/bond_alb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
668668

669669
dev = ip_dev_find(dev_net(bond->dev), arp->ip_src);
670670
if (dev) {
671-
if (netif_is_bridge_master(dev)) {
671+
if (netif_is_any_bridge_master(dev)) {
672672
dev_put(dev);
673673
return NULL;
674674
}

include/linux/netdevice.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5128,6 +5128,11 @@ static inline bool netif_is_ovs_port(const struct net_device *dev)
51285128
return dev->priv_flags & IFF_OVS_DATAPATH;
51295129
}
51305130

5131+
static inline bool netif_is_any_bridge_master(const struct net_device *dev)
5132+
{
5133+
return netif_is_bridge_master(dev) || netif_is_ovs_master(dev);
5134+
}
5135+
51315136
static inline bool netif_is_any_bridge_port(const struct net_device *dev)
51325137
{
51335138
return netif_is_bridge_port(dev) || netif_is_ovs_port(dev);

0 commit comments

Comments
 (0)