Re: [RFC PATCH v3 08/12] net: support non paged skb frags
From: Mina Almasry
Date: Fri Nov 10 2023 - 13:33:52 EST
On Thu, Nov 9, 2023 at 1:15 AM Paolo Abeni <pabeni@xxxxxxxxxx> wrote:
>
> On Sun, 2023-11-05 at 18:44 -0800, Mina Almasry wrote:
> [...]
> > @@ -3421,7 +3446,7 @@ static inline struct page *skb_frag_page(const skb_frag_t *frag)
> > */
> > static inline void __skb_frag_ref(skb_frag_t *frag)
> > {
> > - get_page(skb_frag_page(frag));
> > + page_pool_page_get_many(frag->bv_page, 1);
>
> I guess the above needs #ifdef CONFIG_PAGE_POOL guards and explicit
> skb_frag_is_page_pool_iov() check ?
>
It doesn't actually. page_pool_page_* helpers are compiled in
regardless of CONFIG_PAGE_POOL, and handle both page_pool_iov* & page*
just fine (the checking happens inside the function).
You may yell at me that it's too confusing... I somewhat agree, but
I'm unsure of what is a better name or location for the helpers. The
helpers handle (page_pool_iov* || page*) gracefully, so they seem to
belong in the page pool for me, but it is indeed surprising/confusing
that these helpers are available even if !CONFIG_PAGE_POOL.
>
> Cheers,
>
> Paolo
>
>
--
Thanks,
Mina