Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Revert "net: Get rid of consume_skb when tracing is off"
@ 2021-07-28  3:56 Yajun Deng
  2021-07-28 12:52 ` Herbert Xu
  2021-07-29  4:01 ` yajun.deng
  0 siblings, 2 replies; 5+ messages in thread
From: Yajun Deng @ 2021-07-28  3:56 UTC (permalink / raw)
  To: davem, kuba; +Cc: herbert, linux-kernel, netdev, 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)
Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
---
 include/linux/skbuff.h | 9 ---------
 net/core/skbuff.c      | 2 --
 2 files changed, 11 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f19190820e63..da897d455d58 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -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;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index fc7942c0dddc..f4c6529ce6b9 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -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
-- 
2.32.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Revert "net: Get rid of consume_skb when tracing is off"
  2021-07-28  3:56 [PATCH] Revert "net: Get rid of consume_skb when tracing is off" Yajun Deng
@ 2021-07-28 12:52 ` Herbert Xu
  2021-07-29  4:01 ` yajun.deng
  1 sibling, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2021-07-28 12:52 UTC (permalink / raw)
  To: Yajun Deng; +Cc: davem, kuba, linux-kernel, netdev

On Wed, Jul 28, 2021 at 11:56:05AM +0800, Yajun Deng wrote:
> 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)
> Signed-off-by: Yajun Deng <yajun.deng@linux.dev>

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Revert "net: Get rid of consume_skb when tracing is off"
  2021-07-28  3:56 [PATCH] Revert "net: Get rid of consume_skb when tracing is off" Yajun Deng
  2021-07-28 12:52 ` Herbert Xu
@ 2021-07-29  4:01 ` yajun.deng
  2021-07-29  4:03   ` Herbert Xu
  2021-07-29  4:10   ` yajun.deng
  1 sibling, 2 replies; 5+ messages in thread
From: yajun.deng @ 2021-07-29  4:01 UTC (permalink / raw)
  To: Herbert Xu; +Cc: davem, kuba, linux-kernel, netdev

July 28, 2021 8:52 PM, "Herbert Xu" <herbert@gondor.apana.org.au> wrote:

> On Wed, Jul 28, 2021 at 11:56:05AM +0800, Yajun Deng wrote:
> 
>> 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)
>> Signed-off-by: Yajun Deng <yajun.deng@linux.dev>
> 
> 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.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Revert "net: Get rid of consume_skb when tracing is off"
  2021-07-29  4:01 ` yajun.deng
@ 2021-07-29  4:03   ` Herbert Xu
  2021-07-29  4:10   ` yajun.deng
  1 sibling, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2021-07-29  4:03 UTC (permalink / raw)
  To: yajun.deng; +Cc: davem, kuba, linux-kernel, netdev

On Thu, Jul 29, 2021 at 04:01:28AM +0000, yajun.deng@linux.dev 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,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Revert "net: Get rid of consume_skb when tracing is off"
  2021-07-29  4:01 ` yajun.deng
  2021-07-29  4:03   ` Herbert Xu
@ 2021-07-29  4:10   ` yajun.deng
  1 sibling, 0 replies; 5+ messages in thread
From: yajun.deng @ 2021-07-29  4:10 UTC (permalink / raw)
  To: Herbert Xu; +Cc: davem, kuba, linux-kernel, netdev

July 29, 2021 12:03 PM, "Herbert Xu" <herbert@gondor.apana.org.au> wrote:

> On Thu, Jul 29, 2021 at 04:01:28AM +0000, yajun.deng@linux.dev 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. 
> Cheers,
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-29  4:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-28  3:56 [PATCH] Revert "net: Get rid of consume_skb when tracing is off" Yajun Deng
2021-07-28 12:52 ` Herbert Xu
2021-07-29  4:01 ` yajun.deng
2021-07-29  4:03   ` Herbert Xu
2021-07-29  4:10   ` yajun.deng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).