🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24593

Re: [PATCH net 1/3] libeth: xsk: Count each XDP_TX buffer on its own

#24593
From: Björn Töpel
Date: Mon, 30 Nov 2026 11:58
56 lines
10397 bytes
netdev-bot+sashiko@kernel.org writes:

> [Severity: Low]
> The enum doc is updated here. Should the struct libeth_sqe kernel-doc in
> the same file be updated as well? It still describes per-frame values:

Will fix.

> [Severity: High]
> Does this decrement move the in-flight count the right way once idpf
> applies it?

[...]

> Should libeth accumulate a positive count here (cp->xdp_tx++, and
> cp->xdp_tx += sqe->nr_frags above)? Or should idpf add cp.xdp_tx
> instead of subtracting it?

Correct, but it is older than this patch. Since 26ce8eb0bb7d ("libeth:
xdp: add XDPSQE completion helpers") libeth counts completed buffers
down from zero and idpf subtracts the result, so xdp_tx only grows. This
patch keeps that convention. It is not related to the shared info, so
that's a separate series.

> [Severity: Low]
> This isn't a bug introduced by this patch, but the kernel-doc for
> struct libeth_cq_pp in include/net/libeth/tx.h says:
>
>  * @xdp_tx: number of XDP-not-XSk frames processed
>
> __libeth_xdp_complete_tx() actually counts buffers, and that includes
> XSk XDP_TX buffers. The old code already counted LIBETH_SQE_XSK_TX
> here. Could the wording be fixed while this code is being changed?

Ya, but with the separate fix above.

> [Severity: High]
> This is a pre-existing issue and was not introduced by this patch. It
> is in the same XSk XDP_TX path: does libeth_xsk_tx_queue_bulk() in this
> file handle a flush failure in the middle of a frame correctly?

[...]

> This goes back to b3ad8450b4dc, and 90e5d84086d9 only covered the
> success exit. Would it help to free the popped frag (or put it back) on
> this error path, and handle the head's frags flag consistently?

This one is real too. It only happens when the XDP queue has no free
descriptor at all, and then the popped frag leaks, the frags after it
stay on the pool's list, and the head keeps its frags flag. It is not
related to the shared info, so separate fix on its own instead of
growing this series.


Björn
Technical Details
Message-ID: <87cxrm1qgi.fsf@all.your.base.are.belong.to.us>
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374149-linux-kernel-netdev=dewy.ru
References: <20261127142131.3527737-2-bjorn@kernel.org> <179587888871.3135.18266598324203799547@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374149-linux-kernel-netdev=dewy.ru
From: bjorn@kernel.org (Björn Töpel)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net 1/3] libeth: xsk: Count each XDP_TX buffer on its own
Date: Mon, 30 Nov 2026 12:58:05 +0100
Organization: Usenet Network
Message-ID: <87cxrm1qgi.fsf@all.your.base.are.belong.to.us>
References: <20261127142131.3527737-2-bjorn@kernel.org>
 <179587888871.3135.18266598324203799547@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="1418049"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:VJ4QDV3SGR7Jd7QnXxu8AL3imO8= sha256:TBN9sXHPEGA7dnWpU+LbyEb3jZlmwidWGTvrK6W3MC4=
	sha1:SeV5WfHNOMxvdVcwtzLlCTUDV8w= sha256:BCXx2UGNcmtBhhDfS/z+Y3J3cbGKssvbNgNOa0it4zI=
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 A6AC4125FDE; Mon, 30 Nov 2026 14:58:30 +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 hYmML87SzLnF;
	Mon, 30 Nov 2026 14:58:27 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-374149-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 4998C125FD9; Mon, 30 Nov 2026 14:58:17 +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 C72BD259DB; Mon, 30 Nov 2026 11:58:14 +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=1796039894;
	b=dqQCLkf24m6FWTtd6AoQyG9fyQrUYci7z7ZVw1JvRaAlbVXL3D7KT4c5XS+31Grx8Wx+
	 2mv0L4fwrXtWAwmhzCCAaKxUhRtd2lB6JR/y4yJM9xIvWsr9CY73QM4f5KCilR4nUf9KN
	 MKz5Cb7GSLQItMKCYG+3gv+MVgd/bEkDXG80v1sg8olu5Ak0VO+LrHEvxAjmTQpihJXlw
	 JEEYYlfqo1u9QS/BZz6DvqFLWQFKYp9lkv7pst0FW6LW37agfwttSgwnv51aa5Br4y4hl
	 6MS09a5VBjZPHP0mRTFBEkML/508ROrl44LAJ4K4jpQhA4cvLUxcAAq6aYAIOS3ccYg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796039894;
	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=YOTBarLJXs6OqJiPEFGsJVGvFiGvOf115rh0mcUxoJk=;
	b=3HIoAf6r+ZOsc6T0goOMwwQeU2D//MoeqP9WM/7N9AgbkBGU7cGTDVnw6gJZTsrshwTE
	 NsLBjirN43OudtqJoGgFwDJ/Txb4OpQp93x6wd0CRsWWtuj+2M2ex5ZVZ19f6LUdB/iwC
	 RO25YgWN8w4SwpeKJFUpGmV8W85i1qias8V+OtSDnq4sHs/WVuth5i3afEKSq5AhNlXVK
	 q5a7CrTZEMEAfGLVcEtzKgverD16QwoglmMkUGTWi0Le/Xyo2wtCy0ZAEvF3piaIcNueA
	 M2JNbKQwTkOHpi5pUd65w4MiHqjGjONVX00yW/sjRVRP28fmPrJZmh2FIkjRjLK5ojA==
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=gEePQfYQ;
	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 7F460606A32C;
	Mon, 30 Nov 2026 11:58:14 +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=gEePQfYQ
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=1796039888;
	b=CEqH3qyhGKy55p4EALHIS3i0raQQnmWLDfgbpBCul86ElUZwouC9ZWFMu5dXNfROwJ/6
	 3A3aicape5gvpovFbcrhhuZqHC89KMtd2PhpUJUI6YZtoYJh6DvFGTeNoS+fcxUh3jXgf
	 tvpUWwpkjZVR1Qidsmx3cGX1fPGNCgXYX3sv9AkRAun0rndJJeBcSzbExJLFCDaLhXRTl
	 SsjBq+Jx2DppF0VYRFBZMMtOaVh7O15komKKkgZ6VFfWRIsnC8NuuYwiXB87Hvm0zlAzc
	 +1A2f5NEXgSkJfGEIa86M7hlZHO+dmcexYuyCnA0jJ0ymoKuJPnCs8861/zW1q5T6Cg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796039888;
	h=Received:DKIM-Signature:From:To:Cc:Subject:In-Reply-To:References:
	 Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding;
	bh=YOTBarLJXs6OqJiPEFGsJVGvFiGvOf115rh0mcUxoJk=;
	b=W3a4L2TBcyXMoblW9HPlKagNDonFAeMCt4mp5zDP7xBjq4V7dQ58KNWGe8yzTFPZFwKA
	 pScgTVnnEcne3mIFRrmPPTLnKYHQLgGa8HbbjLZJqkvqrnM5dZH3dwPOTKqvSPm9jDf29
	 Su4Y2YzTEgIcDz8qdorm5YhgCRsH/fUBhv4phr08q5tetODGyMW3zFezTSjyDRrQcVilw
	 cVq4H4iVhoKdzIS78S9C59pQgtcjsqJSY0IK2Y7OFCXGWqbBgPixBVj1wA1W+siLk0LFz
	 j+2olIDYE9lJ37E2NbuNQ9Q+1URWqK5kLrcaUFkQ18n2c7yqC64EPFGHsQw8sOnjNag==
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=gEePQfYQ;
	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 9AE2C606A31C;
	Mon, 30 Nov 2026 11:58:08 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52B361F00898;
	Mon, 30 Nov 2026 11:58:07 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796039888;
	bh=YOTBarLJXs6OqJiPEFGsJVGvFiGvOf115rh0mcUxoJk=;
	h=From:To:Cc:Subject:In-Reply-To:References:Date;
	b=gEePQfYQKVM9h0jkgj7FK7RL2gRQdp51V9h6HRAV6Atmy3Gw6E7DHSz0rRxvqifR7
	 ynWBV8HhrpNCzLPKQN1O8x7v8WDK5BHweQ1P6W/cE4P5SJ1F0LaIETIrONIDoPFuZe
	 HZLhRT0aoUXvwu4v60XSLKa1x4YEL8hd2R4x4GyhEaxDTYnfmHEWiZialg3US66ZtU
	 gIzCRpl1GIhc+QT8Or8ud1GtUh/QJlsZIvR0/MaBwKrbYqts1EREq1JCHDrVcQsEM1
	 ykPXXgu/DtWw9qRYKdK4uzHEkP5E24+B92MUhaSvbyCFBmtnAr+ZAL4GmO6enYr4NB
	 y7GKJ5Km6OpqQ==
X-Cc: magnus.karlsson@intel.com, maciej.fijalkowski@intel.com,
 aleksander.lobakin@intel.com, ast@kernel.org, daniel@iogearbox.net,
 hawk@kernel.org, john.fastabend@gmail.com, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
 willemb@google.com, andrii@kernel.org, eddyz87@gmail.com,
 memxor@gmail.com, shuah@kernel.org, netdev@vger.kernel.org,
 bpf@vger.kernel.org, horms@kernel.org, sdf@fomichev.me,
 martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev,
 jolsa@kernel.org, emil@etsalapatis.com, ihor.solodrai@linux.dev,
 anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com,
 larysa.zaremba@intel.com, tushar.vyavahare@intel.com,
 kerneljasonxing@gmail.com, bastien.curutchet@bootlin.com,
 colin.i.king@gmail.com, intel-wired-lan@lists.osuosl.org,
 linux-kselftest@vger.kernel.org
X-In-Reply-To: <179587888871.3135.18266598324203799547@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