Subject: Re: [RFC net-next 07/22] eth: bnxt: set page pool page order based on rx_page_size

From: Stanislav Fomichev <[email-masked]>
Date: Tue, 22 Apr 2025 08:32:29 -0700

On 04/21, Jakub Kicinski wrote:
> If user decides to increase the buffer size for agg ring
> we need to ask the page pool for higher order pages.
> There is no need to use larger pages for header frags,
> if user increase the size of agg ring buffers switch
> to separate header page automatically.
> 
> Signed-off-by: Jakub Kicinski <[email-masked]>
> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index b611a5ff6d3c..a86bb2ba5adb 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -3802,6 +3802,7 @@ static int bnxt_alloc_rx_page_pool(struct bnxt *bp,
>  	pp.pool_size = bp->rx_agg_ring_size;
>  	if (BNXT_RX_PAGE_MODE(bp))
>  		pp.pool_size += bp->rx_ring_size;
> +	pp.order = get_order(bp->rx_page_size);

Since it's gonna be configured by the users going forward, for the
pps that don't have mp, we might want to check pp.order against
MAX_PAGE_ORDER (and/or PAGE_ALLOC_COSTLY_ORDER?) during
page_pool_create?