Re: [PATCH v6 net-next] net: drop_monitor: support drop reason

From: Menglong Dong
Date: Mon Feb 07 2022 - 22:01:43 EST


On Mon, Feb 7, 2022 at 10:43 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> On Sat, 5 Feb 2022 16:17:38 +0800
> menglong8.dong@xxxxxxxxx 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
> > *