]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: Get rid of consume_skb when tracing is off
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 Aug 2020 22:23:29 +0000 (08:23 +1000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Aug 2020 23:12:26 +0000 (16:12 -0700)
The function consume_skb is only meaningful when tracing is enabled.
This patch makes it conditional on CONFIG_TRACEPOINTS.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h
net/core/skbuff.c

index 46881d9021241c27ca39e2cf16665cb1e18a0cfa..e8bca74857a381559e6fd98f1ef5f86ca2742773 100644 (file)
@@ -1056,7 +1056,16 @@ void kfree_skb(struct sk_buff *skb);
 void kfree_skb_list(struct sk_buff *segs);
 void skb_dump(const char *level, const struct sk_buff *skb, bool full_pkt);
 void skb_tx_error(struct sk_buff *skb);
+
+#ifdef CONFIG_TRACEPOINTS
 void consume_skb(struct sk_buff *skb);
+#else
+static inline void consume_skb(struct sk_buff *skb)
+{
+       return kfree_skb(skb);
+}
+#endif
+
 void __consume_stateless_skb(struct sk_buff *skb);
 void  __kfree_skb(struct sk_buff *skb);
 extern struct kmem_cache *skbuff_head_cache;
index e18184ffa9c3fa65426979be78257cfaf9776a4c..6faf73d6a0f7431cd96a853b652fce68916c477f 100644 (file)
@@ -820,6 +820,7 @@ void skb_tx_error(struct sk_buff *skb)
 }
 EXPORT_SYMBOL(skb_tx_error);
 
+#ifdef CONFIG_TRACEPOINTS
 /**
  *     consume_skb - free an skbuff
  *     @skb: buffer to free
@@ -837,6 +838,7 @@ void consume_skb(struct sk_buff *skb)
        __kfree_skb(skb);
 }
 EXPORT_SYMBOL(consume_skb);
+#endif
 
 /**
  *     consume_stateless_skb - free an skbuff, assuming it is stateless