Subject: Re: [PATCH net-next 1/4] eth: mlx4: create a page pool for Rx

From: Jakub Kicinski <[email-masked]>
Date: Thu, 6 Feb 2025 15:04:34 -0800

On Thu, 6 Feb 2025 21:44:38 +0200 Tariq Toukan wrote:
> > -	if (xdp_rxq_info_reg(&ring->xdp_rxq, priv->dev, queue_index, 0) < 0)
> > +	pp.flags = PP_FLAG_DMA_MAP;
> > +	pp.pool_size = MLX4_EN_MAX_RX_SIZE;  
> 
> Pool size is not accurate.
>  From one side, MLX4_EN_MAX_RX_SIZE might be too big compared to the 
> actual size.
> 
> However, more importantly, it can be too small when working with large 
> MTU. This is mutually exclusive with XDP in mlx4.
> 
> Rx ring entries consist of 'frags', each entry needs between 1 to 4 
> (MLX4_EN_MAX_RX_FRAGS) frags. In default MTU, each page shared between 
> two entries.

The pool_size is just the size of the cache, how many unallocated
DMA mapped pages we can keep around before freeing them to system
memory. It has no implications for correctness.