]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/skbuff.h
skb: allow skb_scrub_packet() to be used by tunnels
[karo-tx-linux.git] / include / linux / skbuff.h
index 5afefa01a13c892e1fe9eb7ce6fc3f047e5880ba..2ddb48d9312c260e1e41a87ac25a19314f2aa379 100644 (file)
@@ -501,7 +501,7 @@ struct sk_buff {
        /* 7/9 bit hole (depending on ndisc_nodetype presence) */
        kmemcheck_bitfield_end(flags2);
 
-#if defined CONFIG_NET_DMA || defined CONFIG_NET_LL_RX_POLL
+#if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL
        union {
                unsigned int    napi_id;
                dma_cookie_t    dma_cookie;
@@ -1805,10 +1805,13 @@ static inline void pskb_trim_unique(struct sk_buff *skb, unsigned int len)
  */
 static inline void skb_orphan(struct sk_buff *skb)
 {
-       if (skb->destructor)
+       if (skb->destructor) {
                skb->destructor(skb);
-       skb->destructor = NULL;
-       skb->sk         = NULL;
+               skb->destructor = NULL;
+               skb->sk         = NULL;
+       } else {
+               BUG_ON(skb->sk);
+       }
 }
 
 /**
@@ -1902,8 +1905,8 @@ static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
        return __netdev_alloc_skb_ip_align(dev, length, GFP_ATOMIC);
 }
 
-/*
- *     __skb_alloc_page - allocate pages for ps-rx on a skb and preserve pfmemalloc data
+/**
+ *     __skb_alloc_pages - allocate pages for ps-rx on a skb and preserve pfmemalloc data
  *     @gfp_mask: alloc_pages_node mask. Set __GFP_NOMEMALLOC if not for network packet RX
  *     @skb: skb to set pfmemalloc on if __GFP_MEMALLOC is used
  *     @order: size of the allocation
@@ -2356,6 +2359,10 @@ extern int              skb_copy_datagram_from_iovec(struct sk_buff *skb,
                                                    const struct iovec *from,
                                                    int from_offset,
                                                    int len);
+extern int            zerocopy_sg_from_iovec(struct sk_buff *skb,
+                                             const struct iovec *frm,
+                                             int offset,
+                                             size_t count);
 extern int            skb_copy_datagram_const_iovec(const struct sk_buff *from,
                                                     int offset,
                                                     const struct iovec *to,
@@ -2385,7 +2392,7 @@ extern void              skb_split(struct sk_buff *skb,
                                 struct sk_buff *skb1, const u32 len);
 extern int            skb_shift(struct sk_buff *tgt, struct sk_buff *skb,
                                 int shiftlen);
-extern void           skb_scrub_packet(struct sk_buff *skb);
+extern void           skb_scrub_packet(struct sk_buff *skb, bool xnet);
 
 extern struct sk_buff *skb_segment(struct sk_buff *skb,
                                   netdev_features_t features);