From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=193.142.43.55 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== 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== 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 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 ; Tue, 1 Dec 2026 16:49:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9686D606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de 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 Date: Tue, 1 Dec 2026 17:49:43 +0100 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== 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== From: Sebastian Andrzej Siewior To: netdev-bot+sashiko@kernel.org 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 Subject: Re: [PATCH net-next v13 8/8] selftests: hsr: Add test for the inline PTP header on HSR Message-ID: <20261201164943.L_HEOx0N@linutronix.de> References: <20261130-hsr_ptp-v13-8-598326208fc5@linutronix.de> <179611533353.3146.6294208363158546982@kernel.org> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <179611533353.3146.6294208363158546982@kernel.org> On 2026-12-01 08:55:33 [+0000], netdev-bot+sashiko@kernel.org wrote: > Critical: 0 =C2=B7 High: 0 =C2=B7 Medium: 1 =C2=B7 Low: 2 =E2=80=A6 > [ ... ] >=20 > > + 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=3D$? > > + stop_if_error "PTP header test failed (ns1)." >=20 > [ ... ] >=20 > > +check_prerequisites > > +trap cleanup_all_ns EXIT > > + > > +setup_ns ns1 ns2 ns3 > > +setup_hsr_interfaces 1 > > +run_ptp_hdr_tests >=20 > [Severity: Medium] > Can the first hsr_ptp_test run send its frame before the links are fully > active? >=20 > 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 aft= er > setup. >=20 > 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: >=20 > net/sched/sch_generic.c:dev_activate() { > ... > if (!netif_carrier_ok(dev)) > /* Delay activation until next carrier-on event */ > return; > ... > } >=20 > The hsr master's carrier also only follows the slave operstate, which > linkwatch sets. >=20 > 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". >=20 > 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