๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23110

Re: [PATCH net-next v12 6/8] hsr: Assign a socket for cloned skbs

#23110
From: netdev-bot+sashiko
Date: Thu, 26 Nov 2026 14:40
86 lines
10938 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] This patch adds TX timestamp delivery to HSR only, and it relies
  on a uAPI that does not enforce that limit.

--

hsr: Assign a socket for cloned skbs

This patch assigns the original skb's socket to the cloned skbs in the HSR
forward path. With the socket set, skb_tstamp_tx() can deliver the TX
timestamp to the sender. The commit message says PRP is not covered.

> diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
> index 1d1d75ed8cd06..9cb3297a8640a 100644
> --- a/net/hsr/hsr_forward.c
> +++ b/net/hsr/hsr_forward.c

[ ... ]

> @@ -347,6 +348,9 @@ struct sk_buff *hsr_create_tagged_frame(struct hsr_frame_info *frame,
>  	if (!skb)
>  		return NULL;
>  
> +	if (frame->req_tx_port != HSR_PT_NONE && frame->skb_std->sk)
> +		skb_set_owner_w(skb, frame->skb_std->sk);
> +
>  	if (port->dev->features & NETIF_F_HW_HSR_TAG_INS)
>  		return skb;
>  
> @@ -582,6 +586,8 @@ static void hsr_forward_do(struct hsr_frame_info *frame)
>  		 */
>  		if (frame->has_hsr_header && frame->skb_std) {
>  			skb = skb_clone(frame->skb_std, GFP_ATOMIC);
> +			if (skb && frame->skb_std->sk)
> +				skb_set_owner_w(skb, frame->skb_std->sk);
>  			goto inject_into_stack;
>  		}

[Severity: Low]
The commit message says:

  "This does not consider PRP part of the stack."

Is the PTP inline header actually rejected on PRP devices, though?

hsr_ptp_parse_header() in net/hsr/hsr_device.c does not check
hsr->prot_version before it accepts the inline header. A PRP master
therefore still accepts req_tx_port and has_hsr_header.

On PRP with has_hsr_header=0, prp_fill_frame_info()->handle_std_frame()
sets skb_std. hsr_forward_do() then calls prp_create_tagged_frame(),
which this patch does not change:

net/hsr/hsr_forward.c:prp_create_tagged_frame() {
    ...
	} else if (port->dev->features & NETIF_F_HW_HSR_TAG_INS) {
		return skb_clone(frame->skb_std, GFP_ATOMIC);
	}

	skb = skb_copy_expand(frame->skb_std, skb_headroom(frame->skb_std),
			      skb_tailroom(frame->skb_std) + HSR_HLEN,
			      GFP_ATOMIC);
	return prp_fill_rct(skb, frame, port);
}

Neither of these copies has a socket, so the requested TX timestamp is
silently lost.

On PRP with has_hsr_header=1, skb_std is still set. The new
skb_set_owner_w() in the has_hsr_header branch of hsr_forward_do() then
runs, and the timestamp is delivered.

So on a PRP device, the HSR-only has_hsr_header flag decides whether a
timestamp comes back. Should hsr_ptp_parse_header() reject the inline
header when the device is in PRP mode? Or should
prp_create_tagged_frame() also assign the socket, so that both cases
behave the same?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261125-hsr_ptp-v12-0-9ddd2a73cb90%40linutronix.de
Technical Details
Message-ID: <179570404077.3135.7555640745657662716@kernel.org>
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-372154-linux-kernel-netdev=dewy.ru
References: <20261125-hsr_ptp-v12-6-9ddd2a73cb90@linutronix.de>

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-372154-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v12 6/8] hsr: Assign a socket for cloned skbs
Date: Thu, 26 Nov 2026 14:40:40 +0000
Organization: Usenet Network
Message-ID: <179570404077.3135.7555640745657662716@kernel.org>
References: <20261125-hsr_ptp-v12-6-9ddd2a73cb90@linutronix.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="487406"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:EzQt4cKlQAb1/VfSKrmncj+sy6A= sha256:mEJpKSuwUylyyQrlJgkIg5GlRPqbS03dRiKscKYy9/Y=
	sha1:+C6QlfuFWEFFIU/UZtzKQWz0vEM= sha256:ZJILCqPFmlncwggIx1XgOKrArdUWC/V3Qk9kHhSkddk=
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 15FE1125EE0; Thu, 26 Nov 2026 17:41:04 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	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 (2048-bit key)
	header.d=kernel.org
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 TQk2Z5cnd_r8;
	Thu, 26 Nov 2026 17:41:00 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-372154-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 3A605125EDF; Thu, 26 Nov 2026 17:40:52 +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 666C42FA99; Thu, 26 Nov 2026 14:40:43 +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=1795704043;
	b=Jtjx+RWcaOqLJkccpvqfr95nt8DpZ4OJyhMhdv3it9pNiEQMmvgIwvFIpBUVCz4vFnne
	 VCkxgp3UF67iUlZbwyiDTn97sVZsRPq1wLUdOHGVBhtxAAdimRP8WEn0wGqMsoA3sWCYg
	 0RzmZ3VQgXbC0KA9Xgqq76/CbMXelEiljvcUenEapLzE1PAcSJUSMVyJMelw2zEvo7AGR
	 nrKCIYBbfIJncjX1xw0XCKxZZARP8UCtIg2qgpmYqnU+zoOaqNjJWRPkIz8mcTGNi+oT5
	 /Ch63ftqZtKoHs6ZArm0ZRbVwB7Vj0OUVMwRzw9s3YSK609dHGo4YAzKdPitl6uljBQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795704043;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=/2qPKL+7KZnDNSN4QH7Uai6RQNsqaTfhlTadJVfJFiI=;
	b=pg48mK1gvDrBxm2vjDtvQPe0hjtwT7lQQOj123U5lmKXLeZE5ssjPyow8/kddxZa+xNm
	 yVRJQOiokboNlSlS1pOzpGVFf6kokaZNCIDcnW4eEuol+dOMCljWNyLrGhs9XBpYU35+q
	 m5RxXTIHm4ueHAnUrU9faeXLA53anDie8tFNGogjMWCZQvunxyi9Lw+XrO+Ie0V4I+B+B
	 djdhwu5kwWQIkUD/WTZ+aVdDVzv+WOFmnZGtsDX2paBjiYCjeNoStn4B+vd2rwLmwlDPQ
	 8drfJdgsGcBI+piqqEwurodR2UnpA2tkG5u8vDSYV4DpsT9UyHOy+sxePHT8PKRZ4VQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ODzrDAtF;
	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 3DC1B606A32A;
	Thu, 26 Nov 2026 14:40:43 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ODzrDAtF
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795704042;
	b=n+GyqKP5ed6KlU5rLWk9aU9zNTS35YhhMMfpNVsGnyYJ0oAmcPaB6OA+yD6+o2UkXFZP
	 /8mOHXznc148MkFYo/v6ND14fM7T69z7lFyw7PpWGtjj9ExK1soPvZ7EgDIOOUn0ETGlo
	 WJb8H32m5EXZEzOIIA9Yg2ulFd69stA7j/P6Dsem4F7i76fcdn4yOKS7qa9S59duHogAv
	 qSe3yKASO+xWUTdihkp7YyqQD+fNGHTBZ445euYxXCDaM6wrDUoX82XEVsh0KjQZyQAGR
	 cPd3BWgOSbT0MoXpqfUvN6fIir6aHd2NDPtv+WNd1Ur6NipNZnnozGqiV9avzzvtbJw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795704042;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=/2qPKL+7KZnDNSN4QH7Uai6RQNsqaTfhlTadJVfJFiI=;
	b=l9gr90VymphuyTr/j4HAlc8vIrV/jmRUG/GHFlWnJKd6i+mwd1jDX4vmVUYku9X78knL
	 manj2NCYh9GA4+Y8ibiGZkYpkEzgXog4vYwZjG61SsVcd37vRE2YTa49EBrYA8VNmSxrp
	 UHvRrXFYGaQFCgQJssBjvFfDS2H9M8/7vLHjqYqHBVYe6Ap3U1e0HkaPR/gIDIR6lLdQv
	 MoBQkQZR9jqjbGmiIINtL5oeXBNInU1wKbHM2LEfsSM9QcM8siVwoqws8C6hJT53+UPO8
	 5BuIx/i4U49XySfh6crxzxG4pZkbH87mhfaENyM3i0pDZx2izSj8LzKGz+Cle2GeWkA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=ODzrDAtF;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D950606A336
	for <netdev@vger.kernel.org>; Thu, 26 Nov 2026 14:40:42 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3800D1F000D2;
	Thu, 26 Nov 2026 14:40:41 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795704042;
	bh=/2qPKL+7KZnDNSN4QH7Uai6RQNsqaTfhlTadJVfJFiI=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=ODzrDAtFsB00mtHW37Rf6IOSA4r6fTQldz0yKzIa8QnRsUQVfmoq7uIzOddC0N90d
	 15TImb2q1XndvdKsCE5qodbeeyNriPGntuWPi/+0bBwEplkry5CBUWskOv8ZMFGz1R
	 Zm+e/EVShuPxaCQLTD4QXajOLIStOpqmxAwIhV2j+wiIE58wmtoeLH4EkyjDsMTUe0
	 FZ61sRE1OyzKcp21DUP6Vz6gS1cvABBIBgSBXXFlfgi8JR7W8LaAuu1GYgPOOb29KX
	 PMHc9zbK1OhSebQAninkRXm+ivkPKDNfcXVw1t+Aw5tT76lhFu/WL2G1BUQtK8JUIM
	 i4aV2SfFa58cg==
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-In-Reply-To: <20261125-hsr_ptp-v12-6-9ddd2a73cb90@linutronix.de>
X-sashiko-severity: Low
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