blob: 3f5b6ddb3179c16afa2874789dc90592c2916adf [file] [log] [blame]
Ido Schimmeledd3d002019-08-17 16:28:12 +03001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#ifndef _NET_DROP_MONITOR_H_
4#define _NET_DROP_MONITOR_H_
5
6#include <linux/ktime.h>
7#include <linux/netdevice.h>
8#include <linux/skbuff.h>
Jiri Pirko742b8cc2020-02-25 11:45:20 +01009#include <net/flow_offload.h>
Ido Schimmeledd3d002019-08-17 16:28:12 +030010
11/**
12 * struct net_dm_hw_metadata - Hardware-supplied packet metadata.
13 * @trap_group_name: Hardware trap group name.
14 * @trap_name: Hardware trap name.
15 * @input_dev: Input netdevice.
Jiri Pirko742b8cc2020-02-25 11:45:20 +010016 * @fa_cookie: Flow action user cookie.
Ido Schimmeledd3d002019-08-17 16:28:12 +030017 */
18struct net_dm_hw_metadata {
19 const char *trap_group_name;
20 const char *trap_name;
21 struct net_device *input_dev;
Jiri Pirko742b8cc2020-02-25 11:45:20 +010022 const struct flow_action_cookie *fa_cookie;
Ido Schimmeledd3d002019-08-17 16:28:12 +030023};
24
Masahiro Yamada1cd9b3a2020-03-11 15:29:25 +090025#if IS_REACHABLE(CONFIG_NET_DROP_MONITOR)
Ido Schimmeledd3d002019-08-17 16:28:12 +030026void net_dm_hw_report(struct sk_buff *skb,
27 const struct net_dm_hw_metadata *hw_metadata);
28#else
29static inline void
30net_dm_hw_report(struct sk_buff *skb,
31 const struct net_dm_hw_metadata *hw_metadata)
32{
33}
34#endif
35
36#endif /* _NET_DROP_MONITOR_H_ */