🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #19749

[PATCH net-next v11 7/8] hsr: Move struct hsr_ethhdr to a global header

#19749
From: Sebastian Andrzej Siewior
Date: Fri, 20 Nov 2026 10:17
58 lines
11403 bytes
In the offloading case the network driver needs to inspect the HSR
header to find out if the encapsulated type is a PTP packet where it
needs to suppress offloading of the packet.

Move the header so it can be included by the driver.

Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 include/linux/if_hsr.h | 6 ++++++
 net/hsr/hsr_main.h     | 5 -----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/linux/if_hsr.h b/include/linux/if_hsr.h
index f4cf2dd36d193..d0773a60c4fd0 100644
--- a/include/linux/if_hsr.h
+++ b/include/linux/if_hsr.h
@@ -3,6 +3,7 @@
 #define _LINUX_IF_HSR_H_
 
 #include <linux/types.h>
+#include <linux/if_ether.h>
 
 struct net_device;
 
@@ -38,6 +39,11 @@ struct hsr_tag {
 
 #define HSR_HLEN	6
 
+struct hsr_ethhdr {
+	struct ethhdr	ethhdr;
+	struct hsr_tag	hsr_tag;
+} __packed;
+
 #if IS_ENABLED(CONFIG_HSR)
 extern bool is_hsr_master(struct net_device *dev);
 extern int hsr_get_version(struct net_device *dev, enum hsr_version *ver);
diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h
index 53e95bae0ee27..36eb82774000c 100644
--- a/net/hsr/hsr_main.h
+++ b/net/hsr/hsr_main.h
@@ -72,11 +72,6 @@ static inline void set_hsr_tag_LSDU_size(struct hsr_tag *ht, u16 LSDU_size)
 				       0xF000) | (LSDU_size & 0x0FFF));
 }
 
-struct hsr_ethhdr {
-	struct ethhdr	ethhdr;
-	struct hsr_tag	hsr_tag;
-} __packed;
-
 struct hsr_vlan_ethhdr {
 	struct vlan_ethhdr vlanhdr;
 	struct hsr_tag	hsr_tag;

-- 
2.55.0
Technical Details
Message-ID: <20261120-hsr_ptp-v11-7-264c88f4f1d0@linutronix.de>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367852-linux-kernel-netdev=dewy.ru
References: <20261120-hsr_ptp-v11-0-264c88f4f1d0@linutronix.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367852-linux-kernel-netdev=dewy.ru
From: bigeasy@linutronix.de (Sebastian Andrzej Siewior)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v11 7/8] hsr: Move struct hsr_ethhdr to a global header
Date: Fri, 20 Nov 2026 11:17:03 +0100
Organization: Usenet Network
Message-ID: <20261120-hsr_ptp-v11-7-264c88f4f1d0@linutronix.de>
References: <20261120-hsr_ptp-v11-0-264c88f4f1d0@linutronix.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="3131468"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:unW/Zfi1LF9YuFLpvjdptcR/f2Q= sha256:fhnDda5F+6sE4aTJhMdNqitHqsh3TbdpfcqZXswZJHg=
	sha1:J1zWb6GTM8aFnLvxZkH3loD9pXw= sha256:TvpL1+BoT+Knustg0k4YJO7D36j5A7sjBkiRwF5D7bc=
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 6E672115947; Fri, 20 Nov 2026 13:17:51 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 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] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=linutronix.de header.b=UQ8h+bem; dkim=neutral
	reason="invalid (unsupported algorithm ed25519-sha256)"
	header.d=linutronix.de header.b=CB6NFeCp
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 aGD7oRD-wXlv;
	Fri, 20 Nov 2026 13:17:48 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-367852-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 CBF94115945; Fri, 20 Nov 2026 13:17:34 +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 014093666A; Fri, 20 Nov 2026 10:17:27 +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=1795169835;
	b=5OfUHlXkaeNKXttUjw4vCQu/9J84on/7nol2mRns3gRfl+zilK8UGZuQAAvSYLltC6L9
	 KBFibJt2MxLpZqpFgL5W0AtCKjxPZPHmARNLfOTKx8YFEEP6QZg7lSCStIVunAmDjDiHn
	 3HD4ueOOTum6KeC8ACbC5Ry3MjETQvXLOFzdO5H7amFlGm+10Tc7XS3/AiD2FZCVuL1UE
	 KnNjJyrpjNdfU4apVRt0XNFpB8sXTBggayDSnBQQPWZB6lvZY7G4t9Hv/xEkSoQd0K9Ej
	 5pe4tF18DJahb6CRRBPRBu7XpHjO7uBg8XHhD9ZG7jo5CuT3n4ZPUyXWt1HCASlt7Bw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795169835;
	h=X-Original-To:Received:DMARC-Filter:From:DKIM-Signature:
	 DKIM-Signature:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=I+G+ZDFPb4FfbpdCyFfeOwCDzp3rlKHbt4LCLi1AOSE=;
	b=4wjT7JSfXyEgl9DvPalQwo3daMUojuRoqudcAIkDjFC7JCsDZjJfUdbxQQguLbaKhnJE
	 KA24EnCm9CU2TBpDzSNeuSFdAxSlISRS8Q0wcbaNl4hLRId3txDHRVn3C9vHOAZMbp2C0
	 TRZPwuULY9d6glxm2ZKoe8yxd+5xos4ZHU4eY+hQZ7i4qTiKrDShbeKBSawCOZToysZc3
	 H/yeU09Y3JkqEEYWM4TKhGT3QmZKBPvGK34BDvaijF/hKHFAcZxl4YpcCfA9RrC9uk3Fd
	 0zbwPMLhkB9QtuLbWUtDAr/GqwpakhyxOK8OySs+HRao3tCufbh4ePSxwdMstOZGLMw==
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=UQ8h+bem;
	dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=CB6NFeCp;
	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 4030D60A263E;
	Fri, 20 Nov 2026 10:17:15 +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=UQ8h+bem;
	dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=CB6NFeCp
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=1795169834;
	b=rxMGAsAmqiahcFZPbEqIFCuRzGvHjEJI1CTqS/JMZ1EGhW/GTzGT/gxeCH4c94nPRL7b
	 sSo6jslioLLFnrovD9xSNKOE/0JND6B67VyFbf8rSKn0sbxAnmEUu52Iu8nkw4tVae1LJ
	 53VOTJfyxixudAeJf9rT/WvnqYrAWz7QbdLNJ0lgje8WDTsyqfVoy1nz9v6obmfUhAFLx
	 9VkOTeSjrt1P9k5D5ALt8C+gwWzbpsbi/9S68m0BuPCxdmjB8x+iEQLDrB5F6W7xJWpou
	 kXwjwkF9xO5bmkDZ/oqRmv5hV/RPYo1HCmswXME4xGHp4XQ6e+Q2bOewnCLG25Wpzng==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795169834;
	h=DMARC-Filter:From:DKIM-Signature:DKIM-Signature:To:Cc:Subject:Date:
	 Message-ID:In-Reply-To:References:MIME-Version:Content-Type:
	 Content-Transfer-Encoding;
	bh=I+G+ZDFPb4FfbpdCyFfeOwCDzp3rlKHbt4LCLi1AOSE=;
	b=BGb4n9PQ1ik+kR4lsDr37sq55Q4lxPRClJYJxQkTM7bQRPuVQTD/3xq1KkRcI+m1XzRW
	 b94Jn9GPnDIya9EWEgyVkYyAFVlRDe14kLYY9vqpCGDaMsDqDeXHA0SqW4jUJrZLwGk1v
	 8hwmJIZyctKfjsooDV2DLsLx2w01JmsVxiZWyk8p7az7Enmw3SGxB2cJKCUCd9aC9EVCp
	 lFErS1vTteAgqwwfxrG77dWQ1rSaU7FaDHIetKkVS08Hw+Ple61Y2zl4EuSKfBfLTmZjC
	 bdsp67tyjAxEOhrmXqABsDd0RW8l9vsDkBejLvHdCASmChru9NTq72FOqChLrs+WGMw==
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=UQ8h+bem;
	dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=CB6NFeCp;
	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 EA69660A261E
	for <netdev@vger.kernel.org>; Fri, 20 Nov 2026 10:17:13 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EA69660A261E
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=1795169831;
	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=I+G+ZDFPb4FfbpdCyFfeOwCDzp3rlKHbt4LCLi1AOSE=;
	b=UQ8h+bemGtY36PCcK94KetuI0oZzgsVVYZEdbr0Cuj4ApXlywvsAIdq6+ULYAghwWMfxZ5
	nuw4uyy5v1QAT/oPOR7ehO/baq0Gz6//MsFUCL1oM8VcstcwQbvrWU6BgQKJPUDbu/Be94
	yWihB2WQXBHfmPafOhSE0jU+LtwRDpheN9GsCJKbk+gQEEOJxiEUSTwZMkynL4HuP/kOVx
	CZIdk72NaKsK0gjoSH6kYnKEpmuyv4DlN+F/Pgjklot0YbOIDzXrcapg/whgkmPFLFKnKe
	qqQvU6IIaMd5LH4xOcyv8I5HLKuJEuZM33eGBiSzv96n4NsPLpKM8qLRbgF7dw==
X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020e; t=1795169831;
	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=I+G+ZDFPb4FfbpdCyFfeOwCDzp3rlKHbt4LCLi1AOSE=;
	b=CB6NFeCpP/W265hQuyVeMDuURDtXNPdKwRQGDzY9/c/SPSW9NXrhHIyCs+VVYD536M1q/p
	F/7xBPdwXruPfhDg==
X-Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	"(JC), Jayachandran" <j-rameshbabu@ti.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	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>,
	Daniel Machon <daniel.machon@microchip.com>,
	Eric Dumazet <edumazet@kernel.org>
X-In-Reply-To: <20261120-hsr_ptp-v11-0-264c88f4f1d0@linutronix.de>
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