Commit 47d29646a2c1c147d8a7598aeac2c87dd71ed638
1 parent
4381548237
Exists in
master
and in
7 other branches
net: Inline skb_pull() in eth_type_trans().
In commit 6be8ac2f ("[NET]: uninline skb_pull, de-bloats a lot") we uninlined skb_pull. But in some critical paths it makes sense to inline this thing and it helps performance significantly. Create an skb_pull_inline() so that we can do this in a way that serves also as annotation. Based upon a patch by Eric Dumazet. Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 3 changed files with 7 additions and 2 deletions Side-by-side Diff
include/linux/skbuff.h
... | ... | @@ -1128,6 +1128,11 @@ |
1128 | 1128 | return skb->data += len; |
1129 | 1129 | } |
1130 | 1130 | |
1131 | +static inline unsigned char *skb_pull_inline(struct sk_buff *skb, unsigned int len) | |
1132 | +{ | |
1133 | + return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len); | |
1134 | +} | |
1135 | + | |
1131 | 1136 | extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); |
1132 | 1137 | |
1133 | 1138 | static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) |
net/core/skbuff.c
net/ethernet/eth.c