Article View: linux.kernel.netdev
Article #17273Re: [PATCH net-next v8 07/19] net: ethernet: cortina: Preserve in-flight free queue pages
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 14:45
Date: Mon, 16 Nov 2026 14:45
117 lines
12288 bytes
12288 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 ยท High: 0 ยท Medium: 1 ยท Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] This patch replaces position-indexed free queue metadata with
a fixed pool of page slots.
--
net: ethernet: cortina: Preserve in-flight free queue pages
Free queue page metadata is no longer indexed by free queue ring position.
Metadata slots now come from a pool tracked by a bitmap, sized for the
free queue plus both RX rings. Each posted fragment keeps its own page
reference and XArray entry until it is claimed. The page is unmapped and
its slot released once all of its fragments have been claimed. The shared
queue is only rebuilt while the peer port is down.
> diff --git a/drivers/net/ethernet/cortina/gemini.c b/drivers/net/ethernet/cortina/gemini.c
> index 4ee630a9f5897..4b0c10d732ab5 100644
> --- a/drivers/net/ethernet/cortina/gemini.c
> +++ b/drivers/net/ethernet/cortina/gemini.c
[ ... ]
> @@ -795,6 +817,21 @@ static struct page *geth_freeq_lookup(struct gemini_ethernet *geth,
> if (!valid)
> goto err_unlock;
>
> + dma_sync_single_range_for_cpu(geth->dev, page_mapping,
> + mapping - page_mapping, frag_len,
> + DMA_FROM_DEVICE);
> + xa_erase(&geth->freeq_mappings, index);
> + if (!--gpage->fragments) {
> + slot = gpage - geth->freeq_pages;
> + dma_unmap_single_attrs(geth->dev, page_mapping, PAGE_SIZE,
> + DMA_FROM_DEVICE,
> + DMA_ATTR_SKIP_CPU_SYNC);
> + gpage->page = NULL;
> + gpage->mapping = 0;
> + __clear_bit(slot, geth->freeq_page_bitmap);
> + put_page(page);
> + }
[Severity: Medium]
With the new slot pool, this block in geth_freeq_claim() is the only
runtime path that releases a slot, its page and its DMA mapping. It only
runs once every fragment of the page has been claimed.
What happens to a fragment that the hardware takes from the free queue
but never returns as a usable RX descriptor?
gmac_rx() has two paths that drop the descriptor without claiming
anything:
if (!mapping) {
if (net_ratelimit())
netdev_err(netdev,
"rxq[%u]: HW BUG: zero DMA desc\n",
r);
goto err_drop;
}
page = geth_freeq_claim(geth, mapping, &page_offs);
if (!page) {
dev_err_ratelimited(geth->dev,
"could not find mapping\n");
goto err_drop;
}
gmac_cleanup_rxq() also skips zero mappings. In these cases
gpage->fragments never reaches zero. The page, its streaming mapping and
its bit in freeq_page_bitmap then stay held until geth_cleanup_freeq().
The commit message acknowledges such fragments exist: "This does not
reclaim unclaimed fragments while the peer runs." Also,
geth_resize_freeq() only rebuilds when the peer is down:
if (other_running)
return -EBUSY;
The pool from geth_freeq_page_slots() has very little headroom. With the
defaults it is 1024 + 512 + 512 = 2048 slots. The legitimate in-flight
worst case is roughly len/2 - 1 free queue pages plus
(1 << rxq_order) - 1 per RX ring, which leaves about 3 spare slots.
As lost fragments build up, geth_freeq_alloc_slot() will start
returning -ENOSPC. geth_fill_freeq() then stops at the first failed
geth_freeq_add_page() call. Could this first limit refill during RX
bursts and eventually starve RX altogether?
On a dual-port setup with both interfaces kept up, it looks like the
only recovery is to take both interfaces down. The old design
overwrote metadata by queue position, so a lost fragment could not
reduce refill capacity.
The later patches in the series don't seem to change this. "Recycle
claimed free queue pages" only recycles slots whose fragments have all
been claimed. "Separate RX buffer capacity from free queue size" keeps
the same sizing scheme. At the end of the series, gmac_rx() still drops
zero and unknown mappings without claiming them.
Would it make sense to reclaim these fragments some other way, or to
size the pool with more headroom?
[ ... ]
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261112-gemini-ethernet-fixes-3-v8-0-f55bd43e02d3%40kernel.org
Technical Details
Message-ID:
<179484034674.3136.17017391064607605132@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364468-linux-kernel-netdev=dewy.ruReferences:
<20261112-gemini-ethernet-fixes-3-v8-7-f55bd43e02d3@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364468-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v8 07/19] net: ethernet: cortina: Preserve in-flight free queue pages Date: Mon, 16 Nov 2026 14:45:46 +0000 Organization: Usenet Network Message-ID: <179484034674.3136.17017391064607605132@kernel.org> References: <20261112-gemini-ethernet-fixes-3-v8-7-f55bd43e02d3@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2089733"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:AnlK75lIBXwhrMKahlVaaj9oQtU= sha256:WYCVIKsJjcn3TKlMZk/AKYI4598WBH4oBMSYIjodTOU= sha1:4QRNoccIjsbYnP8IdJpoKel5ZvU= sha256:n5wwO78XMgV3DDM3RByaoDIRtsy96XGmUrAicVmEhKE= 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 CD3B9114C8E; Mon, 16 Nov 2026 17:46:08 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 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, URIBL_BLOCKED=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 VxbqRSA_evX0; Mon, 16 Nov 2026 17:46:05 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-364468-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 4B15B114C91; Mon, 16 Nov 2026 17:45:55 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 6E0A2267D6; Mon, 16 Nov 2026 14:45:52 +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=1794840348; b=Nv5b1aylQKXX71lbZ53DRxaF0Zu9/1ZTBk/PpSvBu5yUePAtz6eeuXWsd8rLtODx2JJ0 1LEApBQjIBc0B1lZe0+x2kcVFf/iNURggSpjefL1OmB0/nMseADjBIQ5uUBUAvvKiuZjX 9AhJJT1yxwBUsoZLt50TaLXTohNA7ZJfpUhEmuwJ/2OUjE4MJOKTMABz3kn5EHIcoAfcK PCEyezcDuTRHKvXY47BpoZTOsjpoCwrvKoH5KXZF2o9FtbadmcD7cSJHlmM4PFiekHdiN dq2g+yM9MAtQnQ+8nJK0foTGFKzxBIduS5g/Q7YBj8aa9H6EmdeY8amx06MTrrs8arA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794840348; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=AnbpXCmtxf3xCpEWG3l0yg+vKtFTZzAHA2DBPYL2KZ8=; b=Nuk+CtwQoZFV1iDWI5AtBwSzcR4okuuGdiGSu59XG1hS9lvMIoRuwM/RWJ2adUk+vWBc 4ux0pxsW1ZWlGAo8jUdZfVSqhewMiPAaSC1TqtdtAgDDRSedO5ncARlm4uol76IASWntb Zx+cUWXFHwggLIuvm7k2z/QOtEJn/szaNSxyHLMGnKzZ1Y0usFFfxwrYfS5gHUDNUdbVa dghGsSmgN/W4fx70X1JtA7JCLXFzq4DXF+DjuXMccSNmeFwxu/VKQDj6WyHhhaFpuG/Aa 1on5kY/Dm5n2ICMUNzAJLfuV00Q03p8BypB3+2/mT79KMkQQrL8x73Yh7F4+wpmLVFg== 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=bbwKfZqU; 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 CE73A606A32A; Mon, 16 Nov 2026 14:45:48 +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=bbwKfZqU 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=1794840348; b=l7nh2KEhVTPtQyWYW7chuUpxAgB3S9AJyXhx9jSreNMSv10duVhHLsHsWcJSo2n3mGJL NNhvG3Rcwhta0BKzxTwIKpaXW7AmmivAO+2VdP1Lespawc8BSP5EXauijo+uoLD27xsBd nCYBEIpyIirgV/T4ETXkMgIk9vEjcF9pAcWQUsEVxsWWPDi1cp37p8CQAwbEpzYLuJA6B JVZeQIbu91bBbEXFH0whKoTkOQfqPN9AzDmFsprWEqgjXd6snbS1dFNCPpAYjFzD5U6pf zWNIsDz3j0+13yLxtiNhR0pOJYnNGm1mkkpmXtyC90OMzOWt79vICeMA2T9CMwzJLTA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794840348; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=AnbpXCmtxf3xCpEWG3l0yg+vKtFTZzAHA2DBPYL2KZ8=; b=nfgQHB3AoTO7IIxH5LdTOh9dtsl1tvpyHOl1dzo+HkKtCryTIwvEzKgFzG14VX7T9k3H 3cOxL1C1IRWV3wDQGnGSpeXBq7U9grsn4KboHWPbba61emT+4ONuay4s9grWFXcJxglUK nMVs4MxFmD/kYoOjxzq3SGkabPPGPztg2E2EhNCtuYYb4ysS7goNZq7pjBh1GoGHUrCAo K0PA3ULY4PsiXjAWzcqCkVEKmIAiqGPSTDlNnEFNsP01EFAbQCtxp71zq4W52C7yU25WX 5oGKN4V6gil9CE8hC5SZDlhC5WMY+ostT5dYSFYnCSFQbe1NK3NCvzhQvr4g1yjdoHQ== 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=bbwKfZqU; 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 EEAAD606A33A for <netdev@vger.kernel.org>; Mon, 16 Nov 2026 14:45:47 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A8A71F000C5; Mon, 16 Nov 2026 14:45:47 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1794840347; bh=AnbpXCmtxf3xCpEWG3l0yg+vKtFTZzAHA2DBPYL2KZ8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=bbwKfZqU/23GeXKlFYfFHtjUkr8spfNdYzG84E8o9OzIJPgaYYvL/W4TYJHpk79K4 o0OX4EDK1hIAi4Z1vyILj3eVEu/5VcfqwJj/5igr1VFKFAsFRSFhXEyCjMCPPIwQyR zNRcMrg7Ti1cxNMy9QKr5PoBb3OepGmoEK9leoHQWjFKu5NWFMWiVMhFN4DbUCczQz 8opMiQTZUMspta1MJYlnrChop3CQxQbNgs8/9WtSogcV6kvPlGTkDsSS6RO+30T4xr +8hpyMIxn55BNg3tLu/vmY9mYH7OxuOMN0tM0058Q07md4x3vSxuc02ITIYQv/mDKl UPbYy7+abQVNg== X-Cc: ulli.kroll@googlemail.com, andrew+netdev@lunn.ch, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, mirq-linux@rere.qmqm.pl, mhun512@gmail.com, edumazet@kernel.org, netdev@vger.kernel.org X-In-Reply-To: <20261112-gemini-ethernet-fixes-3-v8-7-f55bd43e02d3@kernel.org> X-sashiko-severity: Medium 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