drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c- Extension
.c- Size
- 54309 bytes
- Lines
- 1803
- 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.
- 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/bitfield.hrvu.hrvu_reg.hrvu_struct.hrvu_npc_hash.hcn20k/npc.h
Detected Declarations
enum rvu_af_dl_param_idfunction Copyrightfunction rvu_report_pair_endfunction rvu_common_request_irqfunction rvu_nix_intr_workfunction rvu_nix_af_rvu_intr_handlerfunction rvu_nix_gen_workfunction rvu_nix_af_rvu_gen_handlerfunction rvu_nix_err_workfunction rvu_nix_af_rvu_err_handlerfunction rvu_nix_ras_workfunction rvu_nix_af_rvu_ras_handlerfunction rvu_nix_unregister_interruptsfunction rvu_nix_register_interruptsfunction rvu_nix_report_showfunction rvu_hw_nix_intr_dumpfunction rvu_hw_nix_intr_recoverfunction rvu_hw_nix_gen_dumpfunction rvu_hw_nix_gen_recoverfunction rvu_hw_nix_err_dumpfunction rvu_hw_nix_err_recoverfunction rvu_hw_nix_ras_dumpfunction rvu_hw_nix_ras_recoverfunction rvu_nix_register_reportersfunction rvu_nix_health_reporters_createfunction rvu_nix_health_reporters_destroyfunction rvu_npa_intr_workfunction rvu_npa_af_rvu_intr_handlerfunction rvu_npa_gen_workfunction rvu_npa_af_gen_intr_handlerfunction rvu_npa_err_workfunction rvu_npa_af_err_intr_handlerfunction rvu_npa_ras_workfunction rvu_npa_af_ras_intr_handlerfunction rvu_npa_unregister_interruptsfunction rvu_npa_register_interruptsfunction rvu_npa_report_showfunction rvu_hw_npa_intr_dumpfunction rvu_hw_npa_intr_recoverfunction rvu_hw_npa_gen_dumpfunction rvu_hw_npa_gen_recoverfunction rvu_hw_npa_err_dumpfunction rvu_hw_npa_err_recoverfunction rvu_hw_npa_ras_dumpfunction rvu_hw_npa_ras_recoverfunction rvu_npa_register_reportersfunction rvu_npa_health_reporters_createfunction rvu_npa_health_reporters_destroy
Annotated Snippet
if (rvu->irq_allocated[offs + i]) {
free_irq(pci_irq_vector(rvu->pdev, offs + i), rvu_dl);
rvu->irq_allocated[offs + i] = false;
}
}
static int rvu_nix_register_interrupts(struct rvu *rvu)
{
int blkaddr, base;
bool rc;
blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NIX, 0);
if (blkaddr < 0)
return blkaddr;
/* Get NIX AF MSIX vectors offset. */
base = rvu_read64(rvu, blkaddr, NIX_PRIV_AF_INT_CFG) & 0x3ff;
if (!base) {
dev_warn(rvu->dev,
"Failed to get NIX%d NIX_AF_INT vector offsets\n",
blkaddr - BLKADDR_NIX0);
return 0;
}
/* Register and enable NIX_AF_RVU_INT interrupt */
rc = rvu_common_request_irq(rvu, base + NIX_AF_INT_VEC_RVU,
"NIX_AF_RVU_INT",
rvu_nix_af_rvu_intr_handler);
if (!rc)
goto err;
rvu_write64(rvu, blkaddr, NIX_AF_RVU_INT_ENA_W1S, ~0ULL);
/* Register and enable NIX_AF_GEN_INT interrupt */
rc = rvu_common_request_irq(rvu, base + NIX_AF_INT_VEC_GEN,
"NIX_AF_GEN_INT",
rvu_nix_af_rvu_gen_handler);
if (!rc)
goto err;
rvu_write64(rvu, blkaddr, NIX_AF_GEN_INT_ENA_W1S, ~0ULL);
/* Register and enable NIX_AF_ERR_INT interrupt */
rc = rvu_common_request_irq(rvu, base + NIX_AF_INT_VEC_AF_ERR,
"NIX_AF_ERR_INT",
rvu_nix_af_rvu_err_handler);
if (!rc)
goto err;
rvu_write64(rvu, blkaddr, NIX_AF_ERR_INT_ENA_W1S, ~0ULL);
/* Register and enable NIX_AF_RAS interrupt */
rc = rvu_common_request_irq(rvu, base + NIX_AF_INT_VEC_POISON,
"NIX_AF_RAS",
rvu_nix_af_rvu_ras_handler);
if (!rc)
goto err;
rvu_write64(rvu, blkaddr, NIX_AF_RAS_ENA_W1S, ~0ULL);
return 0;
err:
rvu_nix_unregister_interrupts(rvu);
return rc;
}
static int rvu_nix_report_show(struct devlink_fmsg *fmsg, void *ctx,
enum nix_af_rvu_health health_reporter)
{
struct rvu_nix_event_ctx *nix_event_context;
u64 intr_val;
nix_event_context = ctx;
switch (health_reporter) {
case NIX_AF_RVU_INTR:
intr_val = nix_event_context->nix_af_rvu_int;
rvu_report_pair_start(fmsg, "NIX_AF_RVU");
devlink_fmsg_u64_pair_put(fmsg, "\tNIX RVU Interrupt Reg ",
nix_event_context->nix_af_rvu_int);
if (intr_val & BIT_ULL(0))
devlink_fmsg_string_put(fmsg, "\n\tUnmap Slot Error");
rvu_report_pair_end(fmsg);
break;
case NIX_AF_RVU_GEN:
intr_val = nix_event_context->nix_af_rvu_gen;
rvu_report_pair_start(fmsg, "NIX_AF_GENERAL");
devlink_fmsg_u64_pair_put(fmsg, "\tNIX General Interrupt Reg ",
nix_event_context->nix_af_rvu_gen);
if (intr_val & BIT_ULL(0))
devlink_fmsg_string_put(fmsg, "\n\tRx multicast pkt drop");
if (intr_val & BIT_ULL(1))
devlink_fmsg_string_put(fmsg, "\n\tRx mirror pkt drop");
if (intr_val & BIT_ULL(4))
devlink_fmsg_string_put(fmsg, "\n\tSMQ flush done");
rvu_report_pair_end(fmsg);
Annotation
- Immediate include surface: `linux/bitfield.h`, `rvu.h`, `rvu_reg.h`, `rvu_struct.h`, `rvu_npc_hash.h`, `cn20k/npc.h`.
- Detected declarations: `enum rvu_af_dl_param_id`, `function Copyright`, `function rvu_report_pair_end`, `function rvu_common_request_irq`, `function rvu_nix_intr_work`, `function rvu_nix_af_rvu_intr_handler`, `function rvu_nix_gen_work`, `function rvu_nix_af_rvu_gen_handler`, `function rvu_nix_err_work`, `function rvu_nix_af_rvu_err_handler`.
- Atlas domain: Driver Families / drivers/net.
- 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.