Hi Jacob,

Thanks for the review, I tested this patch previously
for 4kb page size systems. The throughput improvement is around
10 to 15%. Also sligthly better memory utilization as for
typical 1500 MTU size we are able to fit 2 Rx buffer in
a single 4kb page as compared to 1 per page previously.

Thanks
Dipayaan Roy 

On Mon, Jul 21, 2025 at 04:51:10PM -0700, Jacob Keller wrote:
> 
> 
> On 7/21/2025 3:14 AM, Dipayaan Roy wrote:
> > This patch enhances RX buffer handling in the mana driver by allocating
> > pages from a page pool and slicing them into MTU-sized fragments, rather
> > than dedicating a full page per packet. This approach is especially
> > beneficial on systems with 64KB page sizes.
> > 
> > Key improvements:
> > 
> > - Proper integration of page pool for RX buffer allocations.
> > - MTU-sized buffer slicing to improve memory utilization.
> > - Reduce overall per Rx queue memory footprint.
> > - Automatic fallback to full-page buffers when:
> >    * Jumbo frames are enabled (MTU > PAGE_SIZE / 2).
> >    * The XDP path is active, to avoid complexities with fragment reuse.
> > - Removal of redundant pre-allocated RX buffers used in scenarios like MTU
> >   changes, ensuring consistency in RX buffer allocation.
> > 
> > Testing on VMs with 64KB pages shows around 200% throughput improvement.
> > Memory efficiency is significantly improved due to reduced wastage in page
> > allocations. Example: We are now able to fit 35 Rx buffers in a single 64KB
> > page for MTU size of 1500, instead of 1 Rx buffer per page previously.
> > 
> Nice to see such improvements while also reducing the overall driver
> code footprint!
> 
> Do you happen to have numbers on some of the smaller page sizes? I'm not
> sure how common 64KB is, but it seems like this would still be quite
> beneficial even if you had 4K or 8K pages when operating at 1500 MTU.
> 
> Reviewed-by: Jacob Keller <[email protected]>




Reply via email to