Article View: linux.kernel.netdev
Article #26974[PATCH net v4 1/5] libeth: xdp: Count completed XDP_TX buffers up
From: Björn Töpel
Date: Fri, 04 Dec 2026 14:20
Date: Fri, 04 Dec 2026 14:20
56 lines
10354 bytes
10354 bytes
libeth adds the buffers it sends on an XDPSQ to the driver's in-flight
XDP_TX count. On completion, libeth counts them in struct
libeth_cq_pp, whose kernel-doc calls it the number processed, and idpf
subtracts that number. Currently libeth counts down from 0, so the
subtraction adds, and the count grows by two per buffer.
idpf reads the count only on its XSk queues. At 0 it completes all
done descriptors as XSk xmit frames at once. After the first XDP_TX
buffer the count never gets back to 0, and every completion takes the
slow path. After about 2^31 buffers the count wraps. If it lands on 0
while XDP_TX buffers are in flight, idpf completes them as XSk xmit
frames. Their buffers are never freed, and userspace gets completions
for xmit descriptors that are still in flight.
Count the completed buffers up, as the kernel-doc says, and say
buffers there, not frames.
Found by an AI code review agent in review of this series. Not
triggered at runtime.
Fixes: 8ff6d62261a3 ("idpf: implement XSk xmit")
Signed-off-by: Björn Töpel <bjorn@kernel.org>
---
include/net/libeth/tx.h | 2 +-
include/net/libeth/xdp.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/libeth/tx.h b/include/net/libeth/tx.h
index c3db5c6f1641..622c26059cb9 100644
--- a/include/net/libeth/tx.h
+++ b/include/net/libeth/tx.h
@@ -93,7 +93,7 @@ struct libeth_sqe {
* @bq: XDP frame bulk to combine return operations
* @ss: onstack NAPI stats to fill
* @xss: onstack XDPSQ NAPI stats to fill
- * @xdp_tx: number of XDP-not-XSk frames processed
+ * @xdp_tx: number of non-XSk-xmit XDP buffers processed
* @napi: whether it's called from the NAPI context
*
* libeth uses this structure to access objects needed for performing full
diff --git a/include/net/libeth/xdp.h b/include/net/libeth/xdp.h
index 898723ab62e8..38fcd3fdff70 100644
--- a/include/net/libeth/xdp.h
+++ b/include/net/libeth/xdp.h
@@ -1795,7 +1795,7 @@ __libeth_xdp_complete_tx(struct libeth_sqe *sqe, struct libeth_cq_pp *cp,
case LIBETH_SQE_XDP_TX:
case LIBETH_SQE_XDP_XMIT:
case LIBETH_SQE_XSK_TX:
- cp->xdp_tx -= sqe->nr_frags;
+ cp->xdp_tx += sqe->nr_frags;
cp->xss->packets++;
cp->xss->bytes += sqe->bytes;
--
2.53.1
Technical Details
Message-ID:
<20261204142030.626820-2-bjorn@kernel.org>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377410-linux-kernel-netdev=dewy.ruReferences:
<20261204142030.626820-1-bjorn@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377410-linux-kernel-netdev=dewy.ru From: bjorn@kernel.org (Björn Töpel) Newsgroups: linux.kernel.netdev Subject: [PATCH net v4 1/5] libeth: xdp: Count completed XDP_TX buffers up Date: Fri, 4 Dec 2026 15:20:21 +0100 Organization: Usenet Network Message-ID: <20261204142030.626820-2-bjorn@kernel.org> References: <20261204142030.626820-1-bjorn@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2782483"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:wqMh0TX0Qv94vPi7F9IUEFeJ31k= sha256:aZtW2lblW3sg+6nxHZQ/Iu+t1HfxAlg8FJeO5uouFG8= sha1:9n698MgXBMAqXI2LKEFsq3+wZjM= sha256:e/qxJf/lIahqpVhG2xcti9hKIY8lP6lIYnnlARYooBs= 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 8CCBA117C27; Fri, 4 Dec 2026 17:21:10 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.642 X-Spam-Status: No, score=-3.642 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.142, 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 stdsgjQzGNyl; Fri, 4 Dec 2026 17:21:08 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-377410-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 DA026117BD2; Fri, 4 Dec 2026 17:20:59 +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 036392EA18; Fri, 4 Dec 2026 14:20:57 +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=1796394052; b=N4zumfcPNyKGKorxKl5Riq5ifCfFKyKUbBLw7Ga57sIu1aKXo77zuO5mvBHyf39lBFKI zckkerGlwjSizRh9B93DRY/DpO/TGK6N5vbZdZHohayWdTC/nLKK3jA2RJOf/NqWQYfDN HoguBylQEFxi1SndGt1PsW/BvauCc8NSTlLh5YiEz3YhJ8eHPOal0pJ2dZ+jELPiJJe41 AD9IoDxSZShqkH3MTDd9BlpO0tbZaoRDcLP8ZYVZFammaCQeI30pHxRpTZXzPuqCCbNMW 9bpSS26JcMvSOaDvyHIs8Gnd6h6T0AKspVRyupQXat3qpuu34Apbl/fadXfSrISrfbg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796394052; h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject: Date:Message-ID:X-Mailer: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=6/rPUekGYcfBVj7HlIOptGKIRjakD9k3PsGVTSoPS+w=; b=io3RmSyH0YucPBw0Xx02zdzcxlHMTSFQ69Z5eC6mq83Ga5m5D6G5kyZn1zpknZ18uXuA CjLMMV0pQdbnIaZYFn7sL88T9I+KLXtjeP6bbcTIC2k6DucHjvVud/YbjuzQGYn8GZPsN SuKDOf/k2XsgIhsgIB3AP1UOOXvtkcgZbVDFt2KhX1XF+JxHLkRnjtRU9lJoCvEoOlKnN vhj/+JGZYmykiQaZurImaRTlOBtMUhuBLszZ7jAJvSc91+GoF5dV345BIiSlhjP9ZTs9C K0vD8j2l2JNItyZKFJrmHeAa6ZM2mRmmM/zPChYXB/AfqyOP9eO2st9pvkws71GXeCQ== 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=fDo0JhYR; 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 D8E54606A686; Fri, 4 Dec 2026 14:20:52 +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=fDo0JhYR 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=1796394052; b=JSbSmbitlC94St0M9kYgRJeIc85ncSvEz/bCO+2wqYreogMQGFVd8Err6Mpk+Ti7k/ZD LSsrfxPz7MAUlyvZMFnfv5rUA588GCqNID1RGBxGpXRhNMVC5ZX4r9GkQ9OZ9Quq8vkGX AlspIN1jWJUGUFYizgDQIeG7QVP6DR5+nhEGWZ0oNbUCbKSolZzij/N+FEffwqVJDKvbq piDtVOZkzP6fxz8HhVGwT2ioSKRNKaVMJSrMEsYjatCuiMcmifM/ed2+GUAOU2V8w7b0y aX7zEfzHRnSnkXXnZ7kTfu0FgHuxhiXhXh+KJvBtdW1dRYom4HvQm9GYOjeEw77+YxA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796394052; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=6/rPUekGYcfBVj7HlIOptGKIRjakD9k3PsGVTSoPS+w=; b=WO92N+IjWR5O1ce59jrqHpvO4QuVieRYbxTDlzv8b8shA74A9EXEo/LMrVH3exedc1yx mJB/34bR28VTDw0WL25lxgxTFQp25zBcvRO+XgdiWviixtrSuTXx8zLcOhctOWFU4n/mh jA+RC0BufDPPbWnI7Mi0RGssBWdd4zNYC5nx3+1QjLOxXg8CWSqmb+s1ITTG2lRw+AFxm TRzeKPO9AStQHqvzAYfYd1iMvhHYJJ+1Z4ngHsV0cQBofJDSQrQ/TS64DZImh90pRZnPl CpDShcs5CCjWwL0KH1Dl3CduyiBpjCb7catz+85fL1psBj9JulRtoMtJUei//ReeYKg== 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=fDo0JhYR; 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 EBE0F606A32D; Fri, 4 Dec 2026 14:20:51 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12F941F000CE; Fri, 4 Dec 2026 14:20:44 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796394051; bh=6/rPUekGYcfBVj7HlIOptGKIRjakD9k3PsGVTSoPS+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fDo0JhYRJcIq7O7kXDITuf6+1yV2SjsbZ6y8RYXJGmOTTwk279rLeZLxOD3vnr7V2 zCcTjCcBETvVkpsH/uZYdLfCMObcC5VLCFWOc0pLO7Nz9Z79VbLY2f90Oko0rUp5az fFPHvhN6aOmfuMSe/Ljdla/inIL4YCt+Y23oHjaAdtcY6pEt2MqYZ43cN3sm+gluX1 wcyEPnuhA/8034JMa/QEcGBPzXMHoMroYRkLlcVn36M6ySI/yzUMAkXUimSIT+qtUp tvZtkNZLwGyC/9aBKF3lZktp2EV2mUVbGPDn6TV5HukpWV+P8GUNPV1sP2On3iplL4 BCUhDVQW6QvCA== X-Cc: Björn Töpel <bjorn@kernel.org>, Simon Horman <horms@kernel.org>, Stanislav Fomichev <sdf@fomichev.me>, Martin KaFai Lau <martin.lau@linux.dev>, Song Liu <song@kernel.org>, Yonghong Song <yonghong.song@linux.dev>, Jiri Olsa <jolsa@kernel.org>, Emil Tsalapatis <emil@etsalapatis.com>, Ihor Solodrai <ihor.solodrai@linux.dev>, intel-wired-lan@lists.osuosl.org, Clément Lecigne <clecigne@google.com>, Michal Swiatkowski <michal.swiatkowski@linux.intel.com>, Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>, Kurt Kanzenbach <kurt@linutronix.de>, Michal Kubiak <michal.kubiak@intel.com> X-Mailer: git-send-email 2.56.1 X-In-Reply-To: <20261204142030.626820-1-bjorn@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