๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25366

Re: [PATCH net-next v13 8/8] selftests: hsr: Add test for the inline PTP header on HSR

#25366
From: Sebastian Andrzej Siewior
Date: Tue, 01 Dec 2026 16:49
71 lines
11942 bytes
On 2026-12-01 08:55:33 [+0000], netdev-bot+sashiko@kernel.org wrote:
> Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 2
โ€ฆ
> [ ... ]
> 
> > +	ip -net "$ns3" link set ns3eth1 up
> > +	ip -net "$ns3" link set ns3eth2 up
> > +	ip -net "$ns3" link set hsr3 up
> > +}
> > +
> > +run_ptp_hdr_tests()
> > +{
> > +	echo "INFO: Running PTP-header tests."
> > +
> > +	ip netns exec "$ns1" ./hsr_ptp_test -H hsr1 -A ns1eth1 -B ns1eth2
> > +	ret=$?
> > +	stop_if_error "PTP header test failed (ns1)."
> 
> [ ... ]
> 
> > +check_prerequisites
> > +trap cleanup_all_ns EXIT
> > +
> > +setup_ns ns1 ns2 ns3
> > +setup_hsr_interfaces 1
> > +run_ptp_hdr_tests
> 
> [Severity: Medium]
> Can the first hsr_ptp_test run send its frame before the links are fully
> active?
> 
> run_ptp_hdr_tests() starts right after the last "ip link set ... up" in
> setup_hsr_interfaces(), and nothing waits in between. hsr_ping.sh,
> hsr_redbox.sh, hsr_prp_redbox.sh and link_faults.sh all sleep or wait after
> setup.
> 
> When a veth peer comes up, the other side gets carrier through the
> asynchronous linkwatch work. Until linkwatch calls dev_activate(), that
> device's TX queue is still on noop_qdisc:
> 
> net/sched/sch_generic.c:dev_activate() {
>     ...
> 	if (!netif_carrier_ok(dev))
> 		/* Delay activation until next carrier-on event */
> 		return;
>     ...
> }
> 
> The hsr master's carrier also only follows the slave operstate, which
> linkwatch sets.
> 
> If pkt_send() runs inside that window, noop_enqueue drops the frame on
> either hsrN or the slave. send() still succeeds, because NET_XMIT_CN maps
> to 0 and hsr_dev_xmit() returns NETDEV_TX_OK. raw_recv() then times out
> after 100ms, and recv_verify() reports "Missing packet on portA" or
> "Missing packet on portB".
> 
> Would it make sense to wait for carrier/operstate on the hsr and slave
> devices before running the test, as the other scripts here do?

The other scripts do wait but not for the link to get up but for "HSR
supervision" frames to get exchanged and the nodes on both sides are
known/ "merged". This avoids duplicate frames.
In the PTP case, the duplication is skipped and sending is done a
specific interface.
On the other hand this can only happen once the link is up. I'm unsure
if this wait/ sleep is really needed.

Sebastian
Technical Details
Message-ID: <20261201164943.L_HEOx0N@linutronix.de>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375215-linux-kernel-netdev=dewy.ru
References: <20261130-hsr_ptp-v13-8-598326208fc5@linutronix.de> <179611533353.3146.6294208363158546982@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375215-linux-kernel-netdev=dewy.ru
From: bigeasy@linutronix.de (Sebastian Andrzej Siewior)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v13 8/8] selftests: hsr: Add test for the inline
 PTP header on HSR
Date: Tue, 1 Dec 2026 17:49:43 +0100
Organization: Usenet Network
Message-ID: <20261201164943.L_HEOx0N@linutronix.de>
References: <20261130-hsr_ptp-v13-8-598326208fc5@linutronix.de>
 <179611533353.3146.6294208363158546982@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="1769749"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:s67R/7MMtQ3u8/4ldtlWeVKxqXQ= sha256:gsqPnch1wfaTTsR3NCMVUxUPT6XEY2O/OrNF7qKzldY=
	sha1:w6fZGq32dtsBssOlZzrf5ERtoxc= sha256:4u2MtXq6AfLaSXLVo0010H1RnB7bLTq6E2sXZCye7gU=
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 CCE3911741C; Tue,  1 Dec 2026 19:50:13 +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 (2048-bit key)
	header.d=linutronix.de header.b=AUujUTu9; dkim=neutral
	reason="invalid (unsupported algorithm ed25519-sha256)"
	header.d=linutronix.de header.b=vA+Ttn4t
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 Xp8DRNZMTGiW;
	Tue,  1 Dec 2026 19:50:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-375215-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linutronix.de
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 0A710117419; Tue,  1 Dec 2026 19:49:55 +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 7673322079; Tue,  1 Dec 2026 16:49:53 +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=1796143791;
	b=QbUqIGehxwSopM7xmnzoi98f0hxQtuZgrXNdAA1c/+qdIfMLWzhIbgyw76sunF115hya
	 tUQ9x/2kYhIKbbebODytCSJ4ZcRlyRkMLb1rQlRv52sY/oWZz2rdouHYwuAbeRELUaSAf
	 TFcKw1ZNvQq1BpFZ+slzFNXVXsdlpWlxIXrMdsO7oJxkNSFATwCNFO/c4N9SbZailZ3KN
	 B2naOsW0zkwpfDBjlp0S/vrg/bsC4CQVNDGWps9ocJbhs0PI4/UvGU9OtHNdcmHiKwJBH
	 QLNGBBX8/oLRxU10+GoiDZdcv4wW0451r0XLKxL1gvYLWG7NRwTavVwQlbodh1dwoNA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796143791;
	h=X-Original-To:Received:DMARC-Filter:Date:DKIM-Signature:
	 DKIM-Signature: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=sJxxovxZGm/3of4/g49ooOTn/hlBYb6xNrJjhzhoG3k=;
	b=lkWMhITY9mv/zbuRRy0ZuYZyTfyHueL7xTPUDqlKVbtFRWm/A4dg3Lr8H8Qkw8jD3W0c
	 Ked55khwZYc+cqzPg39YsSNI+niZBkOxd3fwUNkQ3pX43N6QD3dryjZO2BVJVUr5btIjk
	 eZtuuqsp81K4pGbt+gIpx+rGxpBiW7SUVf7cTYhNvdgA5jO6qz6jHykXJLuJG2MhFXs3D
	 i350I5X0i7vwFrOOyIdpFhVepF5O0/Cj4lA9krAmKFBTEuRrK9on0x9oTbVIYrCLoLxuB
	 MJ5y5RXAYFcdA8MqfZf/RdwJnrL/x/rhR/O1mxZB9PvSi+U7+NEnq+kE5L6TNZGEK2w==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=AUujUTu9;
	dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=vA+Ttn4t;
	dmarc=pass header.from=linutronix.de;
	spf=pass smtp.mailfrom=linutronix.de;
	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 EF20F606A32A;
	Tue,  1 Dec 2026 16:49:50 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=AUujUTu9;
	dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=vA+Ttn4t
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=193.142.43.55
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796143790;
	b=j2Dva0WBg9C8NNecyWdOkeSsDfKWcj3nwFAtPm4HpbvkrO9B2o3USogMTNUssOffRTnl
	 xj0PHTJ4XGcVVt5GxKihmWarny30MfdviL4A/bhqUTRhg0PEXFruAXuME59WwvDdfDHDp
	 Q4AJ+pCAhHIgT+8e00dEe4QgsEXXFyLnXFWp9MT+/TnxPfRNXuGvrQRZbEW9bAlgcM2kQ
	 7c2SdWRyOvvw4L3YIZajVjbnmjvwqZEbG8GKrUDrEv/xMrsrYdwRdswM8LKXwkZ8/qey8
	 No8SV6iubwrKV1ppXixqBILYCtPTBaAFkxijhP4+ExLB1E0id3GjgcQG7pLAi/mC65w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796143790;
	h=DMARC-Filter:Date:DKIM-Signature:DKIM-Signature:From:To:Cc:Subject:
	 Message-ID:References:MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=sJxxovxZGm/3of4/g49ooOTn/hlBYb6xNrJjhzhoG3k=;
	b=3je44feI9dVHVzMcV6otSwX82U3CjVDTO6R2Rs433Tfg25ONkP0F2bJRq2UcrmKSnPuo
	 eSjMlIjHdukfsHCfp6bqXz7z4O6/p81zywH4NQ3+2qnssDl6uQAzqIqsQtGxCHMKKEl7p
	 O+G8Aw9wsNgaePx6JgVuXKUAwwYrJSFl01ZF/KKb4LHOnRWYc5grwXtnLF5oz5CKS/UVW
	 KAm2LX/e9fP5inIJOTS+cWFcVZbwdtgoBAprG3WNgIYMVM0MDL3d+ut2FEl3ea4BrqPH9
	 CN/iuM9EA5bL9lDMfWuNP/QjklePLiLMvJbSKcSqsfsMTD3AThlHQZWb2zF1sNYd9qA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linutronix.de;
	spf=pass smtp.mailfrom=linutronix.de;
	dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=AUujUTu9;
	dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=vA+Ttn4t;
	arc=none smtp.remote-ip=193.142.43.55
X-Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55])
	(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 9686D606A31A
	for <netdev@vger.kernel.org>; Tue,  1 Dec 2026 16:49:49 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9686D606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020; t=1796143784;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=sJxxovxZGm/3of4/g49ooOTn/hlBYb6xNrJjhzhoG3k=;
	b=AUujUTu9cduHWGBscN823peaO7ChkvqocgZITqBVtksF71hlsZj6HC6bbsZxuZd7nlyRyx
	MtdcDdcz/VoVDpn7FVWD47utOLb6AlYxsLhDj08eZuY2eqYvdAmLdEGX/FKFbR/eWRe185
	m3qGOlKQIPuPXfc+buSQtP0PenaCWxK3bfP/MJxfBLjXYgZgakeV9FcQTheWKVP6oicnr+
	V582YalUe+pR4SBUfQwO/qFJzpnNfzkqY4PjFLv5gmyu4dMVlNJAumvcD++3mdoB9qV4aq
	xO6sZEG+hjCecQ/kklF59NMol0RBJl0Mik57B29ognNk9dey4JZ5lxP5HCMmXA==
X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020e; t=1796143784;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=sJxxovxZGm/3of4/g49ooOTn/hlBYb6xNrJjhzhoG3k=;
	b=vA+Ttn4tTeSj59ayRLF2PxzrEwPOoQpXrUItR1NYZbdupGCi2AEAWD6Y4sQDgKcDvb8qCE
	MGimkJUhoSBc6sBQ==
X-Cc: netdev@vger.kernel.org, j-rameshbabu@ti.com, andrew+netdev@lunn.ch,
	danishanwar@ti.com, d-qiu@ti.com, davem@davemloft.net,
	fmaurer@redhat.com, kuba@kernel.org, neelima@ti.com,
	pabeni@redhat.com, praneeth@ti.com, pratheesh@ti.com,
	richardcochran@gmail.com, horms@kernel.org, vigneshr@ti.com,
	willemdebruijn.kernel@gmail.com, daniel.machon@microchip.com,
	edumazet@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: <179611533353.3146.6294208363158546982@kernel.org>