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

From: Steven Rostedt
Date: Mon Feb 07 2022 - 09:46:27 EST


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[] = {

-- Steve

> + TRACE_SKB_DROP_REASON
> +};
> +
> /* net_dm_mutex
> *