xref: /openbmc/linux/include/net/netns/mctp.h (revision 36de991e)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * MCTP per-net structures
4  */
5 
6 #ifndef __NETNS_MCTP_H__
7 #define __NETNS_MCTP_H__
8 
9 #include <linux/types.h>
10 
11 struct netns_mctp {
12 	/* Only updated under RTNL, entries freed via RCU */
13 	struct list_head routes;
14 
15 	/* Bound sockets: list of sockets bound by type.
16 	 * This list is updated from non-atomic contexts (under bind_lock),
17 	 * and read (under rcu) in packet rx
18 	 */
19 	struct mutex bind_lock;
20 	struct hlist_head binds;
21 
22 	/* tag allocations. This list is read and updated from atomic contexts,
23 	 * but elements are free()ed after a RCU grace-period
24 	 */
25 	spinlock_t keys_lock;
26 	struct hlist_head keys;
27 
28 	/* MCTP network */
29 	unsigned int default_net;
30 
31 	/* neighbour table */
32 	struct mutex neigh_lock;
33 	struct list_head neighbours;
34 };
35 
36 #endif /* __NETNS_MCTP_H__ */
37