🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #2387

Re: [PATCH net-next v8 5/8] hsr: Use the port and header information in hsr_forward_skb()

#2387
From: Sebastian Andrzej Siewior
Date: Mon, 12 Oct 2026 15:03
41 lines
8249 bytes
On 2026-10-06 14:31:18 [+0000], netdev-bot+sashiko@kernel.org wrote:
> [Severity: Medium]
> Does "deliver it only on the requested port" still hold when the slaves
> have HSR hardware offload enabled?

No, this is software only. Driver with HW offload support enabled need
to be adjusted to support PTP without duplicating packets and so on.

> [Severity: Low]
> Does this clone lose the socket ownership of the original skb?
> 
> __skb_clone() sets n->sk and n->destructor to NULL on the clone. After
> that, hsr_forward_skb() frees the socket-owned original:
> 
> 	kfree_skb(frame.skb_std);
> 
> That runs sock_wfree() while the clone may still be queued on the slave.
> The socket's wmem accounting then stops covering the in-flight packet.
> Also, skb_tstamp_tx() sees a NULL sk, so the PTP TX timestamp never reaches
> the sender.
> 
> A later commit in the series, "hsr: Assign a socket for cloned skbs",
> seems to fix this. It adds the following to this branch, and does the same
> for the req_tx_port case in hsr_create_tagged_frame():
> 
> 	if (skb && frame->skb_std->sk)
> 		skb_set_owner_w(skb, frame->skb_std->sk);
> 
> The old path through hsr_create_tagged_frame() also cloned without
> restoring the socket, so this patch doesn't make things worse.
> 
> Could that fix be folded into this patch?

No, I want to keep it separate. The skbs are simply cloned, preserving
as much data as possible and later the socket is wired up. This is
primary to get the timestamp to work.

> [ ... ]

Sebastian
Technical Details
Message-ID: <20261012150327.EafuO1XK@linutronix.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345057-linux-kernel-netdev=dewy.ru
References: <20261002-hsr_ptp-v8-5-60dabc07e554@linutronix.de> <179129707887.434549.17889821067161034900@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-345057-linux-kernel-netdev=dewy.ru
From: bigeasy@linutronix.de (Sebastian Andrzej Siewior)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v8 5/8] hsr: Use the port and header information
 in hsr_forward_skb()
Date: Mon, 12 Oct 2026 17:03:27 +0200
Organization: Usenet Network
Message-ID: <20261012150327.EafuO1XK@linutronix.de>
References: <20261002-hsr_ptp-v8-5-60dabc07e554@linutronix.de>
 <179129707887.434549.17889821067161034900@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Injection-Info: usenet.network;
	logging-data="1806419"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:7HBejVNsM6fyFDD+Lc+/povFe58= sha256:oPEc0vrro2uIpjAaMq9swJdcZKXSro8jjYqeq7ohVIQ=
	sha1:+2zy0ZT0s6LtzXOtUJn6lLzoH/E= sha256:UJvrc3OqNNvqkXXQgugl24S4IBLSEnxSWygy0jjhkME=
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 41CA210FC2B; Mon, 12 Oct 2026 18:13:47 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.75
X-Spam-Status: No, score=-0.75 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, 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=N972de9u; dkim=neutral
	reason="invalid (unsupported algorithm ed25519-sha256)"
	header.d=linutronix.de header.b=rEtO+1vJ
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 TLQn-ODj-3nP;
	Mon, 12 Oct 2026 18:13:44 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-345057-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 9310210FBA6; Mon, 12 Oct 2026 18:13:28 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id D40A138D54; Mon, 12 Oct 2026 15:03:31 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id A2E8B494822;
	Mon, 12 Oct 2026 15:03:31 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="N972de9u";
	dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rEtO+1vJ"
X-Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55])
	(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 5FC1149363A
	for <netdev@vger.kernel.org>; Mon, 12 Oct 2026 15:03:30 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791817411; cv=none; b=KGCCksjh5Yx2RfNomMrcNufy5TSPtI8dQVLAsOFHUIiMiv+u5MRsH4o3gePMFUDPaEbm9a8RoPyPtoeg4rWmjknuYnwt4K7BOXC82xtf6e3AlnAseC6N3DSkF6Hrdof0lD4Sdx36AQ9Q4WqPhFhb7zOdt78GWsZBOT+aW9rpyOY=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791817411; c=relaxed/simple;
	bh=VRPCFC2K7YxHlV93gUE0PcTL4lpH7r/Q8ZbdXHcnU+w=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=DfwrFf3PKVJppP7KIeIIhBwkul0OWlBCUHPG6nZpZVKGRKlloiXv2dlv9Kb3ITo3BKC7weFwBIp+0HOfOXXJI1o8W9c1k8aMcl/jLzuJ5lVuz1Lg1+h0WpT5urx0k61arKXJLMw7lvul9Ro+/T9jncTwJA5r9Vs4cznjwSc6udc=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=N972de9u; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=rEtO+1vJ; arc=none smtp.client-ip=193.142.43.55
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=1791817408;
	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:
	 in-reply-to:in-reply-to:references:references;
	bh=kzDEXNkTU/qRVrG5He5x4EzP3MIDqGgFo0zhmDlNxQc=;
	b=N972de9uh57AWya3JNI+Oki4NAU9LLXLV9nPz9pgiZRtILIFFU8NbzFH4OQKw0+rdbBHqS
	g7VqOfkB09WyYBOAng8qnXFnfLZOJEz7YOLHIIkMDyCjw06XVW0nDsCKcxMkFBHWp43yFr
	3k4rDxTLM7OjTUo9IKEfbuEca3KI2LVqjOLlhWyy8HLAAqnMsicAi6+A6zBGMPg6VCydUV
	Z4of8iyaqhyxISdTXMjMRKQLT/KlED5NPGgb7DR81AtkO7wB+CyYi23KXXV28RQ0FJkkj8
	jP3n1I3VyCgjnvtuNXJsoEpHPpmfRTbvU/6sokNuFKz5KbtRHFg2yMfQK6LhyA==
X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020e; t=1791817408;
	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:
	 in-reply-to:in-reply-to:references:references;
	bh=kzDEXNkTU/qRVrG5He5x4EzP3MIDqGgFo0zhmDlNxQc=;
	b=rEtO+1vJqjFhRzYP4aAVAH7+8YcHidjIW7mSY+kmXXmQrjLzdA1kGgetZCfRDfN+AjN5Jj
	pxWzH2IkDy7G50Cw==
X-Cc: netdev@vger.kernel.org, j-rameshbabu@ti.com, andrew+netdev@lunn.ch,
	c-vankar@ti.com, danishanwar@ti.com, d-qiu@ti.com,
	davem@davemloft.net, edumazet@google.com, 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
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <179129707887.434549.17889821067161034900@kernel.org>