From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796384490; b=UA7Vsxe1Zk5mm/DBufQ+Ej635ok2KrYKTfDHfBadhvb7hDKZFqDMUdPra/mfDNIU5fQ/ 3+viaS/MGEJzSc6/Yaf55K7URZzcWK7s9FKsUrPtz4Dzv+1zBiJXqMlfr3Xy+/dZd6hYX w5PLX4u+eiebHIrQTzs1hQ2mWL+JXauNXIyv0oMsxjc4py6ul11fD0PUv7NC4hFFv873g w0+Ts0m64qHOzMqQg+bEr2H3LTfriA4CThLOohUqaXtdUEF6VY+EMMciid455PlwnfmIt ZJdGDVvjJNMo/+g2bUZ2412wZXHS26Sg6cE3LfsdOhpCcLXKRP47lwYJJFfFQkEWwKw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796384490; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=DIbU6idoAD5k6qnbb+eGFqklv+6DpgXVmKm+CdWzeSU=; b=liU5jqyDgNARn9JLpxBhMCEDo08yIMe+lbRfcFJ47R0yEcn3GqTHtJW5FZDe3Dcbrd/Q xlNo8dz6jnOf2pyaEH5XO9prp3dzYYJLZjSLqUn/EE9t+80N38la4hTYgJ867uMTsgVAe 0i5lJw/8jKQnFOjKniJU7qD3UYMOcXRXga7B01OO7B3xmiyV2Hw/IrtJeD3wS7F5oj2mz s0MvDMKXCnv81ykbyLyetkMlex5SmRJQA2RmeWtF1iwgLCVV62icSsVo1m9leRc7eWlSU 6YFBh6tfxrABn83iz4ZD1xXF1P0sq0uDY3JgPNPzWgoZsL053Bv5uhpmhYAOP9cp0Og== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=BQN0VP9s; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 06538606A32D; Fri, 4 Dec 2026 11:41:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=BQN0VP9s Received: by smtp.kernel.org (Postfix) with ESMTPSA id 773111F000C2; Fri, 4 Dec 2026 11:41:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796384489; bh=DIbU6idoAD5k6qnbb+eGFqklv+6DpgXVmKm+CdWzeSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BQN0VP9sa9E0iNkcORvIoKIf3Pn5wCzjR8PrZiGIWNpWMvLP7Ay+qNua7+M7QLdPw iIb3LYd4yWwnR8BQiC5HwViwGy96BWY/F32ZvLFoojJBvBytFbk/u202CQdPSda9el KxYApRzFf3PdJcbHU18Qmx6bvlieNFYTBOuLi+Rc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Timur Stukan , Hangbin Liu , Paolo Abeni , Sasha Levin Subject: [PATCH 6.6 0172/1167] bonding: 3ad: dont set BOND_LINK_FAIL on a slave that is not up Date: Fri, 4 Dec 2026 18:53:19 +0900 Message-ID: <20261204100706.554635099@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Timur Stukan [ Upstream commit 9a65b9c2a97594bcaaf393329807653eff895bbf ] In 802.3ad mode, when bond_update_speed_duplex() fails on NETDEV_UP or NETDEV_CHANGE, bond_slave_netdev_event() sets the slave link to FAIL if the slave has ever been up (last_link_up != 0), and to DOWN otherwise, so that miimon can set it right once speed/duplex are valid. last_link_up is never cleared, so a slave that is currently DOWN but was up before is set to FAIL as well. miimon then treats it as a slave that is still in use and takes it through the full down path again: the link failure count is incremented, "link status definitely down" is logged and the 802.3ad port is disabled a second time, although the slave has not been up since it went down. Reproduced in 802.3ad mode with miimon=100 by setting a slave down and up again. On NETDEV_UP the speed is still unknown, so the notifier sets FAIL, and the next miimon pass sees no carrier and proposes DOWN: ip link add bond0 type bond mode 802.3ad miimon 100 lacp_rate 1 ip link set enp0s3 down ip link set enp0s4 down ip link set enp0s3 master bond0 ip link set enp0s4 master bond0 ip link set enp0s3 up ip link set enp0s4 up ip link set bond0 up # wait for LACP to settle ip link set enp0s3 down ip link set enp0s3 up procfs then shows "Link Failure Count: 2" in enp0s3 slave part. Also in dmesg wrote twice: "link status definitely down, disabling slave". Fix this by setting FAIL only for a slave that is currently UP and leaving other states alone. An up slave that loses speed/duplex still goes through FAIL as before, and DOWN/BACK slaves are left to miimon, as in the other modes. Fixes: ea53abfab960 ("bonding/802.3ad: fix link_failure_count tracking") Signed-off-by: Timur Stukan Reviewed-by: Hangbin Liu Link: https://patch.msgid.link/20261101145653.63648-1-timur.stukan.linux@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/bonding/bond_main.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 7acf6afb29b03..e3b10368b149c 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -3956,18 +3956,13 @@ static int bond_slave_netdev_event(unsigned long event, case NETDEV_CHANGE: /* For 802.3ad mode only: * Getting invalid Speed/Duplex values here will put slave - * in weird state. Mark it as link-fail if the link was - * previously up or link-down if it hasn't yet come up, and - * let link-monitoring (miimon) set it right when correct - * speeds/duplex are available. + * in weird state. Mark an up slave as link-fail and let + * miimon set it right when correct speed/duplex are available. */ if (bond_update_speed_duplex(slave) && - BOND_MODE(bond) == BOND_MODE_8023AD) { - if (slave->last_link_up) - slave->link = BOND_LINK_FAIL; - else - slave->link = BOND_LINK_DOWN; - } + BOND_MODE(bond) == BOND_MODE_8023AD && + slave->link == BOND_LINK_UP) + slave->link = BOND_LINK_FAIL; if (BOND_MODE(bond) == BOND_MODE_8023AD) bond_3ad_adapter_speed_duplex_changed(slave); -- 2.53.0