[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d99b52d7-bdd7-4c67-9be5-f5c48edc8afa@redhat.com>
Date: Thu, 3 Apr 2025 16:02:33 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Hangbin Liu <liuhangbin@...il.com>, netdev@...r.kernel.org
Cc: Jay Vosburgh <jv@...sburgh.net>, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Nikolay Aleksandrov <razor@...ckwall.org>,
Simon Horman <horms@...nel.org>, Cosmin Ratiu <cratiu@...dia.com>,
linux-kernel@...r.kernel.org, Liang Li <liali@...hat.com>
Subject: Re: [PATCH net] bonding: use permanent address for MAC swapping if
device address is same
On 3/19/25 9:09 AM, Hangbin Liu wrote:
> Similar with a951bc1e6ba5 ("bonding: correct the MAC address for "follow"
> fail_over_mac policy"). The fail_over_mac follow mode requires the formerly
> active slave to swap MAC addresses with the newly active slave during
> failover. However, the slave's MAC address can be same under certain
> conditions:
>
> 1) ip link set eth0 master bond0
> bond0 adopts eth0's MAC address (MAC0).
>
> 1) ip link set eth1 master bond0
> eth1 is added as a backup with its own MAC (MAC1).
>
> 3) ip link set eth0 nomaster
> eth0 is released and restores its MAC (MAC0).
> eth1 becomes the active slave, and bond0 assigns MAC0 to eth1.
It was not immediately clear to me that the mac-dance in the code below
happens only at failover time.
I second Jakub's doubt, I think it would be better to change eth0 mac
address here (possibly to permanent eth1 mac, to preserve some consistency?)
Doing that in ndo_del_slave() should allow bonding to change the mac
while still owning the old slave and avoid races with user-space.
WDYT?
Thanks,
Paolo
Powered by blists - more mailing lists