projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b3a703c
)
skbuff: optimize the pull_pages code in __pskb_pull_tail()
author
linzhang
<
[email protected]
>
Mon, 17 Jul 2017 09:25:02 +0000
(17:25 +0800)
committer
David S. Miller
<
[email protected]
>
Mon, 17 Jul 2017 15:56:50 +0000
(08:56 -0700)
In the pull_pages code block, if the first frag size > eat,
we can end the loop in advance to avoid extra copy.
Signed-off-by: Lin Zhang <
[email protected]
>
Acked-by: Eric Dumazet <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/core/skbuff.c
patch
|
blob
|
history
diff --git
a/net/core/skbuff.c
b/net/core/skbuff.c
index 8b11341ed69ad97d34dd3e9b73c8c44ef7c452ff..b352c6bcfb31b6ddbf12666d71cb2eca101c65d6 100644
(file)
--- a/
net/core/skbuff.c
+++ b/
net/core/skbuff.c
@@
-1719,6
+1719,8
@@
pull_pages:
if (eat) {
skb_shinfo(skb)->frags[k].page_offset += eat;
skb_frag_size_sub(&skb_shinfo(skb)->frags[k], eat);
+ if (!i)
+ goto end;
eat = 0;
}
k++;
@@
-1726,6
+1728,7
@@
pull_pages:
}
skb_shinfo(skb)->nr_frags = k;
+end:
skb->tail += delta;
skb->data_len -= delta;