🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #270

Re: [PATCH net-next] net: ag71xx: align the IP header behind DSA tags

#270
From: Andrew Lunn
Date: Wed, 07 Oct 2026 18:27
27 lines
6702 bytes
On Wed, Oct 07, 2026 at 10:44:49AM -0700, Rosen Penev wrote:
> The receive buffer offset includes NET_IP_ALIGN to get the IP header
> aligned behind a 14 byte Ethernet header. Most ag71xx devices use DSA
> switches whose tag sits in front of the EtherType, which moves the IP
> header by another 2 bytes. Every access to the IP and TCP headers then
> traps and gets emulated by the unaligned access handler, around 6 times
> per forwarded frame.
> 
> Take the headroom needed by the DSA tagger into account when choosing
> the offset.
> 
> TP-Link Archer C7 v2 (qca8k), median of 3 runs, Mbit/s:
> 
>                        before   after
>   routed up               743     855
>   routed down             660     749
>   local receive           554     572
> 
> The unaligned instruction counter no longer moves while forwarding.
> 
> Assisted-by: LLM
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Technical Details
Message-ID: <d89d6b2f-3ff3-4f76-9b77-7e59d16ed482@lunn.ch>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342454-linux-kernel-netdev=dewy.ru
References: <20261007174449.671416-1-rosenp@gmail.com>

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-342454-linux-kernel-netdev=dewy.ru
From: andrew@lunn.ch (Andrew Lunn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next] net: ag71xx: align the IP header behind DSA tags
Date: Wed, 7 Oct 2026 20:27:50 +0200
Organization: Usenet Network
Message-ID: <d89d6b2f-3ff3-4f76-9b77-7e59d16ed482@lunn.ch>
References: <20261007174449.671416-1-rosenp@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="709667"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:WHGLiHir1Y/EHI9w5ihfGO0ioyA= sha256:cLKeFhzIKRzVyk/eGJ2byccPm0X5RlRfA/u0K+7mt6M=
	sha1:48Z0uKvyMFGFOnfq2QFGrmMoje8= sha256:VxfuagP+7kr1lRbSaXETvya9gSVkxrqlU0IdUtsB3tU=
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 5584C10F1F0; Wed,  7 Oct 2026 21:28:18 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.15
X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31
	tests=[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,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=lunn.ch
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 koxRuQZiqLRa;
	Wed,  7 Oct 2026 21:28:15 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-342454-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id ACBA110F1C5; Wed,  7 Oct 2026 21:28:10 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sto.lore.kernel.org (Postfix) with ESMTP id AF0DD603D3A; Wed,  7 Oct 2026 18:28:09 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 7FE5C4DAF89;
	Wed,  7 Oct 2026 18:28:08 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="dTdaCHyx"
X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101])
	(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 B1A32430CCA;
	Wed,  7 Oct 2026 18:28:06 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791397688; cv=none; b=cfrUZQGzmCzIFUJOpeazRea6bAQG47klEKDpGMcFwNi6MWT/mx+Z0/VQQAYVmt5tvL7RP774uCO3Ill1/IBNjAcNlxJpH4IfJZtTpmtMcVkxPU09rYSGemUPXINRUinr0aeX4Nyam193bW7+/OYV0ZzqTENZa/VvbyaIbIB2p+s=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791397688; c=relaxed/simple;
	bh=6nJnWIVkp3NZzdOu95QF+LRXEa3N0wPLCRO69S6Nuls=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=Lg5Svjw8gIhbcKd87IPrvDUemIM9UaPIKN0FFtVf5naE3grQKV7ieTQETb8AiCLku8RCwsxI/osaNM+DmlJUf+ftC//c5dXmtw8HYZXcDZYUmlbuVkDB7fn6+xVPXOAyr5JsVnPsIMyHxNBEce2cvW53wB1O+88gtsfCvFxgB4E=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=dTdaCHyx; arc=none smtp.client-ip=156.67.10.101
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch;
	s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject:
	Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:
	Content-ID:Content-Description:Content-Disposition:In-Reply-To:References;
	bh=fI1D+NI+FFsPEpv4UzZGCRSeI03RhqdghV6rGdRdVg8=; b=dTdaCHyxa4m8zFBwMVBpkRU1z+
	fhyOKKVl5xzg5WTweCROZKAxp0QHE+Iv4wCRNWUSm5/KnjXar/mee8WJFpeylZWXjWIjSewg3I9xm
	m2W0a2vXWuXYsDaLkFe3UGlUKQgAwSquHXf8W6/1jHTFNnXV2XOikEa5ss183Yh+ol3Y=;
X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2)
	(envelope-from <andrew@lunn.ch>)
	id 1xEWMo-009V4g-83; Wed, 07 Oct 2026 20:27:50 +0200
X-Cc: netdev@vger.kernel.org, Chris Snook <chris.snook@gmail.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	open list <linux-kernel@vger.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: <20261007174449.671416-1-rosenp@gmail.com>