include/net/netns/mctp.h
Source file repositories/reference/linux-study-clean/include/net/netns/mctp.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/netns/mctp.h- Extension
.h- Size
- 1212 bytes
- Lines
- 50
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/hash.hlinux/hashtable.hlinux/mutex.hlinux/types.h
Detected Declarations
struct netns_mctpfunction mctp_bind_hash
Annotated Snippet
struct netns_mctp {
/* Only updated under RTNL, entries freed via RCU */
struct list_head routes;
/* Bound sockets: hash table of sockets, keyed by
* (type, src_eid, dest_eid).
* Specific src_eid/dest_eid entries also have an entry for
* MCTP_ADDR_ANY. This list is updated from non-atomic contexts
* (under bind_lock), and read (under rcu) in packet rx.
*/
struct mutex bind_lock;
DECLARE_HASHTABLE(binds, MCTP_BINDS_BITS);
/* tag allocations. This list is read and updated from atomic contexts,
* but elements are free()ed after a RCU grace-period
*/
spinlock_t keys_lock;
struct hlist_head keys;
/* MCTP network */
unsigned int default_net;
/* neighbour table */
struct mutex neigh_lock;
struct list_head neighbours;
};
static inline u32 mctp_bind_hash(u8 type, u8 local_addr, u8 peer_addr)
{
return hash_32(type | (u32)local_addr << 8 | (u32)peer_addr << 16,
MCTP_BINDS_BITS);
}
#endif /* __NETNS_MCTP_H__ */
Annotation
- Immediate include surface: `linux/hash.h`, `linux/hashtable.h`, `linux/mutex.h`, `linux/types.h`.
- Detected declarations: `struct netns_mctp`, `function mctp_bind_hash`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.