🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26120

Re: [PATCH net-next 2/2] selftests: bonding: test that the ARP monitor keeps UP slaves when it starts

#26120
From: Hangbin Liu
Date: Thu, 03 Dec 2026 03:23
97 lines
11909 bytes
Hi Ramses,
On Tue, Dec 01, 2026 at 12:20:30PM +0200, Ramses de Norre via B4 Relay wrote:
> From: Ramses de Norre <ramses@well-founded.dev>
> 
> Add a test for the two ways the ARP monitor can start after the slaves
> were enslaved: bringing the bond up after enslaving into it while it is
> down, and setting arp_interval on a running bond that uses miimon. In
> both cases the test waits longer than the arp_missed_max window before
> the monitor starts, and checks that the primary stays active and that no
> slave gets a link failure.
> 
> Without the previous patch, both cases fail: the first monitor run takes
> both slaves down and the bond comes back on eth1, where it stays with
> primary_reselect=failure.
> 
> Signed-off-by: Ramses de Norre <ramses@well-founded.dev>
> ---
>  .../testing/selftests/drivers/net/bonding/Makefile |   1 +
>  .../drivers/net/bonding/bond_arp_monitor_start.sh  | 154 +++++++++++++++++++++
>  2 files changed, 155 insertions(+)
> 
> diff --git a/tools/testing/selftests/drivers/net/bonding/Makefile b/tools/testing/selftests/drivers/net/bonding/Makefile
> index 46d9fede59185..12276c942506e 100644
> --- a/tools/testing/selftests/drivers/net/bonding/Makefile
> +++ b/tools/testing/selftests/drivers/net/bonding/Makefile
> @@ -6,6 +6,7 @@ TEST_PROGS := \
>  	bond-break-lacpdu-tx.sh \
>  	bond-eth-type-change.sh \
>  	bond-lladdr-target.sh \
> +	bond_arp_monitor_start.sh \
>  	bond_ipsec_offload.sh \
>  	bond_lacp_independent_control.sh \
>  	bond_lacp_prio.sh \
> diff --git a/tools/testing/selftests/drivers/net/bonding/bond_arp_monitor_start.sh b/tools/testing/selftests/drivers/net/bonding/bond_arp_monitor_start.sh
> new file mode 100755
> index 0000000000000..a718292172244
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/net/bonding/bond_arp_monitor_start.sh
> @@ -0,0 +1,154 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +#
> +# Check that the ARP monitor does not take UP slaves down when it starts
> +# after the slaves were enslaved. That happens when the slaves are enslaved
> +# while the bond is down, or when arp_interval is set on a running bond
> +# that used miimon. The monitor must give the slaves a full arp_missed_max
> +# window from when it starts, not from when they were enslaved.
> +#
> +#  +------------------------+
> +#  |  bond0 192.0.2.1/24    |  h_ns
> +#  |  eth0          eth1    |
> +#  +---+-------------+------+
> +#      |             |
> +#  +---+-------------+------+
> +#  |  sw0           sw1     |  sw_ns
> +#  |  br0 192.0.2.254/24    |
> +#  +------------------------+
> +
> +# shellcheck disable=SC2034,SC2329
> +ALL_TESTS="
> +	arp_monitor_start_on_open
> +	arp_monitor_start_on_interval_set
> +"
> +REQUIRE_MZ=no
> +NUM_NETIFS=0
> +lib_dir=$(dirname "$0")
> +# shellcheck disable=SC1091
> +source "$lib_dir"/../../../net/forwarding/lib.sh
> +
> +require_command jq
> +

[...]

> +
> +trap cleanup EXIT
> +
> +setup_prepare
> +setup_wait

Since we don't need the NUM_NETIFS, there is no need to call setup_wait.
With that, we can include net/lib.sh directly, and remove the
REQUIRE_MZ/NUM_NETIFS setting.

Thanks
Hangbin

> +
> +tests_run
> +
> +exit "$EXIT_STATUS"
> 
> -- 
> 2.56.1
> 
> 
Technical Details
Message-ID: <axDgWrEy4NTneD4l@fedora>
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376256-linux-kernel-netdev=dewy.ru
References: <20261201-bonding-arp-reseed-v1-0-984d4a3991cb@well-founded.dev> <20261201-bonding-arp-reseed-v1-2-984d4a3991cb@well-founded.dev>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376256-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 2/2] selftests: bonding: test that the ARP
 monitor keeps UP slaves when it starts
Date: Thu, 3 Dec 2026 11:23:18 +0800
Organization: Usenet Network
Message-ID: <axDgWrEy4NTneD4l@fedora>
References: <20261201-bonding-arp-reseed-v1-0-984d4a3991cb@well-founded.dev>
 <20261201-bonding-arp-reseed-v1-2-984d4a3991cb@well-founded.dev>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="2130981"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:QDDXnpdh+RTfzoH+i80rO5JNOls= sha256:9Zs3Tv/b/YaBqMYFRz8cVX2eMmsopXpMhH2bj84EtK8=
	sha1:SJ9NCXbf7NBbTp7KMz/nMAiEylI= sha256:3/hjhLOHFkm18a8r2bhRbTMfGqdI04Rf2KbD6HAUlB0=
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 20EE51177FF; Thu,  3 Dec 2026 06:23:54 +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 YOr-sAuH9sQC;
	Thu,  3 Dec 2026 06:23:48 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376256-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 401A31177FC; Thu,  3 Dec 2026 06:23:39 +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 02540264BF; Thu,  3 Dec 2026 03:23:36 +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=1796268214;
	b=YcY4VzsfwIC0AcA/UdtyNEArW1lDswCax+jFXXzfFQ4kefto7fmulym7Dnv6RqZTnnTO
	 dPpDy9NGNIlODZI1KRppinjmcDu8Bhm2BV1PdpJ839tPeP1D9/gU32bQshgvuYwUEKSpP
	 2Pe77ulHyF0L7VKqP2a6pNDcs8nj2sNKjVzSFrXORF+RGvpIUDU6FtZtAvbzfJS3KhxLD
	 YQ6HxuH3jSApRns0ar8y50rHOE1LKl6HapfSPf5IWp+2jNZ6QPNtyGTst2OjKNaedxIg1
	 b3eQZ9hBHnX8OQhIDv5jrscZIwuO3IEZTUaPWIfgwFoxmmwgtLEtFG/GrE3h1oZYO0g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796268214;
	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:In-Reply-To;
	bh=RHuSdEGTiAL0rX9oMXGh0hpgKGtvX7t7NgH59mbgpq0=;
	b=KLVbHpewYuNOTzfnIpGgGCW27c26/heCzwtr5xl2q7vnxopxr11um55OlyNmRCkivq4y
	 HaGqw9yXy3e4hpMKxVDdH5LozI9GSzaMq4sxM8QH7lF2jeiCOVagUhpH/wMmOXqfDKJRF
	 YP4t/112FS5kXktQznIFq/mojFGAJWa/kZPS2W9mfqRHDUgJdcqRK6wg1Rj7I5eutWqFX
	 KONKuimb4Q0EHJOtUcsfFN+XW3tbHBVvs1I2QjnVPqTk6TKDsmfDjxyfRz3n2FIn3T9we
	 FvrZ03ZVo+fr8k/fjvQZe67cnansqlvv3MWfw/L2kuH00SgW9ILWA9TbOdzMfF1t/eQ==
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=hw5rN35q;
	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 D2985606A33D;
	Thu,  3 Dec 2026 03:23:34 +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=hw5rN35q
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.47
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796268214;
	b=NpOeH+GAymz469B5ZZhPnaTkmJOwQZEdlna6MS87NRpEBMD2ZNUZcr0uk2wegmk21YXg
	 R7AmjTNSMDHAXZxM9xAwn2xl1sPY8+3NFYGg3qx9P+/CWGwm22scfTJqn/ObRtrzfqx4z
	 gLfYP8VRltNHBb1edrTyuLZQG0dh9Kg7AFH0LCvJBmCXPVaCOmj5vG53g0Kc7jobTZlw2
	 XJ27Rely9qwLYet0kmWwEAD4s+j7uJyh3QP59rkv/rAabHzjYGH33dzABGMK+Yg5lo6V2
	 taL02sC8+s1O1qP9zA4QxlBd3wQ153hc07N1JC8mG7EN24OY6rPzp7qyhMsVq5fR7rw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796268214;
	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:In-Reply-To;
	bh=RHuSdEGTiAL0rX9oMXGh0hpgKGtvX7t7NgH59mbgpq0=;
	b=PEtJF5SeDQ0i9w4kK4wLjPGSsMfsJLzM5yPDYIegueNWY0K9AdLMVHqV7Cw2r1WEX+Vz
	 szx8RHvIAv+xer554S4BddOnINbgOO8lew9rMCMs4xWV6NaUY1bABB7qTImoAUtpSDyca
	 0nkDHbmZJ5/aFuO0dLQpVe1H6y1E2knuV8W4jiVI9WlgOKm2pEAKIphEfT70sERownCFU
	 azrwRtaFo7HlhYHA4LwnDMT8nDCwWudUcPufL3ErfSfIGBzRsgHhtVn5naPEYTe0IPWwR
	 AbTDjgh50mzk2jt5HQSk8g2zuV1zb31amSZ96oD+441dmx2iYQe45pphHJqcXq80FqQ==
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=hw5rN35q;
	arc=none smtp.remote-ip=95.215.58.47
X-Received: from mta1.migadu.com (out-47.mta1.migadu.com [95.215.58.47])
	(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 58A3E606A32D
	for <netdev@vger.kernel.org>; Thu,  3 Dec 2026 03:23:32 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 58A3E606A32D
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=8ci7PmxvTxeiWUWN32xqoBItcU5Ke/5bMx2gayBM288=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1796268210; v=1; x=1796873010;
 b=hw5rN35qaB+bqTc/QB7/xKYfympwpL/9oiIPqlcq1OxEANCMOvLtsGuBLtveetRKGdmW8P8g
 Bu2j0lKhOKXaQu5ZDokvSlHBSztVpXa0AI/xn053w6Bb78dg4zzFRI/2TSLJKhmfPCzoi9bKVXj
 datlE+NOAKx6jYAKkWljZhQo=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta12.migadu.com with ESMTPS id 95673dcce7b3f8b3;
	Thu, 03 Dec 2026 03:23:30 +0000
X-Mizu-Trace-ID: 95673dcce7b3f8b3
X-Migadu-Flow: FLOW_OUT
X-Cc: Jay Vosburgh <jv@jvosburgh.net>, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Jiri Bohac <jbohac@suse.cz>, Eric Dumazet <edumazet@kernel.org>,
	Willem de Bruijn <willemb@google.com>,
	Simon Horman <horms@kernel.org>, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Nikolay Aleksandrov <razor@blackwall.org>,
	Shuah Khan <shuah@kernel.org>
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: <20261201-bonding-arp-reseed-v1-2-984d4a3991cb@well-founded.dev>