STRUCT EF4_NIC(9)
πΈ NAME πΈ
okay bestie, welcome to the struct ef4_nic(9) page β this is the Kernel API Manual, and we're talking about the big one: an Efx NIC. like, the whole struct that holds the NIC's whole personality. no cap, it's giving main character energy for the driver π
β¨ SYNOPSIS β¨
here's the struct in all its glory β every field, exactly as it appears, no skipping, no summarizing, because we don't do that here π«Ά
struct ef4_nic {
char name[IFNAMSIZ];
struct list_head node;
struct ef4_nic *primary;
struct list_head secondary_list;
struct pci_dev *pci_dev;
unsigned int port_num;
const struct ef4_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;
enum ef4_int_mode interrupt_mode;
unsigned int timer_quantum_ns;
unsigned int timer_max_ns;
bool irq_rx_adaptive;
unsigned int irq_mod_step_us;
unsigned int irq_rx_moderation_us;
u32 msg_enable;
enum nic_state state;
unsigned long reset_pending;
struct ef4_channel *channel[EF4_MAX_CHANNELS];
struct ef4_msi_context msi_context[EF4_MAX_CHANNELS];
const struct ef4_channel_type *
extra_channel_type[EF4_MAX_EXTRA_CHANNELS];
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_tx_channels;
unsigned n_channels;
unsigned n_rx_channels;
unsigned rss_spread;
unsigned tx_channel_offset;
unsigned n_tx_channels;
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;
u8 rx_hash_key[40];
u32 rx_indir_table[128];
bool rx_scatter;
unsigned int_error_count;
unsigned long int_error_expire;
bool irq_soft_enabled;
struct ef4_buffer irq_status;
unsigned irq_zero_count;
unsigned irq_level;
struct delayed_work selftest_work;
#ifdef CONFIG_SFC_FALCON_MTD;
struct list_head mtd_list;
#endif;
void *nic_data;
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;
struct ef4_buffer stats_buffer;
u64 rx_nodesc_drops_total;
u64 rx_nodesc_drops_while_down;
bool rx_nodesc_drops_prev_state;
unsigned int phy_type;
const struct ef4_phy_operations *phy_op;
void *phy_data;
struct mdio_if_info mdio;
enum ef4_phy_mode phy_mode;
u32 link_advertising;
struct ef4_link_state link_state;
unsigned int n_link_state_changes;
bool unicast_filter;
union ef4_multicast_hash multicast_hash;
u8 wanted_fc;
unsigned fc_disable;
atomic_t rx_reset;
enum ef4_loopback_mode loopback_mode;
u64 loopback_modes;
void *loopback_selftest;
struct rw_semaphore filter_sem;
spinlock_t filter_lock;
void *filter_state;
#ifdef CONFIG_RFS_ACCEL;
unsigned int rps_expire_channel;
unsigned int rps_expire_index;
#endif;
atomic_t active_queues;
atomic_t rxq_flush_pending;
atomic_t rxq_flush_outstanding;
wait_queue_head_t flush_wq;
char *vpd_sn;
struct delayed_work monitor_work;
spinlock_t biu_lock;
int last_irq_cpu;
spinlock_t stats_lock;
atomic_t n_rx_noskb_drops;
};
heads up bestie: this is part 1 of 2, so don't panic when it cuts off right after the struct β more is literally coming π
and yes, we kept every single field exactly as written, including the little #ifdef/#endif moments with their semicolons β that's the vibe, don't come for me π part 2 is gonna keep the group chat going, so stay tuned β¨
π MEMBERS π
okay bestie, buckle up β struct ef4_nic has a lot of members, and we're going through every single one because she deserves it π no skipping, no "you get the idea", we're doing the whole tour.
nameβ the device name, iykyk β that's the net device name, or the bus id if we're still pre-net-device-registration πΈnodeβ a list node keeping track of the primary/secondary function lists πprimaryβ thestruct ef4_nicinstance for the primary function of this controller. Could literally be the same structure as this one, and it may beNULLif no primary function is bound. Serialised byrtnl_lockπsecondary_listβ the list ofstruct ef4_nicinstances for the secondary PCI functions of the controller, but only if this one is the primary function. Serialised byrtnl_lockβ¨pci_devβ the PCI device, periodt πtypeβ controller type attributeslegacy_irqβ IRQ numberworkqueueβ workqueue for port reconfigures and the HW monitor. Huge caveat: work items do not hold and must not acquire RTNL β οΈworkqueue_nameβ the name of the workqueuereset_workβ the scheduled reset workitemmembase_physβ the Memory BAR value, but as a physical addressmembaseβ the Memory BAR valueinterrupt_modeβ interrupt modetimer_quantum_nsβ interrupt timer quantum, in nanoseconds β±οΈtimer_max_nsβ interrupt timer maximum value, in nanosecondsirq_rx_adaptiveβ adaptive IRQ moderation enabled for RX event queuesirq_rx_moderation_usβ IRQ moderation time for RX event queuesmsg_enableβ log message enable flagsstateβ device state number (STATE_*). Serialised by thertnl_lockπreset_pendingβ bitmask for pending resetschannelβ channelsmsi_contextβ context for each MSIrxq_entriesβ size of receive queues requested by user.txq_entriesβ size of transmit queues requested by user.txq_stop_threshβ the TX queue fill level at or above which we stop it πtxq_wake_threshβ the TX queue fill level at or below which we wake it back up πtx_dc_baseβ base qword address in SRAM of the TX queue descriptor cachesrx_dc_baseβ base qword address in SRAM of the RX queue descriptor cachessram_lim_qwβ qword address limit of SRAMnext_buffer_tableβ first available buffer table idn_channelsβ number of channels in usen_rx_channelsβ number of channels used for RX (= the number of RX queues) π―n_tx_channelsβ number of channels used for TXrx_ip_alignβ RX DMA address offset so the IP header lines up in accordance withNET_IP_ALIGNrx_dma_lenβ current maximum RX DMA lengthrx_buffer_orderβ order (log2) of the number of pages for each RX bufferrx_buffer_truesizeβ amortised allocation size of an RX buffer, for use insk_buff::truesizerx_prefix_sizeβ size of the RX prefix before the packet datarx_packet_hash_offsetβ offset of the RX flow hash from the start of packet data (valid only ifrx_prefix_size != 0; always negative) πrx_packet_len_offsetβ offset of the RX packet length from the start of packet data (valid only for NICs that setEF4_RX_PKT_PREFIX_LEN; always negative)rx_packet_ts_offsetβ offset of the timestamp from the start of packet data (valid only ifchannel->sync_timestamps_enabled; always negative) β°rx_hash_keyβ Toeplitz hash key for RSSrx_indir_tableβ indirection table for RSSrx_scatterβ scatter mode enabled for receivesint_error_countβ number of internal errors seen recently π¬int_error_expireβ time at which the error count will be expiredirq_soft_enabledβ are IRQs soft-enabled? If not, the IRQ handler will acknowledge but do nothing else, literally just vibing π«₯irq_statusβ interrupt status bufferirq_zero_countβ number of legacy IRQs seen with queue flags == 0irq_levelβ IRQ level/index for IRQs not triggered by an event queueselftest_workβ work item for the asynchronous self-test π§ͺmtd_listβ list of MTDs attached to the NICnic_dataβ hardware dependent statemac_lockβ MAC access lock. Protectsport_enabled,phy_mode,ef4_monitorandef4_reconfigure_portπmac_workβ work item for changing MAC promiscuity and the multicast hashport_enabledβ port enabled indicator. Serialisesef4_stop_all,ef4_start_all,ef4_monitorandef4_mac_workwith kernel interfaces. It's safe to read under any one of thertnl_lock,mac_lock, ornetif_tx_lock, but all three must be held to modify it β all three, bestie, no cutting corners πport_initializedβ port initialized?net_devβ the operating system network device. Consider holding the rtnl lock π€fixed_featuresβ features which cannot be turned offstats_bufferβ DMA buffer for statisticsphy_typeβ PHY typephy_opβ PHY interfacephy_dataβ PHY private data (including PHY-specific stats)mdioβ PHY MDIO interfacephy_modeβ PHY operating mode. Serialised bymac_lockπlink_advertisingβ autonegotiation advertising flagslink_stateβ current state of the linkn_link_state_changesβ number of times the link has changed state, she's been through a lot πunicast_filterβ flag for Falcon-arch simple unicast filter. Protected bymac_lockπ¦multicast_hashβ multicast hash table for Falcon-arch. Protected bymac_lockwanted_fcβ wanted flow control flagsfc_disableβ when non-zero, flow control is disabled. Typically used to make sure network back pressure doesn't delay dma queue flushes. Serialised by the rtnl lock πloopback_modeβ loopback statusloopback_modesβ supported loopback mode bitmaskloopback_selftestβ offline self-test private statefilter_semβ filter tablerw_semaphore, for freeing the tablefilter_lockβ filter table lock, for mere content changesfilter_stateβ architecture-dependent filter table staterps_expire_channelβ next channel to check for expiryrps_expire_indexβ next index to check for expiry inrps_expire_channel'srps_flow_idactive_queuesβ count of RX and TX queues that haven't been flushed and drained.rxq_flush_pendingβ count of the number of receive queues that need to be flushed. Decremented whenef4_flush_rx_queueis called.rxq_flush_outstandingβ count of the 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 byef4_nic_flush_queuesto wait for flush completions. π°vpd_snβ serial number read from VPDmonitor_workβ hardware monitor workitembiu_lockβ BIU (bus interface unit) locklast_irq_cpuβ last CPU to handle a possible test interrupt. This field is used byef4_test_interruptsto verify that an interrupt has actually occurred πstats_lockβ statistics update lock. Must be held when callingef4_nic_type::{update,start,stop}_stats. πn_rx_noskb_dropsβ count of RX packets dropped due to failure to allocate an skb π
πΈ DESCRIPTION πΈ
so here's the tea: this whole entire struct is stored in the private area of the struct net_device. that's the description. she's big, she's iconic, and she lives rent-free in net_device's private area π
β¨
π¦ SEE ALSO π¦
kernel file ./drivers/net/ethernet/sfc/falcon/net_driver.h, plus the whole friend group:
struct ef4_buffer(9)struct ef4_special_buffer(9)struct ef4_tx_buffer(9)struct ef4_tx_queue(9)struct ef4_rx_buffer(9)struct ef4_rx_page_state(9)struct ef4_rx_queue(9)struct ef4_channel(9)struct ef4_msi_context(9)struct ef4_channel_type(9)struct ef4_link_state(9)struct ef4_phy_operations(9)enum ef4_phy_mode(9)struct ef4_hw_stat_desc(9)struct ef4_nic_type(9)
and that's the page, bestie π«Ά this one came straight out of ./drivers/net/ethernet/sfc/falcon, dated October 2026, and she answers to the name struct ef4_nic(9) β go forth and read the source, mwah πππ§
π¦ 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