Skip to contentSkip to conversation

Revert "net: Get rid of consume_skb when tracing is off"

PATCH In review Yajun Deng 2 participants 5 messages Jul 28, 2021 – Jul 29, 2021

Subsystems (2)
lore
Share & tools
lore

Yajun Deng

author
#0 lore raw

PATCH 1/1 Revert "net: Get rid of consume_skb when tracing is off"

This reverts commit be769db2f95861cc8c7c8fedcc71a8c39b803b10. There is trace_kfree_skb() in kfree_skb(), the trace_kfree_skb() is also a trace function.

Fixes be769db2f958 (net: Get rid of consume_skb when tracing is off)
---
 include/linux/skbuff.h | 9 ---------
 net/core/skbuff.c      | 2 --
 2 files changed, 11 deletions(-)
include/linux/skbuff.h +0 -9
index f19190820e63..da897d455d58 100644
@@ -1072,16 +1072,7 @@ 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;
net/core/skbuff.c +0 -2
index fc7942c0dddc..f4c6529ce6b9 100644
@@ -893,7 +893,6 @@ 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
@@ -911,7 +910,6 @@ 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
Signature · 1 line
2.32.0
#1 lore raw
Quoted 6 lines · Yajun Deng

This reverts commit be769db2f95861cc8c7c8fedcc71a8c39b803b10. There is trace_kfree_skb() in kfree_skb(), the trace_kfree_skb() is also a trace function.

Fixes be769db2f958 (net: Get rid of consume_skb when tracing is off)

Please explain in more detail why your patch is needed. As it stands I do not understand the reasoning.

Thanks,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#2 lore raw
Quoted 6 lines · Herbert Xu
Quoted 4 lines · Yajun Deng

This reverts commit be769db2f95861cc8c7c8fedcc71a8c39b803b10. There is trace_kfree_skb() in kfree_skb(), the trace_kfree_skb() is also a trace function.

Quoted 6 lines
Quoted 2 lines
Fixes be769db2f958 (net: Get rid of consume_skb when tracing is off)

Please explain in more detail why your patch is needed. As it stands I do not understand the reasoning.

if we don't define CONFIG_TRACEPOINTS, consume_skb() wolud called kfree_skb(), there have trace_kfree_skb() in kfree_skb(), the trace_kfree_skb() is also a trace function. So we can trace consume_skb() even if we don't define CONFIG_TRACEPOINTS.
This patch "net: Get rid of consume_skb when tracing is off" does not seem to be effective.

Quoted 5 lines

Thanks,
--
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

#3 lore raw
Quoted 5 lines · On Thu, Jul 29, 2021 at 04:01:28AM +0000, [email protected] wrote:

if we don't define CONFIG_TRACEPOINTS, consume_skb() wolud called kfree_skb(), there have trace_kfree_skb() in kfree_skb(), the trace_kfree_skb() is also a trace function. So we can trace consume_skb() even if we don't define CONFIG_TRACEPOINTS.
This patch "net: Get rid of consume_skb when tracing is off" does not seem to be effective.

The point of my patch was to get rid of consume_skb because its only purpose is to provide extra information for tracing. If you're not tracing then you don't need that extra information (and overhead).

Cheers,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#4 lore raw
Quoted 11 lines · Herbert Xu
Quoted 4 lines · On Thu, Jul 29, 2021 at 04:01:28AM +0000, [email protected] wrote:

if we don't define CONFIG_TRACEPOINTS, consume_skb() wolud called kfree_skb(), there have trace_kfree_skb() in kfree_skb(), the trace_kfree_skb() is also a trace function. So we can trace consume_skb() even if we don't define CONFIG_TRACEPOINTS.
This patch "net: Get rid of consume_skb when tracing is off" does not seem to be effective.

The point of my patch was to get rid of consume_skb because its only purpose is to provide extra information for tracing. If you're not tracing then you don't need that extra information (and overhead).

Ok, I didn't understand it well.

Quoted 5 lines

Cheers,
--
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt