diff mbox series

[net-next,1/2] net: skb: introduce SKB_DR_MAX_LEN

Message ID 20220208072836.3540192-2-imagedong@tencent.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: drop_monitor: support drop reason | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 15 this patch: 15
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 18 this patch: 18
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 20 this patch: 20
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Menglong Dong Feb. 8, 2022, 7:28 a.m. UTC
From: Menglong Dong <imagedong@tencent.com>

Introduce 'SKB_DR_MAX_LEN' to define the max length of drop reasons.
32 should be enough, as the current longest reason is
'UNICAST_IN_L2_MULTICAST'.

Signed-off-by: Menglong Dong <imagedong@tencent.com>
---
 include/trace/events/skb.h | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h
index cfcfd26399f7..920adcd564bc 100644
--- a/include/trace/events/skb.h
+++ b/include/trace/events/skb.h
@@ -9,6 +9,11 @@ 
 #include <linux/netdevice.h>
 #include <linux/tracepoint.h>
 
+/* max string length of drop reason. We use 'SKB_DR_' as the prefix to
+ * make it distinct from 'enum skb_drop_reason'
+ */
+#define SKB_DR_MAX_LEN	32
+
 #define TRACE_SKB_DROP_REASON					\
 	EM(SKB_DROP_REASON_NOT_SPECIFIED, NOT_SPECIFIED)	\
 	EM(SKB_DROP_REASON_NO_SOCKET, NO_SOCKET)		\