drivers/net/ethernet/pensando/ionic/ionic_dev.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/pensando/ionic/ionic_dev.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/pensando/ionic/ionic_dev.c- Extension
.c- Size
- 28369 bytes
- Lines
- 1089
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/kernel.hlinux/types.hlinux/errno.hlinux/io.hlinux/slab.hlinux/etherdevice.hionic.hionic_dev.hionic_lif.h
Detected Declarations
function ionic_watchdog_cbfunction ionic_napi_schedule_do_softirqfunction ionic_doorbell_napi_workfunction ionic_get_preferred_cpufunction ionic_queue_dbell_napi_workfunction ionic_doorbell_check_dworkfunction ionic_doorbell_wafunction ionic_watchdog_initfunction ionic_queue_doorbell_checkfunction ionic_init_devinfofunction ionic_map_disc_cmbfunction le32_to_cpufunction ionic_map_classic_cmbfunction ionic_map_cmbfunction ionic_dev_setupfunction ionic_dev_teardownfunction __ionic_is_fw_runningfunction ionic_is_fw_runningfunction ionic_heartbeat_checkfunction test_bitfunction ionic_dev_cmd_statusfunction ionic_dev_cmd_donefunction ionic_dev_cmd_compfunction ionic_dev_cmd_gofunction ionic_dev_cmd_identifyfunction ionic_dev_cmd_initfunction ionic_dev_cmd_resetfunction ionic_dev_cmd_port_identifyfunction ionic_dev_cmd_port_initfunction ionic_dev_cmd_port_resetfunction ionic_dev_cmd_port_statefunction ionic_dev_cmd_port_speedfunction ionic_dev_cmd_port_autonegfunction ionic_dev_cmd_port_fecfunction ionic_dev_cmd_port_pausefunction ionic_set_vf_configfunction ionic_vf_startfunction ionic_dev_cmd_queue_identifyfunction ionic_dev_cmd_lif_identifyfunction ionic_dev_cmd_lif_initfunction ionic_dev_cmd_lif_resetfunction ionic_dev_cmd_adminq_initfunction ionic_dev_cmd_discover_cmbfunction ionic_db_page_numfunction ionic_get_cmbfunction ionic_put_cmbfunction ionic_cq_initfunction ionic_cq_service
Annotated Snippet
if (!work) {
netdev_err(lif->netdev, "rxmode change dropped\n");
return;
}
work->type = IONIC_DW_TYPE_RX_MODE;
netdev_dbg(lif->netdev, "deferred: rx_mode\n");
ionic_lif_deferred_enqueue(lif, work);
}
}
static void ionic_napi_schedule_do_softirq(struct napi_struct *napi)
{
local_bh_disable();
napi_schedule(napi);
local_bh_enable();
}
void ionic_doorbell_napi_work(struct work_struct *work)
{
struct ionic_qcq *qcq = container_of(work, struct ionic_qcq,
doorbell_napi_work);
unsigned long now, then, dif;
now = READ_ONCE(jiffies);
then = qcq->q.dbell_jiffies;
dif = now - then;
if (dif > qcq->q.dbell_deadline)
ionic_napi_schedule_do_softirq(&qcq->napi);
}
static int ionic_get_preferred_cpu(struct ionic *ionic,
struct ionic_intr_info *intr)
{
int cpu;
cpu = cpumask_first_and(*intr->affinity_mask, cpu_online_mask);
if (cpu >= nr_cpu_ids)
cpu = cpumask_local_spread(0, dev_to_node(ionic->dev));
return cpu;
}
static void ionic_queue_dbell_napi_work(struct ionic *ionic,
struct ionic_qcq *qcq)
{
int cpu;
if (!(qcq->flags & IONIC_QCQ_F_INTR))
return;
cpu = ionic_get_preferred_cpu(ionic, &qcq->intr);
queue_work_on(cpu, ionic->wq, &qcq->doorbell_napi_work);
}
static void ionic_doorbell_check_dwork(struct work_struct *work)
{
struct ionic *ionic = container_of(work, struct ionic,
doorbell_check_dwork.work);
struct ionic_lif *lif = ionic->lif;
mutex_lock(&lif->queue_lock);
if (test_bit(IONIC_LIF_F_FW_STOPPING, lif->state) ||
test_bit(IONIC_LIF_F_FW_RESET, lif->state)) {
mutex_unlock(&lif->queue_lock);
return;
}
ionic_napi_schedule_do_softirq(&lif->adminqcq->napi);
if (test_bit(IONIC_LIF_F_UP, lif->state)) {
int i;
for (i = 0; i < lif->nxqs; i++) {
ionic_queue_dbell_napi_work(ionic, lif->txqcqs[i]);
ionic_queue_dbell_napi_work(ionic, lif->rxqcqs[i]);
}
if (lif->hwstamp_txq &&
lif->hwstamp_txq->flags & IONIC_QCQ_F_INTR)
ionic_napi_schedule_do_softirq(&lif->hwstamp_txq->napi);
if (lif->hwstamp_rxq &&
lif->hwstamp_rxq->flags & IONIC_QCQ_F_INTR)
ionic_napi_schedule_do_softirq(&lif->hwstamp_rxq->napi);
}
mutex_unlock(&lif->queue_lock);
ionic_queue_doorbell_check(ionic, IONIC_NAPI_DEADLINE);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/errno.h`, `linux/io.h`, `linux/slab.h`, `linux/etherdevice.h`, `ionic.h`, `ionic_dev.h`.
- Detected declarations: `function ionic_watchdog_cb`, `function ionic_napi_schedule_do_softirq`, `function ionic_doorbell_napi_work`, `function ionic_get_preferred_cpu`, `function ionic_queue_dbell_napi_work`, `function ionic_doorbell_check_dwork`, `function ionic_doorbell_wa`, `function ionic_watchdog_init`, `function ionic_queue_doorbell_check`, `function ionic_init_devinfo`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.