drivers/infiniband/hw/irdma/ctrl.c
Source file repositories/reference/linux-study-clean/drivers/infiniband/hw/irdma/ctrl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/hw/irdma/ctrl.c- Extension
.c- Size
- 208845 bytes
- Lines
- 6628
- 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.
- 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/etherdevice.hosdep.hhmc.hdefs.htype.hws.hprotos.h
Detected Declarations
function irdma_sc_suspend_resume_qpsfunction irdma_set_qos_infofunction irdma_change_l2paramsfunction irdma_qp_rem_qosfunction irdma_qp_add_qosfunction irdma_sc_pd_initfunction irdma_sc_add_arp_cache_entryfunction irdma_sc_del_arp_cache_entryfunction irdma_sc_manage_apbvt_entryfunction irdma_sc_manage_qhash_table_entryfunction irdma_sc_qp_initfunction irdma_sc_srq_initfunction irdma_sc_srq_createfunction irdma_sc_srq_modifyfunction irdma_sc_srq_destroyfunction irdma_sc_qp_createfunction irdma_sc_qp_modifyfunction irdma_sc_qp_destroyfunction irdma_sc_get_encoded_ird_sizefunction irdma_sc_qp_setctx_roce_gen_2function irdma_sc_get_encoded_ird_size_gen_3function irdma_sc_qp_setctx_roce_gen_3function irdma_sc_qp_setctx_rocefunction irdma_sc_alloc_local_mac_entryfunction irdma_sc_add_local_mac_entryfunction irdma_sc_del_local_mac_entryfunction irdma_sc_qp_setctxfunction irdma_sc_alloc_stagfunction irdma_sc_mr_reg_non_sharedfunction irdma_sc_dealloc_stagfunction irdma_sc_mw_allocfunction irdma_sc_mr_fast_registerfunction irdma_sc_gen_rts_aefunction irdma_sc_send_lsmmfunction irdma_sc_send_rttfunction irdma_iwarp_opcodefunction irdma_bld_termhdr_ctrlfunction irdma_bld_termhdr_ddp_rdmafunction irdma_bld_terminate_hdrfunction irdma_terminate_send_finfunction irdma_terminate_connectionfunction irdma_terminate_receivedfunction irdma_null_ws_addfunction irdma_null_ws_removefunction irdma_get_stats_idxfunction irdma_hw_stats_init_gen1function irdma_vsi_stats_initfunction irdma_vsi_stats_free
Annotated Snippet
while (qp) {
if (op == IRDMA_OP_RESUME) {
if (!qp->dev->ws_add(vsi, i)) {
qp->qs_handle =
vsi->qos[qp->user_pri].qs_handle;
irdma_cqp_qp_suspend_resume(qp, op);
} else {
irdma_cqp_qp_suspend_resume(qp, op);
irdma_modify_qp_to_err(qp);
}
} else if (op == IRDMA_OP_SUSPEND) {
/* issue cqp suspend command */
if (!irdma_cqp_qp_suspend_resume(qp, op))
atomic_inc(&vsi->qp_suspend_reqs);
}
qp = irdma_get_qp_from_list(&vsi->qos[i].qplist, qp);
}
mutex_unlock(&vsi->qos[i].qos_mutex);
}
}
static void irdma_set_qos_info(struct irdma_sc_vsi *vsi,
struct irdma_l2params *l2p)
{
u8 i;
if (vsi->dev->hw_attrs.uk_attrs.hw_rev >= IRDMA_GEN_3) {
for (i = 0; i < IRDMA_MAX_USER_PRIORITY; i++) {
vsi->qos[i].qs_handle = vsi->dev->qos[i].qs_handle;
vsi->qos[i].valid = true;
}
return;
}
vsi->qos_rel_bw = l2p->vsi_rel_bw;
vsi->qos_prio_type = l2p->vsi_prio_type;
vsi->dscp_mode = l2p->dscp_mode;
if (l2p->dscp_mode) {
memcpy(vsi->dscp_map, l2p->dscp_map, sizeof(vsi->dscp_map));
for (i = 0; i < IRDMA_MAX_USER_PRIORITY; i++)
l2p->up2tc[i] = i;
}
for (i = 0; i < IRDMA_MAX_USER_PRIORITY; i++) {
if (vsi->dev->hw_attrs.uk_attrs.hw_rev == IRDMA_GEN_1)
vsi->qos[i].qs_handle = l2p->qs_handle_list[i];
vsi->qos[i].traffic_class = l2p->up2tc[i];
vsi->qos[i].rel_bw =
l2p->tc_info[vsi->qos[i].traffic_class].rel_bw;
vsi->qos[i].prio_type =
l2p->tc_info[vsi->qos[i].traffic_class].prio_type;
vsi->qos[i].valid = false;
}
}
/**
* irdma_change_l2params - given the new l2 parameters, change all qp
* @vsi: RDMA VSI pointer
* @l2params: New parameters from l2
*/
void irdma_change_l2params(struct irdma_sc_vsi *vsi,
struct irdma_l2params *l2params)
{
if (l2params->mtu_changed) {
vsi->mtu = l2params->mtu;
if (vsi->ieq)
irdma_reinitialize_ieq(vsi);
}
if (!l2params->tc_changed)
return;
vsi->tc_change_pending = false;
irdma_set_qos_info(vsi, l2params);
irdma_sc_suspend_resume_qps(vsi, IRDMA_OP_RESUME);
}
/**
* irdma_qp_rem_qos - remove qp from qos lists during destroy qp
* @qp: qp to be removed from qos
*/
void irdma_qp_rem_qos(struct irdma_sc_qp *qp)
{
struct irdma_sc_vsi *vsi = qp->vsi;
ibdev_dbg(to_ibdev(qp->dev),
"DCB: DCB: Remove qp[%d] UP[%d] qset[%d] on_qoslist[%d]\n",
qp->qp_uk.qp_id, qp->user_pri, qp->qs_handle,
qp->on_qoslist);
mutex_lock(&vsi->qos[qp->user_pri].qos_mutex);
if (qp->on_qoslist) {
Annotation
- Immediate include surface: `linux/etherdevice.h`, `osdep.h`, `hmc.h`, `defs.h`, `type.h`, `ws.h`, `protos.h`.
- Detected declarations: `function irdma_sc_suspend_resume_qps`, `function irdma_set_qos_info`, `function irdma_change_l2params`, `function irdma_qp_rem_qos`, `function irdma_qp_add_qos`, `function irdma_sc_pd_init`, `function irdma_sc_add_arp_cache_entry`, `function irdma_sc_del_arp_cache_entry`, `function irdma_sc_manage_apbvt_entry`, `function irdma_sc_manage_qhash_table_entry`.
- 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.
- 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.