Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Usama Arif
Thu, 26 Nov 2026 18:25
[PATCH v2] eth: bnxt: fix the agg page pool recycle ring size
Author: Usama Arif
Date: Thu, 26 Nov 2026 18:25
Date: Thu, 26 Nov 2026 18:25
55 lines
10588 bytes
10588 bytes
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 the number of agg buffers per page.
Commit c55bf90a2112 ("eth: bnxt: adjust the fill level of agg queues
with larger buffers") changed the divisor to rx_page_size /
BNXT_RX_PAGE_SIZE, which is wrong in two cases:
- On 64K-page kernels rx_page_size can only be 32K, so the divisor is
1, although each 64K page holds two agg buffers. With 1024 RX
descriptors the agg ring posts 2048 buffers in 1024 pages, while the
recycle ring can cache 2048 pages, or 128 MiB per RX queue.
- When a memory provider sets rx_page_size above PAGE_SIZE, each buffer
is its own allocation and the fill level is already divided by
rx_page_size / BNXT_RX_PAGE_SIZE. Dividing again gives a 4K kernel
with 16K buffers a 256-entry ring for 1024 posted buffers.
Divide the fill level by the number of buffers per allocation,
max(PAGE_SIZE, rx_page_size) / rx_page_size. Nothing changes for
kernels with pages of 32K or less that use the default buffer size.
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 in the agg page pools after the fix, 64 MiB per busy queue.
This NIC's firmware lacks the VNIC RE_FLUSH capability bnxt needs for
the queue API, so memory providers could not be bound. Instead, a
test-only patch forcing rx_page_size to 16K and 32K on one queue of a
4K kernel showed the ring going from 256 and 64 entries to 1024 and
512, matching the buffers posted.
Fixes: c55bf90a2112 ("eth: bnxt: adjust the fill level of agg queues with larger buffers")
Suggested-by: Björn Töpel <bjorn@kernel.org>
Signed-off-by: Usama Arif <usama.arif@linux.dev>
Reviewed-by: Björn Töpel <bjorn@kernel.org>
---
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..85ce4b2e297ecb 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) /
+ rxr->rx_page_size;
const unsigned int rx_size_fac = PAGE_SIZE / SZ_4K;
struct page_pool_params pp = { 0 };
struct page_pool *pool;
--
2.53.1-Meta
Re: [PATCH v2] eth: bnxt: fix the agg page pool recycle ring size
Author: patchwork-bot+netdevbpf
Date: Wed, 02 Dec 2026 04:20
Date: Wed, 02 Dec 2026 04:20
24 lines
8732 bytes
8732 bytes
Hello:
This patch was applied to netdev/net.git (main)
by Willem de Bruijn <willemb@google.com>:
On Thu, 26 Nov 2026 10:25:20 -0800 you wrote:
> 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 the number of agg buffers per page.
> Commit c55bf90a2112 ("eth: bnxt: adjust the fill level of agg queues
> with larger buffers") changed the divisor to rx_page_size /
> BNXT_RX_PAGE_SIZE, which is wrong in two cases:
>
> [...]
Here is the summary with links:
- [v2] eth: bnxt: fix the agg page pool recycle ring size
https://git.kernel.org/netdev/net/c/28cfc94e29f5
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads