drivers/infiniband/core/iwpm_util.h
Source file repositories/reference/linux-study-clean/drivers/infiniband/core/iwpm_util.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/core/iwpm_util.h- Extension
.h- Size
- 8267 bytes
- Lines
- 266
- Domain
- Driver Families
- Bucket
- drivers/infiniband
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/io.hlinux/in.hlinux/in6.hlinux/spinlock.hlinux/kernel.hlinux/netdevice.hlinux/delay.hlinux/workqueue.hlinux/mutex.hlinux/jhash.hlinux/kref.hnet/netlink.hlinux/errno.hrdma/iw_portmap.hrdma/rdma_netlink.h
Detected Declarations
struct iwpm_nlmsg_requeststruct iwpm_mapping_infostruct iwpm_remote_infostruct iwpm_admin_datafunction iwpm_validate_nlmsg_attr
Annotated Snippet
struct iwpm_nlmsg_request {
struct list_head inprocess_list;
__u32 nlmsg_seq;
void *req_buffer;
u8 nl_client;
u8 request_done;
u16 err_code;
struct semaphore sem;
struct kref kref;
};
struct iwpm_mapping_info {
struct hlist_node hlist_node;
struct sockaddr_storage local_sockaddr;
struct sockaddr_storage mapped_sockaddr;
u8 nl_client;
u32 map_flags;
};
struct iwpm_remote_info {
struct hlist_node hlist_node;
struct sockaddr_storage remote_sockaddr;
struct sockaddr_storage mapped_loc_sockaddr;
struct sockaddr_storage mapped_rem_sockaddr;
u8 nl_client;
};
struct iwpm_admin_data {
atomic_t nlmsg_seq;
u32 reg_list[RDMA_NL_NUM_CLIENTS];
};
/**
* iwpm_get_nlmsg_request - Allocate and initialize netlink message request
* @nlmsg_seq: Sequence number of the netlink message
* @nl_client: The index of the netlink client
* @gfp: Indicates how the memory for the request should be allocated
*
* Returns the newly allocated netlink request object if successful,
* otherwise returns NULL
*/
struct iwpm_nlmsg_request *iwpm_get_nlmsg_request(__u32 nlmsg_seq,
u8 nl_client, gfp_t gfp);
/**
* iwpm_free_nlmsg_request - Deallocate netlink message request
* @kref: Holds reference of netlink message request
*/
void iwpm_free_nlmsg_request(struct kref *kref);
/**
* iwpm_find_nlmsg_request - Find netlink message request in the request list
* @echo_seq: Sequence number of the netlink request to find
*
* Returns the found netlink message request,
* if not found, returns NULL
*/
struct iwpm_nlmsg_request *iwpm_find_nlmsg_request(__u32 echo_seq);
/**
* iwpm_wait_complete_req - Block while servicing the netlink request
* @nlmsg_request: Netlink message request to service
*
* Wakes up, after the request is completed or expired
* Returns 0 if the request is complete without error
*/
int iwpm_wait_complete_req(struct iwpm_nlmsg_request *nlmsg_request);
/**
* iwpm_get_nlmsg_seq - Get the sequence number for a netlink
* message to send to the port mapper
*
* Returns the sequence number for the netlink message.
*/
int iwpm_get_nlmsg_seq(void);
/**
* iwpm_add_remote_info - Add remote address info of the connecting peer
* to the remote info hash table
* @reminfo: The remote info to be added
*/
void iwpm_add_remote_info(struct iwpm_remote_info *reminfo);
/**
* iwpm_check_registration - Check if the client registration
* matches the given one
* @nl_client: The index of the netlink client
* @reg: The given registration type to compare with
*
* Call iwpm_register_pid() to register a client
Annotation
- Immediate include surface: `linux/io.h`, `linux/in.h`, `linux/in6.h`, `linux/spinlock.h`, `linux/kernel.h`, `linux/netdevice.h`, `linux/delay.h`, `linux/workqueue.h`.
- Detected declarations: `struct iwpm_nlmsg_request`, `struct iwpm_mapping_info`, `struct iwpm_remote_info`, `struct iwpm_admin_data`, `function iwpm_validate_nlmsg_attr`.
- Atlas domain: Driver Families / drivers/infiniband.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.