1889b7da2SJeremy Kerr /* SPDX-License-Identifier: GPL-2.0 */ 2889b7da2SJeremy Kerr /* 3889b7da2SJeremy Kerr * MCTP per-net structures 4889b7da2SJeremy Kerr */ 5889b7da2SJeremy Kerr 6889b7da2SJeremy Kerr #ifndef __NETNS_MCTP_H__ 7889b7da2SJeremy Kerr #define __NETNS_MCTP_H__ 8889b7da2SJeremy Kerr 9*949d6b40SJakub Kicinski #include <linux/mutex.h> 10889b7da2SJeremy Kerr #include <linux/types.h> 11889b7da2SJeremy Kerr 12889b7da2SJeremy Kerr struct netns_mctp { 13889b7da2SJeremy Kerr /* Only updated under RTNL, entries freed via RCU */ 14889b7da2SJeremy Kerr struct list_head routes; 154d8b9319SMatt Johnston 16833ef3b9SJeremy Kerr /* Bound sockets: list of sockets bound by type. 17833ef3b9SJeremy Kerr * This list is updated from non-atomic contexts (under bind_lock), 18833ef3b9SJeremy Kerr * and read (under rcu) in packet rx 19833ef3b9SJeremy Kerr */ 20833ef3b9SJeremy Kerr struct mutex bind_lock; 21833ef3b9SJeremy Kerr struct hlist_head binds; 22833ef3b9SJeremy Kerr 23833ef3b9SJeremy Kerr /* tag allocations. This list is read and updated from atomic contexts, 24833ef3b9SJeremy Kerr * but elements are free()ed after a RCU grace-period 25833ef3b9SJeremy Kerr */ 26833ef3b9SJeremy Kerr spinlock_t keys_lock; 27833ef3b9SJeremy Kerr struct hlist_head keys; 28833ef3b9SJeremy Kerr 2903f2bbc4SMatt Johnston /* MCTP network */ 3003f2bbc4SMatt Johnston unsigned int default_net; 3103f2bbc4SMatt Johnston 324d8b9319SMatt Johnston /* neighbour table */ 334d8b9319SMatt Johnston struct mutex neigh_lock; 344d8b9319SMatt Johnston struct list_head neighbours; 35889b7da2SJeremy Kerr }; 36889b7da2SJeremy Kerr 37889b7da2SJeremy Kerr #endif /* __NETNS_MCTP_H__ */ 38