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

From: menglong8 . dong
Date: Tue Feb 08 2022 - 02:29:15 EST


From: Menglong Dong <imagedong@xxxxxxxxxxx>

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@xxxxxxxxxxx>
---
include/trace/events/skb.h | 5 +++++
1 file changed, 5 insertions(+)

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) \
--
2.34.1