🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #10399

Re: [PATCH net] net: stmmac: set XDP metadata length on the page_pool RX path

#10399
From: Nicolai Buchwitz
Date: Tue, 03 Nov 2026 13:47
39 lines
10248 bytes
Hi Lorenzo

On 2.11.2026 12:46, Lorenzo Bianconi wrote:
> stmmac_rx() initializes the XDP buffer with the metadata area valid, so
> an XDP program can reserve metadata with bpf_xdp_adjust_meta() and 
> write
> it in [xdp->data_meta, xdp->data), for example to export the RX 
> hardware
> timestamp obtained from the metadata kfunc. When such a frame is passed
> to the stack, the skb is built in place around the same page with
> napi_build_skb(), but skb_metadata_set() is never called.
> 
> napi_build_skb() clears skb_shared_info up to dataref, which includes
> meta_len, so skb_metadata_len() stays zero. The stack and TC BPF then 
> see
> an empty metadata range even though the bytes are present in the skb
> headroom. The AF_XDP zero-copy path already records the length in
> stmmac_construct_skb_zc().
> 
> Record the metadata length after reserving the headroom and adding the
> frame data. No copy is needed because the skb is built over the buffer 
> the
> XDP program wrote to. With the length recorded, the software VLAN
> stripping path can move the metadata together with the MAC header, as 
> it
> already does for zero-copy frames.
> 
> Fixes: e3f9c3e34840 ("net: stmmac: add Rx HWTS metadata to XDP receive 
> pkt")
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
> ---

> [...]

Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>

Thanks,
Nicolai
Technical Details
Message-ID: <3ab1926864137534eac81371ccadf3e9@tipi-net.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-355658-linux-kernel-netdev=dewy.ru
References: <20261102-stmmac_meatada_pp_path-v1-1-d93cc4f9a864@oss.qualcomm.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-355658-linux-kernel-netdev=dewy.ru
From: nb@tipi-net.de (Nicolai Buchwitz)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] net: stmmac: set XDP metadata length on the page_pool
 RX path
Date: Tue, 03 Nov 2026 14:47:49 +0100
Organization: Usenet Network
Message-ID: <3ab1926864137534eac81371ccadf3e9@tipi-net.de>
References: <20261102-stmmac_meatada_pp_path-v1-1-d93cc4f9a864@oss.qualcomm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="3179569"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:cx5wzzn9xjqGHZIf/y4ubQ9DYD0= sha256:rtQklvn+VX/Ay5/eaDNvrY6sFW5KHd/+VObklqyEUFk=
	sha1:g2ECB8oMI1ryQr+sVrYvt832o34= sha256:7ruJixkXql5w+X5myAaumM9WdJEO4u6Mj/rhwTPq1mo=
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 A038F1128BF; Tue,  3 Nov 2026 16:56:42 +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=tipi-net.de
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 Q9W-KAon4ItH;
	Tue,  3 Nov 2026 16:56:39 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-355658-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 42777112806; Tue,  3 Nov 2026 16:56:30 +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 86BC234D0D; Tue,  3 Nov 2026 13:47:58 +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=1793713677;
	b=reLdHgvyCoaJHMJmjRk0qy/IkzeOOGMAj/JuiPHSpDdyWO0Nccgb6KkB8ZfN6Ay1Xt3t
	 G5FFRWhp0UtzFrp6JMKHxRYo7seDWYXlP/wFOLUJt5axS33JaFvc/r0u0O6Vg8NAmAHoP
	 LGC/6SZbBir9cxiZjNfcm5V2wGCyu12OGkIia6ktJO1M3Q+cj6ZhYoQIB7SNQQupJ2L5K
	 m9PGmTNhnN/pSyk+TlHadU3x+zMUPuWRJyBJJ0fZFc6znYZ5ntJ8fu98QxuhS6/VzMhOu
	 wqUUrPEB64rUed4YnP4BB2JcYueGWgzs5+8aRuf1p/S81wBtS5GUfg+cHYLCz6Mw68Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793713677;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Date:From:To:Cc:
	 Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type:
	 Content-Transfer-Encoding:X-Last-TLS-Session-Version;
	bh=bUoP3KIGCAm0xwt3Z15aBvbUhr08siqGySkpr9jx0II=;
	b=cXpbzrVvnkRZwhFuMjDCzujlKSiH/njETM+XT1ZYcFaX9SC30uuuJ2i8718bEdcwsPqs
	 iA4OECkhfzM5m2uZeFaBQiCx/aS0doP56DR7+H79wOS5j+d2+tggjOMtKTAE063XiipSK
	 JGplOwq6W8IkiPzS/i6KPxM1rYtQbIGD43OtB+NO2sJ7OMTYyZJ7HWmGG1Kxt59/Khl5d
	 7dZLDXXyxYdooZuqH7UyzDUvqUJ2279VpvVLIuBZxQSVavywBkJ2UCbuWtjJZltmhVYXK
	 hXefU9tdh+dUjVq+c5jZDKZ9fEduSuMAhdfoMDCRDZ0WMgnip2+ZwwunzIc0djoO9Cg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b="ESvA4/Jp";
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.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 399C0606A332;
	Tue,  3 Nov 2026 13:47:57 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b=ESvA4/Jp
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=194.13.80.246
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793713676;
	b=sKfCh2Gvx1V/ipd0Gmi81veNhX5TvMu/DOmIkgEdIfR8n5XrT+Vx7aRzS5ObmVj1Z/EW
	 3EeDfEXWQu1pyE6ulenj4BldT8jJlcwj8nD12r7ESSnu1Xv0/cykmbKu8L+AZKn4ZoVkC
	 nv8j3MpBeg8kn09UngL+E1TVkVP005zjFEpoU9QdrXNJOCMKq26menIpTRIij3VDYFt1j
	 5bshmKeHYVWHPtkoJdlBJ9gAAqHmBhkLLMs80D6jxuI3i544VEpPdVBA/RxopZ+6aou6B
	 Bn+72CnreYlYy/ko9wuCIWz5HBJN7L+6EH8/p/2Ti5C5xOtNnQgpqjOc4BptBB6B8lg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793713676;
	h=DMARC-Filter:Received:DKIM-Signature:MIME-Version:Date:From:To:Cc:
	 Subject:In-Reply-To:References:Message-ID:X-Sender:Content-Type:
	 Content-Transfer-Encoding:X-Last-TLS-Session-Version;
	bh=bUoP3KIGCAm0xwt3Z15aBvbUhr08siqGySkpr9jx0II=;
	b=nx3Nxl3QmHMQf7UR1xpB5OkeuRc64LTUJii58Rsv2gDj/X4CSJ011xCdz4Zbn/shwrI5
	 VfKwxsHp7SNONITj+NWhA5koSmBsipL1f0CZJAcWrpFV2sRzCE5U64X1uYvcwQyAUdI3k
	 u6zOqg2ZoHcAYdfSsWC7dP88r8qkrHGCDRCvVGSNhpmBYD4SN8AdQc9qe+l8nJ5ePWcTt
	 2uu2ioauKEqvC56s88DiOu98vVRNxBdD0IDHnqBaTl0DkMeiZS5r7KGw81/YV0BGErpeh
	 uEoB9aqECXgvmOkVaN033t372ZZePkjJRnvjCNWlqILUCAOAuGJopYHFLCKot54aMUg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=tipi-net.de;
	spf=pass smtp.mailfrom=tipi-net.de;
	dkim=pass header.d=tipi-net.de header.i=@tipi-net.de header.a=rsa-sha256 header.s=dkim header.b="ESvA4/Jp";
	arc=none smtp.remote-ip=194.13.80.246
X-Received: from mail.tipi-net.de (mail.tipi-net.de [194.13.80.246])
	(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 D3D44606A328;
	Tue,  3 Nov 2026 13:47:54 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D3D44606A328
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tipi-net.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tipi-net.de
X-Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id EBAC4A1608;
	Tue, 03 Nov 2026 14:47:49 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tipi-net.de; s=dkim;
	t=1793713672; h=from:subject:date:message-id:to:cc:mime-version:content-type:
	 content-transfer-encoding:in-reply-to:references;
	bh=bUoP3KIGCAm0xwt3Z15aBvbUhr08siqGySkpr9jx0II=;
	b=ESvA4/JpvRFHG1JdoykgCugdbYm2RqvacQyesF9UtwALRjJK9UsmqSJKKPng/fXpkA5tt5
	dwyd6hA4Lr2O2uL17PlQChGLg8ORfppfVQubGTSxEUJt8FxTzB6zZbpJwuxKCeaim/nSk4
	KkD+G5+2vtL+mhOhH3f3/20sqPQCfn4iy6wbrSSgwpP8sDFwxlYe6c2akd15/EYmEOmWLC
	gBBtbzU/HOGOq2rSx/agRyjI8t+TKK2nU3jCujchVpckU/coQibIQhQYA9kaivyj2jDPT7
	9TEAWipqDjxvl9PzfR1D2TsIzuBf3sD9Exu05zWlsyiz8HVZ5H9E7JKwODBuwA==
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
X-Cc: Maxime Chevallier <maxime.chevallier@bootlin.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>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre
 Torgue <alexandre.torgue@foss.st.com>, Alexei Starovoitov <ast@kernel.org>,
 Daniel Borkmann <daniel@iogearbox.net>, Jesper Dangaard Brouer
 <hawk@kernel.org>, John Fastabend <john.fastabend@gmail.com>, Stanislav
 Fomichev <sdf@fomichev.me>, Song Yoong Siang <yoong.siang.song@intel.com>,
 netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 bpf@vger.kernel.org
X-In-Reply-To: <20261102-stmmac_meatada_pp_path-v1-1-d93cc4f9a864@oss.qualcomm.com>
X-Sender: nb@tipi-net.de
X-Last-TLS-Session-Version: TLSv1.3