accel/ivpu: Enable HWS by default on all platforms
[drm/drm-misc.git] / include / net / ioam6.h
blob2cbbee6e806aab71105df6d874092aa28078ec4b
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3 * IPv6 IOAM implementation
5 * Author:
6 * Justin Iurman <justin.iurman@uliege.be>
7 */
9 #ifndef _NET_IOAM6_H
10 #define _NET_IOAM6_H
12 #include <linux/net.h>
13 #include <linux/ipv6.h>
14 #include <linux/ioam6.h>
15 #include <linux/ioam6_genl.h>
16 #include <linux/rhashtable-types.h>
18 struct ioam6_namespace {
19 struct rhash_head head;
20 struct rcu_head rcu;
22 struct ioam6_schema __rcu *schema;
24 __be16 id;
25 __be32 data;
26 __be64 data_wide;
29 struct ioam6_schema {
30 struct rhash_head head;
31 struct rcu_head rcu;
33 struct ioam6_namespace __rcu *ns;
35 u32 id;
36 int len;
37 __be32 hdr;
39 u8 data[];
42 struct ioam6_pernet_data {
43 struct mutex lock;
44 struct rhashtable namespaces;
45 struct rhashtable schemas;
48 static inline struct ioam6_pernet_data *ioam6_pernet(struct net *net)
50 #if IS_ENABLED(CONFIG_IPV6)
51 return net->ipv6.ioam6_data;
52 #else
53 return NULL;
54 #endif
57 struct ioam6_namespace *ioam6_namespace(struct net *net, __be16 id);
58 void ioam6_fill_trace_data(struct sk_buff *skb,
59 struct ioam6_namespace *ns,
60 struct ioam6_trace_hdr *trace,
61 bool is_input);
63 int ioam6_init(void);
64 void ioam6_exit(void);
66 int ioam6_iptunnel_init(void);
67 void ioam6_iptunnel_exit(void);
69 void ioam6_event(enum ioam6_event_type type, struct net *net, gfp_t gfp,
70 void *opt, unsigned int opt_len);
72 #endif /* _NET_IOAM6_H */