🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16740

Re: [PATCH net-next v1 03/11] xdp: Copy buffers with restricted lifetime

#16740
From: Björn Töpel
Date: Sun, 15 Nov 2026 19:02
39 lines
9765 bytes
netdev-bot+sashiko@kernel.org writes:

[...]

> With XDP_FLAGS_EXT the head chunk no longer holds the shared info at
> all. Does anything still keep data_end below xdp_data_hard_end() for
> these buffers? If not, len alone can run past skb->end, since
> __skb_put() does not check.

Yes. fbnic's MAX_HDR leaves the same tailroom, and bpf_xdp_adjust_tail()
stops at xdp_data_hard_end().

> Should the destination size be derived from the copy instead of
> xdp->frame_sz? For example: headroom + LARGEST_ALIGN(len) +
> SKB_DATA_ALIGN(sizeof(struct skb_shared_info)). Or should this path
> copy exactly len bytes?

Yes, but that's pre-existing. XSK buffers without XDP_USE_SG have no
tailroom at all, so it's worse there. It's the head sizing from
Clement's thread [1]. A fix that sizes the head by its contents and
copies exact lengths goes to net, and v2 sits on top of it.

[...]

> Could xdp_build_skb_from_zc() compute the metadata size the way
> xdp_copy_buff_to_frame() does? That means treating unsupported
> metadata as zero length and copying from xdp->data.

Yes. Nothing hits it today, as fbnic marks the metadata valid, but this
patch makes it a generic path. Will fix.

pw-bot: cr


Björn

[1] https://lore.kernel.org/bpf/20260629072300.1664622-1-clecigne@google.com/
Technical Details
Message-ID: <87cxs5j4u7.fsf@all.your.base.are.belong.to.us>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363810-linux-kernel-netdev=dewy.ru
References: <20261110102039.1002605-4-bjorn@kernel.org> <179443688445.2199510.2127044982916637399@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363810-linux-kernel-netdev=dewy.ru
From: bjorn@kernel.org (Björn Töpel)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v1 03/11] xdp: Copy buffers with restricted
 lifetime
Date: Sun, 15 Nov 2026 20:02:24 +0100
Organization: Usenet Network
Message-ID: <87cxs5j4u7.fsf@all.your.base.are.belong.to.us>
References: <20261110102039.1002605-4-bjorn@kernel.org>
 <179443688445.2199510.2127044982916637399@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="1879246"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:THneSLqZPqCpfkuQuXr2nsfBdys= sha256:fzVb5fuXfEg8VbkLjaWWJhDqrCikNoQdrHssp6f5HO8=
	sha1:08HwkAc/I9eKShG1r4QD2LSD6hA= sha256:CpdowEct1cRv6agVhcCUKEAb2ncKR5tz2nqp9BpN3BE=
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 8D3C0114A3E; Sun, 15 Nov 2026 22:02:46 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	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=kernel.org
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 xB-Tf1dOZEai;
	Sun, 15 Nov 2026 22:02:40 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-363810-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id B48B3114A2E; Sun, 15 Nov 2026 22:02:31 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 73C5A2EC82; Sun, 15 Nov 2026 19:02:30 +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=1794769348;
	b=H72w6VOmoUcOEExyQGuj0SzGyN0afcycJHStES5nh+aAes4JFLyGvve6/MBBUVspwuu+
	 zFV3D3agwNmrE8gXBS74L1sju7JFxteezTV/mIno7KrNIcq8V976hxHXSQCbj6qK4+mQH
	 CLqynPWsL0JBfGvmwbyJYJkwxVDXMd2vYxqKdyl6YvuW6lKfFVltyt8p0klPUsVIIZvaO
	 ym+ULfSkzY+wLpfZGlM3iNLA6HDxNjwqt5Mvvc9fdme7F6+MONw6UE1rQXJHIGI+5ig0r
	 rT7J0ImmzyABgdGRM8PY7mWAwS/JdzgJ2SopgA5P5SOxYwo6ghJTtSWDxlfK+6T04cw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794769348;
	h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject:
	 In-Reply-To:References:Date:Message-ID:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding;
	bh=Q/hyJs7suUsQWM9rDMdP2P/X/6Nyzlv7hmi1/xYG81U=;
	b=KpzYqNxi3pEr/rJrrSkSh9IzPEfKpbnml1VLnJhNMjj93S6Dqlexv/RqKvwAjxwn/R+H
	 AkZpqIty5NDdb7hlYtFaIAgsiujk5XXPsdHdNsl0ahWClf2iR+6ZTc48h1EScBHtSZ7eE
	 N4SBEI1HDlMcjIHl/BvTS9+FTZ0JwkIoBDzP3UiFBORqvq7/fNwz6JnReYUESkTgB8qJO
	 ZRJ71XKE7LhailyQRY+tM41Ibyn2cAtxQophzPE27k5FXm7W2zxheOdScl9mby9Dd8tB8
	 YGdhGLGnfbfWaZYJGf8ILZp4Xki/RpyfC+jSg3qD+xVnN69HHFkiyuwDjbdRUV2JM6g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jCitSQMY;
	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 58FB9606A893;
	Sun, 15 Nov 2026 19:02:28 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jCitSQMY
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794769347;
	b=SOAf901PQFhgFvru0jciwpwX6vGrO/rlx9phkTLvL3ETBoVVVY11Ty0edw4QC6mBCsj+
	 aaUGbqWUJ9GphsuPABxueriGMit+hFs11bJCU8ltPyEOTG28OZTwGLt12HDTyflGp38mK
	 Cvj7lZcT4k5SQzgJHLiZr/OVGIkvnj8TwRY1EJFULA6RFoznPsf6dPpXcvvm399jWggD6
	 Y1hGmhJaSgW/JCehrPUU2UFqolTPyQfV22XEp9iI6NncMOdgfnnC+9raHQhLvmGdSos/L
	 JMkBJC556pvSSujaRBvp9ArgqbxeGPaImqVj28ZnBXkiIv8XnhhN8rZR/io/gqKyIxQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794769347;
	h=Received:DKIM-Signature:From:To:Cc:Subject:In-Reply-To:References:
	 Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding;
	bh=Q/hyJs7suUsQWM9rDMdP2P/X/6Nyzlv7hmi1/xYG81U=;
	b=0EzuiauqZgNhVYSgUwAmNaBAdTsS/4RpLDUiv9JbAsvBvrzvoOYUU20r4mNu9YHziv3c
	 Bk+9Z3j5HmITazqtXj43kvieeBrL8Bps2deSNpXOtuyxXVjdHcKE3omiKYzG1YSGB9NZA
	 IcPCmm8C8tgMwrVJn7fZHsgHRt9Iq2JxS76q7eUrIq8sB2Lqrp1g4DfMM9+/IXjXbjj8C
	 QlsDiSqmPI8B80k9dMCRGor6cVgFIcXY2kpEpDmqiCeUfh+LuVdav4aFJOj3j0MPkYdFI
	 aP8HC7ii4jm1T/BFrUiOMQb29EK/81AigMRZrO1jU0UrUbax5kBR9jbiy5q0ufnu0Xw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jCitSQMY;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(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 7187C606A323;
	Sun, 15 Nov 2026 19:02:27 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7757C1F000C4;
	Sun, 15 Nov 2026 19:02:26 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794769347;
	bh=Q/hyJs7suUsQWM9rDMdP2P/X/6Nyzlv7hmi1/xYG81U=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date;
	b=jCitSQMY9Tb/nXzJc/Rl5/ebOalpmPIig30aTEvEKnFOfNmqb45l+Mp0RQmNW9EKV
	 UzwdX+vPG8NlYqsLZQLjYm1Z9yKMJzUMxdiEwqb0ZL34wD72xTu7XNnpUMfc+zgZ4Y
	 3uP5YWR4Zx9PrNG96nCKjOCYVHXYgCIBiwLBodX3o+LRQ9P/F6JvoiNQYYJCf75Rn2
	 y/XPI2f7UB1/9HbGShF0QJhwwojOJ7nnflYYQeDikv8MlOvMFe+O+M59HDLeSEB79W
	 X48CkpEKcHQa0qIva1yk9RnPpl7BBoS/y7RSVHceJP4/xOam+VJME5HnvQtoAQ/BYh
	 wlf+4ym7G1U/A==
X-Cc: magnus.karlsson@intel.com, maciej.fijalkowski@intel.com,
 sdf@fomichev.me, davem@davemloft.net, edumazet@kernel.org,
 kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, corbet@lwn.net,
 skhan@linuxfoundation.org, rdunlap@infradead.org, alexanderduyck@fb.com,
 kernel-team@meta.com, andrew+netdev@lunn.ch, hawk@kernel.org,
 ilias.apalodimas@linaro.org, ast@kernel.org, daniel@iogearbox.net,
 john.fastabend@gmail.com, asml.silence@gmail.com, axboe@kernel.dk,
 andrii@kernel.org, eddyz87@gmail.com, memxor@gmail.com,
 martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev,
 jolsa@kernel.org, emil@etsalapatis.com, ihor.solodrai@linux.dev,
 netdev@vger.kernel.org, bpf@vger.kernel.org, io-uring@vger.kernel.org,
 almasrymina@google.com, mike.marciniszyn@gmail.com, bestswngs@gmail.com,
 razor@blackwall.org, dw@davidwei.uk, aleksander.lobakin@intel.com,
 linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, stuclar@meta.com
X-In-Reply-To: <179443688445.2199510.2127044982916637399@kernel.org>
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