From: Jay Vosburgh <jv@jvosburgh.net>
To: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Stanislav Fomichev <sdf@fomichev.me>,
netdev@vger.kernel.org
Subject: Re: [PATCH net] bonding: fix mii_status when slave is down
Date: Fri, 07 Nov 2025 10:40:42 +0100 [thread overview]
Message-ID: <398691.1762508442@vermin> (raw)
In-Reply-To: <20251106180252.3974772-1-nicolas.dichtel@6wind.com>
Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote:
>netif_carrier_ok() doesn't check if the slave is up. Before the below
>commit, netif_running() was also checked.
>
>Fixes: 23a6037ce76c ("bonding: Remove support for use_carrier")
>Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Jay Vosburgh <jv@jvosburgh.net>
>---
> drivers/net/bonding/bond_main.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index e95e593cd12d..5abef8a3b775 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -2120,7 +2120,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
> /* check for initial state */
> new_slave->link = BOND_LINK_NOCHANGE;
> if (bond->params.miimon) {
>- if (netif_carrier_ok(slave_dev)) {
>+ if (netif_running(slave_dev) && netif_carrier_ok(slave_dev)) {
> if (bond->params.updelay) {
> bond_set_slave_link_state(new_slave,
> BOND_LINK_BACK,
>@@ -2665,7 +2665,8 @@ static int bond_miimon_inspect(struct bonding *bond)
> bond_for_each_slave_rcu(bond, slave, iter) {
> bond_propose_link_state(slave, BOND_LINK_NOCHANGE);
>
>- link_state = netif_carrier_ok(slave->dev);
>+ link_state = netif_running(slave->dev) &&
>+ netif_carrier_ok(slave->dev);
>
> switch (slave->link) {
> case BOND_LINK_UP:
>--
>2.47.1
>
next prev parent reply other threads:[~2025-11-07 9:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-06 18:02 [PATCH net] bonding: fix mii_status when slave is down Nicolas Dichtel
2025-11-07 2:36 ` Andrew Lunn
2025-11-07 8:10 ` Nicolas Dichtel
2025-11-07 13:55 ` Andrew Lunn
2025-11-07 14:29 ` Nicolas Dichtel
2025-11-07 17:32 ` Andrew Lunn
2025-11-07 18:45 ` Nicolas Dichtel
2025-11-07 9:40 ` Jay Vosburgh [this message]
2025-11-11 2:10 ` 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=398691.1762508442@vermin \
--to=jv@jvosburgh.net \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
/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).