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 /** 21baa951a1SJohannes Berg * @SKB_DROP_REASON_SUBSYS_MAC80211_MONITOR: mac80211 drop reasons 22baa951a1SJohannes Berg * for frames still going to monitor, see net/mac80211/drop.h 23baa951a1SJohannes Berg */ 24baa951a1SJohannes Berg SKB_DROP_REASON_SUBSYS_MAC80211_MONITOR, 25baa951a1SJohannes Berg 26*9d802da4SAdrian Moreno /** 27*9d802da4SAdrian Moreno * @SKB_DROP_REASON_SUBSYS_OPENVSWITCH: openvswitch drop reasons, 28*9d802da4SAdrian Moreno * see net/openvswitch/drop.h 29*9d802da4SAdrian Moreno */ 30*9d802da4SAdrian Moreno SKB_DROP_REASON_SUBSYS_OPENVSWITCH, 31*9d802da4SAdrian Moreno 32071c0fc6SJohannes Berg /** @SKB_DROP_REASON_SUBSYS_NUM: number of subsystems defined */ 33071c0fc6SJohannes Berg SKB_DROP_REASON_SUBSYS_NUM 34071c0fc6SJohannes Berg }; 35071c0fc6SJohannes Berg 36071c0fc6SJohannes Berg struct drop_reason_list { 37071c0fc6SJohannes Berg const char * const *reasons; 38071c0fc6SJohannes Berg size_t n_reasons; 39071c0fc6SJohannes Berg }; 40071c0fc6SJohannes Berg 41071c0fc6SJohannes Berg /* Note: due to dynamic registrations, access must be under RCU */ 42071c0fc6SJohannes Berg extern const struct drop_reason_list __rcu * 43071c0fc6SJohannes Berg drop_reasons_by_subsys[SKB_DROP_REASON_SUBSYS_NUM]; 44071c0fc6SJohannes Berg 45071c0fc6SJohannes Berg void drop_reasons_register_subsys(enum skb_drop_reason_subsys subsys, 46071c0fc6SJohannes Berg const struct drop_reason_list *list); 47071c0fc6SJohannes Berg void drop_reasons_unregister_subsys(enum skb_drop_reason_subsys subsys); 48071c0fc6SJohannes Berg 49071c0fc6SJohannes Berg #endif 50