drivers/net/ethernet/marvell/octeontx2/af/rvu.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/marvell/octeontx2/af/rvu.c- Extension
.c- Size
- 94701 bytes
- Lines
- 3794
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/module.hlinux/interrupt.hlinux/delay.hlinux/irq.hlinux/pci.hlinux/sysfs.hcgx.hrvu.hrvu_reg.hptp.hmcs.hrvu_trace.hrvu_npc_hash.hcn20k/reg.hcn20k/api.hcn20k/npc.h
Detected Declarations
function rvu_setup_hw_capabilitiesfunction rvu_poll_regfunction rvu_alloc_rsrcfunction rvu_alloc_rsrc_contigfunction rvu_free_rsrc_contigfunction rvu_rsrc_check_contigfunction rvu_free_rsrcfunction rvu_rsrc_free_countfunction is_rsrc_freefunction rvu_alloc_bitmapfunction rvu_free_bitmapfunction rvu_get_lffunction rvu_get_blkaddrfunction rvu_update_rsrc_mapfunction rvu_get_pf_numvfsfunction rvu_get_hwvffunction is_pf_func_validfunction is_block_implementedfunction rvu_check_block_implementedfunction rvu_setup_rvum_blk_revidfunction rvu_clear_rvum_blk_revidfunction rvu_lf_resetfunction rvu_block_resetfunction rvu_reset_all_blocksfunction rvu_scan_blockfunction rvu_check_min_msix_vecfunction rvu_setup_msix_resourcesfunction rvu_reset_msixfunction rvu_free_hw_resourcesfunction rvu_setup_pfvf_macaddressfunction rvu_fwdata_initfunction rvu_fwdata_exitfunction rvu_setup_nix_hw_resourcefunction rvu_setup_cpt_hw_resourcefunction rvu_get_lbk_bufsizefunction rvu_setup_hw_resourcesfunction rvu_aq_freefunction rvu_aq_allocfunction rvu_mbox_handler_readyfunction rvu_get_rsrc_mapcountfunction is_blktype_attachedfunction is_pffunc_map_validfunction rvu_lookup_rsrcfunction rvu_get_blkaddr_from_slotfunction rvu_detach_blockfunction rvu_detach_rsrcsfunction rvu_mbox_handler_detach_resourcesfunction rvu_get_nix_blkaddr
Annotated Snippet
static struct pci_driver rvu_driver = {
.name = DRV_NAME,
.id_table = rvu_id_table,
.probe = rvu_probe,
.remove = rvu_remove,
.shutdown = rvu_shutdown,
};
static int __init rvu_init_module(void)
{
int err;
pr_info("%s: %s\n", DRV_NAME, DRV_STRING);
err = pci_register_driver(&cgx_driver);
if (err < 0)
return err;
err = pci_register_driver(&ptp_driver);
if (err < 0)
goto ptp_err;
err = pci_register_driver(&mcs_driver);
if (err < 0)
goto mcs_err;
err = pci_register_driver(&rvu_driver);
if (err < 0)
goto rvu_err;
return 0;
rvu_err:
pci_unregister_driver(&mcs_driver);
mcs_err:
pci_unregister_driver(&ptp_driver);
ptp_err:
pci_unregister_driver(&cgx_driver);
return err;
}
static void __exit rvu_cleanup_module(void)
{
pci_unregister_driver(&rvu_driver);
pci_unregister_driver(&mcs_driver);
pci_unregister_driver(&ptp_driver);
pci_unregister_driver(&cgx_driver);
}
module_init(rvu_init_module);
module_exit(rvu_cleanup_module);
Annotation
- Immediate include surface: `linux/module.h`, `linux/interrupt.h`, `linux/delay.h`, `linux/irq.h`, `linux/pci.h`, `linux/sysfs.h`, `cgx.h`, `rvu.h`.
- Detected declarations: `function rvu_setup_hw_capabilities`, `function rvu_poll_reg`, `function rvu_alloc_rsrc`, `function rvu_alloc_rsrc_contig`, `function rvu_free_rsrc_contig`, `function rvu_rsrc_check_contig`, `function rvu_free_rsrc`, `function rvu_rsrc_free_count`, `function is_rsrc_free`, `function rvu_alloc_bitmap`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern 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.