drivers/infiniband/sw/rxe/rxe_verbs.c
Source file repositories/reference/linux-study-clean/drivers/infiniband/sw/rxe/rxe_verbs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/sw/rxe/rxe_verbs.c- Extension
.c- Size
- 34983 bytes
- Lines
- 1553
- 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 user memory; correctness depends on fault-safe copying and privilege boundary handling.
- 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/dma-mapping.hnet/addrconf.hrdma/uverbs_ioctl.hrxe.hrxe_queue.hrxe_hw_counters.h
Detected Declarations
function rxe_query_devicefunction rxe_query_portfunction rxe_query_gidfunction rxe_query_pkeyfunction rxe_modify_devicefunction rxe_modify_portfunction rxe_get_link_layerfunction rxe_port_immutablefunction rxe_alloc_ucontextfunction rxe_dealloc_ucontextfunction rxe_alloc_pdfunction rxe_dealloc_pdfunction rxe_create_ahfunction rxe_modify_ahfunction rxe_query_ahfunction rxe_destroy_ahfunction rxe_create_srqfunction rxe_modify_srqfunction rxe_query_srqfunction rxe_post_srq_recvfunction rxe_destroy_srqfunction rxe_create_qpfunction rxe_modify_qpfunction rxe_query_qpfunction rxe_destroy_qpfunction validate_send_wrfunction init_send_wrfunction copy_inline_data_to_wqefunction init_send_wqefunction post_one_sendfunction rxe_post_send_kernelfunction rxe_post_sendfunction post_one_recvfunction rxe_post_recvfunction rxe_create_cqfunction rxe_resize_cqfunction rxe_poll_cqfunction rxe_peek_cqfunction rxe_req_notify_cqfunction rxe_destroy_cqfunction rxe_dereg_mrfunction parent_showfunction rxe_enable_driverfunction rxe_register_device
Annotated Snippet
if (err) {
err = -EFAULT;
rxe_dbg_ah(ah, "unable to copy to user\n");
goto err_cleanup;
}
} else if (ah->is_user) {
/* only if old user provider */
ah->ah_num = 0;
}
rxe_init_av(init_attr->ah_attr, &ah->av);
rxe_finalize(ah);
return 0;
err_cleanup:
cleanup_err = rxe_cleanup(ah);
if (cleanup_err)
rxe_err_ah(ah, "cleanup failed, err = %d\n", cleanup_err);
err_out:
rxe_err_ah(ah, "returned err = %d\n", err);
return err;
}
static int rxe_modify_ah(struct ib_ah *ibah, struct rdma_ah_attr *attr)
{
struct rxe_ah *ah = to_rah(ibah);
int err;
err = rxe_ah_chk_attr(ah, attr);
if (err) {
rxe_dbg_ah(ah, "bad attr\n");
goto err_out;
}
rxe_init_av(attr, &ah->av);
return 0;
err_out:
rxe_err_ah(ah, "returned err = %d\n", err);
return err;
}
static int rxe_query_ah(struct ib_ah *ibah, struct rdma_ah_attr *attr)
{
struct rxe_ah *ah = to_rah(ibah);
memset(attr, 0, sizeof(*attr));
attr->type = ibah->type;
rxe_av_to_attr(&ah->av, attr);
return 0;
}
static int rxe_destroy_ah(struct ib_ah *ibah, u32 flags)
{
struct rxe_ah *ah = to_rah(ibah);
int err;
err = rxe_cleanup_ah(ah, flags & RDMA_DESTROY_AH_SLEEPABLE);
if (err)
rxe_err_ah(ah, "cleanup failed, err = %d\n", err);
return 0;
}
/* srq */
static int rxe_create_srq(struct ib_srq *ibsrq, struct ib_srq_init_attr *init,
struct ib_udata *udata)
{
struct rxe_dev *rxe = to_rdev(ibsrq->device);
struct rxe_pd *pd = to_rpd(ibsrq->pd);
struct rxe_srq *srq = to_rsrq(ibsrq);
struct rxe_create_srq_resp __user *uresp = NULL;
int err, cleanup_err;
if (udata) {
if (udata->outlen < sizeof(*uresp)) {
err = -EINVAL;
rxe_err_dev(rxe, "malformed udata\n");
goto err_out;
}
uresp = udata->outbuf;
}
if (init->srq_type != IB_SRQT_BASIC) {
err = -EOPNOTSUPP;
rxe_dbg_dev(rxe, "srq type = %d, not supported\n",
init->srq_type);
Annotation
- Immediate include surface: `linux/dma-mapping.h`, `net/addrconf.h`, `rdma/uverbs_ioctl.h`, `rxe.h`, `rxe_queue.h`, `rxe_hw_counters.h`.
- Detected declarations: `function rxe_query_device`, `function rxe_query_port`, `function rxe_query_gid`, `function rxe_query_pkey`, `function rxe_modify_device`, `function rxe_modify_port`, `function rxe_get_link_layer`, `function rxe_port_immutable`, `function rxe_alloc_ucontext`, `function rxe_dealloc_ucontext`.
- Atlas domain: Driver Families / drivers/infiniband.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- 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.