Skip to content

Commit

Permalink
net: skb: move skb_pp_recycle() to skbuff.c
Browse files Browse the repository at this point in the history
skb_pp_recycle() is only used by skb_free_head() in
skbuff.c, so move it to skbuff.c.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yunsheng Lin authored and David S. Miller committed Oct 24, 2022
1 parent 127b721 commit 4727bab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 0 additions & 7 deletions include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -5050,12 +5050,5 @@ static inline void skb_mark_for_recycle(struct sk_buff *skb)
}
#endif

static inline bool skb_pp_recycle(struct sk_buff *skb, void *data)
{
if (!IS_ENABLED(CONFIG_PAGE_POOL) || !skb->pp_recycle)
return false;
return page_pool_return_skb_page(virt_to_page(data));
}

#endif /* __KERNEL__ */
#endif /* _LINUX_SKBUFF_H */
7 changes: 7 additions & 0 deletions net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,13 @@ static void skb_clone_fraglist(struct sk_buff *skb)
skb_get(list);
}

static bool skb_pp_recycle(struct sk_buff *skb, void *data)
{
if (!IS_ENABLED(CONFIG_PAGE_POOL) || !skb->pp_recycle)
return false;
return page_pool_return_skb_page(virt_to_page(data));
}

static void skb_free_head(struct sk_buff *skb)
{
unsigned char *head = skb->head;
Expand Down

0 comments on commit 4727bab

Please sign in to comment.