net: remove napi_frag_unref
authorMina Almasry <almasrymina@google.com>
Mon, 8 Apr 2024 15:29:58 +0000 (08:29 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 10 Apr 2024 01:20:32 +0000 (18:20 -0700)
With the changes in the last patches, napi_frag_unref() is now
reduandant. Remove it and use skb_page_unref directly.

Signed-off-by: Mina Almasry <almasrymina@google.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://lore.kernel.org/r/20240408153000.2152844-4-almasrymina@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/skbuff.h
net/core/skbuff.c

index c0ff85bb087ad0dd317f4e6079fc7937c1afbf9c..7135a3e94afd0dea70c8c5817bdc9b3d2d384f2b 100644 (file)
@@ -3531,12 +3531,6 @@ skb_page_unref(struct page *page, bool recycle)
        put_page(page);
 }
 
-static inline void
-napi_frag_unref(skb_frag_t *frag, bool recycle)
-{
-       skb_page_unref(skb_frag_page(frag), recycle);
-}
-
 /**
  * __skb_frag_unref - release a reference on a paged fragment.
  * @frag: the paged fragment
@@ -3547,7 +3541,7 @@ napi_frag_unref(skb_frag_t *frag, bool recycle)
  */
 static inline void __skb_frag_unref(skb_frag_t *frag, bool recycle)
 {
-       napi_frag_unref(frag, recycle);
+       skb_page_unref(skb_frag_page(frag), recycle);
 }
 
 /**
index 21cd01641f4c047c9a7ff2924b686b5a42535f81..888874ef85667684cc7aa30e092a5de2d46a9361 100644 (file)
@@ -1101,7 +1101,7 @@ static void skb_release_data(struct sk_buff *skb, enum skb_drop_reason reason)
        }
 
        for (i = 0; i < shinfo->nr_frags; i++)
-               napi_frag_unref(&shinfo->frags[i], skb->pp_recycle);
+               __skb_frag_unref(&shinfo->frags[i], skb->pp_recycle);
 
 free_head:
        if (shinfo->frag_list)