Netdev List
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Eric Dumazet <edumazet@google.com>
Cc: Menglong Dong <menglong8.dong@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	David Miller <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>, Ingo Molnar <mingo@redhat.com>,
	Menglong Dong <imagedong@tencent.com>,
	David Ahern <dsahern@kernel.org>,
	Hao Peng <flyingpeng@tencent.com>,
	Dongli Zhang <dongli.zhang@oracle.com>,
	robh@kernel.org, Pavel Begunkov <asml.silence@gmail.com>,
	Luiz Augusto von Dentz <luiz.von.dentz@intel.com>,
	Vasily Averin <vasily.averin@linux.dev>,
	LKML <linux-kernel@vger.kernel.org>,
	netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v2] net: skb: export skb drop reaons to user by TRACE_DEFINE_ENUM
Date: Mon, 5 Sep 2022 10:38:08 -0400	[thread overview]
Message-ID: <20220905103808.434f6909@gandalf.local.home> (raw)
In-Reply-To: <CANn89iK7Mm4aPpr1-VM5OgicuHrHjo9nm9P9bYgOKKH9yczFzg@mail.gmail.com>

On Fri, 2 Sep 2022 08:43:07 -0700
Eric Dumazet <edumazet@google.com> wrote:

> > ---
> > v2:
> > - undef FN/FNe after use it (Jakub Kicinski)  
> 
> I would love some feedback from Steven :)

The undef should be fine. I usually do not, but that's more of a preference
than a rule.

As long as the undef is done after the C portion of where the macro is used:

+#undef FN
+#define FN(reason)	TRACE_DEFINE_ENUM(SKB_DROP_REASON_##reason);
+DEFINE_DROP_REASON(FN, FN) <<<--- C portion

+#undef FN
+#undef FNe
+#define FN(reason)	{ SKB_DROP_REASON_##reason, #reason },
+#define FNe(reason)	{ SKB_DROP_REASON_##reason, #reason }
+
 /*
  * Tracepoint for free an sk_buff:
  */
@@ -35,9 +44,13 @@ TRACE_EVENT(kfree_skb,
 
 	TP_printk("skbaddr=%p protocol=%u location=%p reason: %s",
 		  __entry->skbaddr, __entry->protocol, __entry->location,
-		  drop_reasons[__entry->reason])
+		  __print_symbolic(__entry->reason,
+				   DEFINE_DROP_REASON(FN, FNe)))  <<<--- C portion
 );
 
+#undef FN
+#undef FNe

So for this part: Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>

-- Steve

  parent reply	other threads:[~2022-09-05 14:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-02 14:17 [PATCH net-next v2] net: skb: export skb drop reaons to user by TRACE_DEFINE_ENUM menglong8.dong
2022-09-02 15:43 ` Eric Dumazet
2022-09-04  4:34   ` Menglong Dong
2022-09-05 14:38   ` Steven Rostedt [this message]
2022-10-27 15:32     ` Eric Dumazet
2022-10-27 15:44       ` Steven Rostedt
2022-10-27 16:28         ` Eric Dumazet
2022-10-27 16:38           ` Steven Rostedt
2022-10-28  2:26           ` [Internet]Re: " imagedong(董梦龙)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220905103808.434f6909@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=asml.silence@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dongli.zhang@oracle.com \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=flyingpeng@tencent.com \
    --cc=imagedong@tencent.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.von.dentz@intel.com \
    --cc=menglong8.dong@gmail.com \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=vasily.averin@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox