drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c- Extension
.c- Size
- 136561 bytes
- Lines
- 4992
- 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/types.hlinux/bitops.hlinux/module.hlinux/pci.hlinux/netdevice.hlinux/vmalloc.hlinux/string.hlinux/in.hlinux/ip.hlinux/tcp.hlinux/sctp.hlinux/ipv6.hlinux/slab.hnet/checksum.hnet/ip6_checksum.hlinux/ethtool.hlinux/if.hlinux/if_vlan.hlinux/prefetch.hnet/mpls.hlinux/bpf.hlinux/bpf_trace.hlinux/atomic.hnet/xfrm.hixgbevf.h
Detected Declarations
enum latency_rangefunction ixgbevf_service_event_schedulefunction ixgbevf_service_event_completefunction ixgbevf_remove_adapterfunction ixgbevf_check_removefunction ixgbevf_read_regfunction ixgbevf_set_ivarfunction ixgbevf_get_tx_completedfunction ixgbevf_get_tx_pendingfunction ixgbevf_check_tx_hangfunction ixgbevf_tx_timeout_resetfunction ixgbevf_tx_timeoutfunction ixgbevf_clean_tx_irqfunction ixgbevf_rx_skbfunction ixgbevf_rx_hashfunction ixgbevf_rx_checksumfunction ixgbevf_test_staterrfunction ixgbevf_process_skb_fieldsfunction ixgbevf_put_rx_bufferfunction ixgbevf_is_non_eopfunction ixgbevf_rx_offsetfunction ixgbevf_alloc_mapped_pagefunction ixgbevf_alloc_rx_buffersfunction ixgbevf_cleanup_headersfunction ixgbevf_reuse_rx_pagefunction ixgbevf_can_reuse_rx_pagefunction ixgbevf_add_rx_fragfunction ixgbevf_irq_enable_queuesfunction ixgbevf_xmit_xdp_ringfunction ixgbevf_run_xdpfunction ixgbevf_rx_frame_truesizefunction ixgbevf_rx_buffer_flipfunction ixgbevf_clean_rx_irqfunction ixgbevf_pollfunction ixgbevf_for_each_ringfunction ixgbevf_for_each_ringfunction ixgbevf_write_eitrfunction ixgbevf_configure_msixfunction ixgbevf_update_itrfunction ixgbevf_set_itrfunction ixgbevf_msix_otherfunction ixgbevf_msix_clean_ringsfunction ixgbevf_request_msix_irqsfunction ixgbevf_request_irqfunction ixgbevf_free_irqfunction ixgbevf_irq_disablefunction ixgbevf_irq_enablefunction ixgbevf_configure_tx_ring
Annotated Snippet
static const struct net_device_ops ixgbevf_netdev_ops = {
.ndo_open = ixgbevf_open,
.ndo_stop = ixgbevf_close,
.ndo_start_xmit = ixgbevf_xmit_frame,
.ndo_set_rx_mode = ixgbevf_set_rx_mode,
.ndo_get_stats64 = ixgbevf_get_stats,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = ixgbevf_set_mac,
.ndo_change_mtu = ixgbevf_change_mtu,
.ndo_tx_timeout = ixgbevf_tx_timeout,
.ndo_vlan_rx_add_vid = ixgbevf_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = ixgbevf_vlan_rx_kill_vid,
.ndo_features_check = ixgbevf_features_check,
.ndo_bpf = ixgbevf_xdp,
};
static void ixgbevf_assign_netdev_ops(struct net_device *dev)
{
dev->netdev_ops = &ixgbevf_netdev_ops;
ixgbevf_set_ethtool_ops(dev);
dev->watchdog_timeo = 5 * HZ;
}
/**
* ixgbevf_probe - Device Initialization Routine
* @pdev: PCI device information struct
* @ent: entry in ixgbevf_pci_tbl
*
* Returns 0 on success, negative on failure
*
* ixgbevf_probe initializes an adapter identified by a pci_dev structure.
* The OS initialization, configuring of the adapter private structure,
* and a hardware reset occur.
**/
static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{
struct net_device *netdev;
struct ixgbevf_adapter *adapter = NULL;
struct ixgbe_hw *hw = NULL;
const struct ixgbevf_info *ii = ixgbevf_info_tbl[ent->driver_data];
bool disable_dev = false;
int err;
err = pci_enable_device(pdev);
if (err)
return err;
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (err) {
dev_err(&pdev->dev, "No usable DMA configuration, aborting\n");
goto err_dma;
}
err = pci_request_regions(pdev, ixgbevf_driver_name);
if (err) {
dev_err(&pdev->dev, "pci_request_regions failed 0x%x\n", err);
goto err_pci_reg;
}
pci_set_master(pdev);
netdev = alloc_etherdev_mq(sizeof(struct ixgbevf_adapter),
MAX_TX_QUEUES);
if (!netdev) {
err = -ENOMEM;
goto err_alloc_etherdev;
}
SET_NETDEV_DEV(netdev, &pdev->dev);
adapter = netdev_priv(netdev);
adapter->netdev = netdev;
adapter->pdev = pdev;
hw = &adapter->hw;
hw->back = adapter;
adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
/* call save state here in standalone driver because it relies on
* adapter struct to exist, and needs to call netdev_priv
*/
pci_save_state(pdev);
hw->hw_addr = ioremap(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));
adapter->io_addr = hw->hw_addr;
if (!hw->hw_addr) {
err = -EIO;
goto err_ioremap;
}
Annotation
- Immediate include surface: `linux/types.h`, `linux/bitops.h`, `linux/module.h`, `linux/pci.h`, `linux/netdevice.h`, `linux/vmalloc.h`, `linux/string.h`, `linux/in.h`.
- Detected declarations: `enum latency_range`, `function ixgbevf_service_event_schedule`, `function ixgbevf_service_event_complete`, `function ixgbevf_remove_adapter`, `function ixgbevf_check_remove`, `function ixgbevf_read_reg`, `function ixgbevf_set_ivar`, `function ixgbevf_get_tx_completed`, `function ixgbevf_get_tx_pending`, `function ixgbevf_check_tx_hang`.
- 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.