drivers/infiniband/hw/efa/efa_verbs.c
Source file repositories/reference/linux-study-clean/drivers/infiniband/hw/efa/efa_verbs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/hw/efa/efa_verbs.c- Extension
.c- Size
- 61014 bytes
- Lines
- 2290
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/dma-buf.hlinux/dma-resv.hlinux/vmalloc.hlinux/log2.hrdma/ib_addr.hrdma/ib_user_verbs.hrdma/ib_verbs.hrdma/iter.hrdma/uverbs_ioctl.hrdma/uverbs_named_ioctl.hrdma/ib_user_ioctl_cmds.hefa.hefa_io_defs.h
Detected Declarations
struct efa_user_mmap_entrystruct pbl_chunkstruct pbl_chunk_liststruct pbl_contextenum efa_hw_device_statsenum efa_hw_port_statsfunction to_emmapfunction efa_free_mappedfunction efa_query_devicefunction efa_link_gbps_to_speed_and_widthfunction efa_query_portfunction efa_query_port_speedfunction efa_query_qpfunction efa_query_gidfunction efa_query_pkeyfunction efa_pd_deallocfunction efa_alloc_pdfunction efa_dealloc_pdfunction efa_destroy_qp_handlefunction efa_qp_user_mmap_entries_removefunction efa_destroy_qpfunction efa_user_mmap_entry_insertfunction qp_mmap_entries_setupfunction efa_qp_validate_capfunction efa_qp_validate_attrfunction efa_create_qpfunction efa_modify_srd_qp_is_okfunction efa_modify_qp_validatefunction efa_modify_qpfunction efa_destroy_cq_idxfunction efa_cq_user_mmap_entries_removefunction efa_destroy_cqfunction cq_mmap_entries_setupfunction efa_create_user_cqfunction umem_to_page_listfunction pbl_chunk_list_createfunction pbl_chunk_list_destroyfunction pbl_continuous_initializefunction pbl_indirect_initializefunction pbl_indirect_terminatefunction pbl_createfunction pbl_destroyfunction efa_create_inline_pblfunction efa_create_pblfunction efa_register_mrfunction UVERBS_HANDLERfunction efa_dereg_mrfunction efa_get_port_immutable
Annotated Snippet
struct efa_user_mmap_entry {
struct rdma_user_mmap_entry rdma_entry;
u64 address;
u8 mmap_flag;
};
#define EFA_DEFINE_DEVICE_STATS(op) \
op(EFA_SUBMITTED_CMDS, "submitted_cmds") \
op(EFA_COMPLETED_CMDS, "completed_cmds") \
op(EFA_CMDS_ERR, "cmds_err") \
op(EFA_NO_COMPLETION_CMDS, "no_completion_cmds") \
op(EFA_KEEP_ALIVE_RCVD, "keep_alive_rcvd") \
op(EFA_ALLOC_PD_ERR, "alloc_pd_err") \
op(EFA_CREATE_QP_ERR, "create_qp_err") \
op(EFA_CREATE_CQ_ERR, "create_cq_err") \
op(EFA_REG_MR_ERR, "reg_mr_err") \
op(EFA_ALLOC_UCONTEXT_ERR, "alloc_ucontext_err") \
op(EFA_CREATE_AH_ERR, "create_ah_err") \
op(EFA_MMAP_ERR, "mmap_err")
#define EFA_DEFINE_PORT_STATS(op) \
op(EFA_TX_BYTES, "tx_bytes") \
op(EFA_TX_PKTS, "tx_pkts") \
op(EFA_RX_BYTES, "rx_bytes") \
op(EFA_RX_PKTS, "rx_pkts") \
op(EFA_RX_DROPS, "rx_drops") \
op(EFA_SEND_BYTES, "send_bytes") \
op(EFA_SEND_WRS, "send_wrs") \
op(EFA_RECV_BYTES, "recv_bytes") \
op(EFA_RECV_WRS, "recv_wrs") \
op(EFA_RDMA_READ_WRS, "rdma_read_wrs") \
op(EFA_RDMA_READ_BYTES, "rdma_read_bytes") \
op(EFA_RDMA_READ_WR_ERR, "rdma_read_wr_err") \
op(EFA_RDMA_READ_RESP_BYTES, "rdma_read_resp_bytes") \
op(EFA_RDMA_WRITE_WRS, "rdma_write_wrs") \
op(EFA_RDMA_WRITE_BYTES, "rdma_write_bytes") \
op(EFA_RDMA_WRITE_WR_ERR, "rdma_write_wr_err") \
op(EFA_RDMA_WRITE_RECV_BYTES, "rdma_write_recv_bytes") \
op(EFA_RETRANS_BYTES, "retrans_bytes") \
op(EFA_RETRANS_PKTS, "retrans_pkts") \
op(EFA_RETRANS_TIMEOUT_EVENS, "retrans_timeout_events") \
op(EFA_UNRESPONSIVE_REMOTE_EVENTS, "unresponsive_remote_events") \
op(EFA_IMPAIRED_REMOTE_CONN_EVENTS, "impaired_remote_conn_events") \
#define EFA_STATS_ENUM(ename, name) ename,
#define EFA_STATS_STR(ename, nam) \
[ename].name = nam,
enum efa_hw_device_stats {
EFA_DEFINE_DEVICE_STATS(EFA_STATS_ENUM)
};
static const struct rdma_stat_desc efa_device_stats_descs[] = {
EFA_DEFINE_DEVICE_STATS(EFA_STATS_STR)
};
enum efa_hw_port_stats {
EFA_DEFINE_PORT_STATS(EFA_STATS_ENUM)
};
static const struct rdma_stat_desc efa_port_stats_descs[] = {
EFA_DEFINE_PORT_STATS(EFA_STATS_STR)
};
#define EFA_CHUNK_PAYLOAD_SHIFT 12
#define EFA_CHUNK_PAYLOAD_SIZE BIT(EFA_CHUNK_PAYLOAD_SHIFT)
#define EFA_CHUNK_PAYLOAD_PTR_SIZE 8
#define EFA_CHUNK_SHIFT 12
#define EFA_CHUNK_SIZE BIT(EFA_CHUNK_SHIFT)
#define EFA_CHUNK_PTR_SIZE sizeof(struct efa_com_ctrl_buff_info)
#define EFA_PTRS_PER_CHUNK \
((EFA_CHUNK_SIZE - EFA_CHUNK_PTR_SIZE) / EFA_CHUNK_PAYLOAD_PTR_SIZE)
#define EFA_CHUNK_USED_SIZE \
((EFA_PTRS_PER_CHUNK * EFA_CHUNK_PAYLOAD_PTR_SIZE) + EFA_CHUNK_PTR_SIZE)
struct pbl_chunk {
dma_addr_t dma_addr;
u64 *buf;
u32 length;
};
struct pbl_chunk_list {
struct pbl_chunk *chunks;
unsigned int size;
};
struct pbl_context {
Annotation
- Immediate include surface: `linux/dma-buf.h`, `linux/dma-resv.h`, `linux/vmalloc.h`, `linux/log2.h`, `rdma/ib_addr.h`, `rdma/ib_user_verbs.h`, `rdma/ib_verbs.h`, `rdma/iter.h`.
- Detected declarations: `struct efa_user_mmap_entry`, `struct pbl_chunk`, `struct pbl_chunk_list`, `struct pbl_context`, `enum efa_hw_device_stats`, `enum efa_hw_port_stats`, `function to_emmap`, `function efa_free_mapped`, `function efa_query_device`, `function efa_link_gbps_to_speed_and_width`.
- Atlas domain: Driver Families / drivers/infiniband.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.