drivers/net/ethernet/intel/iavf/iavf_main.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/iavf/iavf_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/iavf/iavf_main.c- Extension
.c- Size
- 160839 bytes
- Lines
- 5693
- 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/net/intel/libie/rx.hnet/netdev_lock.hiavf.hiavf_ptp.hiavf_prototype.hiavf_trace.h
Detected Declarations
function iavf_status_to_errnofunction virtchnl_status_to_errnofunction iavf_is_reset_in_progressfunction iavf_allocate_dma_mem_dfunction iavf_free_dma_memfunction iavf_allocate_virt_memfunction iavf_free_virt_memfunction iavf_schedule_resetfunction iavf_schedule_aq_requestfunction iavf_tx_timeoutfunction iavf_misc_irq_disablefunction iavf_misc_irq_enablefunction iavf_irq_disablefunction iavf_irq_enable_queuesfunction iavf_irq_enablefunction iavf_msix_aqfunction iavf_msix_clean_ringsfunction iavf_map_vector_to_rxqfunction iavf_map_vector_to_txqfunction iavf_map_rings_to_vectorsfunction iavf_request_traffic_irqsfunction iavf_request_misc_irqfunction iavf_free_traffic_irqsfunction iavf_free_misc_irqfunction iavf_configure_txfunction iavf_select_rx_desc_formatfunction iavf_configure_rxfunction list_for_each_entryfunction iavf_del_vlanfunction iavf_get_num_vlans_addedfunction iavf_get_max_vlans_allowedfunction iavf_max_vlans_addedfunction iavf_vlan_rx_add_vidfunction iavf_vlan_rx_kill_vidfunction list_for_each_entryfunction iavf_replace_primary_macfunction iavf_is_mac_set_handledfunction iavf_set_macfunction __dev_function __dev_function iavf_promiscuous_mode_changedfunction iavf_set_rx_modefunction iavf_napi_enable_allfunction iavf_napi_disable_allfunction iavf_configurefunction iavf_up_completefunction iavf_clear_mac_filtersfunction iavf_clear_cloud_filters
Annotated Snippet
static const struct net_device_ops iavf_netdev_ops;
int iavf_status_to_errno(enum iavf_status status)
{
switch (status) {
case IAVF_SUCCESS:
return 0;
case IAVF_ERR_PARAM:
case IAVF_ERR_MAC_TYPE:
case IAVF_ERR_INVALID_MAC_ADDR:
case IAVF_ERR_INVALID_LINK_SETTINGS:
case IAVF_ERR_INVALID_PD_ID:
case IAVF_ERR_INVALID_QP_ID:
case IAVF_ERR_INVALID_CQ_ID:
case IAVF_ERR_INVALID_CEQ_ID:
case IAVF_ERR_INVALID_AEQ_ID:
case IAVF_ERR_INVALID_SIZE:
case IAVF_ERR_INVALID_ARP_INDEX:
case IAVF_ERR_INVALID_FPM_FUNC_ID:
case IAVF_ERR_QP_INVALID_MSG_SIZE:
case IAVF_ERR_INVALID_FRAG_COUNT:
case IAVF_ERR_INVALID_ALIGNMENT:
case IAVF_ERR_INVALID_PUSH_PAGE_INDEX:
case IAVF_ERR_INVALID_IMM_DATA_SIZE:
case IAVF_ERR_INVALID_VF_ID:
case IAVF_ERR_INVALID_HMCFN_ID:
case IAVF_ERR_INVALID_PBLE_INDEX:
case IAVF_ERR_INVALID_SD_INDEX:
case IAVF_ERR_INVALID_PAGE_DESC_INDEX:
case IAVF_ERR_INVALID_SD_TYPE:
case IAVF_ERR_INVALID_HMC_OBJ_INDEX:
case IAVF_ERR_INVALID_HMC_OBJ_COUNT:
case IAVF_ERR_INVALID_SRQ_ARM_LIMIT:
return -EINVAL;
case IAVF_ERR_NVM:
case IAVF_ERR_NVM_CHECKSUM:
case IAVF_ERR_PHY:
case IAVF_ERR_CONFIG:
case IAVF_ERR_UNKNOWN_PHY:
case IAVF_ERR_LINK_SETUP:
case IAVF_ERR_ADAPTER_STOPPED:
case IAVF_ERR_PRIMARY_REQUESTS_PENDING:
case IAVF_ERR_AUTONEG_NOT_COMPLETE:
case IAVF_ERR_RESET_FAILED:
case IAVF_ERR_BAD_PTR:
case IAVF_ERR_SWFW_SYNC:
case IAVF_ERR_QP_TOOMANY_WRS_POSTED:
case IAVF_ERR_QUEUE_EMPTY:
case IAVF_ERR_FLUSHED_QUEUE:
case IAVF_ERR_OPCODE_MISMATCH:
case IAVF_ERR_CQP_COMPL_ERROR:
case IAVF_ERR_BACKING_PAGE_ERROR:
case IAVF_ERR_NO_PBLCHUNKS_AVAILABLE:
case IAVF_ERR_MEMCPY_FAILED:
case IAVF_ERR_SRQ_ENABLED:
case IAVF_ERR_ADMIN_QUEUE_ERROR:
case IAVF_ERR_ADMIN_QUEUE_FULL:
case IAVF_ERR_BAD_RDMA_CQE:
case IAVF_ERR_NVM_BLANK_MODE:
case IAVF_ERR_PE_DOORBELL_NOT_ENABLED:
case IAVF_ERR_DIAG_TEST_FAILED:
case IAVF_ERR_FIRMWARE_API_VERSION:
case IAVF_ERR_ADMIN_QUEUE_CRITICAL_ERROR:
return -EIO;
case IAVF_ERR_DEVICE_NOT_SUPPORTED:
return -ENODEV;
case IAVF_ERR_NO_AVAILABLE_VSI:
case IAVF_ERR_RING_FULL:
return -ENOSPC;
case IAVF_ERR_NO_MEMORY:
return -ENOMEM;
case IAVF_ERR_TIMEOUT:
case IAVF_ERR_ADMIN_QUEUE_TIMEOUT:
return -ETIMEDOUT;
case IAVF_ERR_NOT_IMPLEMENTED:
case IAVF_NOT_SUPPORTED:
return -EOPNOTSUPP;
case IAVF_ERR_ADMIN_QUEUE_NO_WORK:
return -EALREADY;
case IAVF_ERR_NOT_READY:
return -EBUSY;
case IAVF_ERR_BUF_TOO_SHORT:
return -EMSGSIZE;
}
return -EIO;
}
int virtchnl_status_to_errno(enum virtchnl_status_code v_status)
{
Annotation
- Immediate include surface: `linux/net/intel/libie/rx.h`, `net/netdev_lock.h`, `iavf.h`, `iavf_ptp.h`, `iavf_prototype.h`, `iavf_trace.h`.
- Detected declarations: `function iavf_status_to_errno`, `function virtchnl_status_to_errno`, `function iavf_is_reset_in_progress`, `function iavf_allocate_dma_mem_d`, `function iavf_free_dma_mem`, `function iavf_allocate_virt_mem`, `function iavf_free_virt_mem`, `function iavf_schedule_reset`, `function iavf_schedule_aq_request`, `function iavf_tx_timeout`.
- 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.