Article View: linux.kernel.netdev
Article #11511Re: [PATCH net v5] bonding: 3ad: update transmit arrays without waiting for RTNL
From: luyun
Date: Thu, 05 Nov 2026 05:58
Date: Thu, 05 Nov 2026 05:58
62 lines
11271 bytes
11271 bytes
ε¨ 2026/11/4 17:31, Eric Dumazet ει:
> Le mer. 4 nov. 2026 Γ 07:44, Yun Lu <luyun_611@163.com> a Γ©crit :
>> From: Yun Lu <luyun@kylinos.cn>
>>
>> During 802.3ad bring-up, packets can be dropped despite carrier being up
>> and LACP having enabled ports for distribution. This was observed on a
>> machine in real use.
>>
>> The LACP worker enables ports before queuing slave_arr_work to rebuild
>> usable_slaves. The transmit path keeps using that array, which can
>> remain empty while the array worker retries rtnl_trylock(). Unrelated
>> RTNL contention can therefore prolong the packet loss.
>>
>> Rebuild the arrays directly from the LACP worker after releasing
>> mode_lock and RCU, and remove the retry worker's RTNL dependency. Retain
>> delayed work to retry allocation failures.
>>
>> Use a per-bond mutex to serialize array allocation, filling and
>> publication, and walk the lower list under RCU. Keep upper link/unlink
>> notifications outside this mutex. Exclude new slaves from both arrays
>> until all fallible setup, including XDP propagation, succeeds and
>> commits array_ready under the same mutex. This keeps concurrently linked
>> slaves from overrunning arrays sized from an earlier slave count.
>> Release completes its final rebuild or allocation-failure skip under the
>> mutex before waiting for RCU readers and freeing a slave.
>>
>> Retry failed final updates for running bonds. Also rebuild broadcast
>> arrays on open and retry failed open updates. Protect the
>> peer-notification array reader with RCU now that RTNL no longer excludes
>> writers. Updating the shared arrays also covers XDP and lower-device
>> queries without changing their selection rules.
>>
>> Tests used an RTNL holder, userspace LACP peers, slow notifiers and
>> test-only allocation failures under KASAN and lockdep to check recovery,
>> concurrent member changes and teardown. All 16 bonding selftests passed.
>>
>> Fixes: ee6377147409 ("bonding: Simplify the xmit function for modes that use xmit_hash")
>> Signed-off-by: Yun Lu <luyun@kylinos.cn>
>> ---
> I think this should target net-next. The rtnl_trylock() retry
> has been there since v3.18, and this patch adds a new locking scheme
> across enslave, release, open, uninit and the 3ad worker. With the
> Fixes: tag it would be backported to every stable tree, which seems
> risky for an issue that only shows up under RTNL contention. Please
> resend against net-next without the Fixes: tag, and keep the problem
> description in the changelog.
Hi Eric,
Thanks for the review and the routing guidance.
I will resend against net-next as v6, without the Fixes tag and with
the problem description kept in the changelog, rebased on current
net-next.
---
Thanks,
Yun Lu
> pw-bot: cr
Technical Details
Message-ID:
<b7e35751-3947-4200-bc22-2d7b679d2c90@163.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357082-linux-kernel-netdev=dewy.ruReferences:
<20261104064409.281303-1-luyun_611@163.com> <CAL4Wiipu2VTRck9Es31krEKmYZuh9iCQu5fwqpOkWP6pQNqjvg@mail.gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357082-linux-kernel-netdev=dewy.ru From: luyun_611@163.com (luyun) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v5] bonding: 3ad: update transmit arrays without waiting for RTNL Date: Thu, 5 Nov 2026 13:58:41 +0800 Organization: Usenet Network Message-ID: <b7e35751-3947-4200-bc22-2d7b679d2c90@163.com> References: <20261104064409.281303-1-luyun_611@163.com> <CAL4Wiipu2VTRck9Es31krEKmYZuh9iCQu5fwqpOkWP6pQNqjvg@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3570988"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Sp7oFEpEf5CockHhaFoEOyzPKlY= sha256:x86EGb5Jt3wqRSJTLdqhIo7Lned7h5dzEuzH/1d5hA0= sha1:fEE8x3GnsiFnHwZdjeQVfzOeVbU= sha256:zqEGt3XVdCS0DX1i5hOiQwQczqXwqk0InEsNmqOcVCs= Content-Language: en-US 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 A621F112EA6; Thu, 5 Nov 2026 08:59:55 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.049 X-Spam-Status: No, score=-3.049 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, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, 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] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=163.com 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 uybdPzlYrLyU; Thu, 5 Nov 2026 08:59:52 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-357082-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=163.com X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id A6DBC112E1E; Thu, 5 Nov 2026 08:59:42 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 45FD4302DD; Thu, 5 Nov 2026 05:59:32 +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=1793858372; b=i7vuwI2yxWfok5qjMm5kJeOB9LsAcl6gKBQnqJzdXpI378Gg3XA79YLdiTmra/BUwILI BZ+uu43ZWTP06T1Edbahk4fXgTY/Z0KZPyMSxanPCoBR/pox1QJnGOPh3Y35fzAR+8WpW 5tOKjg4/G7h/WVoc9uO77l8N+4FSY0xeut8XNbvTNrrkakNurTy6tH0yaKGaekU/85Zsp KfYV67HfIMPcrceX8nVe9WBrHHIlIW4Xk9Y4blMLeMqtbLMNkv9EnZG42w7dJIZjSINr0 +Qdf4EkwKv8U4P+6s8z4J8ndFwOxKufTYLhwuDS4/Eiz+rTYfFih/Zb/n+bvS+B3J0g== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793858372; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Message-ID:Date: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-CM-TRANSID: X-Coremail-Antispam:X-CM-SenderInfo; bh=zbh4wMZ9WUBs3S0LO6QMi4wquYaApdRMTQSw+mZIopg=; b=m3Fl4gijAy5bx9Lm2udL4kxw4pLwAV+wHnVut2M2xRG0kQANDFf/sekgLtYdXxiN7vNs bjjjHlHcEu+J51Pid1WsIa7uIXfral2hLTbonqzRubFPVvnTy7re+Mnkk8jpNFwra87NZ QNu1VT2XzhTs6Os2gQ36VopR0QJjSTpbTxw7/kQLcxb7ONsL02hZaxJ6Gq/E8oKyBLQn9 ubJEJwpAiE3hENvO8UK0gxamd89TTTPZ9rNntUTS+snbdqGvSSgzkbtg/9E4TcplHVhcE lTZieIAbVDjGhf2nwn006wWjfaP+1AuydUnC4wsZ0MDmsyg7yVQns3H8gc+JJ8wDAHw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=Q8Ng1T+6; dmarc=pass header.from=163.com; spf=pass smtp.mailfrom=163.com; 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 1B474606A32F; Thu, 5 Nov 2026 05:59:32 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=Q8Ng1T+6 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=220.197.31.3 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793858371; b=WqqHWWIwsFD1RhVLuTjdXaqaS3aYTekupfJJ4F0Vem5ielVOtzbxKJCVODEsboZnSNc3 DTdxvgjbCIp6e9rmj0ZnuKUmXhnWXVr2yVu3H+G20ZQhHP/Fqw33CZ0OwzSLqr8rzclVD b2GBE3T08MvNOZjm+izwkcyZnX0AIUeTEOo4y/bHwVyOObjoBameZAkDUzeoNzDeZNunW ZRcjcTli2N18LyEsHXqRN+HHz1RXvXjElQu4RVMxEMBsa/fkYOGW1UozOy1QKfIWcQn2d P1dI96ntF7uNwtmDIF+K7Qf4XzmF2wlWqpHob+jGYr5Bh+8UNPG4I6Slaex/UFPINxg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793858371; h=DMARC-Filter:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-CM-TRANSID: X-Coremail-Antispam:X-CM-SenderInfo; bh=zbh4wMZ9WUBs3S0LO6QMi4wquYaApdRMTQSw+mZIopg=; b=LNUFP0Vk6e0fgMh9uvg9Aq+zW4e3OE+SCHf4sT18HQWgqDfJpso+aG/qrdOkZtST20D8 QeuistDdsvOwmnHq/t+L0FDX5Me/GKON2+UVg7FQYfywHYgzJe1qB4Ft7UmUqC6ELg+KB vCFU6D+nW+39Fqy3Ik1D5/mcE7AlhaiAPDs45TXg+CGNehtMU1elTz7TH7GN5cmrJV+HS 4BTpH9SNbMXfelflpeY8r+o+RU7IHIvAbkD8R2+lXIw03yccTFOmlCY0y2PHQqw0TZVht hQmnggZg6OHibjMTPzhgUTaPE+ZkKhsCiPDgIVtRIqMjGEW/8spiKZNQQj/ijJQgjbw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass header.d=163.com header.i=@163.com header.a=rsa-sha256 header.s=s110527 header.b=Q8Ng1T+6; arc=none smtp.remote-ip=220.197.31.3 X-Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79BDD606A31B for <netdev@vger.kernel.org>; Thu, 5 Nov 2026 05:59:28 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 79BDD606A31B X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Message-ID:Date:MIME-Version:Subject:To:From: Content-Type; bh=zbh4wMZ9WUBs3S0LO6QMi4wquYaApdRMTQSw+mZIopg=; b=Q8Ng1T+6DzvL1LHDfwPgQEcyk9skcgqpY/XcXAV1rX9ejkkkIqM3vkZIXckwr9 7PXxCxWy1Skcmuqjd7Qxpv5sSon0A4RtTYQAUBvMQXej4j6DkaZ7hzG85FQgRXQL jAK8LGOOcfXCjbu87/aoHOOi5b52/2TFXA6bhvF/XrBNA= 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-User-Agent: Mozilla Thunderbird X-Cc: jv@jvosburgh.net, andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, netdev@vger.kernel.org, hangbin.liu@linux.dev X-In-Reply-To: <CAL4Wiipu2VTRck9Es31krEKmYZuh9iCQu5fwqpOkWP6pQNqjvg@mail.gmail.com> X-CM-TRANSID: PygvCgDn0JMRG+xqvwlmEA--.54657S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxCFyrCFyfWr43CFW5GF4fAFb_yoW5Wr18pa ySyay0kFWqvw129r1q9a1xWrWru3y8KFW5JryFg348ArZ0qFyIvrW7KF1jgasrCrs3uw4j vFWjk3sI93WqyaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UIoGdUUUUU= X-CM-SenderInfo: pox130jbwriqqrwthudrp/xtbC6xKgb2rsGxLnbAAA3y