STRUCT NFP_NET(9)
π struct nfp_net(9) π
okay so bestie, welcome to the struct nfp_net page β this is the NFP network device structure and it lives in the Kernel API Manual. it's a big one, grab a snack π
β¨ SYNOPSIS β¨
like, here's the whole vibe, every field, exactly as it is:
struct nfp_net {
struct nfp_net_dp dp;
const struct nfp_dev_info *dev_info;
struct nfp_net_fw_version fw_ver;
u32 id;
u32 cap;
u32 cap_w1;
u32 max_mtu;
u8 rss_hfunc;
u32 rss_cfg;
u8 rss_key[NFP_NET_CFG_RSS_KEY_SZ];
u8 rss_itbl[NFP_NET_CFG_RSS_ITBL_SZ];
struct xdp_attachment_info xdp;
struct xdp_attachment_info xdp_hw;
unsigned int max_tx_rings;
unsigned int max_rx_rings;
int stride_tx;
int stride_rx;
unsigned int max_r_vecs;
struct nfp_net_r_vector r_vecs[NFP_NET_MAX_R_VECS];
struct msix_entry irq_entries[NFP_NET_MAX_IRQS];
irq_handler_t lsc_handler;
char lsc_name[IFNAMSIZ + 8];
irq_handler_t exn_handler;
char exn_name[IFNAMSIZ + 8];
irq_handler_t shared_handler;
char shared_name[IFNAMSIZ + 8];
bool link_up;
spinlock_t link_status_lock;
spinlock_t reconfig_lock;
u32 reconfig_posted;
bool reconfig_timer_active;
bool reconfig_sync_present;
struct timer_list reconfig_timer;
u32 reconfig_in_progress_update;
struct semaphore bar_lock;
bool rx_coalesce_adapt_on;
bool tx_coalesce_adapt_on;
u32 rx_coalesce_usecs;
u32 rx_coalesce_max_frames;
u32 tx_coalesce_usecs;
u32 tx_coalesce_max_frames;
u8 __iomem *qcp_cfg;
u8 __iomem *tx_bar;
u8 __iomem *rx_bar;
#ifdef CONFIG_NFP_NET_IPSEC;
struct xarray xa_ipsec;
#endif;
struct nfp_net_tlv_caps tlv_caps;
unsigned int ktls_tx_conn_cnt;
unsigned int ktls_rx_conn_cnt;
atomic64_t ktls_conn_id_gen;
atomic_t ktls_no_space;
atomic_t ktls_rx_resync_req;
atomic_t ktls_rx_resync_ign;
atomic_t ktls_rx_resync_sent;
struct {
struct sk_buff_head queue;
wait_queue_head_t wq;
struct workqueue_struct *workq;
struct work_struct wait_work;
struct work_struct runq_work;
u16 tag;
} mbox_cmsg;
struct dentry *debugfs_dir;
struct list_head vnic_list;
struct pci_dev *pdev;
struct nfp_app *app;
bool vnic_no_name;
struct nfp_port *port;
struct {
spinlock_t lock;
struct list_head list;
struct work_struct work;
} mbox_amsg;
struct {
u16 count;
struct list_head list;
} fs;
void *app_priv;
};
πΈ MEMBERS πΈ
okay, deep breath, we're going field by field and honestly? every single one ate π
dpβ the datapath structure. like the whole main-character of data movement.dev_infoβ NFP ASIC params. the hardware's little ID card.fw_verβ firmware version. good to know what we're working with fr fr.idβ vNIC id within the PF (it's0for VFs, no cap).capβ capabilities advertised by the Firmware. the flex list.cap_w1β extended capabilities word advertised by the Firmware. slay, more flex.max_mtuβ maximum support MTU advertised by the Firmware. (yes, "support", that's what it says, don't come for me π)rss_hfuncβ RSS selected hash function.rss_cfgβ RSS configuration.rss_keyβ RSS secret key. π€«rss_itblβ RSS indirection table.xdpβ information about the driver XDP program.xdp_hwβ information about the HW XDP program.max_tx_ringsβ maximum number of TX rings supported by the Firmware.max_rx_ringsβ maximum number of RX rings supported by the Firmware.stride_txβ queue controller TX queue spacing.stride_rxβ queue controller RX queue spacing.max_r_vecsβ number of allocated interrupt vectors for RX/TX.r_vecsβ pre-allocated array of ring vectors.irq_entriesβ pre-allocated array of MSI-X entries.lsc_handlerβ handler for Link State Change interrupt.lsc_nameβ name for Link State Change interrupt.exn_handlerβ handler for Exception interrupt.exn_nameβ name for Exception interrupt.shared_handlerβ handler for shared interrupts.shared_nameβ name for shared interrupt.link_upβ is the link up? (the eternal question π)link_status_lockβ protectslink_*and ensures atomicity with BAR reading.reconfig_lockβ protectsreconfig_posted,reconfig_timer_active,reconfig_sync_presentand HW reconfiguration request regs/machinery from async requests (sync must takebar_lock). lowkey a lot of responsibility ngl.reconfig_postedβ pending reconfig bits coming from async sources.reconfig_timer_activeβ timer for reading reconfiguration results is pending.reconfig_sync_presentβ some thread is performing synchronous reconfig.reconfig_timerβ timer for async reading of reconfig results.reconfig_in_progress_updateβ update FW is processing now (debug only). πbar_lockβ vNIC config BAR access lock, protects:update, mailbox area, crypto TLV.rx_coalesce_adapt_onβ is RX interrupt moderation adaptive?tx_coalesce_adapt_onβ is TX interrupt moderation adaptive?rx_coalesce_usecsβ RX interrupt moderation usecs delay parameter.rx_coalesce_max_framesβ RX interrupt moderation frame count parameter.tx_coalesce_usecsβ TX interrupt moderation usecs delay parameter.tx_coalesce_max_framesβ TX interrupt moderation frame count parameter.qcp_cfgβ pointer to QCP queue used for configuration notification.tx_barβ pointer to mapped TX queues.rx_barβ pointer to mapped FL/RX queues.xa_ipsecβ IPsec xarray SA data. (only a thing whenCONFIG_NFP_NET_IPSECis on, iykyk)tlv_capsβ parsed TLV capabilities.ktls_tx_conn_cntβ number of offloaded kTLS TX connections.ktls_rx_conn_cntβ number of offloaded kTLS RX connections.ktls_conn_id_genβ trivial generator for kTLS connection ids (for TX).ktls_no_spaceβ counter of firmware rejecting kTLS connection due to lack of space. rude of it, honestly.ktls_rx_resync_reqβ counter of TLS RX resync requested.ktls_rx_resync_ignβ counter of TLS RX resync requests ignored.ktls_rx_resync_sentβ counter of TLS RX resync completed.mbox_cmsgβ Common Control Message via vNIC mailbox state.mbox_cmsg.queueβ CCM mbox queue of pending messages.mbox_cmsg.wqβ CCM mbox wait queue of waiting processes.mbox_cmsg.workqβ CCM mbox work queue forwait_workandrunq_work.mbox_cmsg.wait_workβ CCM mbox posted msg reconfig wait work.mbox_cmsg.runq_workβ CCM mbox posted msg queue runner work.mbox_cmsg.tagβ CCM mbox message tag allocator.
debugfs_dirβ device directory in debugfs.vnic_listβ entry on device vNIC list.pdevβ backpointer to PCI device.appβ APP handle if available.vnic_no_nameβ for non-port PF vNIC makendo_get_phys_port_namereturn-EOPNOTSUPPto keep backwards compatibility (set by app). yes that's the whole sentence, it's important π«Άportβ pointer tonfp_portstructure if vNIC is a port.mbox_amsgβ asynchronously processed message via mailbox.mbox_amsg.lockβ protect message list.mbox_amsg.listβ list of message to process.mbox_amsg.workβ work to process message asynchronously.
fsβ flow steering.fs.countβ flow count.fs.listβ list of flows.
app_privβ APP private data for this vNIC.
π¦ SEE ALSO π¦
go read these next bestie, they're all in the kernel file ./drivers/net/ethernet/netronome/nfp/nfp_net.h, and also:
struct nfp_net_tx_ring(9)struct nfp_net_rx_buf(9)struct nfp_net_xsk_rx_buf(9)struct nfp_net_rx_ring(9)struct nfp_net_r_vector(9)struct nfp_net_dp(9)nfp_qcp_rd_ptr_add(9)nfp_qcp_wr_ptr_add(9)nfp_qcp_rd_ptr_read(9)nfp_qcp_wr_ptr_read(9)
and that's the page!! π this one's from ./drivers/net/ethernet/netrono... (they truncated it, not me π), dated October 2026 β ty for reading bestie, go forth and slay those rings β¨ππ
π¦ 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