Article View: linux.kernel.netdev
Article #1976[PATCH net-next v4 12/15] net: ethernet: cortina: Account RX buffer size in truesize
From: Linus Walleij
Date: Sun, 11 Oct 2026 18:06
Date: Sun, 11 Oct 2026 18:06
34 lines
6532 bytes
6532 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 d8bafcdf4d5f..43fd8fd773e3 100644
--- a/drivers/net/ethernet/cortina/gemini.c
+++ b/drivers/net/ethernet/cortina/gemini.c
@@ -1849,7 +1849,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:
<20261011-gemini-ethernet-fixes-3-v4-12-4b1631b08f5d@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-344563-linux-kernel-netdev=dewy.ruReferences:
<20261011-gemini-ethernet-fixes-3-v4-0-4b1631b08f5d@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-344563-linux-kernel-netdev=dewy.ru From: linusw@kernel.org (Linus Walleij) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next v4 12/15] net: ethernet: cortina: Account RX buffer size in truesize Date: Sun, 11 Oct 2026 20:06:25 +0200 Organization: Usenet Network Message-ID: <20261011-gemini-ethernet-fixes-3-v4-12-4b1631b08f5d@kernel.org> References: <20261011-gemini-ethernet-fixes-3-v4-0-4b1631b08f5d@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="1590776"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Tjr35ZF5/LUm7UGbQ8l8q88DUGo= sha256:LfLXEShYvsyi6FlnjsBv0MqDw8GkzHcLUvh5Qpf+hug= sha1:QTTkN+BWTeiWR6aY3hWlVvRJfuo= sha256:ChI4KTGVioD6dwzMeR/NqO2KH8bpJQ/NSoNmlBlOh5A= 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 7591A10FA39; Sun, 11 Oct 2026 21:07:51 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.441 X-Spam-Status: No, score=-1.441 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.241, 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 AiQxI5n36s8E; Sun, 11 Oct 2026 21:07:48 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-344563-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id B22EF10FA3A; Sun, 11 Oct 2026 21:07:45 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id DA60D60486C; Sun, 11 Oct 2026 18:06:58 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D436E44C4EC; Sun, 11 Oct 2026 18:06:54 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CdcAPtgY" 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 C66E644A417 for <netdev@vger.kernel.org>; Sun, 11 Oct 2026 18:06:53 +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=1791742014; cv=none; b=XSoHHScUn2UcKUXIskCC30N70/pePVa4SZ9Ya+uoLYcCy1nvxKPXelLxq7mtLhPU8Z9hXIB5+LHpvYnJUY6zPQgEML8bF2aXoCCvbbEqLIWNAOg2UN/oxGZyoMlMcFegLolR4yBst+GhALxA7z/fQSg+hsIZVvgqDvxsxNdIoHU= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791742014; c=relaxed/simple; bh=oaCREIsgTzhuMCLbnkjFrh5p64rqYoQkX54l+DelF7c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nUb9MCE8nd6YclY/Ul17ZV0QGZErLEzUgatAyZcSByUskpWaLR5HUOG6bNeU10eQgeT4Ebrl5JjDErWDbSvov/44dOkP7Y0duDTdbQlaChNS0v2cxZl2gE/VQ2d4d2VlZ9MUIR1vkI6FbCUwD43NOrrr2ZtVF3ru7Etd24HCUYI= 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=CdcAPtgY; arc=none smtp.client-ip=100.103.45.18 X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B40E1F0089B; Sun, 11 Oct 2026 18:06:51 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791742013; bh=SiO7tzU83chQYZjkseHrpq8wGlhR1HbBsOaIOzg549o=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=CdcAPtgYljlIc+fOOfRQ/3Cu0ttDQudXq7hrjTE0aCbp5QGZ7hYMemVsHKkc8/UaE gurrEGeLCKRZrjhTx2oA807WQXLqDvOtUtN72unYQ2K26OTBenOmargt0mCf/S/pYG spgv99MPHzr1Ejp0lmB9itXfOGQdS6gxYsgoygzQtufMwBTJ6GWOvwDuHbu3oGLnUJ 5B2QDo4fTEfG6t7ulUuvQRNdC8pcQdsiVOxHXsEzpdBdMxpN0bGLsy4eIBzjWE+A5o zoeit8u0lX88pqReMs7TrxBoNU8AIIYUeZASE1K3924O+2AN4mVeisTOYehWgnyi8V ay1S+KVg3gblQ== 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: <20261011-gemini-ethernet-fixes-3-v4-0-4b1631b08f5d@kernel.org> X-Cc: netdev@vger.kernel.org, Linus Walleij <linusw@kernel.org> X-Mailer: b4 0.16.0