xref: /linux-6.15/include/net/dropreason.h (revision 286e6967)
1071c0fc6SJohannes Berg /* SPDX-License-Identifier: GPL-2.0-or-later */
2071c0fc6SJohannes Berg 
3071c0fc6SJohannes Berg #ifndef _LINUX_DROPREASON_H
4071c0fc6SJohannes Berg #define _LINUX_DROPREASON_H
5071c0fc6SJohannes Berg #include <net/dropreason-core.h>
6071c0fc6SJohannes Berg 
7071c0fc6SJohannes Berg /**
8071c0fc6SJohannes Berg  * enum skb_drop_reason_subsys - subsystem tag for (extended) drop reasons
9071c0fc6SJohannes Berg  */
10071c0fc6SJohannes Berg enum skb_drop_reason_subsys {
11071c0fc6SJohannes Berg 	/** @SKB_DROP_REASON_SUBSYS_CORE: core drop reasons defined above */
12071c0fc6SJohannes Berg 	SKB_DROP_REASON_SUBSYS_CORE,
13071c0fc6SJohannes Berg 
14baa951a1SJohannes Berg 	/**
15baa951a1SJohannes Berg 	 * @SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE: mac80211 drop reasons
16baa951a1SJohannes Berg 	 * for unusable frames, see net/mac80211/drop.h
17baa951a1SJohannes Berg 	 */
18baa951a1SJohannes Berg 	SKB_DROP_REASON_SUBSYS_MAC80211_UNUSABLE,
19baa951a1SJohannes Berg 
20baa951a1SJohannes Berg 	/**
21*9d802da4SAdrian Moreno 	 * @SKB_DROP_REASON_SUBSYS_OPENVSWITCH: openvswitch drop reasons,
22*9d802da4SAdrian Moreno 	 * see net/openvswitch/drop.h
23*9d802da4SAdrian Moreno 	 */
24*9d802da4SAdrian Moreno 	SKB_DROP_REASON_SUBSYS_OPENVSWITCH,
25*9d802da4SAdrian Moreno 
26071c0fc6SJohannes Berg 	/** @SKB_DROP_REASON_SUBSYS_NUM: number of subsystems defined */
27071c0fc6SJohannes Berg 	SKB_DROP_REASON_SUBSYS_NUM
28071c0fc6SJohannes Berg };
29071c0fc6SJohannes Berg 
30071c0fc6SJohannes Berg struct drop_reason_list {
31071c0fc6SJohannes Berg 	const char * const *reasons;
32071c0fc6SJohannes Berg 	size_t n_reasons;
33071c0fc6SJohannes Berg };
34071c0fc6SJohannes Berg 
35071c0fc6SJohannes Berg /* Note: due to dynamic registrations, access must be under RCU */
36071c0fc6SJohannes Berg extern const struct drop_reason_list __rcu *
37071c0fc6SJohannes Berg drop_reasons_by_subsys[SKB_DROP_REASON_SUBSYS_NUM];
38071c0fc6SJohannes Berg 
39071c0fc6SJohannes Berg void drop_reasons_register_subsys(enum skb_drop_reason_subsys subsys,
40071c0fc6SJohannes Berg 				  const struct drop_reason_list *list);
41071c0fc6SJohannes Berg void drop_reasons_unregister_subsys(enum skb_drop_reason_subsys subsys);
42071c0fc6SJohannes Berg 
43071c0fc6SJohannes Berg #endif
44