From: Jay Vosburgh <jay.vosburgh@canonical.com>
To: Jonathan Toppins <jtoppins@redhat.com>
Cc: "netdev @ vger . kernel . org" <netdev@vger.kernel.org>,
pabeni@redhat.com, Veaceslav Falico <vfalico@gmail.com>,
Andy Gospodarek <andy@greyhouse.net>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2 2/2] bonding: fix link recovery in mode 2 when updelay is nonzero
Date: Tue, 22 Nov 2022 22:25:20 -0800 [thread overview]
Message-ID: <15930.1669184720@famine> (raw)
In-Reply-To: <f5a7893d8a83c6fb8233bb3127d301e12f45e9b3.1669147951.git.jtoppins@redhat.com>
Jonathan Toppins <jtoppins@redhat.com> wrote:
>Before this change when a bond in mode 2 lost link, all of its slaves
>lost link, the bonding device would never recover even after the
>expiration of updelay. This change removes the updelay when the bond
>currently has no usable links. Conforming to bonding.txt section 13.1
>paragraph 4.
>
>Fixes: 41f891004063 ("bonding: ignore updelay param when there is no active slave")
>Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
This looks correct, although I suspect it would affect more than
just balance-xor ("mode 2"); if memory serves, balance-rr mode operates
similarly.
Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>
-J
>---
>
>Notes:
> v2:
> * added fixes tag and reposted to net tree
>
> drivers/net/bonding/bond_main.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index f298b9b3eb77..f747bd60d399 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -2536,7 +2536,16 @@ static int bond_miimon_inspect(struct bonding *bond)
> struct slave *slave;
> bool ignore_updelay;
>
>- ignore_updelay = !rcu_dereference(bond->curr_active_slave);
>+ if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) {
>+ ignore_updelay = !rcu_dereference(bond->curr_active_slave);
>+ } else {
>+ struct bond_up_slave *usable_slaves;
>+
>+ usable_slaves = rcu_dereference(bond->usable_slaves);
>+
>+ if (usable_slaves && usable_slaves->count == 0)
>+ ignore_updelay = true;
>+ }
>
> bond_for_each_slave_rcu(bond, slave, iter) {
> bond_propose_link_state(slave, BOND_LINK_NOCHANGE);
>--
>2.31.1
>
next prev parent reply other threads:[~2022-11-23 6:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 20:25 [PATCH net-next v2 0/2] bonding: fix bond recovery in mode 2 Jonathan Toppins
2022-11-22 20:25 ` [PATCH net-next v2 1/2] selftests: bonding: up/down delay w/ slave link flapping Jonathan Toppins
2022-11-22 21:24 ` [PATCH net-next v2 2/2] bonding: fix link recovery in mode 2 when updelay is nonzero Jonathan Toppins
2022-11-23 6:25 ` Jay Vosburgh [this message]
2022-11-24 4:20 ` [PATCH net-next v2 0/2] bonding: fix bond recovery in mode 2 patchwork-bot+netdevbpf
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=15930.1669184720@famine \
--to=jay.vosburgh@canonical.com \
--cc=andy@greyhouse.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jtoppins@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vfalico@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.