Article View: linux.kernel.netdev
Article #3639[PATCH net-next v5 11/14] net: ethernet: cortina: Account RX buffer size in truesize
From: Linus Walleij
Date: Thu, 15 Oct 2026 15:24
Date: Thu, 15 Oct 2026 15:24
34 lines
6554 bytes
6554 bytes
gmac_rx() charges only the received payload length for each page fragment attached to an skb. Each fragment pins a complete free queue DMA buffer, so short packets understate their memory use to GRO and socket accounting. Charge the full posted fragment size for every attached fragment. The skb already accounts for its own head separately. The issue was found by reviewing the RX fragment accounting. The series was tested on a D-Link DIR-685 with media playback and ksmbd transfers under ping load. Assisted-by: LLM Signed-off-by: Linus Walleij <linusw@kernel.org> --- drivers/net/ethernet/cortina/gemini.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c index 70aa418d7037..d4e90aa97d22 100644 --- a/drivers/net/ethernet/cortina/gemini.c +++ b/drivers/net/ethernet/cortina/gemini.c @@ -1862,7 +1862,7 @@ static unsigned int gmac_rx(struct net_device *netdev, unsigned int budget, skb_fill_page_desc(skb, frag_nr, page, page_offs, frag_len); skb->len += frag_len; skb->data_len += frag_len; - skb->truesize += frag_len; + skb->truesize += freeq_frag_len; frag_nr++; if (!(word3.bits32 & EOF_BIT)) -- 2.56.0
Technical Details
Message-ID:
<20261015-gemini-ethernet-fixes-3-v5-11-b5c9e2f7b8a3@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346824-linux-kernel-netdev=dewy.ruReferences:
<20261015-gemini-ethernet-fixes-3-v5-0-b5c9e2f7b8a3@kernel.org>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-346824-linux-kernel-netdev=dewy.ru From: linusw@kernel.org (Linus Walleij) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v5 11/14] net: ethernet: cortina: Account RX buffer size in truesize Date: Thu, 15 Oct 2026 17:24:11 +0200 Organization: Usenet Network Message-ID: <20261015-gemini-ethernet-fixes-3-v5-11-b5c9e2f7b8a3@kernel.org> References: <20261015-gemini-ethernet-fixes-3-v5-0-b5c9e2f7b8a3@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="2566756"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:rOk/3wYSBvNUB7R0eb3o/R/xPhA= sha256:H/xhK2hR8L30g9pcA7Vqzv8xKk4Py765e2VV05HOk2s= sha1:wNXEv02//hD37n6s/fNvSHLWmpU= sha256:+n9cGvn3P3UySqQ5dhmPMu57DlkF+D9z9gyypXRMYag= 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 B76C3110356; Thu, 15 Oct 2026 19:11:06 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.34 X-Spam-Status: No, score=-1.34 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, 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 zqm1hDqO4Ytk; Thu, 15 Oct 2026 19:11:04 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-346824-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 E36FD110322; Thu, 15 Oct 2026 19:10:49 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id EAC20A320A; Thu, 15 Oct 2026 15:25:25 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81F054FD274; Thu, 15 Oct 2026 15:24:45 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cWCgiKxc" X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 C8795542EED for <netdev@vger.kernel.org>; Thu, 15 Oct 2026 15:24:38 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792077885; cv=none; b=hJeTJQfwZYGvAodO6+cz2Bh60XQP5WoTaRvvwZzErmVgghck1usH4vITHu0uHnKHcfg5YL4310eYa08afkTL3F5tSpdP97TXVJ4VxgmeSf6KxNRKb6kzyqIzhL0lDzZgVjf5wSIf64S3AU1EIvIilNAEXp6uJAxXoi+Qc8A5b58= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792077885; c=relaxed/simple; bh=qATRpF6iXzAXJ/e3XvISDE3jKplabPi2qYcXQdUv9Z4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qXWXYuQdVnVCxccMjdp8nMC71v56R+kqL3lumGqkHPtwFVEJatjhS6BQhyZw6atp78uA22yGF8Z8q0wV4lb7dS4tbdSAS61mxAm3iznSgcUp5aap9skfzMWE4IP/u6VtkeZHYsiLcJ0Jxh/EJGtGVXFqkjui7mzbV9ZKjqPstag= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cWCgiKxc; arc=none smtp.client-ip=100.103.45.18 X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E9381F000C4; Thu, 15 Oct 2026 15:24:35 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792077878; bh=5mi32mBJxaMiGumfOeXHTAjQdQ2Z1fOexJQU9H6njgE=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=cWCgiKxcrUOfVRzQcHkiNK/HUBlU29PyARWlfdyv3RiQROfga18sHOPDUew18zDQ5 BSHNIV0kA7Qrjtq1icofTaOLp1xUjYSn5fmSbwSfsfgAYeCgG6lmMbPS9mKLtn4RMW ueQZzmFN3JWcBZOUmCg8k2wsBbmfnybyeq/tdN7WaEYR2HfBsRPGLlE3P9F/e5Yzb7 D7Mw5IfWz920VzzZZfP55bi+ZLoN0l9ojBYUo2KjsqMrzRZNv7GTAhPi8qf065gnFy QRZ6M3AdXnGCTVHweWTN1Ix2DxJynz/Tuek38I85qs8J65ybz0OP0JfKB0bV8B9FVZ QtXmKPq6raasg== 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: <20261015-gemini-ethernet-fixes-3-v5-0-b5c9e2f7b8a3@kernel.org> X-Cc: netdev@vger.kernel.org, Linus Walleij <linusw@kernel.org> X-Mailer: b4 0.16.0