Loading include/linux/skbuff.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -501,7 +501,7 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size, return __alloc_skb(size, priority, 1, -1); return __alloc_skb(size, priority, 1, -1); } } extern int skb_recycle_check(struct sk_buff *skb, int skb_size); extern bool skb_recycle_check(struct sk_buff *skb, int skb_size); extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); extern struct sk_buff *skb_clone(struct sk_buff *skb, extern struct sk_buff *skb_clone(struct sk_buff *skb, Loading net/core/skbuff.c +6 −6 Original line number Original line Diff line number Diff line Loading @@ -482,22 +482,22 @@ EXPORT_SYMBOL(consume_skb); * reference count dropping and cleans up the skbuff as if it * reference count dropping and cleans up the skbuff as if it * just came from __alloc_skb(). * just came from __alloc_skb(). */ */ int skb_recycle_check(struct sk_buff *skb, int skb_size) bool skb_recycle_check(struct sk_buff *skb, int skb_size) { { struct skb_shared_info *shinfo; struct skb_shared_info *shinfo; if (irqs_disabled()) if (irqs_disabled()) return 0; return false; if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE) if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE) return 0; return false; skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD); skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD); if (skb_end_pointer(skb) - skb->head < skb_size) if (skb_end_pointer(skb) - skb->head < skb_size) return 0; return false; if (skb_shared(skb) || skb_cloned(skb)) if (skb_shared(skb) || skb_cloned(skb)) return 0; return false; skb_release_head_state(skb); skb_release_head_state(skb); Loading @@ -509,7 +509,7 @@ int skb_recycle_check(struct sk_buff *skb, int skb_size) skb->data = skb->head + NET_SKB_PAD; skb->data = skb->head + NET_SKB_PAD; skb_reset_tail_pointer(skb); skb_reset_tail_pointer(skb); return 1; return true; } } EXPORT_SYMBOL(skb_recycle_check); EXPORT_SYMBOL(skb_recycle_check); Loading Loading
include/linux/skbuff.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -501,7 +501,7 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size, return __alloc_skb(size, priority, 1, -1); return __alloc_skb(size, priority, 1, -1); } } extern int skb_recycle_check(struct sk_buff *skb, int skb_size); extern bool skb_recycle_check(struct sk_buff *skb, int skb_size); extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); extern struct sk_buff *skb_clone(struct sk_buff *skb, extern struct sk_buff *skb_clone(struct sk_buff *skb, Loading
net/core/skbuff.c +6 −6 Original line number Original line Diff line number Diff line Loading @@ -482,22 +482,22 @@ EXPORT_SYMBOL(consume_skb); * reference count dropping and cleans up the skbuff as if it * reference count dropping and cleans up the skbuff as if it * just came from __alloc_skb(). * just came from __alloc_skb(). */ */ int skb_recycle_check(struct sk_buff *skb, int skb_size) bool skb_recycle_check(struct sk_buff *skb, int skb_size) { { struct skb_shared_info *shinfo; struct skb_shared_info *shinfo; if (irqs_disabled()) if (irqs_disabled()) return 0; return false; if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE) if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE) return 0; return false; skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD); skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD); if (skb_end_pointer(skb) - skb->head < skb_size) if (skb_end_pointer(skb) - skb->head < skb_size) return 0; return false; if (skb_shared(skb) || skb_cloned(skb)) if (skb_shared(skb) || skb_cloned(skb)) return 0; return false; skb_release_head_state(skb); skb_release_head_state(skb); Loading @@ -509,7 +509,7 @@ int skb_recycle_check(struct sk_buff *skb, int skb_size) skb->data = skb->head + NET_SKB_PAD; skb->data = skb->head + NET_SKB_PAD; skb_reset_tail_pointer(skb); skb_reset_tail_pointer(skb); return 1; return true; } } EXPORT_SYMBOL(skb_recycle_check); EXPORT_SYMBOL(skb_recycle_check); Loading