Ido Schimmel | edd3d00 | 2019-08-17 16:28:12 +0300 | [diff] [blame] | 1 | /* 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 Pirko | 742b8cc | 2020-02-25 11:45:20 +0100 | [diff] [blame] | 9 | #include <net/flow_offload.h> |
Ido Schimmel | edd3d00 | 2019-08-17 16:28:12 +0300 | [diff] [blame] | 10 | |
| 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 Pirko | 742b8cc | 2020-02-25 11:45:20 +0100 | [diff] [blame] | 16 | * @fa_cookie: Flow action user cookie. |
Ido Schimmel | edd3d00 | 2019-08-17 16:28:12 +0300 | [diff] [blame] | 17 | */ |
| 18 | struct net_dm_hw_metadata { |
| 19 | const char *trap_group_name; |
| 20 | const char *trap_name; |
| 21 | struct net_device *input_dev; |
Jiri Pirko | 742b8cc | 2020-02-25 11:45:20 +0100 | [diff] [blame] | 22 | const struct flow_action_cookie *fa_cookie; |
Ido Schimmel | edd3d00 | 2019-08-17 16:28:12 +0300 | [diff] [blame] | 23 | }; |
| 24 | |
Masahiro Yamada | 1cd9b3a | 2020-03-11 15:29:25 +0900 | [diff] [blame] | 25 | #if IS_REACHABLE(CONFIG_NET_DROP_MONITOR) |
Ido Schimmel | edd3d00 | 2019-08-17 16:28:12 +0300 | [diff] [blame] | 26 | void net_dm_hw_report(struct sk_buff *skb, |
| 27 | const struct net_dm_hw_metadata *hw_metadata); |
| 28 | #else |
| 29 | static inline void |
| 30 | net_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_ */ |