From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5CCE27E07E; Fri, 27 Feb 2026 01:42:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772156540; cv=none; b=FDq68RXm9gLvt7bRxlehfgFGVi+z8amvoprHUDOr//7efvqbHxG4sMJf9W8aPuLvKEFXoLb6VKLB7FYnLLxJ7TXRGhpVqaDoBHswliFp2Ubof3l6RUXdNwtiwJfpN8aDB+1VpUHFT+2TNuNrJhnmlWlQM4vtNgYN5UZRm9TS1qE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772156540; c=relaxed/simple; bh=MH1JbKo8U096w/4SFfWy4iZNR02/r/hu8EgOy22BlKk=; h=From:To:cc:Subject:In-reply-to:References:MIME-Version: Content-Type:Date:Message-ID; b=FcrhLCon2UPneUquLAgjhgwZ3//1wZgvXTLJSE1q0V2Bt2//MS7Q+wFD3MH4Ph3N4f8i1ieAKQg/S6cWQ8YpDjshIT+73wfj16+YsEM9NaR5ivTGtgkCrbVLoeOmTQMpNRKZNgKBlpEMFqRNaQBruqNmAaYoep6RMq7Zcm1dSJM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=jvosburgh.net; spf=pass smtp.mailfrom=jvosburgh.net; dkim=pass (2048-bit key) header.d=jvosburgh.net header.i=@jvosburgh.net header.b=idR/M650; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=qsLyARwu; arc=none smtp.client-ip=202.12.124.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=jvosburgh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=jvosburgh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=jvosburgh.net header.i=@jvosburgh.net header.b="idR/M650"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="qsLyARwu" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 719A87A0099; Thu, 26 Feb 2026 20:42:15 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Thu, 26 Feb 2026 20:42:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jvosburgh.net; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm2; t=1772156535; x=1772242935; bh=S/8T4N0Phog8PIfQ8l0W0QujJkGhGj3J ItKbBB/XGc8=; b=idR/M650cmCb/Acd4RmNsTvOv3qnPVsI/GVTq8P812r2Es0h GWEqxFWLIIb6GjQx5d4hBkWHcHy4ib7Gq44qwvf0gADs67PWwKFh4g/djg3qGPo2 MVc7S9fRM6yY6101dQu4Hyp7XleXtIApkuX3QHxmC1lmXSK+3Yo1N7sdOzvHnzuJ n97i5UAcm8JAv1Kx2duaVh4tuIHP78RY2ZsmzXqRmqSCxKRoRiUDWCS6rs9SPHJr uI+hwP623TspAw2UUpVRBR5/g5fx/NZx94yUO3z2G9CwiEmTH453FLw0OwKZ2TO3 YI1qFE5x9noO2Lo176jwyD/2Vxy4jeLXgYfvhg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1772156535; x= 1772242935; bh=S/8T4N0Phog8PIfQ8l0W0QujJkGhGj3JItKbBB/XGc8=; b=q sLyARwu1vOdFk/bbX3XRdtCG+hui5jIBf5SyKWOS1VMP8TINKrXhS/DdxqCvmlKg j2JWcNibba+T/KY2LWdO5Q1dVXLUoEYVEJOgVUinorwIgKLSlyYewl22ey9VxmLt tvWjqqMD7RX+oBJ0SfSHy8UUHafi4QrDENzq1yUpbSOKpXN7bDw59tnIanKBIpMb y2S7m2e100HboX9/cs3HbMdWI7YH0TdoP4mX21eEjoqpSALeZ5hSbJK/MX0VkOQ+ dSubL4asiMpScAZyB8yinwPjavjk0mCR7IkqV3urKBPoSwlzMjWl5ACx3jBwScxu POiUO5kT2zCQ2a5hnbQIw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvgeejieekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefujghfofggtgfgfffksehtqhertdertdejnecuhfhrohhmpeflrgihucgg ohhssghurhhghhcuoehjvhesjhhvohhssghurhhghhdrnhgvtheqnecuggftrfgrthhtvg hrnhepgeefgffhgffhhfejgfevkefhueekvefftefhgfdtuddtfeffueehleegleeiuefh necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhvse hjvhhoshgsuhhrghhhrdhnvghtpdhnsggprhgtphhtthhopedufedpmhhouggvpehsmhht phhouhhtpdhrtghpthhtoheprhgriihorhessghlrggtkhifrghllhdrohhrghdprhgtph htthhopegurghvvghmsegurghvvghmlhhofhhtrdhnvghtpdhrtghpthhtoheplhhiuhhh rghnghgsihhnsehgmhgrihhlrdgtohhmpdhrtghpthhtohepvgguuhhmrgiivghtsehgoh hoghhlvgdrtghomhdprhgtphhtthhopehmrghhvghshhgssehgohhoghhlvgdrtghomhdp rhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhhuhgrhh eskhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprghnughrvgifodhnvghtuggvvheslhhu nhhnrdgthhdprhgtphhtthhopehlihgrlhhisehrvgguhhgrthdrtghomh X-ME-Proxy: Feedback-ID: i53714940:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Feb 2026 20:42:14 -0500 (EST) Received: by famine.localdomain (Postfix, from userid 1000) id 99F159FCB1; Thu, 26 Feb 2026 17:42:13 -0800 (PST) Received: from famine (localhost [127.0.0.1]) by famine.localdomain (Postfix) with ESMTP id 98F5E9FC39; Thu, 26 Feb 2026 17:42:13 -0800 (PST) From: Jay Vosburgh To: Hangbin Liu cc: netdev@vger.kernel.org, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , Nikolay Aleksandrov , Mahesh Bandewar , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Liang Li Subject: Re: [PATCHv3 net 2/3] bonding: restructure ad_churn_machine In-reply-to: References: <20260226125331.28147-1-liuhangbin@gmail.com> <20260226125331.28147-3-liuhangbin@gmail.com> <941081.1772152606@famine> Comments: In-reply-to Hangbin Liu message dated "Fri, 27 Feb 2026 00:52:54 +0000." X-Mailer: MH-E 8.6+git; nmh 1.8+dev; Emacs 29.3 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 26 Feb 2026 17:42:13 -0800 Message-ID: <943602.1772156533@famine> Hangbin Liu wrote: >On Thu, Feb 26, 2026 at 04:36:46PM -0800, Jay Vosburgh wrote: >> Hangbin Liu wrote: >>=20 >> >The current ad_churn_machine implementation only transitions the >> >actor/partner churn state to churned or none after the churn timer expi= res. >> >However, IEEE 802.1AX-2014 specifies that a port should enter the none >> >state immediately once the actor=E2=80=99s port state enters synchroniz= ation. >> > >> >Another issue is that if the churn timer expires while the churn machin= e is >> >not in the monitor state (e.g. already in churn), the state may remain >> >stuck indefinitely with no further transitions. This becomes visible in >> >multi-aggregator scenarios. For example: >> > >> >Ports 1 and 2 are in aggregator 1 (active) >> >Ports 3 and 4 are in aggregator 2 (backup) >> > >> >Ports 1 and 2 should be in none >> >Ports 3 and 4 should be in churned >> > >> >If a failover occurs due to port 2 link down/up, aggregator 2 becomes a= ctive. >> >Under the current implementation, the resulting states may look like: >> > >> >agg 1 (backup): port 1 -> none, port 2 -> churned >> >agg 2 (active): ports 3,4 keep in churned. >> > >> >The root cause is that ad_churn_machine() only clears the >> >AD_PORT_CHURNED flag and starts a timer. When a churned port becomes ac= tive, >> >its RX state becomes AD_RX_CURRENT, preventing the churn flag from bein= g set >> >again, leaving no way to retrigger the timer. Fixing this solely in >> >ad_rx_machine() is insufficient. >> > >> >This patch rewrites ad_churn_machine according to IEEE 802.1AX-2014 >> >(Figures 6-23 and 6-24), ensuring correct churn detection, state transi= tions, >> >and timer behavior. With new implementation, there is no need to set >> >AD_PORT_CHURNED in ad_rx_machine(). >> > >> >Fixes: 14c9551a32eb ("bonding: Implement port churn-machine (AD standar= d 43.4.17).") >> >Reported-by: Liang Li >> >Tested-by: Liang Li >> >Signed-off-by: Hangbin Liu >>=20 >> I missed this last time it was posted, but reading it now I >> think the functional change looks good, but I question the usefulness of >> including the 25 line ASCII art version of the state diagram. >>=20 >> The standard is publicly available, so a comment saying that the >> state machine logic conforms to IEEE 802.1AX-2014 figures 6-23 and 6-24 >> should be sufficient. Anyone seriously checking the code against the >> standard will need to read the relevant text, so they'll be looking it >> up anyway. > >I added it here to help new readers and reviewers understand the logic >quickly. If you think there=E2=80=99s no need to include it in the code, m= aybe >we can move it to the commit description? Personally, I'd leave it out, and just put a reference. The churn machine isn't that critical, even the standards committee didn't like it and removed it from the 2020 edition of 802.1AX. Still, whatever we provide should work in accordance with the 2014 standard we're nominally conforming to, so functionally the patch looks fine to me. -J --- -Jay Vosburgh, jv@jvosburgh.net