🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #4939

Re: [PATCH net-next v9 2/8] hsr: Use skb_clone() while adding the HSR header

#4939
From: Sebastian Andrzej Siewior
Date: Mon, 19 Oct 2026 13:33
35 lines
8696 bytes
On 2026-10-16 11:41:20 [+0200], To Daniel Machon wrote:
> If this is important, I could add to the patch description. The removed
> skb_reset_mac_header() should be obvious.
> The csum_start() removal and so on was mostly sashiko complaining about
> one thing at at time and memove() got replaced with
> skb_postpush_data_move() in the last iteration which I just learned
> about myself ;) That looks like a nice clean up.

Updated as:

| hsr_create_tagged_frame() creates a new skb where the HSR header can be
| prepended via __pskb_copy(). This does not copy the skb_shared_info part
| of the original skb so any timestamp request is lost.
|  
| An alternative is to use skb_clone() where the skb_shared_info part is
| shared and then skb_cow_head() to make the header part writeable. This
| avoids touching manually the tx_flags and tskey members.
| Using skb_clone() allows also return early (after the clone) in the
| offloaded case so this can be unified a bit.
| The clone case does not need manual adjustment of sk_buff::csum_start
| because by using skb_cow_head() the head does not move relative to the
| payload. Should the head need expansion then pskb_expand_head() will
| move it and update sk_buff::csum_start accordingly. The clone also
| preserves metadata (if available) so skb_postpush_data_move() is used
| instead of memmove() to move both. Finally skb_reset_mac_len() is added
| to set the new length of the header after expansion.
|  
| This is a preparation for PTP handling where timestamps are requested.

Is this better?

> > /Daniel
> 
Sebastian
Technical Details
Message-ID: <20261019133348.Mp_8923i@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-348551-linux-kernel-netdev=dewy.ru
References: <20261014-hsr_ptp-v9-0-2d20a2a0f816@linutronix.de> <20261014-hsr_ptp-v9-2-2d20a2a0f816@linutronix.de> <20261016090940.a2ztkv6p3wtysk57@DEN-DL-M70577.microsemi.net> <20261016094118.Mq6pgtly@linutronix.de>

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-348551-linux-kernel-netdev=dewy.ru
From: bigeasy@linutronix.de (Sebastian Andrzej Siewior)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v9 2/8] hsr: Use skb_clone() while adding the
 HSR header
Date: Mon, 19 Oct 2026 15:33:48 +0200
Organization: Usenet Network
Message-ID: <20261019133348.Mp_8923i@linutronix.de>
References: <20261014-hsr_ptp-v9-0-2d20a2a0f816@linutronix.de>
 <20261014-hsr_ptp-v9-2-2d20a2a0f816@linutronix.de>
 <20261016090940.a2ztkv6p3wtysk57@DEN-DL-M70577.microsemi.net>
 <20261016094118.Mq6pgtly@linutronix.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Injection-Info: usenet.network;
	logging-data="3617124"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:hrZLQvvrr+iQOzn/36hBk/1eeWQ= sha256:BiWM6k65L+/TL9x82NpCzCvU9JVHR50nulmvqqXWFb4=
	sha1:ZxoYh4u6+FojXUsW9eRVuDlYdWQ= sha256:PMOKuiZ01Ynd/g9j8pjs6AMaacn3hi6mO2Lzet1YQaw=
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 DF348110A0D; Mon, 19 Oct 2026 16:48:34 +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.25,
	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=linutronix.de header.b=bbgT4HHt; dkim=neutral
	reason="invalid (unsupported algorithm ed25519-sha256)"
	header.d=linutronix.de header.b=EYzJeIA5
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 sPNFGBO5fSym;
	Mon, 19 Oct 2026 16:48:29 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-348551-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 04F27110A09; Mon, 19 Oct 2026 16:48:16 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sin.lore.kernel.org (Postfix) with ESMTP id CC20B33725; Mon, 19 Oct 2026 13:34:32 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 3632F4F68A3;
	Mon, 19 Oct 2026 13:33:53 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="bbgT4HHt";
	dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="EYzJeIA5"
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 C74A94F5DF7
	for <netdev@vger.kernel.org>; Mon, 19 Oct 2026 13:33:51 +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=1792416833; cv=none; b=s/Wpqeb5wNegLwQIz+V0olF4Y1ksCMtJL4FkHUQQ0JDnQ74hKFOpxjpC7cMwaaydZcN2zxEz0oGvBecKl92pCZOVPT2PvLcbN3R0pz1g/uCE0MtoB9fTfkk29ZYciqxzgp+nF5nwHaAPUf4UFz4c1qmF0SpccT6W+LQuley9h/8=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792416833; c=relaxed/simple;
	bh=EvuQ5/ZmAOkpURpwGLFG8ZUesxUOZy5+XlwsFsXO7Lo=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=eih5n31/gDs6gN99N0qB6TyC/mGgzuT39vbkeLgwGTdaYgJ0dVVT3Maem61hdpaZTacYwBdN1uLwNQ3QWdhQE9E9js7iG68IuODPVXDGCG96TU9hIyXzgtk5W3GS0S1fgbPxZbJp+7q8iUOjPpsawgvcYl7menYJCrMsSurAsUw=
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=bbgT4HHt; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=EYzJeIA5; 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=1792416829;
	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=Qnq+bsMRivn1fuUpeza/2gvb0so3pEDLMOaIAJ1Ax4Q=;
	b=bbgT4HHtB7bx94a6uCMMIYXeWYpP+7rKPi68PLCxMhNIO65pwsGBXSv5mz/mrh9frJQ4z1
	brscXg6CvB9AFrmq+hP7mqNf33Y8uYTlSgmYUiv2tOWJa389w5YQZmN9H64smq+gKXXxc0
	cQyxilNOkz8xPMw69NHSmjATQIujFhs267wayCwcdJpgajzmXSL6OxCzlrj7j9dmz8Li9g
	VMaKjvuAQMTPwqDwXOKzTDeqWS0OfkpMACYgsKoqVI/6rMTiWmPdmpCKKdXxDlmtAt4Qso
	nsdPBieU+u5uz02zsZQ/i2gNJwsaXunfQpSM4aChZcPCAKrvTlYN63R0Ip+PRA==
X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020e; t=1792416829;
	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=Qnq+bsMRivn1fuUpeza/2gvb0so3pEDLMOaIAJ1Ax4Q=;
	b=EYzJeIA5gaLHrYHaSBsb/qyJ0sugYa6v65tMTApB1yUpNTwJIw2Vds+61mceM/uU5s2Unn
	zjXHKG4HtffPVICg==
X-Cc: netdev@vger.kernel.org, "(JC), Jayachandran" <j-rameshbabu@ti.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Chintan Vankar <c-vankar@ti.com>, Danish Anwar <danishanwar@ti.com>,
	Daolin Qiu <d-qiu@ti.com>, "David S. Miller" <davem@davemloft.net>,
	Felix Maurer <fmaurer@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
	Neelima Muralidharan <neelima@ti.com>,
	Paolo Abeni <pabeni@redhat.com>, Praneeth Bajjuri <praneeth@ti.com>,
	Pratheesh Gangadhar TK <pratheesh@ti.com>,
	Richard Cochran <richardcochran@gmail.com>,
	Simon Horman <horms@kernel.org>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	Eric Dumazet <edumazet@kernel.org>
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: <20261016094118.Mq6pgtly@linutronix.de>