diff options
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index dec1748..bd3b539 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -419,8 +419,11 @@ struct sk_buff { * want to keep them across layers you have to do a skb_clone() * first. This is owned by whoever has the skb queued ATM. */ +#ifdef CONFIG_AS_FASTPATH + char cb[96] __aligned(8); +#else char cb[48] __aligned(8); - +#endif unsigned long _skb_refdst; #ifdef CONFIG_XFRM struct sec_path *sp; @@ -511,6 +514,10 @@ struct sk_buff { sk_buff_data_t inner_transport_header; sk_buff_data_t inner_network_header; +#ifdef CONFIG_RX_TX_BUFF_XCHG + __u8 owner; + struct sk_buff *new_skb; +#endif sk_buff_data_t inner_mac_header; sk_buff_data_t transport_header; sk_buff_data_t network_header; @@ -658,6 +665,9 @@ static inline struct sk_buff *alloc_skb_head(gfp_t priority) return __alloc_skb_head(priority, -1); } +extern void skb_recycle(struct sk_buff *skb); +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 int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask); extern struct sk_buff *skb_clone(struct sk_buff *skb, @@ -2918,6 +2928,27 @@ static inline void skb_checksum_none_assert(const struct sk_buff *skb) bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); +static inline bool skb_is_recycleable(const struct sk_buff *skb, int skb_size) +{ + if (irqs_disabled()) + return false; + + if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) + return false; + + if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE) + return false; + + skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD); + if (skb_end_offset(skb) < skb_size) + return false; + + if (skb_shared(skb) || skb_cloned(skb)) + return false; + + return true; +} + u32 __skb_get_poff(const struct sk_buff *skb); /** |