From: Paolo Abeni <pabeni@redhat.com>
To: Hangbin Liu <liuhangbin@gmail.com>, netdev@vger.kernel.org
Cc: Jay Vosburgh <jv@jvosburgh.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Nikolay Aleksandrov <razor@blackwall.org>,
Simon Horman <horms@kernel.org>, Cosmin Ratiu <cratiu@nvidia.com>,
linux-kernel@vger.kernel.org, Liang Li <liali@redhat.com>
Subject: Re: [PATCH net] bonding: use permanent address for MAC swapping if device address is same
Date: Thu, 3 Apr 2025 16:02:33 +0200 [thread overview]
Message-ID: <d99b52d7-bdd7-4c67-9be5-f5c48edc8afa@redhat.com> (raw)
In-Reply-To: <20250319080947.2001-1-liuhangbin@gmail.com>
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
next prev parent reply other threads:[~2025-04-03 14:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 8:09 Hangbin Liu
2025-03-20 19:13 ` Jay Vosburgh
2025-03-24 2:30 ` Hangbin Liu
2025-03-25 13:24 ` Jakub Kicinski
2025-03-26 10:22 ` Hangbin Liu
2025-03-26 11:32 ` Jakub Kicinski
2025-03-26 14:18 ` Hangbin Liu
2025-04-03 14:02 ` Paolo Abeni [this message]
2025-04-07 7:57 ` Hangbin Liu
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=d99b52d7-bdd7-4c67-9be5-f5c48edc8afa@redhat.com \
--to=pabeni@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=cratiu@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=liali@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liuhangbin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=razor@blackwall.org \
/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
all inboxes | Powered by JetHome®