Skip to content
Commit ec43908d authored by Menglong Dong's avatar Menglong Dong Committed by Paolo Abeni
Browse files

net: skb: use auto-generation to convert skb drop reason to string



It is annoying to add new skb drop reasons to 'enum skb_drop_reason'
and TRACE_SKB_DROP_REASON in trace/event/skb.h, and it's easy to forget
to add the new reasons we added to TRACE_SKB_DROP_REASON.

TRACE_SKB_DROP_REASON is used to convert drop reason of type number
to string. For now, the string we passed to user space is exactly the
same as the name in 'enum skb_drop_reason' with a 'SKB_DROP_REASON_'
prefix. Therefore, we can use 'auto-generation' to generate these
drop reasons to string at build time.

The new source 'dropreason_str.c' will be auto generated during build
time, which contains the string array
'const char * const drop_reasons[]'.

Signed-off-by: default avatarMenglong Dong <imagedong@tencent.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent ff8372a4
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment