STRUCT EFX_NIC(9)
π NAME π
okay so welcome to the struct efx_nic(9) page from the Kernel API Manual, bestie β this is literally all about struct efx_nic, aka an Efx NIC. that's the name, that's the assignment, and we're already serving main character energy. π
β¨
β¨ SYNOPSIS β¨
here's the whole struct, every field exactly as written β no skipping, no remixing, no "oops I dropped a member" behavior. this is the source-code realness, periodt:
struct efx_nic {
char name[IFNAMSIZ];
struct list_head node;
struct efx_nic *primary;
struct list_head secondary_list;
struct pci_dev *pci_dev;
unsigned int port_num;
const struct efx_nic_type *type;
int legacy_irq;
bool eeh_disabled_legacy_irq;
struct workqueue_struct *workqueue;
char workqueue_name[16];
struct work_struct reset_work;
resource_size_t membase_phys;
void __iomem *membase;
unsigned int vi_stride;
enum efx_int_mode interrupt_mode;
unsigned int timer_quantum_ns;
unsigned int timer_max_ns;
bool irq_rx_adaptive;
bool irqs_hooked;
unsigned int irq_mod_step_us;
unsigned int irq_rx_moderation_us;
u32 msg_enable;
enum nic_state state;
unsigned long reset_pending;
struct efx_channel *channel[EFX_MAX_CHANNELS];
struct efx_msi_context msi_context[EFX_MAX_CHANNELS];
const struct efx_channel_type *
extra_channel_type[EFX_MAX_EXTRA_CHANNELS];
unsigned int xdp_tx_queue_count;
struct efx_tx_queue **xdp_tx_queues;
enum efx_xdp_tx_queues_mode xdp_txq_queues_mode;
unsigned rxq_entries;
unsigned txq_entries;
unsigned int txq_stop_thresh;
unsigned int txq_wake_thresh;
unsigned tx_dc_base;
unsigned rx_dc_base;
unsigned sram_lim_qw;
unsigned next_buffer_table;
unsigned int max_channels;
unsigned int max_vis;
unsigned int max_tx_channels;
unsigned n_channels;
unsigned n_rx_channels;
unsigned rss_spread;
unsigned tx_channel_offset;
unsigned n_tx_channels;
unsigned n_extra_tx_channels;
unsigned int tx_queues_per_channel;
unsigned int n_xdp_channels;
unsigned int xdp_channel_offset;
unsigned int xdp_tx_per_channel;
unsigned int rx_ip_align;
unsigned int rx_dma_len;
unsigned int rx_buffer_order;
unsigned int rx_buffer_truesize;
unsigned int rx_page_buf_step;
unsigned int rx_bufs_per_page;
unsigned int rx_pages_per_batch;
unsigned int rx_prefix_size;
int rx_packet_hash_offset;
int rx_packet_len_offset;
int rx_packet_ts_offset;
bool rx_scatter;
struct efx_rss_context rss_context;
u32 vport_id;
unsigned int_error_count;
unsigned long int_error_expire;
bool must_realloc_vis;
bool irq_soft_enabled;
struct efx_buffer irq_status;
unsigned irq_zero_count;
unsigned irq_level;
struct delayed_work selftest_work;
#ifdef CONFIG_SFC_SIENA_MTD;
struct list_head mtd_list;
#endif;
void *nic_data;
struct efx_mcdi_data *mcdi;
struct mutex mac_lock;
struct work_struct mac_work;
bool port_enabled;
bool mc_bist_for_other_fn;
bool port_initialized;
struct net_device *net_dev;
netdev_features_t fixed_features;
u16 num_mac_stats;
struct efx_buffer stats_buffer;
u64 rx_nodesc_drops_total;
u64 rx_nodesc_drops_while_down;
bool rx_nodesc_drops_prev_state;
unsigned int phy_type;
void *phy_data;
struct mdio_if_info mdio;
unsigned int mdio_bus;
enum efx_phy_mode phy_mode;
unsigned long link_advertising[BITS_TO_LONGS(
__ETHTOOL_LINK_MODE_MASK_NBITS)];
u32 fec_config;
struct efx_link_state link_state;
unsigned int n_link_state_changes;
bool unicast_filter;
union efx_multicast_hash multicast_hash;
u8 wanted_fc;
unsigned fc_disable;
atomic_t rx_reset;
enum efx_loopback_mode loopback_mode;
u64 loopback_modes;
void *loopback_selftest;
struct bpf_prog *xdp_prog;
struct rw_semaphore filter_sem;
void *filter_state;
#ifdef CONFIG_RFS_ACCEL;
struct mutex rps_mutex;
unsigned long rps_slot_map;
struct efx_async_filter_insertion rps_slot[EFX_RPS_MAX_IN_FLIGHT];
spinlock_t rps_hash_lock;
struct hlist_head *rps_hash_table;
u32 rps_next_id;
#endif;
atomic_t active_queues;
atomic_t rxq_flush_pending;
atomic_t rxq_flush_outstanding;
wait_queue_head_t flush_wq;
#ifdef CONFIG_SFC_SIENA_SRIOV;
unsigned vf_count;
unsigned vf_init_count;
unsigned vi_scale;
#endif;
struct efx_ptp_data *ptp_data;
bool ptp_warned;
char *vpd_sn;
bool xdp_rxq_info_failed;
struct notifier_block netdev_notifier;
unsigned int mem_bar;
u32 reg_base;
struct delayed_work monitor_work;
spinlock_t biu_lock;
int last_irq_cpu;
spinlock_t stats_lock;
atomic_t n_rx_noskb_drops;
};
nameβ the device name, bestie. It's the net device name, or a bus id if the net device hasn't registered yet. β¨nodeβ list node for keeping the primary/secondary function lists in line. πprimaryβ thestruct efx_nicinstance for the primary function of this controller. It may be the same structure as this one, and it may beNULLif no primary function is bound. Serialised byrtnl_lock. πsecondary_listβ the list ofstruct efx_nicinstances for the secondary PCI functions of the controller β only relevant if this one's the primary function. Serialised byrtnl_lock. πpci_devβ the PCI device. that's it. that's the whole field. π€typeβ controller type attributes.legacy_irqβ the IRQ number.workqueueβ workqueue for port reconfigures and the HW monitor. Real talk: work items do not hold, and must not acquire, RTNL. π¨workqueue_nameβ name of workqueue.reset_workβ the scheduled reset workitem.membase_physβ memory BAR value as a physical address.membaseβ memory BAR value.vi_strideβ step between per-VI registers / memory regions.interrupt_modeβ interrupt mode.timer_quantum_nsβ interrupt timer quantum, in nanoseconds. β±οΈtimer_max_nsβ interrupt timer maximum value, in nanoseconds.irq_rx_adaptiveβ adaptive IRQ moderation enabled for RX event queues.irqs_hookedβ channel interrupts are hooked.irq_rx_moderation_usβ IRQ moderation time for RX event queues.msg_enableβ log message enable flags.stateβ device state number (STATE_*). Serialised by thertnl_lock.reset_pendingβ bitmask for pending resets.channelβ channels.msi_contextβ context for each MSI.xdp_tx_queue_countβ number of entries inxdp_tx_queues.xdp_tx_queuesβ array of pointers to tx queues used for XDP transmit.xdp_txq_queues_modeβ XDP TX queues sharing strategy.rxq_entriesβ size of receive queues requested by user.txq_entriesβ size of transmit queues requested by user.txq_stop_threshβ TX queue fill level at or above which we stop it. πtxq_wake_threshβ TX queue fill level at or below which we wake it. π«Άtx_dc_baseβ base qword address in SRAM of TX queue descriptor caches.rx_dc_baseβ base qword address in SRAM of RX queue descriptor caches.sram_lim_qwβ qword address limit of SRAM.next_buffer_tableβ first available buffer table id.n_channelsβ number of channels in use.n_rx_channelsβ number of channels used for RX (= number of RX queues).n_tx_channelsβ number of channels used for TX.n_extra_tx_channelsβ number of extra channels with TX queues.tx_queues_per_channelβ number of TX queues probed on each channel.n_xdp_channelsβ number of channels used for XDP TX.xdp_channel_offsetβ offset of the zeroth channel used for XDP TX.xdp_tx_per_channelβ max number of TX queues on an XDP TX channel.rx_ip_alignβ RX DMA address offset so the IP header ends up aligned in accordance withNET_IP_ALIGN. πrx_dma_lenβ current maximum RX DMA length.rx_buffer_orderβ order (log2) of number of pages for each RX buffer.rx_buffer_truesizeβ amortised allocation size of an RX buffer, for use insk_buff::truesize.rx_prefix_sizeβ size of RX prefix before packet data.rx_packet_hash_offsetβ offset of RX flow hash from start of packet data (valid only ifrx_prefix_size != 0; always negative).rx_packet_len_offsetβ offset of RX packet length from start of packet data (valid only for NICs that setEFX_RX_PKT_PREFIX_LEN; always negative).rx_packet_ts_offsetβ offset of timestamp from start of packet data (valid only ifchannel->sync_timestamps_enabled; always negative).rx_scatterβ scatter mode enabled for receives.rss_contextβ main RSS context.vport_idβ the function's vport ID, only relevant for PFs. iykyk. π«‘int_error_countβ number of internal errors seen recently.int_error_expireβ time at which error count will be expired.must_realloc_visβ flag: VIs have yet to be reallocated after MC reboot.irq_soft_enabledβ are IRQs soft-enabled? If not, the IRQ handler will acknowledge but do nothing else. πirq_statusβ interrupt status buffer.irq_zero_countβ number of legacy IRQs seen with queue flags== 0.irq_levelβ IRQ level/index for IRQs not triggered by an event queue.selftest_workβ work item for asynchronous self-test.mtd_listβ list of MTDs attached to the NIC.nic_dataβ hardware dependent state.mcdiβ Management-Controller-to-Driver Interface state.mac_lockβ MAC access lock. Protectsport_enabled,phy_mode,efx_monitorandefx_siena_reconfigure_port. πmac_workβ work item for changing MAC promiscuity and multicast hash.port_enabledβ port enabled indicator. Serialisesefx_siena_stop_all,efx_siena_start_all,efx_monitorandefx_mac_workwith kernel interfaces. Reading it is safe under any one of thertnl_lock,mac_lock, ornetif_tx_lockβ but all three must be held to modify it. yes, all three. no shortcuts bestie. πport_initializedβ port initialized?net_devβ operating system network device. Consider holding the rtnl lock.fixed_featuresβ features which cannot be turned off.num_mac_statsβ number of MAC stats reported by firmware (MAC_STATS_NUM_STATSfield ofMC_CMD_GET_CAPABILITIES_V4response, orMC_CMD_MAC_NSTATS).stats_bufferβ DMA buffer for statistics.phy_typeβ PHY type.phy_dataβ PHY private data (including PHY-specific stats).mdioβ PHY MDIO interface.mdio_busβ PHY MDIO bus ID (only used by Siena).phy_modeβ PHY operating mode. Serialised bymac_lock.link_advertisingβ autonegotiation advertising flags.fec_configβ Forward Error Correction configuration flags. For bit positions seeenum ethtool_fec_config_bits. πlink_stateβ current state of the link.n_link_state_changesβ number of times the link has changed state.unicast_filterβ flag for Falcon-arch simple unicast filter. Protected bymac_lock.multicast_hashβ multicast hash table for Falcon-arch. Protected bymac_lock.wanted_fcβ wanted flow control flags.fc_disableβ when non-zero, flow control is disabled. Typically used to ensure that network back pressure doesn't delay dma queue flushes. Serialised by the rtnl lock.loopback_modeβ loopback status.loopback_modesβ supported loopback mode bitmask.loopback_selftestβ offline self-test private state.xdp_progβ current XDP programme for this interface.filter_semβ filter table rw_semaphore, protects existence offilter_state.filter_stateβ architecture-dependent filter table state.rps_mutexβ protects RPS state of all channels.rps_slot_mapβ bitmap of in-flight entries inrps_slot.rps_slotβ array of ARFS insertion requests forefx_filter_rfs_work.rps_hash_lockβ protects ARFS filter mapping state (rps_hash_tableandrps_next_id).rps_hash_tableβ mapping between ARFS filters and their various IDs.rps_next_idβ nextarfs_idfor an ARFS filter.active_queuesβ count of RX and TX queues that haven't been flushed and drained.rxq_flush_pendingβ count of number of receive queues that need to be flushed. Decremented when theefx_flush_rx_queueis called.rxq_flush_outstandingβ count of number of RX flushes started but not yet completed (either success or failure). Not used when MCDI is used to flush receive queues.flush_wqβ wait queue used byefx_nic_flush_queuesto wait for flush completions.vf_countβ number of VFs intended to be enabled.vf_init_countβ number of VFs that have been fully initialised.vi_scaleβ log2 number of vnics per VF.ptp_dataβ PTP state data.ptp_warnedβ has this NIC seen and warned about unexpected PTP events?vpd_snβ serial number read from VPD.xdp_rxq_info_failedβ have any of the rx queues failed to initialise theirxdp_rxq_infostructures? π«netdev_notifierβ netdevice notifier.mem_barβ the BAR that is mapped intomembase.reg_baseβ offset from the start of the bar to the function control window.monitor_workβ hardware monitor workitem.biu_lockβ BIU (bus interface unit) lock.last_irq_cpuβ last CPU to handle a possible test interrupt. This field is used byefx_test_interruptsto verify that an interrupt has occurred.stats_lockβ statistics update lock. Must be held when callingefx_nic_type::{update,start,stop}_stats.n_rx_noskb_dropsβ count of RX packets dropped due to failure to allocate an skb. π
π¦ DESCRIPTION π¦
So like, where does this whole big beautiful struct actually live? It's stored in the private area of the struct net_device. that's the whole description. iconic brevity honestly. π
π SEE ALSO π
Kernel file ./drivers/net/ethernet/sfc/siena/net_driver.h, plus the whole friend group:
struct efx_buffer(9)struct efx_special_buffer(9)struct efx_tx_buffer(9)struct efx_tx_queue(9)struct efx_rx_buffer(9)struct efx_rx_page_state(9)struct efx_rx_queue(9)struct efx_channel(9)struct efx_msi_context(9)struct efx_channel_type(9)struct efx_link_state(9)enum efx_phy_mode(9)struct efx_hw_stat_desc(9)struct efx_rss_context(9)struct efx_arfs_rule(9)struct efx_async_filter_insertion(9)struct efx_nic_type(9)
okay that's the whole thing, you made it to the end, so proud of you fr fr π this one came from ./drivers/net/ethernet/sfc/siena, dated October 2026, and it's struct efx_nic(9) β go forth and read the header file bestie, it's giving main character energy β¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms