summaryrefslogtreecommitdiff
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h71
1 files changed, 47 insertions, 24 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 9995165..7521bf4 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -417,8 +417,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;
@@ -510,6 +513,10 @@ struct sk_buff {
__be16 inner_protocol;
__u16 inner_transport_header;
__u16 inner_network_header;
+#if defined(CONFIG_GIANFAR) && defined(CONFIG_AS_FASTPATH)
+ __u8 owner;
+ struct sk_buff *new_skb;
+#endif
__u16 inner_mac_header;
__u16 transport_header;
__u16 network_header;
@@ -657,29 +664,24 @@ static inline struct sk_buff *alloc_skb_head(gfp_t priority)
return __alloc_skb_head(priority, -1);
}
-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,
- gfp_t priority);
-extern struct sk_buff *skb_copy(const struct sk_buff *skb,
- gfp_t priority);
-extern struct sk_buff *__pskb_copy(struct sk_buff *skb,
- int headroom, gfp_t gfp_mask);
-
-extern int pskb_expand_head(struct sk_buff *skb,
- int nhead, int ntail,
- gfp_t gfp_mask);
-extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
- unsigned int headroom);
-extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
- int newheadroom, int newtailroom,
- gfp_t priority);
-extern int skb_to_sgvec(struct sk_buff *skb,
- struct scatterlist *sg, int offset,
- int len);
-extern int skb_cow_data(struct sk_buff *skb, int tailbits,
- struct sk_buff **trailer);
-extern int skb_pad(struct sk_buff *skb, int pad);
+void skb_recycle(struct sk_buff *skb);
+bool skb_recycle_check(struct sk_buff *skb, int skb_size);
+
+struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
+int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask);
+struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t priority);
+struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t priority);
+struct sk_buff *__pskb_copy(struct sk_buff *skb, int headroom, gfp_t gfp_mask);
+
+int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask);
+struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
+ unsigned int headroom);
+struct sk_buff *skb_copy_expand(const struct sk_buff *skb, int newheadroom,
+ int newtailroom, gfp_t priority);
+int skb_to_sgvec(struct sk_buff *skb, struct scatterlist *sg, int offset,
+ int len);
+int skb_cow_data(struct sk_buff *skb, int tailbits, struct sk_buff **trailer);
+int skb_pad(struct sk_buff *skb, int pad);
#define dev_kfree_skb(a) consume_skb(a)
extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
@@ -2803,6 +2805,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);
/**