Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp907115pxb; Tue, 8 Feb 2022 05:19:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAw+oDCUtEMGQP+NiMhIMlm9dLfcu/VDukFEaVHoz1XjR1oZp6gePNZugOiWCLdde+RWxC X-Received: by 2002:a17:902:e5cb:: with SMTP id u11mr1408523plf.33.1644326353724; Tue, 08 Feb 2022 05:19:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644326353; cv=none; d=google.com; s=arc-20160816; b=N6rTAQGOnZlPEJLE+sDkm4CKsyAvinvGdAU1SsAD9yLEp2fquysEeyi6LMUY+Zmt10 QY+eCWUfUgJ4mUEVmttHNpec1FZUcqpdzVV7mVXOqJFkymyL9SGuOWtuan5FMoB9rtN1 oTLD42RY14m8uceo5bi41WAuTWS2vk2qm8DYlkBQIZOlATOjX+vwQxMCwkrSysDQbPBl SIkQmpGBP2io2/q6oIiL9cOi5r2slojJ980LCg4FSwn5CNXvPjzvF4ut7TOX9n6XpjA1 C7DMTDi/Driyo37FiveIDyrz7m8GnXyyoAdF6KkV0Sexry4AhVy5otDD6Yp8tCHzDGZK C2mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=KgJJdfopCu/gOTHns364l9rxwDPl5Ujwxxvwj3Zh+CA=; b=GznQc6Ht7VAKvZgBLmk/yA5X86wTD9Ll/lk5mWabCH2AlWYC/oFO/UEMgcnUOQM9aO nyHEdzAaFDz6fayceoXmdQAsCFOnKp1TeWFNfeHjd4jRsPh+FKbkilTFiTvxsGLyZ05Q MBvWFo+ZuQlZyJ+oUlUgNv3l+9IzhJ1SLxzuyg28G1VR78rc7dizrTjBgW5cwnLqARBV eZwt+K+gWXB5wugySoucTbe00ytZF+JFPGKurErw8CsRk0LRjr5FtkYr5oEGzMNUd3SQ zzt5WjU4afRipgbYTtGDe/9oTt3y9Fq0AwnDgyclIP7oMcml3dskvOvclI5WN/coM62V mmMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lgnRSdgF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt23si2154306pjb.101.2022.02.08.05.19.00; Tue, 08 Feb 2022 05:19:13 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lgnRSdgF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345744AbiBHDBk (ORCPT + 99 others); Mon, 7 Feb 2022 22:01:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245526AbiBHDBj (ORCPT ); Mon, 7 Feb 2022 22:01:39 -0500 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9CABC061A73; Mon, 7 Feb 2022 19:01:38 -0800 (PST) Received: by mail-ej1-x642.google.com with SMTP id m4so48071191ejb.9; Mon, 07 Feb 2022 19:01:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KgJJdfopCu/gOTHns364l9rxwDPl5Ujwxxvwj3Zh+CA=; b=lgnRSdgFW6GsulGqW6bELZTt4gLU7Iqwu2zRGVIQOOlgP13+GlUT3pxc8u8uC469nl VZNz50vaB6hg2JIAebzJoCMgQ38LTFlXpDq1vWoK0ez980OdQ9z3RTeodLipWHbL7Yke 1teeBSwS+lfwi3CVx4dkBK4DKhnqsXd84FygiXgobtpn0lTHgm3MspDOQS3VA1WkX2qu PCWnBvsX5SMipHyRXKeadFgjF9LHRl4TP9F3sUfNh/o4TKRtoh84HVF32VRQivlVm9So Qkj6ldLLBnLMNStCGc/ysMDqhSOpJ77stv1E10E322pYDLeMeTQCAGUeHv+UFZmudZHU Wlgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KgJJdfopCu/gOTHns364l9rxwDPl5Ujwxxvwj3Zh+CA=; b=eOxBbnK+IFRyDjPjrovedgqFdQKaxWUitWt70uGlfr9oP3GWIUMsO++N8VKVurKz+x NDPvtqSHGMimI80/e0W2UKq9XXAwTu4+MS5zN17NRkXJck3DFhYyoZIgQVU9+Lrg9+Qk L8hrFOrTKObRNt8W2oQlSYnGCHITP28aNHe66hHUjGwBjfEa9S5qALAkYyQveUzmUhYu UYCMBQPlGsU4zi0fzYPn+1vQraDQZPDcazpYOj6+VS5zbH7/LtktYiXM0wdmW4NMXxSx skwhpQuNgSpM8B6OtxSl1UAwHKLMBcAqdpkw8S4Bw304bGYbS2XJeCkSVuz5sf2JxCuz 43qw== X-Gm-Message-State: AOAM531zgam0zh7E4ta/7P1xlKxGnGYhLHNMGdwAEsPgLQLAD+ZkWcVA znliRnSXIx7ZNUzl6mtZtHoNqMDVf0C4sGPORM8= X-Received: by 2002:a17:907:1689:: with SMTP id hc9mr2096012ejc.348.1644289297300; Mon, 07 Feb 2022 19:01:37 -0800 (PST) MIME-Version: 1.0 References: <20220205081738.565394-1-imagedong@tencent.com> <20220207094301.5c061d23@gandalf.local.home> In-Reply-To: <20220207094301.5c061d23@gandalf.local.home> From: Menglong Dong Date: Tue, 8 Feb 2022 10:56:44 +0800 Message-ID: Subject: Re: [PATCH v6 net-next] net: drop_monitor: support drop reason To: Steven Rostedt Cc: Jakub Kicinski , David Ahern , Ido Schimmel , Neil Horman , David Miller , netdev , LKML , Menglong Dong Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Mon, Feb 7, 2022 at 10:43 PM Steven Rostedt wrote: > > On Sat, 5 Feb 2022 16:17:38 +0800 > menglong8.dong@gmail.com wrote: > > > --- a/net/core/drop_monitor.c > > +++ b/net/core/drop_monitor.c > > @@ -48,6 +48,16 @@ > > static int trace_state = TRACE_OFF; > > static bool monitor_hw; > > > > +#undef EM > > +#undef EMe > > + > > +#define EM(a, b) [a] = #b, > > +#define EMe(a, b) [a] = #b > > + > > +static const char *drop_reasons[SKB_DROP_REASON_MAX + 1] = { > > Do you need to define the size above? Can't the compiler do it for you? > > static const char *drop_reasons[] = { > Yeah, it seems the compiler can do this job. Thanks! > -- Steve > > > + TRACE_SKB_DROP_REASON > > +}; > > + > > /* net_dm_mutex > > *