netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mat Kowalski <mko@redhat.com>
To: netdev@vger.kernel.org
Cc: Jay Vosburgh <j.vosburgh@gmail.com>,
	Andy Gospodarek <andy@greyhouse.net>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: [PATCH net-next] bonding: support balance-alb with openvswitch
Date: Fri, 28 Jul 2023 14:24:32 +0200	[thread overview]
Message-ID: <19d45fbf-2d02-02e9-2906-69bf570e9c7f@redhat.com> (raw)

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@redhat.com>
---
  drivers/net/bonding/bond_alb.c | 2 +-
  include/linux/netdevice.h      | 5 +++++
  2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index b9dbad3a8af8..cc5049eb25f8 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;
          }
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 32a4cdf37dd4..265888af1220 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -5100,6 +5100,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


             reply	other threads:[~2023-07-28 12:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-28 12:24 Mat Kowalski [this message]
2023-07-29 11:12 ` [PATCH net-next] bonding: support balance-alb with openvswitch Simon Horman
2023-07-29 16:26   ` Mat Kowalski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19d45fbf-2d02-02e9-2906-69bf570e9c7f@redhat.com \
    --to=mko@redhat.com \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=j.vosburgh@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).