drivers/infiniband/hw/ionic/ionic_datapath.c
Source file repositories/reference/linux-study-clean/drivers/infiniband/hw/ionic/ionic_datapath.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/hw/ionic/ionic_datapath.c- Extension
.c- Size
- 32984 bytes
- Lines
- 1400
- 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/module.hlinux/printk.hrdma/ib_addr.hrdma/ib_user_verbs.hionic_fw.hionic_ibdev.h
Detected Declarations
function ionic_next_cqefunction ionic_flush_recvfunction ionic_flush_recv_manyfunction ionic_flush_sendfunction ionic_flush_send_manyfunction ionic_poll_recvfunction ionic_peek_sendfunction ionic_poll_sendfunction ionic_poll_send_manyfunction ionic_validate_consfunction ionic_comp_msnfunction ionic_comp_npgfunction ionic_reserve_sync_cqfunction ionic_reserve_cqfunction ionic_poll_vcq_cqfunction list_for_each_entry_safefunction list_for_each_entry_safefunction ionic_poll_cqfunction ionic_req_notify_vcq_cqfunction ionic_req_notify_cqfunction ionic_prep_inlinefunction ionic_prep_pldfunction ionic_prep_basefunction ionic_prep_commonfunction ionic_prep_sq_wqefunction ionic_prep_rq_wqefunction ionic_prep_sendfunction ionic_prep_send_udfunction ionic_prep_rdmafunction ionic_prep_atomicfunction ionic_prep_invfunction ionic_prep_regfunction ionic_prep_one_rcfunction ionic_prep_one_udfunction ionic_prep_recvfunction ionic_post_send_commonfunction ionic_post_recv_commonfunction ionic_post_sendfunction ionic_post_recv
Annotated Snippet
if (unlikely(!qp)) {
ibdev_dbg(&dev->ibdev, "missing qp for qid %u\n", qid);
goto cq_next;
}
switch (type) {
case IONIC_V1_CQE_TYPE_RECV:
spin_lock(&qp->rq_lock);
rc = ionic_poll_recv(dev, cq, qp, cqe, wc + npolled);
spin_unlock(&qp->rq_lock);
if (rc < 0)
goto out;
npolled += rc;
break;
case IONIC_V1_CQE_TYPE_SEND_MSN:
spin_lock(&qp->sq_lock);
rc = ionic_comp_msn(qp, cqe);
if (!rc) {
rc = ionic_poll_send_many(dev, cq, qp,
wc + npolled,
nwc - npolled);
peek = ionic_peek_send(qp);
}
spin_unlock(&qp->sq_lock);
if (rc < 0)
goto out;
npolled += rc;
if (peek)
list_move_tail(&qp->cq_poll_sq, &cq->poll_sq);
break;
case IONIC_V1_CQE_TYPE_SEND_NPG:
spin_lock(&qp->sq_lock);
rc = ionic_comp_npg(qp, cqe);
if (!rc) {
rc = ionic_poll_send_many(dev, cq, qp,
wc + npolled,
nwc - npolled);
peek = ionic_peek_send(qp);
}
spin_unlock(&qp->sq_lock);
if (rc < 0)
goto out;
npolled += rc;
if (peek)
list_move_tail(&qp->cq_poll_sq, &cq->poll_sq);
break;
default:
ibdev_warn(&dev->ibdev,
"unexpected cqe type %u\n", type);
rc = -EIO;
goto out;
}
cq_next:
ionic_queue_produce(&cq->q);
cq->color = ionic_color_wrap(cq->q.prod, cq->color);
}
/* lastly, flush send and recv queues */
if (likely(!cq->flush))
goto out;
cq->flush = false;
list_for_each_entry_safe(qp, qp_next, &cq->flush_sq, cq_flush_sq) {
if (npolled == nwc)
goto out;
spin_lock(&qp->sq_lock);
rc = ionic_flush_send_many(qp, wc + npolled, nwc - npolled);
spin_unlock(&qp->sq_lock);
if (rc > 0)
npolled += rc;
if (npolled < nwc)
list_del_init(&qp->cq_flush_sq);
else
Annotation
- Immediate include surface: `linux/module.h`, `linux/printk.h`, `rdma/ib_addr.h`, `rdma/ib_user_verbs.h`, `ionic_fw.h`, `ionic_ibdev.h`.
- Detected declarations: `function ionic_next_cqe`, `function ionic_flush_recv`, `function ionic_flush_recv_many`, `function ionic_flush_send`, `function ionic_flush_send_many`, `function ionic_poll_recv`, `function ionic_peek_send`, `function ionic_poll_send`, `function ionic_poll_send_many`, `function ionic_validate_cons`.
- 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.