Subject: Re: [PATCH net-next v4 4/6] enic: Use the Page Pool API for RX when MTU is less than page size

From: Jakub Kicinski <[email-masked]>
Date: Fri, 10 Jan 2025 16:41:52 -0800

On Fri, 10 Jan 2025 15:52:04 -0800 John Daley wrote:
> >SG, but please don't report it via ethtool. Add it in 
> >enic_get_queue_stats_rx() as alloc_fail (and enic_get_base_stats()).
> >As one of the benefits you'll be able to use
> >tools/testing/selftests/drivers/net/hw/pp_alloc_fail.py
> >to test this stat and error handling in the driver.  
> 
> Fyi, after making suggested change I used pp_alloc_fail.py but no
> errors were injected. I think the path from page_pool_dev_alloc()
> does not call page_pool_alloc_pages()?
> 
> Here is what I beleive the call path is:
> page_pool_dev_alloc(rq->pool, &offset, &truesize)
>   page_pool_alloc(pool, offset, size, gfp)
>     netmem_to_page(page_pool_alloc_netmem(pool, offset, size, gfp));
>       page_pool_alloc_frag_netmem(pool, offset, *size, gfp);
>         page_pool_alloc_netmems(pool, gfp);
>           __page_pool_alloc_pages_slow(pool, gfp);
> 
> If I change the call from page_pool_dev_alloc() to
> page_pool_dev_alloc_pages() in the driver I do see the errors injected.

Ah, good point. I think the netmems conversion broke it :(
If we moved the error injection to happen on page_pool_alloc_netmems
it would work, right? Would I be able to convince you to test that
and send a patch? :)