Article View: linux.kernel.netdev
Article #23027Re: [PATCH] eth: bnxt: fix the agg page pool ring size on 64K-page kernels
From: Björn Töpel
Date: Thu, 26 Nov 2026 10:49
Date: Thu, 26 Nov 2026 10:49
69 lines
10515 bytes
10515 bytes
Usama Arif <usama.arif@linux.dev> writes:
> Commit f7dbedba6312 ("eth: bnxt: take page size into account for page
> pool recycling rings") sized the recycle ring of the agg page pool in
> pages, dividing the agg ring size by PAGE_SIZE / BNXT_RX_PAGE_SIZE.
> Commit c55bf90a2112 ("eth: bnxt: adjust the fill level of agg queues
> with larger buffers") replaced PAGE_SIZE in that divisor with
> rx_page_size.
>
> On 64K-page kernels rx_page_size can only be 32K, so the divisor is now
> always 1. Each 64K page still holds two agg buffers and the page pool
> recycles whole pages, so the recycle ring can cache twice as many pages
> as the agg ring uses. With 1024 RX descriptors, the agg ring posts 2048
> buffers in 1024 pages while the recycle ring holds up to 2048 pages, or
> 128 MiB per RX queue.
>
> Divide by the larger of PAGE_SIZE and rx_page_size to restore the
> original size. x86 with 4K base PAGE_SIZE and arm64 with 4K and 16K
> PAGE_SIZE are unaffected, as rx_page_size is never smaller than PAGE_SIZE
> there.
>
> The ring only fills up when the stack releases agg pages faster than
> the driver reuses them. On a 64K arm64 host with a BCM57508 (32 queues,
> 1024 RX descriptors), a TCP receiver that drained its sockets every
> 1.5 s left about 1.8 GiB less memory cached after the fix, 64 MiB per
> busy queue.
>
> Fixes: c55bf90a2112 ("eth: bnxt: adjust the fill level of agg queues with larger buffers")
> Signed-off-by: Usama Arif <usama.arif@linux.dev>
> ---
> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 52606db3f7b4a8..ecc4848499c307 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -3948,7 +3948,8 @@ static int bnxt_alloc_rx_page_pool(struct bnxt *bp,
> struct bnxt_rx_ring_info *rxr,
> int numa_node)
> {
> - unsigned int agg_size_fac = rxr->rx_page_size / BNXT_RX_PAGE_SIZE;
> + unsigned int agg_size_fac = max(PAGE_SIZE, rxr->rx_page_size) /
> + BNXT_RX_PAGE_SIZE;
Hmm, shouldn't the denominator be rxr->rx_page_size rather than
BNXT_RX_PAGE_SIZE?
bnxt_rx_agg_ring_fill_level() already accounts for larger RX buffers, so
using the default buffer size here seems to account for the override
twice.
IIUC, the purpose of agg_size_fac is to convert the number of posted RX
buffers into the number of recyclable backing allocations.
E.g. an iouring 16K override would result in a smaller (too small?)
pool.
This patch had me thinking; The default agg pool buffer size is 32K on
64K systems. That's quite a step up from the default 4K on 4K systems.
8x more RX buffer memory as an effect of using a system with larger
pages... maybe there's a need for a system knob? That's pretty wasteful,
unless the workload is really HWGRO friendly.
Björn
Technical Details
Message-ID:
<87zeuvkgv6.fsf@all.your.base.are.belong.to.us>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372044-linux-kernel-netdev=dewy.ruReferences:
<20261125162916.1743123-1-usama.arif@linux.dev>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372044-linux-kernel-netdev=dewy.ru From: bjorn@kernel.org (Björn Töpel) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH] eth: bnxt: fix the agg page pool ring size on 64K-page kernels Date: Thu, 26 Nov 2026 11:49:01 +0100 Organization: Usenet Network Message-ID: <87zeuvkgv6.fsf@all.your.base.are.belong.to.us> References: <20261125162916.1743123-1-usama.arif@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: usenet.network; logging-data="443175"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:mz2dTVj5SDQM3q6FbxM4xS2NJq4= sha256:Zym3K44hbZ43fI/ZNVBCd6qcGZkRkW2U+Og93Lmj1Ew= sha1:h1lzb67vjNgZW9m3Df33at5RSc0= sha256:jOt2mxeWGTb0qcDda0uzQ6TG0PON4FL/OxgsxHNq9DY= 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 4C517125ECE; Thu, 26 Nov 2026 13:49:20 +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 ITVVBNEiCoDt; Thu, 26 Nov 2026 13:49:17 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-372044-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id EDD1D125ECC; Thu, 26 Nov 2026 13:49:08 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 002F73996D; Thu, 26 Nov 2026 10:49:06 +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=1795690146; b=LFFMd1rhXjWJ4B+KQG98c3DlhZ3cLf3I6wg7nJeVtlMcYrz0VLW1AAVqQlWM46DHQfhJ Fi70vdLbhaNsOjKXjh5/4tSUxbemAFCla/ygT5pBPGCKhFxBish+DG7PpI0Xa8em36ykz oLJ9ZVbjQbXtm2AcYtdDzZiLk7WDZLzMguWFSmfmGNFEj0Alh17rGGsDJcCiYlGPPMPaf oNaXdz2bFlh8cAbQx1O98gD6dDAbiUgqfuRMl+WOBTTVaZsYOjbg/eiZbuHf2YrtLPRnW r78qiMWBi238A5LyCSzoZm7XE73DrBt4iGiAVEv7Q+qjLSJ3y8qU97huIl/waz7fvYQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795690146; 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=noqA/XccKQukWr7dOkX6fkvjd/D/kbwIuY05hOVW29I=; b=ELeFR74BsXSP4CXYRNq2onFFpKBR5x+gH3FUoCtCI109CIOtftguZXlAGw33Pr+w26Zb uGs3IS7vsRF+q72gfmLRoCY6ByfbzlejUq9bIreHPJwdiD3EjhAhV+trRnPEcsMcUtR9R V4g5IFtimeXeyoXt4OmACgTz1r3rh012tWzuu7a4PGnSvZtcv/qwJqwFZw0rAJNSlc0PG 8XZJwut4rioGWzvFEABA309/5u4Jc4DBt9IIgRQN6NBlw4HgjRCCfzAfzGgihVTiYHc1/ eiBVE+4KTGcDaEDYdrOXp2OeGXfUUwhN1h9hrQOxIqikAaY/KERjme4gHwMiYOu5GrQ== 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=GT4Oqynm; 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 C7137606A32A; Thu, 26 Nov 2026 10:49:06 +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=GT4Oqynm 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=1795690146; b=cplrmAwUjlx7fGE9cmxbWQA4RNBaIXFexngyC044dbgTZshID5XZP+d+tOJoRyppV37w wVqy01yBsRIDBoUIanUX0fGIoXCQuqr+M5xG1UTkdsnJUU/PKBnJlRjp9OBcd4iXbWp+f 41tLA0fo1nfHCw5tEULM/WhqHnT3VjXdO93pJAQbn3FfRtY1RXuFyADFynjhORvZ/d4Ia TtCDDStisE27g0uDzx6TSjwq04BEjsN7wvwDqQ82Azr5rL7cO1Ewur3+unUdgrCbj4AMq pt9aVK7oHBKVYqaTG3LxEGQDOEagdvG+c541Ntp9wnC1xpc2L6eftnuCMX0jh8yy8Lg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795690146; h=Received:DKIM-Signature:From:To:Cc:Subject:In-Reply-To:References: Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=noqA/XccKQukWr7dOkX6fkvjd/D/kbwIuY05hOVW29I=; b=AudwQXZ+78JpLGcuN+dlK3OUzn3K7LUYPgfia1xE+Hk4JNndtXZ7ciCsHdeAYCKTvICF p0VgxVJ2Z5YOmkadeJYeWCsPn0iQTyc5dRyKGgMur8C766AwuQoV6y6qnLDVRMBMAE6K6 3v1lc2+Wz737n1PKyuGo7D7nnMCIz/DxDB82WBuzvEkR0kEkOw15CVLJ2X5YMk7FGuuLc 6pj8+uOYiPmr0s1vCTlAYGLaF+iCrhjHLafCxZczr6JQ8BCHYV/uhttGT+rhifb/bFabF 1M6EKuXK8qrJLTjODZz82/5IttfTS8AEnZ3Y1OeCsTvvd/juxAvM+GH5W+0/fn1W15A== 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=GT4Oqynm; 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) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E58A8606A31C for <netdev@vger.kernel.org>; Thu, 26 Nov 2026 10:49:05 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1944B1F000C4; Thu, 26 Nov 2026 10:49:04 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795690145; bh=noqA/XccKQukWr7dOkX6fkvjd/D/kbwIuY05hOVW29I=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=GT4OqynmPIL2Cj1rEpqL3nbDmOqh7i+AkjMa1Q4uhNpHOmtKarraVPnfYQXiN5EKj 2mnVdXUGnMiEUbmfMXk9AeWjDag6EN4pASMx/Ay7IcMBj34ii2BfOkdOioa8UMOsjf geVKs2DDapxBYtCHD8JM25VreNNhmn1pfGRiPMeHCkvPfYlEeBoMhCsWD5dbXuPEyk n1cUkUNzl9xBEHRJ394hocMJoHBrjWf9WMXcWskTq8cFnXTqZxiPyCpHW89UZLlY/f dErHn3lMGi9f5Nm3Lwhk6qcHOBDybrW/PbOkRxZwm0AKqQRXPivhaEBZ+xOi5vmdSa 4JgxKe+pVvJpw== X-Cc: Usama Arif <usama.arif@linux.dev> X-In-Reply-To: <20261125162916.1743123-1-usama.arif@linux.dev> 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