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=1795705155; b=5WV3saclcLUBYWGFovLH2cWlxLmZu6UcoKziR9wqwjObv2cu4iu7WC+kcJ/PLC455X3c Lp89gdxU2+y8Ygy93/+FDVNG+MoOsTbgTSUIzAwhkNLn/eZtuZ25jvFj8trY/HHPIwc2b YTGyIo7Xw72ZCK1dL15F1NG3gt3zRzcGYPNDd4i58mUDVz7tqV893FN870F6OdEtlpzqd 4K+yRdnKN4tjyQ4JWx4fFyUYo9Ok9fbco2DDxIeqZHfdnf7HnQ6YvspEY7bcGZtI9Ah8M Bn2zOK2IPpPVGZVb2F5Vjgb8gjiS5ZE7t33noWGKQaN/ji5UQbwf3NdjfkCUFPJYjaQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795705155; 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=YkUT9z25AceaX/ghzBPMYMa4Dn6xE5ElqWhnwjNtStg=; b=gX9AW04H7oIrDAuC0QNAZzUPCK0T3jthhKqTQOFt4g8gNBYVnqR46mSgIysg9k9RrKmS jq05BpktCm5+dKAPBcNuUua5X1d2P/iisg6R3u2Hytc9Noek46gOKPRTa0t9crPeNM4JU G4RyegRzrrAh+VOE7/G7mqPS6B9qC4tyXNol2H+j6AHPeMCO5R6yfE6HVmnHAJBIhqzx7 IJ4iPu9rNurNDM3kwNA3A+0uD2Z0KzuiUEnkMLFweI0JqpmA0k4bTRdIk2rxfD5H6qvzu TRi2sH3KjeBsNLhZERXfvonDe+tMSuVE/V2O71KK5KV70FVILiI2+Pwj7ENZ9bOoeLQ== 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=ytCfGmAw; 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 12768606A31E; Thu, 26 Nov 2026 14:59:15 +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=ytCfGmAw Received: by smtp.kernel.org (Postfix) with ESMTPSA id 541711F000D8; Thu, 26 Nov 2026 14:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795705154; bh=YkUT9z25AceaX/ghzBPMYMa4Dn6xE5ElqWhnwjNtStg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ytCfGmAwZ6y3BJkf41qtjCqZEGXk/7Mkw5jMJEnqZlsKyBiHOc4SHu7ycelDDZ7lY ReZNOKWcffQJihmhxTdQmDTNj0AqQ9R+S0lrYn/nIhmPf02ARCR4R/dAqFvsuBdHsa yjhkDnDHErPu3N0KjxNmNglQUUmxm1xV9RVRv/GY= 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 5.15 102/319] bonding: 3ad: dont set BOND_LINK_FAIL on a slave that is not up Date: Thu, 26 Nov 2026 15:37:50 +0100 Message-ID: <20261126144009.046949052@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261126144006.732901931@linuxfoundation.org> References: <20261126144006.732901931@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-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 558bff14740bd..17f08b7dd5395 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -3607,18 +3607,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