drivers/net/ethernet/pensando/ionic/ionic_lif.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/pensando/ionic/ionic_lif.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/pensando/ionic/ionic_lif.c- Extension
.c- Size
- 109699 bytes
- Lines
- 4116
- 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/ethtool.hlinux/printk.hlinux/dynamic_debug.hlinux/netdevice.hlinux/etherdevice.hlinux/if_vlan.hlinux/rtnetlink.hlinux/interrupt.hlinux/pci.hlinux/cpumask.hlinux/crash_dump.hlinux/vmalloc.hnet/page_pool/helpers.hionic.hionic_bus.hionic_dev.hionic_lif.hionic_aux.hionic_txrx.hionic_ethtool.hionic_debugfs.h
Detected Declarations
function ionic_dim_workfunction ionic_lif_deferred_workfunction ionic_lif_deferred_enqueuefunction ionic_link_status_checkfunction ionic_link_status_check_requestfunction ionic_isrfunction ionic_request_irqfunction ionic_intr_allocfunction ionic_intr_freefunction ionic_irq_aff_notifyfunction ionic_irq_aff_releasefunction ionic_qcq_disablefunction ionic_lif_qcq_deinitfunction ionic_qcq_intr_freefunction ionic_qcq_freefunction ionic_qcqs_freefunction ionic_link_qcq_interruptsfunction ionic_alloc_qcq_interruptfunction ionic_qcq_allocfunction ionic_qcqs_allocfunction ionic_qcq_sanitizefunction ionic_lif_txq_initfunction ionic_lif_rxq_initfunction ionic_lif_create_hwstamp_txqfunction ionic_lif_create_hwstamp_rxqfunction ionic_lif_config_hwstamp_rxq_allfunction ionic_lif_set_hwstamp_txmodefunction ionic_lif_del_hwstamp_rxfiltfunction ionic_lif_add_hwstamp_rxfiltfunction ionic_lif_set_hwstamp_rxfiltfunction ionic_adminq_napifunction ionic_get_stats64function ionic_addr_addfunction ionic_addr_delfunction ionic_lif_rx_modefunction ionic_ndo_set_rx_modefunction ionic_netdev_features_to_nicfunction ionic_set_nic_featuresfunction ionic_init_nic_featuresfunction ionic_set_featuresfunction ionic_set_attr_macfunction ionic_get_attr_macfunction ionic_program_macfunction ionic_set_mac_addressfunction ionic_stop_queues_reconfigfunction ionic_start_queues_reconfigfunction ionic_xdp_is_valid_mtufunction ionic_change_mtu
Annotated Snippet
static const struct net_device_ops ionic_netdev_ops = {
.ndo_open = ionic_open,
.ndo_stop = ionic_stop,
.ndo_start_xmit = ionic_start_xmit,
.ndo_bpf = ionic_xdp,
.ndo_xdp_xmit = ionic_xdp_xmit,
.ndo_get_stats64 = ionic_get_stats64,
.ndo_set_rx_mode = ionic_ndo_set_rx_mode,
.ndo_set_features = ionic_set_features,
.ndo_set_mac_address = ionic_set_mac_address,
.ndo_validate_addr = eth_validate_addr,
.ndo_tx_timeout = ionic_tx_timeout,
.ndo_change_mtu = ionic_change_mtu,
.ndo_vlan_rx_add_vid = ionic_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = ionic_vlan_rx_kill_vid,
.ndo_set_vf_vlan = ionic_set_vf_vlan,
.ndo_set_vf_trust = ionic_set_vf_trust,
.ndo_set_vf_mac = ionic_set_vf_mac,
.ndo_set_vf_rate = ionic_set_vf_rate,
.ndo_set_vf_spoofchk = ionic_set_vf_spoofchk,
.ndo_get_vf_config = ionic_get_vf_config,
.ndo_set_vf_link_state = ionic_set_vf_link_state,
.ndo_get_vf_stats = ionic_get_vf_stats,
.ndo_hwtstamp_get = ionic_hwstamp_get,
.ndo_hwtstamp_set = ionic_hwstamp_set,
};
static int ionic_cmb_reconfig(struct ionic_lif *lif,
struct ionic_queue_params *qparam)
{
struct ionic_queue_params start_qparams;
int err = 0;
/* When changing CMB queue parameters, we're using limited
* on-device memory and don't have extra memory to use for
* duplicate allocations, so we free it all first then
* re-allocate with the new parameters.
*/
/* Checkpoint for possible unwind */
ionic_init_queue_params(lif, &start_qparams);
/* Stop and free the queues */
ionic_stop_queues_reconfig(lif);
ionic_txrx_free(lif);
/* Set up new qparams */
ionic_set_queue_params(lif, qparam);
if (netif_running(lif->netdev)) {
/* Alloc and start the new configuration */
err = ionic_txrx_alloc(lif);
if (err) {
dev_warn(lif->ionic->dev,
"CMB reconfig failed, restoring values: %d\n", err);
/* Back out the changes */
ionic_set_queue_params(lif, &start_qparams);
err = ionic_txrx_alloc(lif);
if (err) {
dev_err(lif->ionic->dev,
"CMB restore failed: %d\n", err);
goto err_out;
}
}
err = ionic_start_queues_reconfig(lif);
if (err) {
dev_err(lif->ionic->dev,
"CMB reconfig failed: %d\n", err);
goto err_out;
}
}
err_out:
/* This was detached in ionic_stop_queues_reconfig() */
netif_device_attach(lif->netdev);
return err;
}
static void ionic_swap_queues(struct ionic_qcq *a, struct ionic_qcq *b)
{
/* only swapping the queues and napi, not flags or other stuff */
swap(a->napi, b->napi);
if (a->q.type == IONIC_QTYPE_RXQ) {
swap(a->q.page_pool, b->q.page_pool);
a->q.page_pool->p.napi = &a->napi;
if (b->q.page_pool) /* is NULL when increasing queue count */
Annotation
- Immediate include surface: `linux/ethtool.h`, `linux/printk.h`, `linux/dynamic_debug.h`, `linux/netdevice.h`, `linux/etherdevice.h`, `linux/if_vlan.h`, `linux/rtnetlink.h`, `linux/interrupt.h`.
- Detected declarations: `function ionic_dim_work`, `function ionic_lif_deferred_work`, `function ionic_lif_deferred_enqueue`, `function ionic_link_status_check`, `function ionic_link_status_check_request`, `function ionic_isr`, `function ionic_request_irq`, `function ionic_intr_alloc`, `function ionic_intr_free`, `function ionic_irq_aff_notify`.
- 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.