lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 5 Sep 2022 10:38:08 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     Menglong Dong <menglong8.dong@...il.com>,
        Jakub Kicinski <kuba@...nel.org>,
        David Miller <davem@...emloft.net>,
        Paolo Abeni <pabeni@...hat.com>,
        Ingo Molnar <mingo@...hat.com>,
        Menglong Dong <imagedong@...cent.com>,
        David Ahern <dsahern@...nel.org>,
        Hao Peng <flyingpeng@...cent.com>,
        Dongli Zhang <dongli.zhang@...cle.com>, robh@...nel.org,
        Pavel Begunkov <asml.silence@...il.com>,
        Luiz Augusto von Dentz <luiz.von.dentz@...el.com>,
        Vasily Averin <vasily.averin@...ux.dev>,
        LKML <linux-kernel@...r.kernel.org>,
        netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v2] net: skb: export skb drop reaons to user by
 TRACE_DEFINE_ENUM

On Fri, 2 Sep 2022 08:43:07 -0700
Eric Dumazet <edumazet@...gle.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@...dmis.org>

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ