From nobody Sun Feb 8 20:24:42 2026 Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net [185.136.65.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0433F275AE4 for ; Tue, 4 Nov 2025 06:17:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.136.65.225 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762237056; cv=none; b=jFAHjtFLeKOChzVlxof2270axhf17ZRLjvhW3JtoxoONp1CbriueAi25sw4T1IQSt3/fDukoCYMFAGUZJZiy63brFPEEIL7TsE2p88RIjV0HuqA8ZdFKB2FhzZB2hNVlO6/FGLUg0K0S5dLs+Cauw4XvdatkMwvKLppZ+obvGbU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762237056; c=relaxed/simple; bh=H0akFcysYtoQMTq6SLErZbIYDBnSs6SR33JYqUBHGPs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MLatiqbkG6mG8gWkuZJ00eKTyyJzoPNDF6I0B1MbzzB7H7xvgUvCCHdBViDkytJWYX//Wk2zPp7W8o20WH0f6ELTX9vRFqpBLsLKzWa/fafMqYDENVqxOV61ICg2JJWuGO1rPdELEIDKPSqCa/exOLCIxXoxOuwK2EKRv3IN3n8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com; dkim=pass (2048-bit key) header.d=siemens.com header.i=alexander.sverdlin@siemens.com header.b=IdN+22Dp; arc=none smtp.client-ip=185.136.65.225 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=siemens.com header.i=alexander.sverdlin@siemens.com header.b="IdN+22Dp" Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 202511040617270498a4af2000020733 for ; Tue, 04 Nov 2025 07:17:27 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=alexander.sverdlin@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; bh=kw0zFvKnv/CewtK+Xr1RXZdXV8kS1VzqX7ZfwO3TUrM=; b=IdN+22DpJWY88axdQwz0mu8PUj/V4i4pB69VdJtAzZ5VAxWJfuYo9BW8Z9Y5ZVM1GDvwQh sKfYs+dRda2STHlpTPto/AajshOdCBcEcUhz0rck5rnM1lDNUW59IPkVJNZ66P9rEipjosEv pq30S83CgZeIUanJ1kHZ4vCDkMVh26nIFcFOntlTmz7NGiVCZQECWp9H6S7w3oMjWgbCZYRa X3IOB7kYysx6alVzQi0qGZSK+LvpnAo9Tmp/XxI8ZhBPvFfuyF5TO5y+UypaUldu9VMSvZ4E vyCkd5mdPpFPuD3gTDz0GB62fjNjqpHv0d4rwW9BZQ688H5fcFqNBSaA==; From: "A. Sverdlin" To: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: Alexander Sverdlin , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Shuah Khan , Vladimir Oltean , linux-kernel@vger.kernel.org Subject: [PATCH] selftests: net: local_termination: Wait for interfaces to come up Date: Tue, 4 Nov 2025 07:17:21 +0100 Message-ID: <20251104061723.483301-1-alexander.sverdlin@siemens.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-456497:519-21489:flowmailer Content-Type: text/plain; charset="utf-8" From: Alexander Sverdlin It seems that most of the tests prepare the interfaces once before the test run (setup_prepare()), rely on setup_wait() to wait for link and only then run the test(s). local_termination brings the physical interfaces down and up during test run but never wait for them to come up. If the auto-negotiation takes some seconds, first test packets are being lost, which leads to false-negative test results. Use setup_wait_dev() after corresponding simple_if_init() on physical interfaces to make sure auto-negotiation has been completed and test packets will not be lost because of the race against link establishment. The wait has to be done in each individual test because the interfaces have to be brough up first and only then we can wait for link (not individually, because they are expected to be looped in pairs). Fixes: 90b9566aa5cd3f ("selftests: forwarding: add a test for local_termina= tion.sh") Signed-off-by: Alexander Sverdlin Reviewed-by: Vladimir Oltean --- .../selftests/net/forwarding/local_termination.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/local_termination.sh b/= tools/testing/selftests/net/forwarding/local_termination.sh index ecd34f364125c..369c8b2c1f4a2 100755 --- a/tools/testing/selftests/net/forwarding/local_termination.sh +++ b/tools/testing/selftests/net/forwarding/local_termination.sh @@ -430,6 +430,8 @@ standalone() h1_create h2_create macvlan_create $h2 + setup_wait_dev $h1 + setup_wait_dev $h2 =20 run_test $h1 $h2 $skip_ptp $no_unicast_flt "$h2" =20 @@ -448,6 +450,8 @@ test_bridge() bridge_create $vlan_filtering simple_if_init br0 $H2_IPV4/24 $H2_IPV6/64 macvlan_create br0 + setup_wait_dev $h1 + setup_wait_dev $h2 =20 run_test $h1 br0 $skip_ptp $no_unicast_flt \ "vlan_filtering=3D$vlan_filtering bridge" @@ -480,6 +484,8 @@ test_vlan() h1_vlan_create h2_vlan_create macvlan_create $h2.100 + setup_wait_dev $h1 + setup_wait_dev $h2 =20 run_test $h1.100 $h2.100 $skip_ptp $no_unicast_flt "VLAN upper" =20 @@ -505,6 +511,8 @@ vlan_over_bridged_port() h2_vlan_create bridge_create $vlan_filtering macvlan_create $h2.100 + setup_wait_dev $h1 + setup_wait_dev $h2 =20 run_test $h1.100 $h2.100 $skip_ptp $no_unicast_flt \ "VLAN over vlan_filtering=3D$vlan_filtering bridged port" @@ -536,6 +544,8 @@ vlan_over_bridge() simple_if_init br0 vlan_create br0 100 vbr0 $H2_IPV4/24 $H2_IPV6/64 macvlan_create br0.100 + setup_wait_dev $h1 + setup_wait_dev $h2 =20 if [ $vlan_filtering =3D 1 ]; then bridge vlan add dev $h2 vid 100 master --=20 2.51.1