Article View: linux.kernel.netdev
Article #15572Re: [PATCH net-next 1/2] bonding: 3ad: Receive packets in COLLECTING state
From: Hangbin Liu
Date: Fri, 13 Nov 2026 01:32
Date: Fri, 13 Nov 2026 01:32
127 lines
13027 bytes
13027 bytes
Hi Ido,
On Thu, Nov 12, 2026 at 08:21:57PM +0000, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential
> issue(s) to consider.
>
> Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 1
>
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
>
> - [Medium] The fix clears 'inactive' only when ad_enable_collecting()
> runs.
> - [Low] The patch fixes a real, user-visible bug but has no Fixes: tag.
>
> --
>
> bonding: 3ad: Receive packets in COLLECTING state
>
> With coupled control disabled, an 802.3ad port in COLLECTING state should
> receive packets, but the RX path only delivers from slaves whose inactive
> flag is cleared. This patch makes bond_set_slave_rx_enabled_flags() clear
> slave->inactive in addition to slave->rx_disabled.
>
> > When coupled control is disabled, a port in COLLECTING state is supposed
> > to receive packets, but it does not. The bond only delivers packets from
> > slaves whose 'inactive' flag is cleared, whereas
> > bond_set_slave_rx_enabled_flags() only clears 'rx_disabled'.
> >
> > Fix by clearing 'inactive' as well.
>
> [Severity: Low]
> Should this carry a Fixes: tag?
>
> bond_set_slave_rx_enabled_flags() was added by commit 240fd405528b
> ("bonding: Add independent control state machine"), and that commit only
> cleared rx_disabled. The RX gate in bond_should_deliver_exact_match()
> checks only bond_is_slave_inactive(), so the bug goes back to that commit.
>
> The notes say this targets net-next because it never worked, and that
> makes sense. A tag would still let stable and distro maintainers link the
> fix to the original commit:
>
> Fixes: 240fd405528b ("bonding: Add independent control state machine")
Makes sense to me.
>
> > diff --git a/include/net/bonding.h b/include/net/bonding.h
> > index 598d56b1bc970..cb89aff437f44 100644
> > --- a/include/net/bonding.h
> > +++ b/include/net/bonding.h
> > @@ -594,6 +594,7 @@ static inline void bond_set_slave_active_flags(struct slave *slave,
> > static inline void bond_set_slave_rx_enabled_flags(struct slave *slave,
> > bool notify)
> > {
> > + slave->inactive = 0;
> > slave->rx_disabled = 0;
> > }
>
> [Severity: Medium]
> With this change, inactive is only cleared when ad_enable_collecting()
> runs. Can a COLLECTING port still be left with inactive=1 and
> rx_disabled=0?
>
> bond_option_all_slaves_active_set() can still set inactive without
> touching rx_disabled when all_slaves_active goes from 1 to 0:
>
> drivers/net/bonding/bond_options.c:bond_option_all_slaves_active_set() {
> ...
> bond_for_each_slave(bond, slave, iter) {
> if (!bond_is_active_slave(slave)) {
> if (newval->value)
> slave->inactive = 0;
> else
> slave->inactive = 1;
> }
> }
> ...
> }
>
> A COLLECTING port matches !bond_is_active_slave(). This is because
> ad_disable_distributing()->__disable_distributing_port()->
> bond_set_slave_tx_disabled_flags() left it in BOND_STATE_BACKUP.
>
> The steady-state COLLECTING recheck in ad_mux_machine() only looks at
> rx_disabled:
>
> drivers/net/bonding/bond_3ad.c:ad_mux_machine() {
> ...
> if (aggregator->is_active &&
> bond_is_slave_rx_disabled(slave)) {
> ad_enable_collecting(port);
> *update_slave_arr = true;
> }
> ...
> }
>
> Since rx_disabled stays 0, the recheck never fires. Until the next mux
> transition, bond_should_deliver_exact_match() keeps returning true, and
> every non-LACPDU frame on that port gets RX_HANDLER_EXACT.
>
> The notes list this as known issue 1 and describe COLLECTING as
> transient. However, the companion selftest ("selftests: bonding: Add a
> test for 802.3ad with coupled control disabled") keeps a port in
> COLLECTING indefinitely by clearing the partner's Collecting bit. So a
> partner that never sets LACP_STATE_COLLECTING would keep the port
> dropping traffic.
If the partner does not set LACP_STATE_COLLECTING, it is not supposed to
send any packets.
> Would it work to also check bond_is_slave_inactive(slave) in the recheck,
> for example:
>
> bond_is_slave_rx_disabled(slave) || bond_is_slave_inactive(slave)
>
> That would let the port recover on the next state machine tick.
I'm fine with or without this checking. But having this check looks better.
Up to you.
Thanks
Hangbin
Technical Details
Message-ID:
<avZoqePFtrM6kEIV@fedora>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-362367-linux-kernel-netdev=dewy.ruReferences:
<20261111171947.2816258-1-idosch@nvidia.com> <179451491706.2199510.1058504888559496420@kernel.org>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-362367-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 1/2] bonding: 3ad: Receive packets in COLLECTING state Date: Fri, 13 Nov 2026 09:32:25 +0800 Organization: Usenet Network Message-ID: <avZoqePFtrM6kEIV@fedora> References: <20261111171947.2816258-1-idosch@nvidia.com> <179451491706.2199510.1058504888559496420@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1268174"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:7UKTKeg73w6sJB7ORr7ihw006TY= sha256:CPC/aChkV7PSQSUwpbcSw4jHiwdKUFRG1/7nUM/JDIA= sha1:aqCqTF86BNaGj6ukVf6m/Bvpll0= sha256:rEtsaF8yAYVZjfJr80htTGzQHDJeGhOIjA+qIaGlanM= Content-Disposition: inline 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 B85A8114482; Fri, 13 Nov 2026 08:13:22 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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 (1024-bit key) header.d=linux.dev 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 5QTWlULD_qHa; Fri, 13 Nov 2026 08:13:12 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-362367-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 3676D114478; Fri, 13 Nov 2026 08:13:03 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id A0D71181A0B; Fri, 13 Nov 2026 01:32: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=1794533566; b=2HNQlR/YPcRUw/fvssB0MIuuRxgGliA2tsvttZdZFdYd54gh4ytIVzGUtl2PSLzEP9Ud cECS5EZLy8WdvjLzudZiEkMctyqWB/eI98BfwGQeIStr2YkdJIIFioF2nmaUuR/SsmL6i CoycCMGhS6JFhuV9vmXlxHU+m7Ll5x7p4bHcK/Yy4DNPslBagFJaxkmmekdbzbyEJ5Xxs yBX/NdJpFR5LZqhMeW7YA21gdEYAG43uKVCmFhst+PPMW/h8/JQ8IScJHlxqRvFAX5Dz/ yi09fw3+i019UdUkaCScLwOBx3COuhMEsROK+882q/CUYJF/gqiy4qrbz+6p9y1lakg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794533566; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=/AIb3So9MCT2SbD2Scd+/HlVguvx2ln4M2C5vvxMyjs=; b=TzY53DsGozFjtCFzPFNW0FCriJfamavawGGpnWfs33AoxAdIZiZjJvhDYlo10B6kC/n4 r0MndkDH+e/2LiFjp7CD4sdJTgoJUUJXkS99QN9lDvvzacYw7CYV7ovJV/cHK4z6FiRA1 Om1w/UPgGO7xqqeo+u5N/06TROQtMI8b6jgIy2zvcpeT0KWVOKG2Od44IxikZWEqqelU0 hIWRcoZHYC4ECWDGBq+62wiB5l1I0xmriLjPh2hpAt4Iy42M1+jbAjiY6DxOSmGKptsUY 8DWgAFr23A/LXuGHHonW4XRSmJDO9y+gUjwddlWDayfkYZz2/U3gkvJEORhDRaf4X0A== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=Pbu9Pnn9; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; 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 5AF55606A32E; Fri, 13 Nov 2026 01:32:46 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=Pbu9Pnn9 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.74 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794533565; b=ipUZEf/Nvaf1v+krpWe5TDa36PrVNeGY/lXJf5HkOaBOV7Wpxpjk9LcPHU67PSU233re rWWEpOIwpMhjEQ6OG1o8+kLFAzZNC+xypieK6431pJ34xvyUEMCXEwKNojW817HyCvPQw BYx0WaB3CMVhvXdtF9c1usFieM2B9RpAWmEPFDgFmuBiuaMG478XFTkDFy1QqWBSTnTry 3a+S/1HYq/lfvE3q1Wu9s4QyqZKO1DPTH8PD9ZWFKFBmJviJFIaQq6M1Q4p39IcVnf4sF MM7C+G+8pZDhffJ8ysRVyqO14C2/g44ugmeHJWxdpBadFQTDrrAEAIcc3CcHe3Vx6lQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794533565; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=/AIb3So9MCT2SbD2Scd+/HlVguvx2ln4M2C5vvxMyjs=; b=npZGgguUoQzNwtzBfN7jDv9KG7mWFmH5HKr9YzcTJ77dEgTAR6HcEC8dso03OHyZDtUi Zju+AqTAL2zem3vzoIbWiCVQ5GRwzHxhVlETULs9HG8G7jY8jNDMi9NTnEn7esW6Ki1dj 8oE3LSMvLe+04iOVmd3K4QTzT8RZ7pW9paPCX+6RbWcVGYoxpFuiGFVLHTJETcS4lZBT9 aDu/weZ3oIJPYLk7pjE6Bu9jQdKku9+VoBJQW6JbCXTW5GzxCgbp4MVxjNR/qTH1zMqBx 0/l5auzm/cZvSzWW86yofTIYMPG1VQGmN+qoTms1HpMTEha4DD7aRhiZh13iMiwQunw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=Pbu9Pnn9; arc=none smtp.remote-ip=95.215.58.74 X-Received: from mta1.migadu.com (out-74.mta1.migadu.com [95.215.58.74]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9470606A31C for <netdev@vger.kernel.org>; Fri, 13 Nov 2026 01:32:44 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C9470606A31C X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=XBRHkQX7a1dXHxnR1u1SHo8udwsy2HxO8jafhHb8B3A=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1794533562; v=1; x=1795138362; b=Pbu9Pnn9Q3hPVIZKH7d+wEAFxQomQqe4/SQEZtECuWupCXdnE8D+6zFBKRAqcicVWBx0iXVD JKxPusirVbpYVsJh5VZkosxwvWIOa4HBIC3JtcPgBCdsvvTRuqW78u90PK6f49NUcT8fCJChURB Aswh1ef8jgoDAnjbXv5sd5x4= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta11.migadu.com with ESMTPS id 79730afe89d0038b; Fri, 13 Nov 2026 01:32:42 +0000 X-Mizu-Trace-ID: 79730afe89d0038b X-Migadu-Flow: FLOW_OUT 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, razor@blackwall.org, aahila@google.com 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 X-In-Reply-To: <179451491706.2199510.1058504888559496420@kernel.org>