drivers/net/ethernet/ibm/ehea/ehea_qmr.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/ibm/ehea/ehea_qmr.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/ibm/ehea/ehea_qmr.c- Extension
.c- Size
- 22704 bytes
- Lines
- 1000
- Domain
- Driver Families
- Bucket
- drivers/net
- 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.
- 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/mm.hlinux/slab.hehea.hehea_phyp.hehea_qmr.h
Detected Declarations
function hw_queue_ctorfunction hw_queue_dtorfunction ehea_destroy_cq_resfunction ehea_destroy_cqfunction ehea_destroy_eq_resfunction ehea_destroy_eqfunction ehea_qp_alloc_registerfunction map_wqe_sizefunction ehea_destroy_qp_resfunction ehea_destroy_qpfunction ehea_calc_indexfunction ehea_init_top_bmapfunction ehea_init_bmapfunction ehea_rebuild_busmapfunction ehea_update_busmapfunction ehea_add_sect_bmapfunction ehea_rem_sect_bmapfunction ehea_is_hugepagefunction ehea_create_busmap_callbackfunction ehea_create_busmapfunction ehea_destroy_busmapfunction ehea_map_vaddrfunction ehea_reg_mr_sectionfunction ehea_reg_mr_sectionsfunction ehea_reg_mr_dir_sectionsfunction ehea_reg_kernel_mrfunction ehea_rem_mrfunction ehea_gen_smrfunction print_error_datafunction ehea_error_data
Annotated Snippet
if (!vpage) {
pr_err("hw_qpageit_get_inc failed\n");
goto out_kill_hwq;
}
rpage = __pa(vpage);
hret = ehea_h_register_rpage(adapter->handle,
0, EHEA_CQ_REGISTER_ORIG,
cq->fw_handle, rpage, 1);
if (hret < H_SUCCESS) {
pr_err("register_rpage_cq failed ehea_cq=%p hret=%llx counter=%i act_pages=%i\n",
cq, hret, counter, cq->attr.nr_pages);
goto out_kill_hwq;
}
if (counter == (cq->attr.nr_pages - 1)) {
vpage = hw_qpageit_get_inc(&cq->hw_queue);
if ((hret != H_SUCCESS) || (vpage)) {
pr_err("registration of pages not complete hret=%llx\n",
hret);
goto out_kill_hwq;
}
} else {
if (hret != H_PAGE_REGISTERED) {
pr_err("CQ: registration of page failed hret=%llx\n",
hret);
goto out_kill_hwq;
}
}
}
hw_qeit_reset(&cq->hw_queue);
ehea_reset_cq_ep(cq);
ehea_reset_cq_n1(cq);
return cq;
out_kill_hwq:
hw_queue_dtor(&cq->hw_queue);
out_freeres:
ehea_h_free_resource(adapter->handle, cq->fw_handle, FORCE_FREE);
out_freemem:
kfree(cq);
out_nomem:
return NULL;
}
static u64 ehea_destroy_cq_res(struct ehea_cq *cq, u64 force)
{
u64 hret;
u64 adapter_handle = cq->adapter->handle;
/* deregister all previous registered pages */
hret = ehea_h_free_resource(adapter_handle, cq->fw_handle, force);
if (hret != H_SUCCESS)
return hret;
hw_queue_dtor(&cq->hw_queue);
kfree(cq);
return hret;
}
int ehea_destroy_cq(struct ehea_cq *cq)
{
u64 hret, aer, aerr;
if (!cq)
return 0;
hcp_epas_dtor(&cq->epas);
hret = ehea_destroy_cq_res(cq, NORMAL_FREE);
if (hret == H_R_STATE) {
ehea_error_data(cq->adapter, cq->fw_handle, &aer, &aerr);
hret = ehea_destroy_cq_res(cq, FORCE_FREE);
}
if (hret != H_SUCCESS) {
pr_err("destroy CQ failed\n");
return -EIO;
}
return 0;
}
struct ehea_eq *ehea_create_eq(struct ehea_adapter *adapter,
const enum ehea_eq_type type,
Annotation
- Immediate include surface: `linux/mm.h`, `linux/slab.h`, `ehea.h`, `ehea_phyp.h`, `ehea_qmr.h`.
- Detected declarations: `function hw_queue_ctor`, `function hw_queue_dtor`, `function ehea_destroy_cq_res`, `function ehea_destroy_cq`, `function ehea_destroy_eq_res`, `function ehea_destroy_eq`, `function ehea_qp_alloc_register`, `function map_wqe_size`, `function ehea_destroy_qp_res`, `function ehea_destroy_qp`.
- Atlas domain: Driver Families / drivers/net.
- 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.