未验证 提交 c5e14e78 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!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: Jialin Zhang <zhangjialin11@huawei.com> 
......@@ -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)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册