Article View: linux.kernel.netdev
Article #26387Re: [PATCH] eth: bnxt: fix the agg page pool ring size on 64K-page kernels
From: Pavel Begunkov
Date: Thu, 03 Dec 2026 13:02
Date: Thu, 03 Dec 2026 13:02
72 lines
14332 bytes
14332 bytes
On 11/26/26 10:49, Björn Töpel wrote:
> 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.
Oh yes, and I have a suspicion I messed it up while rebasing.
> 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.
Fwiw, the normal zcrx buffer circulation doesn't use ring_ptr, so
we can even shrink it to save memory.
> 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.
--
Pavel Begunkov
Technical Details
Message-ID:
<a21f2b4b-ae97-478a-81da-3f21161e0790@gmail.com>Path:
mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376613-linux-kernel-netdev=dewy.ruReferences:
<20261125162916.1743123-1-usama.arif@linux.dev> <87zeuvkgv6.fsf@all.your.base.are.belong.to.us>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376613-linux-kernel-netdev=dewy.ru
From: asml.silence@gmail.com (Pavel Begunkov)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] eth: bnxt: fix the agg page pool ring size on 64K-page
kernels
Date: Thu, 3 Dec 2026 13:02:13 +0000
Organization: Usenet Network
Message-ID: <a21f2b4b-ae97-478a-81da-3f21161e0790@gmail.com>
References: <20261125162916.1743123-1-usama.arif@linux.dev>
<87zeuvkgv6.fsf@all.your.base.are.belong.to.us>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2496316"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:R56ju0RAgIGDW+oTU4GskMP1uHE= sha256:TwgnKNrUHFHwVkPpO1uJMtL7ItMjL2gzx9ZUcMVl/2g=
sha1:LtW88Zy8bFJl13UrK2acWesn3tE= sha256:LQU6LEmmw403Qh7Ab6bv+OWoKnrXXynuIp8pqzmX2q0=
Content-Language: en-US
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 5F18D117950; Thu, 3 Dec 2026 16:02:51 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.397
X-Spam-Status: No, score=-3.397 tagged_above=-9999 required=6.31
tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
HEADER_FROM_DIFFERENT_DOMAINS=0.001, 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=gmail.com
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 gg90P78UX7O2;
Thu, 3 Dec 2026 16:02:49 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376613-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 847FA117948; Thu, 3 Dec 2026 16:02:29 +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 576BE26438; Thu, 3 Dec 2026 13:02:24 +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=1796302941;
b=GDEv9olMJ4S0Yrv9NM/eNnIGS2y+irziPv2lZZohzipK352nLEiL74iYYuwz0J3od7uG
IBrA+9HwHYG1sQUflQPplqPngqYX6CuHqiq53XIJaaHx9rmkpbnrMdHGm1L+y7xGge6AU
QscjUOr/kdXNdUV3/GwNt+cXUpRIwBCHpQO8EvjE8Jv+md7qr3bnjwdhcJE9FlwExIzXK
6B79T+a0mKbda9Ev4rQBiuIPwHjS+lU5nJxlsjHhR02/8ZNYzkajpw06gfJJf7ZGu4OAq
oxZY/QiUALgNzn35hBTgdN4Rl22hzzTWMwhtVcm+U/U46E1t2EohykwEjQ4xrIFODbQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796302941;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:Message-ID:Date:X-Mailing-List:List-Id:
List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
Precedence:MIME-Version:User-Agent:Subject:To:References:
Content-Language:From:In-Reply-To:Content-Type:
Content-Transfer-Encoding;
bh=t8I1CCtq1rKgHsgQgOXyX5pWBdJjNWU8nyWYQ4bIFxY=;
b=sDHBy1NksT6aJj0BcPKuFy2aZQ2YGjmx9lgu7AzaoVZY5Dsslq+jVsowNiHoOde676bk
an19TKAT+r2gX+H2jEihzGZjIOSI2HixO3DTZDMMlhYdrOpPxLLs+qwtHg7uq2Md6ncje
kPSD9gh4nixLeH4Jfn35SM6yQp5bCSn2Jmh16Eed/DgAk/bxiuWx7X+9RTpTbLfchve2j
6RSbSNDQt3kVnPl6uoXL9wlwm5o5E+DFZ4HR6hyy/1M3WQRo/pRSY9gF/Y5gCwx41LWq8
A4FMHtTeJlsuAR7o8waGrSI43CFqgiM7WQjFURFnu9kjyd9VSBF+ARXLrMhgczsyFsA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=maMTEhUg;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
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 D2718606A32F;
Thu, 3 Dec 2026 13:02:21 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=maMTEhUg
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.218.43
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796302941;
b=m/tLUF5JVfDnaincaEEakdRBC+r0ALwMRtld/09EysnIbtv1x8aUc8D3Jey+/6lFgJgz
psHxcDqmtgtEDxhnl7hNE98RmOOWsAW0m7lkGdd1jqskEziJXuEL8Eisfid6X831rsmLE
N+Mo6DIJNu82UmQDkrQqVwgs/POlABYqT4zguoiJDEmjT7RzQ+DnjyLZ5Qj2pESbd14/L
wFNsErTNzGVpWSXNJ1yxxCMryVeyxm6VvGc89TPr1a+79aJpDB12nqR+9uscCFbz72pYw
cTx+NdqRyLVR73zLvyt1QZV7E7AixqPHVm1EFw//RZMyt5fQYnehju4f19UxEQKEsxA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796302941;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
Message-ID:Date:MIME-Version:User-Agent:Subject:To:References:
Content-Language:From:In-Reply-To:Content-Type:
Content-Transfer-Encoding;
bh=t8I1CCtq1rKgHsgQgOXyX5pWBdJjNWU8nyWYQ4bIFxY=;
b=5NNsTX7UVMBkkGeh4DowLog18GuKnjI0tFpwlag1YaLM2+0BrjEgq+SBm3ucfait286D
BaIMOa/ae5NouZWuIQ5HZs2mNYCpAOh2sPo+9KBT+Tb/tjVUPkFw44CpbtnkgH/q3WqZH
ABf/iLBbM0UKrAWFUPGFXYFVgrA8k7h21keYTJTwfZT8Q3LTnzHL1H88bqw0rf3Y2WmEF
ukzOpX+lbNehgpLQEubax/d4dhvsEBmMhgQ5VtnW878HF97HNSZLVdOoFXLd66ACgRuKU
/Y5dCGqwjFzpVbVt6IKqZzmauiCbAjZVgJSjMaqXT0H+2+AZJv0liduQknHI5RabP2w==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=maMTEhUg;
arc=none smtp.remote-ip=209.85.218.43
X-Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0E4C606A680
for <netdev@vger.kernel.org>; Thu, 3 Dec 2026 13:02:20 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A0E4C606A680
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-c51c294cef6so839502266b.3
for <netdev@vger.kernel.org>; Thu, 03 Dec 2026 05:02:20 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1796302939; x=1796907739; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:in-reply-to:from
:content-language:references:to:subject:user-agent:mime-version:date
:message-id:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=t8I1CCtq1rKgHsgQgOXyX5pWBdJjNWU8nyWYQ4bIFxY=;
b=maMTEhUgVZCDTTcV4H7yGUS0CVa3VRhSLkHNTaRyjWfiCaYBNoxDAhzrqifKGkW0/8
D1I7zjrB2FV2DeSPlrvoUjCA+z6qNKM2vsDQM11wqw4lFiTJ2c5w7s2jZgRwxCMR/xDY
U8RFgvPnIQhm6t9RvPx3ODxxdHSGwpbvYSBFIuB5clc++Mpogfk+xzI9WV2VuPsXN6aO
5tHXgGor3zh2mrkywUgFn/Jo7j/Z/WKdNzhM1LzToeg4+YZiT5Pzrq0kwVF2dURndQAC
hH4I43WgWLBJWGaIDeYUKVOADEDIl47hrO0dvx7GVxypRQZ37JPGScA2IXDYnO+w5Ys6
Wbzw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796302939; x=1796907739;
h=content-transfer-encoding:content-type:in-reply-to:from
:content-language:references:to:subject:user-agent:mime-version:date
:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=t8I1CCtq1rKgHsgQgOXyX5pWBdJjNWU8nyWYQ4bIFxY=;
b=iWI16UgF7/L6l/ue2+SBXnaL2+fA8ZIQ0JcVUsTt9hPR2+JQhmUP0kRalVJXO+hiRG
iAqPwQJJib8iHf7bN9AksLSuQEwyB6wg6OEl3jgqEY+KxsR+9R9kGokK3bOaQz7zDBvi
yLWShFcMuoUrpuPpj9+48jNjeHE1U3Z7Hki10bEdvhgWwRj54/LmuXx0JZYvTeCg/fOg
5vmqXVlYBSDoJCg+CXObr9ec1YarLdiB4hhk5nGiXO+6kD8uw9Gdh0rh4B9JvTgO/cyf
ajeIw+WTMK8swxQ4rahzUuiwKDpXL/ntXu+kWIBe0KjWpX2g789Q1K99QYnf/qDkaN6A
BfUQ==
X-Forwarded-Encrypted: i=1; AL+hErGZ+etQxMgFmiQHJzKMaqFItPoM3XFabzgv2084EO9pQSZtmnnwofGsS0BeoEZqlw6McGmSCVc=@vger.kernel.org
X-Gm-Message-State: APuU4Z/TKS9dWL6IHQWGtkJcVqzKD5L6+BwOiJ7IJmATYe3oIPtJ+lL+
QfVkelKLJTaCzFQMMMZJde65pMqJp3Pu0NQZprdokNdf0dtn7CpmXv9p
X-Gm-Gg: AZFdTZctGgo037gzbY6nfWFzDC/IjRV2PRlAumLA/RM1G9oii31r2KhDVVs8xvxZ/08
YfaCaIMXt2frxbB1+Ga39Ow6QkNAm/6I35Qoa/SVoP17rcTvbwV5Rtb/YpfQt0FOiEVM9XQ4P9b
maCkZQcnbaSAmc/f1psXNc/caZonhU1rn37HQNluLOrbMp/wZVGf8vJJRQ/2Xw2EQgY5T5qRrKi
rl5baybYykcA78E3w5PETbsltU6KDy+nv/18hJxCO2ejXK9/pYsq2mNASvEcGxgl8izIN5hZ/ED
56AU7+0vCsRmNVV3nDL0ATJskkoeW5t9yTzS4CkwDBuW3GTjf7ixSRiTIgRcHF+nPWyESR+Qa8+
M5Bd2qJWbJnzr6csxabg/iiaJ7zJmsvxtp6FW8AZtyRd4Xie9ed/mXpQEV/N/bUmnjcYWN44ZT9
pItz/AWRKuMDuX4yDeMJiM+XeQMpLToLN8NrAmnIajkmFsnpTblpIl0r9GjwBczsZnGK9n3a7lY
iI3Satf9/8wiHQQdSR6I8YzgibhWtnobQvKNK9pdqMbWPYp6cIwTtaVRe78iP8OmDXFvpr6J3Uq
xHT4qz3Qc8AWkSNm0Md6i+R7xVnFw/glzYjQkhgGLtVAyHUmIwFWa5NyEJnDF8OE0JHjyRU3cq7
+qBhmqlp7Wu5Z8KRRbHynt72OatgsWK3ssXWGwCSwExhlHHI7y39Tajda/kQPSuI6fV/27q2/ad
EZQXE=
X-Received: by 2002:a17:907:a890:b0:c51:24a3:fdcd with SMTP id a640c23a62f3a-c513aace71fmr3610385466b.17.1796302938912;
Thu, 03 Dec 2026 05:02:18 -0800 (PST)
X-Received: from ?IPV6:2a01:4b00:bd21:4f00:7cc6:d3ca:494:116c? ([2a01:4b00:bd21:4f00:7cc6:d3ca:494:116c])
by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab5ffcad11sm81551927f8f.0.2026.12.03.05.02.15
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Thu, 03 Dec 2026 05:02:18 -0800 (PST)
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
X-User-Agent: Mozilla Thunderbird
X-In-Reply-To: <87zeuvkgv6.fsf@all.your.base.are.belong.to.us>