drivers/net/ethernet/marvell/octeon_ep/octep_cnxk_pf.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/marvell/octeon_ep/octep_cnxk_pf.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/marvell/octeon_ep/octep_cnxk_pf.c- Extension
.c- Size
- 31730 bytes
- Lines
- 968
- 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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pci.hlinux/netdevice.hlinux/etherdevice.hlinux/jiffies.hoctep_config.hoctep_main.hoctep_regs_cnxk_pf.h
Detected Declarations
function cnxk_dump_regsfunction cnxk_reset_iqfunction cnxk_reset_oqfunction octep_reset_io_queues_cnxk_pffunction octep_setup_pci_window_regs_cnxk_pffunction octep_configure_ring_mapping_cnxk_pffunction octep_init_config_cnxk_pffunction octep_setup_iq_regs_cnxk_pffunction octep_setup_oq_regs_cnxk_pffunction octep_setup_mbox_regs_cnxk_pffunction octep_poll_pfvf_mailbox_cnxk_pffunction octep_pfvf_mbox_intr_handler_cnxk_pffunction octep_poll_oei_cnxk_pffunction octep_oei_intr_handler_cnxk_pffunction octep_poll_non_ioq_interrupts_cnxk_pffunction octep_ire_intr_handler_cnxk_pffunction octep_ore_intr_handler_cnxk_pffunction octep_vfire_intr_handler_cnxk_pffunction octep_vfore_intr_handler_cnxk_pffunction octep_dma_intr_handler_cnxk_pffunction octep_dma_vf_intr_handler_cnxk_pffunction octep_pp_vf_intr_handler_cnxk_pffunction octep_misc_intr_handler_cnxk_pffunction octep_rsvd_intr_handler_cnxk_pffunction octep_ioq_intr_handler_cnxk_pffunction octep_soft_reset_cnxk_pffunction octep_reinit_regs_cnxk_pffunction octep_enable_interrupts_cnxk_pffunction octep_disable_interrupts_cnxk_pffunction octep_update_iq_read_index_cnxk_pffunction octep_enable_iq_cnxk_pffunction octep_enable_oq_cnxk_pffunction octep_enable_io_queues_cnxk_pffunction octep_disable_iq_cnxk_pffunction octep_disable_oq_cnxk_pffunction octep_disable_io_queues_cnxk_pffunction octep_dump_registers_cnxk_pffunction octep_device_setup_cnxk_pf
Annotated Snippet
if (!oct->mbox[vf_mbox_queue]) {
dev_err(&oct->pdev->dev, "bad mbox vf %d\n", vf);
continue;
}
schedule_work(&oct->mbox[vf_mbox_queue]->wk.work);
}
if (reg0)
octep_write_csr64(oct, CNXK_SDP_EPF_MBOX_RINT(0), reg0);
}
}
static irqreturn_t octep_pfvf_mbox_intr_handler_cnxk_pf(void *dev)
{
struct octep_device *oct = (struct octep_device *)dev;
octep_poll_pfvf_mailbox_cnxk_pf(oct);
return IRQ_HANDLED;
}
/* Poll OEI events like heartbeat */
static void octep_poll_oei_cnxk_pf(struct octep_device *oct)
{
u64 reg0;
/* Check for OEI INTR */
reg0 = octep_read_csr64(oct, CNXK_SDP_EPF_OEI_RINT);
if (reg0) {
octep_write_csr64(oct, CNXK_SDP_EPF_OEI_RINT, reg0);
if (reg0 & CNXK_SDP_EPF_OEI_RINT_DATA_BIT_MBOX)
queue_work(octep_wq, &oct->ctrl_mbox_task);
if (reg0 & CNXK_SDP_EPF_OEI_RINT_DATA_BIT_HBEAT)
atomic_set(&oct->hb_miss_cnt, 0);
}
}
/* OEI interrupt handler */
static irqreturn_t octep_oei_intr_handler_cnxk_pf(void *dev)
{
struct octep_device *oct = (struct octep_device *)dev;
octep_poll_oei_cnxk_pf(oct);
return IRQ_HANDLED;
}
/* Process non-ioq interrupts required to keep pf interface running.
* OEI_RINT is needed for control mailbox
* MBOX_RINT is needed for pfvf mailbox
*/
static void octep_poll_non_ioq_interrupts_cnxk_pf(struct octep_device *oct)
{
octep_poll_pfvf_mailbox_cnxk_pf(oct);
octep_poll_oei_cnxk_pf(oct);
}
/* Interrupt handler for input ring error interrupts. */
static irqreturn_t octep_ire_intr_handler_cnxk_pf(void *dev)
{
struct octep_device *oct = (struct octep_device *)dev;
struct pci_dev *pdev = oct->pdev;
u64 reg_val = 0;
int i = 0;
/* Check for IRERR INTR */
reg_val = octep_read_csr64(oct, CNXK_SDP_EPF_IRERR_RINT);
if (reg_val) {
dev_info(&pdev->dev,
"received IRERR_RINT intr: 0x%llx\n", reg_val);
octep_write_csr64(oct, CNXK_SDP_EPF_IRERR_RINT, reg_val);
for (i = 0; i < CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf); i++) {
reg_val = octep_read_csr64(oct,
CNXK_SDP_R_ERR_TYPE(i));
if (reg_val) {
dev_info(&pdev->dev,
"Received err type on IQ-%d: 0x%llx\n",
i, reg_val);
octep_write_csr64(oct, CNXK_SDP_R_ERR_TYPE(i),
reg_val);
}
}
}
return IRQ_HANDLED;
}
/* Interrupt handler for output ring error interrupts. */
static irqreturn_t octep_ore_intr_handler_cnxk_pf(void *dev)
{
struct octep_device *oct = (struct octep_device *)dev;
struct pci_dev *pdev = oct->pdev;
u64 reg_val = 0;
Annotation
- Immediate include surface: `linux/pci.h`, `linux/netdevice.h`, `linux/etherdevice.h`, `linux/jiffies.h`, `octep_config.h`, `octep_main.h`, `octep_regs_cnxk_pf.h`.
- Detected declarations: `function cnxk_dump_regs`, `function cnxk_reset_iq`, `function cnxk_reset_oq`, `function octep_reset_io_queues_cnxk_pf`, `function octep_setup_pci_window_regs_cnxk_pf`, `function octep_configure_ring_mapping_cnxk_pf`, `function octep_init_config_cnxk_pf`, `function octep_setup_iq_regs_cnxk_pf`, `function octep_setup_oq_regs_cnxk_pf`, `function octep_setup_mbox_regs_cnxk_pf`.
- Atlas domain: Driver Families / drivers/net.
- 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.