Patch "bonding: fix macvlan over alb bond support" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    bonding: fix macvlan over alb bond support

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bonding-fix-macvlan-over-alb-bond-support.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2519219bec75b45d0d6ea19c8773f5a2df3f88ed
Author: Hangbin Liu <liuhangbin@xxxxxxxxx>
Date:   Wed Aug 23 15:19:04 2023 +0800

    bonding: fix macvlan over alb bond support
    
    [ Upstream commit e74216b8def3803e98ae536de78733e9d7f3b109 ]
    
    The commit 14af9963ba1e ("bonding: Support macvlans on top of tlb/rlb mode
    bonds") aims to enable the use of macvlans on top of rlb bond mode. However,
    the current rlb bond mode only handles ARP packets to update remote neighbor
    entries. This causes an issue when a macvlan is on top of the bond, and
    remote devices send packets to the macvlan using the bond's MAC address
    as the destination. After delivering the packets to the macvlan, the macvlan
    will rejects them as the MAC address is incorrect. Consequently, this commit
    makes macvlan over bond non-functional.
    
    To address this problem, one potential solution is to check for the presence
    of a macvlan port on the bond device using netif_is_macvlan_port(bond->dev)
    and return NULL in the rlb_arp_xmit() function. However, this approach
    doesn't fully resolve the situation when a VLAN exists between the bond and
    macvlan.
    
    So let's just do a partial revert for commit 14af9963ba1e in rlb_arp_xmit().
    As the comment said, Don't modify or load balance ARPs that do not originate
    locally.
    
    Fixes: 14af9963ba1e ("bonding: Support macvlans on top of tlb/rlb mode bonds")
    Reported-by: susan.zheng@xxxxxxxxxxx
    Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2117816
    Signed-off-by: Hangbin Liu <liuhangbin@xxxxxxxxx>
    Acked-by: Jay Vosburgh <jay.vosburgh@xxxxxxxxxxxxx>
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index a6a70b872ac4a..b29393831a302 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -657,10 +657,10 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
 		return NULL;
 	arp = (struct arp_pkt *)skb_network_header(skb);
 
-	/* Don't modify or load balance ARPs that do not originate locally
-	 * (e.g.,arrive via a bridge).
+	/* Don't modify or load balance ARPs that do not originate
+	 * from the bond itself or a VLAN directly above the bond.
 	 */
-	if (!bond_slave_has_mac_rx(bond, arp->mac_src))
+	if (!bond_slave_has_mac_rcu(bond, arp->mac_src))
 		return NULL;
 
 	if (arp->op_code == htons(ARPOP_REPLY)) {
diff --git a/include/net/bonding.h b/include/net/bonding.h
index 6c90aca917edc..08d222752cc88 100644
--- a/include/net/bonding.h
+++ b/include/net/bonding.h
@@ -700,23 +700,14 @@ static inline struct slave *bond_slave_has_mac(struct bonding *bond,
 }
 
 /* Caller must hold rcu_read_lock() for read */
-static inline bool bond_slave_has_mac_rx(struct bonding *bond, const u8 *mac)
+static inline bool bond_slave_has_mac_rcu(struct bonding *bond, const u8 *mac)
 {
 	struct list_head *iter;
 	struct slave *tmp;
-	struct netdev_hw_addr *ha;
 
 	bond_for_each_slave_rcu(bond, tmp, iter)
 		if (ether_addr_equal_64bits(mac, tmp->dev->dev_addr))
 			return true;
-
-	if (netdev_uc_empty(bond->dev))
-		return false;
-
-	netdev_for_each_uc_addr(ha, bond->dev)
-		if (ether_addr_equal_64bits(mac, ha->addr))
-			return true;
-
 	return false;
 }
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux