Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3275531rwb; Mon, 5 Sep 2022 09:00:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR4h0KQClTMakwNmNNxnJqDYno+p+7/qTyFDf4mI5mINjRs8DA3qSIgH/tDXgN1eiKOwapHo X-Received: by 2002:a17:907:6eaa:b0:741:5338:6259 with SMTP id sh42-20020a1709076eaa00b0074153386259mr30644051ejc.20.1662393623656; Mon, 05 Sep 2022 09:00:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662393623; cv=none; d=google.com; s=arc-20160816; b=pAdYLOmt1SZLHyq0j4ky2dR7V7Sg85/Yi8R4VXnIb+ctHOODvLiXKCX2YiCPrAlP2E QtKZVJtOf4l6gDo/bf3bhhvaEyhlU4I2MW75rm+srUkFgHbMzmJ5HsBxWexAe/lrmu+h JUJ4S0h+xKxsCHfcaFWacY3u93FPvf0BFL/5lYbfhCF+yuMyOi5zNtqQt1D4w4YCTchh /CzIEqo97Dt97NbDGhLdCUIqLh9Q1AUNTRWmxN/Sxu4J/s+/vxRXDZpt0Fm1cRtyOnDl iJ1xyAi1dUoNxKlSnX5Nup1ijDF2E4aJ13tVhGZDkGDVDGM+90jrtt+1CAT5JZ4X+DDA jMlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=ueQkLT3qyOJwYfYlefrUAKSepy2+AkDlGpChmNapWuY=; b=zXaWPJY7OMxAJw45QeyTO37SBaoFn4y43Eyy07qPCijfqNcWdEs9Gz3vHIWB164rSx 9sF3AQC1/3s4eoDeaMzGPQOB/N5asXb/5YKk2mfQ8QTOk/VlSFIkJXIpOoso9ljlm9XQ VJ9ceBe3BYqdqO1AoMLcAwMpjl+PBQj9K9CdO3I+CBMCaU8Ubcb64jg8GivNyhLrQs8b IlJVXfSiXakgiUkz76Zcd4QZk4yESgHmP/iHdnW5j6PZyui8SidSkOUTZvDmZGkyXii7 1DollIJHYLLeh/x2JOpnbuy7o0XBKAW7idoTeyexMwqZ8ComYivxmEnpsgUAC//B8Mex 9gKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y2-20020a056402440200b00445d00730b3si9046750eda.416.2022.09.05.08.59.57; Mon, 05 Sep 2022 09:00:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238569AbiIEOka (ORCPT + 99 others); Mon, 5 Sep 2022 10:40:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238536AbiIEOj6 (ORCPT ); Mon, 5 Sep 2022 10:39:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 432FB5D12D; Mon, 5 Sep 2022 07:37:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7B1BCB81148; Mon, 5 Sep 2022 14:37:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D51EC433D6; Mon, 5 Sep 2022 14:37:31 +0000 (UTC) Date: Mon, 5 Sep 2022 10:38:08 -0400 From: Steven Rostedt To: Eric Dumazet Cc: Menglong Dong , Jakub Kicinski , David Miller , Paolo Abeni , Ingo Molnar , Menglong Dong , David Ahern , Hao Peng , Dongli Zhang , robh@kernel.org, Pavel Begunkov , Luiz Augusto von Dentz , Vasily Averin , LKML , netdev Subject: Re: [PATCH net-next v2] net: skb: export skb drop reaons to user by TRACE_DEFINE_ENUM Message-ID: <20220905103808.434f6909@gandalf.local.home> In-Reply-To: References: <20220902141715.1038615-1-imagedong@tencent.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2 Sep 2022 08:43:07 -0700 Eric Dumazet 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) -- Steve