Skip to contentSkip to conversation

bonding: support balance-alb with openvswitch

PATCH Applied Mat Kowalski 2 participants 2 messages Aug 1, 2023 – Aug 3, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 bonding: support balance-alb with openvswitch

From: Mateusz Kowalski <[email protected]>

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.

---
v5 changes:
- Fix From: tag to match SoB
- Carry Reviewed-by: tag from v1

v4 changes:
- Fix additional space at the beginning of the line

v3 changes:
- Fix tab chars converted to spaces

v2 changes:
- Fix line wrapping

 drivers/net/bonding/bond_alb.c | 2 +-
 include/linux/netdevice.h      | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/net/bonding/bond_alb.c +1 -1
index b9dbad3a8af8..cc5049eb25f8 100644
@@ -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;
 		}
include/linux/netdevice.h +5 -0
index 84c36a7f873f..27593c0d3c15 100644
@@ -5103,6 +5103,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);
Signature · 1 line
2.41.0
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 10 lines · On Tue, 1 Aug 2023 14:37:50 +0200 you wrote:

From: Mateusz Kowalski <[email protected]>

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:

[...]

Here is the summary with links:
- [net-next,v5] bonding: support balance-alb with openvswitch

    https://git.kernel.org/netdev/net-next/c/f11e5bd159b0

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html