Unverified Commit c5e14e78 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!678 backport some bug fix for page pool

Merge Pull Request from: @svishen 
 
backport the patch community has solved a page_pool problem.

issue:
https://gitee.com/openeuler/kernel/issues/I718LV 
 
Link:https://gitee.com/openeuler/kernel/pulls/678

 

Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 44384492 aa8df3f0
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -5261,18 +5261,18 @@ bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
	if (skb_cloned(to))
		return false;

	/* In general, avoid mixing slab allocated and page_pool allocated
	 * pages within the same SKB. However when @to is not pp_recycle and
	 * @from is cloned, we can transition frag pages from page_pool to
	 * reference counted.
	 *
	 * On the other hand, don't allow coalescing two pp_recycle SKBs if
	 * @from is cloned, in case the SKB is using page_pool fragment
	/* In general, avoid mixing page_pool and non-page_pool allocated
	 * pages within the same SKB. Additionally avoid dealing with clones
	 * with page_pool pages, in case the SKB is using page_pool fragment
	 * references (PP_FLAG_PAGE_FRAG). Since we only take full page
	 * references for cloned SKBs at the moment that would result in
	 * inconsistent reference counts.
	 * In theory we could take full references if @from is cloned and
	 * !@to->pp_recycle but its tricky (due to potential race with
	 * the clone disappearing) and rare, so not worth dealing with.
	 */
	if (to->pp_recycle != (from->pp_recycle && !skb_cloned(from)))
	if (to->pp_recycle != from->pp_recycle ||
	    (from->pp_recycle && skb_cloned(from)))
		return false;

	if (len <= skb_tailroom(to)) {