diff options
author | David S. Miller <davem@davemloft.net> | 2010-05-02 02:21:44 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-02 02:21:44 -0700 |
commit | 47d29646a2c1c147d8a7598aeac2c87dd71ed638 (patch) | |
tree | b38f05d82883b5c0fc885812172a546af966d419 /include | |
parent | 43815482370c510c569fd18edb57afcb0fa8cab6 (diff) | |
download | op-kernel-dev-47d29646a2c1c147d8a7598aeac2c87dd71ed638.zip op-kernel-dev-47d29646a2c1c147d8a7598aeac2c87dd71ed638.tar.gz |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/skbuff.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 82f5116..746a652 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1128,6 +1128,11 @@ static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len) return skb->data += len; } +static inline unsigned char *skb_pull_inline(struct sk_buff *skb, unsigned int len) +{ + return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len); +} + extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) |