• Alexander Lobakin's avatar
    net: skbuff: don't include <net/page_pool/types.h> to <linux/skbuff.h> · 75eaf63e
    Alexander Lobakin authored
    Currently, touching <net/page_pool/types.h> triggers a rebuild of more
    than half of the kernel. That's because it's included in
    <linux/skbuff.h>. And each new include to page_pool/types.h adds more
    [useless] data for the toolchain to process per each source file from
    that pile.
    
    In commit 6a5bcd84 ("page_pool: Allow drivers to hint on SKB
    recycling"), Matteo included it to be able to call a couple of functions
    defined there. Then, in commit 57f05bc2 ("page_pool: keep pp info as
    long as page pool owns the page") one of the calls was removed, so only
    one was left. It's the call to page_pool_return_skb_page() in
    napi_frag_unref(). The function is external and doesn't have any
    dependencies. Having very niche page_pool_types.h included only for that
    looks like an overkill.
    
    As %PP_SIGNATURE is not local to page_pool.c (was only in the
    early submissions), nothing holds this function there. Teleport
    page_pool_return_skb_page() to skbuff.c, just next to the main consumer,
    skb_pp_recycle(), and rename it to napi_pp_put_page(), as it doesn't
    work with skbs at all and the former name tells nothing. The #if guards
    here are only to not compile and have it in the vmlinux when not needed
    -- both call sites are already guarded.
    Now, touching page_pool_types.h only triggers rebuilding of the drivers
    using it and a couple of core networking files.
    
    Suggested-by: Jakub Kicinski <kuba@kernel.org> # make skbuff.h less heavy
    Suggested-by: Alexander Duyck <alexanderduyck@fb.com> # move to skbuff.c
    Signed-off-by: default avatarAlexander Lobakin <aleksander.lobakin@intel.com>
    Reviewed-by: default avatarAlexander Duyck <alexanderduyck@fb.com>
    Link: https://lore.kernel.org/r/20230804180529.2483231-3-aleksander.lobakin@intel.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    75eaf63e
skbuff.c 172 KB