Article View: linux.kernel.netdev
Article #19058Re: [PATCH net-next 5/6] bonding: 3ad: Advertise Collecting only after collection is enabled
From: netdev-bot+sashiko
Date: Thu, 19 Nov 2026 09:19
Date: Thu, 19 Nov 2026 09:19
115 lines
12681 bytes
12681 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] In __update_lacpdu_from_port() (drivers/net/bonding/bond_3ad.c),
the patch clears LACP_STATE_COLLECTING in lacpdu->actor_state when…
- [Low] While the Rx notification is pending, procfs ("details actor lacp
pdu: port state"), sysfs ad_actor_oper_port_state and netlink…
- [Low] __update_lacpdu_from_port() masks only LACP_STATE_COLLECTING
while the Rx notification is pending.
--
bonding: 3ad: Advertise Collecting only after collection is enabled
When coupled control is disabled, this commit clears the Collecting bit in
transmitted LACPDUs while the port's Rx state change notification is still
pending. Once the notification is delivered, ad_tx_machine() sets ntt so
that a new LACPDU advertising Collecting goes out.
> diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
> index d2a55f4d89791..61f6de803b667 100644
> --- a/drivers/net/bonding/bond_3ad.c
> +++ b/drivers/net/bonding/bond_3ad.c
[ ... ]
> @@ -903,6 +916,9 @@ static inline void __update_lacpdu_from_port(struct port *port)
> lacpdu->actor_port_priority = htons(port->actor_port_priority);
> lacpdu->actor_port = htons(port->actor_port_number);
> lacpdu->actor_state = port->actor_oper_port_state;
> + /* Collection is only enabled once the Rx state change is notified */
> + if (__port_rx_notify_pending(port))
> + lacpdu->actor_state &= ~LACP_STATE_COLLECTING;
[Severity: Low]
This masks only Collecting. Can the transmitted actor_state have
Distributing set while Collecting is cleared?
Suppose rtnl_trylock() fails in bond_3ad_state_machine_handler() at the end
of the run that entered AD_MUX_COLLECTING. Then should_notify_rx stays set.
On the next tick, ad_mux_machine() can move to AD_MUX_DISTRIBUTING based
only on the partner's state:
case AD_MUX_COLLECTING:
if (!__port_move_to_attached_state(port)) {
if ((port->sm_vars & AD_PORT_SELECTED) &&
(port->partner_oper.port_state & LACP_STATE_SYNCHRONIZATION) &&
(port->partner_oper.port_state & LACP_STATE_COLLECTING)) {
port->sm_mux_state = AD_MUX_DISTRIBUTING;
Entering that state then does:
case AD_MUX_DISTRIBUTING:
port->actor_oper_port_state |= LACP_STATE_DISTRIBUTING;
port->actor_oper_port_state |= LACP_STATE_SYNCHRONIZATION;
ad_enable_collecting_distributing(port,
update_slave_arr);
As far as I can tell, the __enable_port() path does not clear
should_notify_rx, because the slave's Rx state is already enabled.
Any LACPDU sent before RTNL is obtained, such as the periodic one, would
then carry Distributing=1 and Collecting=0. The 802.1AX mux machine never
produces that combination.
Would it make sense to also mask LACP_STATE_DISTRIBUTING while the
notification is pending?
[Severity: Low]
Only the transmitted copy is masked here. While the notification is
pending, procfs, sysfs and netlink still report port->actor_oper_port_state
with Collecting set. For example, bond_info_show_slave() in bond_procfs.c
does:
seq_puts(seq, "details actor lacp pdu:\n");
...
seq_printf(seq, " port state: %d\n",
port->actor_oper_port_state);
The sysfs ad_actor_oper_port_state file and the netlink
IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE attribute are named after
actor_oper_port_state, so they report what their names say. The procfs
block, however, is labelled as the actor LACP PDU, and for a short time it
now shows a different value from the one on the wire.
Is this difference intended? If so, should the procfs label be adjusted or
the difference documented?
Later in this series, "selftests: bonding: Test that Collecting is
advertised after notification" adds test coverage for the transmitted
LACPDU. Its collecting_advertise() captures LACPDUs and checks that
Collecting is only advertised after the 0x1f notification. That test also
suggests the notification is meant to carry the unmasked state.
> slave_dbg(port->slave->bond->dev, port->slave->dev,
> "update lacpdu: actor port state %x\n",
> port->actor_oper_port_state);
[Severity: Low]
Should this debug message print lacpdu->actor_state now?
While the Rx notification is pending, the message prints
port->actor_oper_port_state with Collecting set (for example 0x1f). The
LACPDU on the wire carries 0x0f. Before this patch the two values were
always the same.
Printing lacpdu->actor_state, or both values, would keep the message in
line with what is sent.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118083442.1061289-1-idosch%40nvidia.com
Technical Details
Message-ID:
<179507998243.3136.12068101065568780220@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366877-linux-kernel-netdev=dewy.ruReferences:
<20261118083442.1061289-6-idosch@nvidia.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366877-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 5/6] bonding: 3ad: Advertise Collecting only after collection is enabled Date: Thu, 19 Nov 2026 09:19:42 +0000 Organization: Usenet Network Message-ID: <179507998243.3136.12068101065568780220@kernel.org> References: <20261118083442.1061289-6-idosch@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2837233"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:p9IANsa2MVVKSBQXcnaQn+fckEo= sha256:32mT/RH3I8buOAHZHy6rKfIjOq6rydkZk/yl/poj9/o= sha1:iSJNjg6obsgMnCKLYWsyQF63Fds= sha256:VvoDCeJKD+xm2Kd4tZ5YrY4rs2TGYU6+2NU6mlpX+GM= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 40E28115558; Thu, 19 Nov 2026 12:20:05 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.5 X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O5DYRzrGYpGO; Thu, 19 Nov 2026 12:19:59 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-366877-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id E967A115552; Thu, 19 Nov 2026 12:19:50 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id B4A9E72459C; Thu, 19 Nov 2026 09:19:47 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795079984; b=L0ZCuVHB95dnoIJdvETiE9afKjp1/OH2EGxxlf36RE8TWDazGy8obXvGyNZnn3cGXI1s f+vsa6RlpWZNjaggfMvZRbPli9Rriw2wU1zj8qt2FmdWUcTmSmGQsQr8G6BNdBcU1IXZp woQLI8Hpf6tbOhChmXLMSDkNcjInVXSHJd+nX4qcbt9BvSVx3GyPJQbR283DJoamPIxpr cQ6jyGxFch3k0pbWLhSCmWgmtQxnCusnfn6m1qlaF5MDAUD9QXlIRr0sEkS0fxFynDOKA jAIO5vYAmlFBVnNxCotP9W7Tgxz7gknPk3SgvtXRnXqpYdLmzqlQNPQAYmcyKi+GADg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795079984; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=ZgfM334JTLYV95P+o/xXAJhYa05J9zkqyuWENMt/Zo8=; b=rcyo6VB9cXk4lFDgaW5gsBYyzn4dc9BLvm2ww55ea1kmrqI1G7/vfMcKA5Ww7tlhjRBT mjjH5ZGbBLGUGQGPUb4rz9q0Hz3RKDxuWVjfOI5Y4E8kfG16rSw5E00JeSe+3O8NBABFK +Uir2VNuFP9BKf7cneRmEg8JvKanDQ/ypVf2/WTHOxHGxXZG4id/nrk6ZkZHxzURGp1xn SW0DLyHnWYq4BPiGjD3MXpgXqFLsz98TKF0bb4eutYNclxQk+3qZw4G1sSn5o3wkhrGKs GZhmVE9DSwQXd3Wq2JQB7E+G4N+3gdsgZ/ShV+k3+EkR91G4j9V8V+qguepU2GyKmjQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QINnaWtj; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A222360A2602; Thu, 19 Nov 2026 09:19:44 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QINnaWtj X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795079983; b=LixveXSSgmMJ/7lf+RsmHaMDXUmXUkUIBGrvpo+BnHvtBiRdTm1XTCPKDnrYDg7EfUeh TMdgt5hEt+yf+T0+UgzYkGkrSu4OlV9o/WiDmAi+QLfvouR3NLp7n0znqI+NAWq9UvkqS Snq1XR1jowkxu6oO1jNX3+cteHbV8QFP6K96fEbgAjXyc3H6k2p0lW/z/mhQKEHYlPfdZ t5xuq9l7bxsPIaITXszDwyyO3ZfJ5jTLhW0g9nqH6F1s+FbCrWiZiE2nxdIRGvg7nmnKL TLW9iu7P0vG5AnUzTkbIA2xUt4nygSxr3s+HfdVfvrcAWh/RSebBnNKdZqQtyJI21Ag== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795079983; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=ZgfM334JTLYV95P+o/xXAJhYa05J9zkqyuWENMt/Zo8=; b=lmQJiIqS++S/tPlFvr4Oe0E6KRW02Q3Ld0frMyXpvERvyrdc+1sX7jEnV/SKlLxujnHn hU9Ao3bJeXbu6nfdQg0YQux+daWZav1Ai0mlceUcwtE92weWBAya3NVAIPzxS9VLkJzuE R3dr6RSC3sHcx2oPRVShDmicPcUD5Jp7yVaiTKp/wSctFkhno4lgmkp4t01xCm73Ej3tI +mRiEaQU+VtEAHtjUH2k5c2gNyfgAoHaJFn53OHGORgLHgtyNSogq5dk8hCsEHXsy0Gc0 YxIY3ecslkroU9MI8P8IbpHYci3p+zfFhYzW93sYA5pkoD5pft3/3Ij8JugQyg6eULw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QINnaWtj; arc=none smtp.remote-ip=100.103.45.18 X-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 C11C9606A334; Thu, 19 Nov 2026 09:19:43 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D05271F000C4; Thu, 19 Nov 2026 09:19:42 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795079983; bh=ZgfM334JTLYV95P+o/xXAJhYa05J9zkqyuWENMt/Zo8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=QINnaWtjGPEEthx1qTlDo3t9yxyTHftOcJVCu4shsdo800Lo80VpeEBh0w6eKY+ri B5r6+D4g43Z5iN6SjEscQQC2JOjwsBHyW3p4IlPApFkiROyjEjs55JQa8M8Z5S6lUG vqd6FU6SmsZ3UKhSl5Xa7XxKqEu2nlA+3rmkwCwbSFCZj35nJzYgaYJ4IS7fqfCAp2 WC7VG5R/2lWbysdICICGHCpD+mDZSvzQqs48Is3IKyZtHd/YQqf0z3YgWA+rZkwNu8 FOn+Wua+AkVIAQIe0w11zsqlVeMskp3Fj7ftKsguaIRqoHl2jnFrNTGJwvHCePpgA8 aIUm1781Fh7wg== X-Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@kernel.org, jv@jvosburgh.net, andrew+netdev@lunn.ch, petrm@nvidia.com, sridhar.samudrala@intel.com, jiri@resnulli.us, horms@kernel.org, shuah@kernel.org, linux-kselftest@vger.kernel.org, razor@blackwall.org X-In-Reply-To: <20261118083442.1061289-6-idosch@nvidia.com> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list