🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17655

Re: [PATCH net] selftests: bonding: fix failover race in bond_options.sh prio test

#17655
From: Hangbin Liu
Date: Tue, 17 Nov 2026 07:26
109 lines
13454 bytes
Hi Pin-yen,
On Mon, Nov 16, 2026 at 05:30:28PM -0800, Pin-yen Lin wrote:
> Hi Hangbin,
> 
> On Thu, Nov 12, 2026 at 10:00 PM Hangbin Liu <hangbin.liu@linux.dev> wrote:
> >
> > On Fri, Nov 13, 2026 at 01:23:40PM +0800, Hangbin Liu wrote:
> > > Hi Pin-yen,
> > > On Wed, Nov 11, 2026 at 05:46:18PM -0800, Pin-yen Lin wrote:
> > > > The prio test intermittently fails in the arp_ip_target and
> > > > ns_ip6_target variants:
> > > >
> > > >   TEST: prio (active-backup ns_ip6_target primary_reselect 1)   [FAIL]
> > > >     Current active slave is eth0 but not eth2
> > > >
> > > > The ARP/NS monitor marks a slave down when it has received nothing for
> > > > too long. With arp_interval 100 and the default arp_missed_max, that is
> > > > about 250ms for the active slave (eth1) and 350ms for a backup slave
> > > > (eth0, eth2). Every 100ms, eth1 sends a probe: eth1 receives the reply,
> > > > and eth0/eth2 receive a copy forwarded by the gateway bridge. Once eth1
> > > > is down, its probes reach no one and no slave receives anything, so
> > > > eth1 normally times out first and the new active slave is picked by
> > > > prio:
> > > >
> > > >   t=0    probe: eth1 gets the reply, eth0/eth2 get a copy
> > > >   t=10   test sets eth1 down
> > > >   t=300  monitor: eth1 idle 300ms -> down
> > > >                   eth0/eth2 idle 300ms -> up, eth2 picked by prio
> > > >
> > > > But the test takes eth1 down right after bond_check_connection(), whose
> > > > ping replies only arrive on eth1:
> > > >
> > > >   t=0    probe: eth1 gets the reply, eth0/eth2 get a copy
> > > >   t=70   ping reply on eth1 only
> > > >   t=85   test sets eth1 down
> > > >   t=300  monitor: eth1 idle 230ms -> still up
> > > >   t=400  monitor: eth1 idle 330ms -> down
> > > >                   eth2 idle 400ms -> down too
> > > >
> > > > eth2 can then no longer be picked. eth0 becomes the active slave if it
> > > > happened to receive some other packet (e.g. an MLD report), otherwise
> > > > whichever slave comes back first does. With primary_reselect 1 or 2,
> > > > the bond keeps eth0 even after eth2 comes back.
> > > >
> > > > Before taking the active slave down, wait two monitor intervals
> > > > (200ms), so that at least one more probe is sent after the last ping
> > > > reply and all slaves last received that probe. The miimon variants do
> > > > not need the wait, but the extra delay is negligible.
> > >
> > > I'm afraid the waiting time is too strict, especially with a debug kernel
> > > since delays can happen.
> > >
> > > Bjoern is also fixing[1] this issue by pinging a non-existent neighbor to
> > > keep traffic flowing. Would you like to test whether that works for you?
> > >
> > > [1] https://lore.kernel.org/netdev/20261104142018.552135-1-doebel@amazon.de/
> >
> > BTW, using ping may not able to triger the arp request in time. You can try
> > arping instead.
> 
> Thanks for the pointer, but I believe Bjoern's patch addresses a
> different problem.

I think they are the same issue, as you comment also said

The ARP/NS monitor marks a slave down when it has received nothing for
too long.

> 
> Bjoern's patch keeps the traffic flowing so that idle slaves are kept
> alive between the test steps. This patch fixes the case where the ping
> replies from bond_check_connection() only arrive on the active slave
> right before it is set down. The active slave's failure is then
> detected one monitor interval late, when the backups have also timed
> out.

The reason is we set arp interval to 100ms, and slowwait also check every
100ms. If the backup slave down at the same check point, e.g.

  t=300  monitor: eth1 idle 230ms -> still up
  t=400  monitor: eth1 idle 330ms -> down
                  eth2 idle 400ms -> down too

The test failed.

> 
> The ARP requests triggered by Bjoern's ping are sent only about once
> per second, which isn't frequent enough for this failure. I tested
> Bjoern's patch and confirmed that it didn't fix the issue in our
> testing environment. We also can't simply use arping instead because
> iputils arping doesn't support sub-second intervals.
> 
> If you're worried that the 200ms sleep is too short, would increasing
> it to 0.5s or 1s work for you?

It's not about the sleep time before setting active slave down. I'm afraid
about the slowwait checking time. Even we sleep 1s, with arp interval 100,
we still only have 100ms checking window. Before the window, the active slave
is up, after the window, the backup slave also down. With a debug kernel, this
time is a little tight.

So, either we have some background arp traffic, or let's extend the arp
interval to a larger one.

What do you think?

Thanks
Hangbin
Technical Details
Message-ID: <avwBrbJfp4ET9ifT@fedora>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364999-linux-kernel-netdev=dewy.ru
References: <20261112014942.2946303-1-treapking@google.com> <avaewOJD7tX1UYfE@fedora> <avanVkILHDYdpond@fedora> <CAHwYsio=qtCY10EPnh+qvWpdgtQUG5mw1b3WKMt9_Kytcc7h9A@mail.gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364999-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] selftests: bonding: fix failover race in
 bond_options.sh prio test
Date: Tue, 17 Nov 2026 15:26:37 +0800
Organization: Usenet Network
Message-ID: <avwBrbJfp4ET9ifT@fedora>
References: <20261112014942.2946303-1-treapking@google.com>
 <avaewOJD7tX1UYfE@fedora>
 <avanVkILHDYdpond@fedora>
 <CAHwYsio=qtCY10EPnh+qvWpdgtQUG5mw1b3WKMt9_Kytcc7h9A@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2267399"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1://C+Xg1ivibYyVOfxOEV5jniyrs= sha256:HAokaZtaTLawNTkHpF/B9LfYCYN7nQc8SE6GmvK6vYY=
	sha1:JaM67EZ5TM8p2BeiNkSrMg2twKY= sha256:8sUOhLT2Ytjc8wTDtVUePT/DyVV6OYeQQTIIZdWihC4=
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 8D125114E6D; Tue, 17 Nov 2026 10:27:16 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 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] 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 rR_RF9vDKvLb;
	Tue, 17 Nov 2026 10:27:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-364999-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 0A245114E2A; Tue, 17 Nov 2026 10:27:01 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 5FD90271B1; Tue, 17 Nov 2026 07:26:59 +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=1794900417;
	b=0lFJ2gF0Iv03yqemejJVqZIbFONcoAL8fU48wRtz+RplfPbv595Qjv+wHrpq2rddBPQl
	 SUSGi4eF813HvnHOI4+/zdVNim3etlHF1kiqVD4e7I2cnwDDQWYmFloqRBLLCGXbgd5wE
	 +AD3N0Rn05qlpDlhWFUbGqtFIc5cRwdrw4FL2eLsbOsM44KEzFqNOcZRqvxNrXAwzl3wI
	 /sAeuUAHBLaxC9cpw0ChZhlmFOlV/cdj+QPS8+CqDtB2YcNSYFxeN2rY59HA9V/e8IY2B
	 Xr68M3MzLY4nHhkB3XRFU0MFkn5TNSQ+Jk0Oa47zS3F8RlV6WELr3bmhe/XKD8bie7A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794900417;
	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=MNmh1Reg5Czo+a3LVsCK+8As4ZT63TJjE//xLVoIjok=;
	b=I5lMH5bB/zRrwaE49gKEFoc+iobdIERUgTePDOz8KKukClYiXrMoRTXhu6lppnHQWxIv
	 2D5RcG9pUnXV5hxVKqyKHfvLd/z3YJK3SWtMgW+M2KjGbcuhBJNk3VkYJWzJvB44iviG+
	 8tR2+3tmlxWB7y4b/Gmys920TquLhrxmpwWroNbGjbiGwVkwCPh7zt1maleVMy3rhYIJk
	 BDrZVddRmh/SHtjzuztneMqxMNqv0dU+1szkZabFP+j8W/4P3VRT7DDxmMH/lBfaDSYYW
	 kw6DJCeGKOl4LVM0yPkrwaPxrMwZxze+xyaauqn2SdR6pNSwKMF/yzTPoerEgbKFlaQ==
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=P2BFPSWq;
	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 7FD4C606A331;
	Tue, 17 Nov 2026 07:26:57 +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=P2BFPSWq
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.79
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794900413;
	b=r98quHWn2XmzLcVhsGRWz5MPJSOam7Qj7Yw0G1bR+Of7vVNUu+HQEsJYrW4662J9xgVg
	 rpyq9i2DLxpmpOqyxFZwNAiZG8CaLhaAIWzZSs5q5FnE1lg5PZOP6+Kuw2IhylYTWWfdn
	 ySQA4qhTi8cNx0/BjbyU0jAAsPJgY5zW0eA0cq1IBTvH325byXYvc4Fyn2KPD9S5vH6dm
	 NGMrUFU+4uC55hp9b7GHzjLEjvkRiPLQHYSxwLvzv2amPQh9JuK5e0a8PapxnBD4A+Glq
	 JIMR5WELvyyD+Z9L50KIWSdXALTNvzE2Z1P+GZP709mOpyH5QtdzZgKYPd0Dy0NEJgw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794900413;
	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=MNmh1Reg5Czo+a3LVsCK+8As4ZT63TJjE//xLVoIjok=;
	b=aWfaGipeApyQTjh+WkA5FzX9GZarPoGOdXyVQ89jbHayrKYUC92+KhapB3K0Et3yRfHJ
	 mZexZMU/da9mtu+5tJfQEJInAivl5OOnLX1Qh2X2FIvw5S1wr3HizKhL/lbaKpNmlnH8X
	 SGjK83T2VVbcPt5jGJiLKa2UWnRrFLJz/xCRPToSXQul2x2qYUkQsv2MVwPaT53IJO9Xd
	 tPQerLy0YUUGm7Of0J62dH+4J+sQuFcnLPPN1YnceQQNKmY90HYP7PS5kXuJAptgkRR8B
	 Fq98+YiE/O6gb8kl9jQ+0HOQpop87pAZoLMubyEYGYRR0d0c8rzINU9QP3luyElAM8A==
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=P2BFPSWq;
	arc=none smtp.remote-ip=91.218.175.79
X-Received: from mta0.migadu.com (out-79.mta0.migadu.com [91.218.175.79])
	(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 A760B606A323
	for <netdev@vger.kernel.org>; Tue, 17 Nov 2026 07:26:52 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A760B606A323
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=ZHQ7vGXzig53gxhV15EJJjqr5AYYwWSgOJJV79sVoaQ=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1794900410; v=1; x=1795505210;
 b=P2BFPSWq9Bsx/WL684prYR47sAoRAqgVjfLNXZoMZMvxxCgcZQ49YoewdGoXMM52aWHcTSa6
 IfGYAP4m9ieTqIWTMQ56iyp0ff1whYBeTKJ/cd12qibbIAS9pttFtym/Vpy823SFfsp5IlJUQPN
 AkmBawkdoFFzwnrgrFkLCCbE=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta11.migadu.com with ESMTPS id 5c923570b0d44339;
	Tue, 17 Nov 2026 07:26:50 +0000
X-Mizu-Trace-ID: 5c923570b0d44339
X-Migadu-Flow: FLOW_OUT
X-Cc: Jay Vosburgh <jv@jvosburgh.net>, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Bjoern Doebel <doebel@amazon.de>, Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>,
	netdev@vger.kernel.org, Matthieu Baerts <matttbe@kernel.org>,
	linux-kernel@vger.kernel.org,
	Jonathan Toppins <jon.toppins+linux@gmail.com>,
	linux-kselftest@vger.kernel.org, Hangbin Liu <liuhangbin@gmail.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: <CAHwYsio=qtCY10EPnh+qvWpdgtQUG5mw1b3WKMt9_Kytcc7h9A@mail.gmail.com>