[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1a471c1b-b78c-d646-6d9b-5bbb753a2a0b@redhat.com>
Date: Fri, 28 Jul 2023 10:04:20 +0200
From: Mat Kowalski <mko@...hat.com>
To: netdev@...r.kernel.org
Subject: [PATCH] net:bonding:support balance-alb with openvswitch
Commit d5410ac7b0ba ("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@...hat.com>
---
drivers/net/bonding/bond_alb.c | 3 +--
include/linux/netdevice.h | 5 +++++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index b9dbad3a8af8..6f2ffcc4f19c 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -668,7 +668,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff
*skb, struct bonding *bond)
dev = ip_dev_find(dev_net(bond->dev), arp->ip_src);
if (dev) {
- if (netif_is_bridge_master(dev)) {
+ if (netif_is_any_bridge_master(dev)) {
dev_put(dev);
return NULL;
}
@@ -1833,4 +1833,3 @@ void bond_alb_clear_vlan(struct bonding *bond,
unsigned short vlan_id)
if (bond->alb_info.rlb_enabled)
rlb_clear_vlan(bond, vlan_id);
}
-
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index b828c7a75be2..d250a0b947f1 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -5102,6 +5102,11 @@ static inline bool netif_is_ovs_port(const struct
net_device *dev)
return dev->priv_flags & IFF_OVS_DATAPATH;
}
+static inline bool netif_is_any_bridge_master(const struct net_device *dev)
+{
+ return netif_is_bridge_master(dev)) || netif_is_ovs_master(dev);
+}
+
static inline bool netif_is_any_bridge_port(const struct net_device *dev)
{
return netif_is_bridge_port(dev) || netif_is_ovs_port(dev);
--
2.41.0
Powered by blists - more mailing lists