STRUCT NFP_PF(9)
π struct nfp_pf (9) π
okay bestie, so this is a page from the Kernel API Manual β yes, the real one, section 9, we're in kernel-doc territory now β and it's literally all about struct nfp_pf, the NFP PF-specific device structure. that's it, that's the whole vibe. NFP PF device lore. pull up a chair π«Ά
β¨ NAME β¨
struct nfp_pf β the NFP PF-specific device structure. like, the big one. the main character struct for a physical function on an NFP. π
π SYNOPSIS π
struct nfp_pf {
struct pci_dev *pdev;
const struct nfp_dev_info *dev_info;
struct nfp_cpp *cpp;
struct nfp_app *app;
struct nfp_cpp_area *data_vnic_bar;
struct nfp_cpp_area *ctrl_vnic_bar;
struct nfp_cpp_area *qc_area;
struct nfp_cpp_area *mac_stats_bar;
u8 __iomem *mac_stats_mem;
struct nfp_cpp_area *vf_cfg_bar;
u8 __iomem *vf_cfg_mem;
struct nfp_cpp_area *vfcfg_tbl2_area;
u8 __iomem *vfcfg_tbl2;
const struct nfp_rtsym *mbox;
struct msix_entry *irq_entries;
unsigned int limit_vfs;
unsigned int num_vfs;
bool fw_loaded;
bool unload_fw_on_remove;
struct nfp_net *ctrl_vnic;
const struct nfp_mip *mip;
struct nfp_rtsym_table *rtbl;
struct nfp_hwinfo *hwinfo;
struct nfp_dumpspec *dumpspec;
u32 dump_flag;
u32 dump_len;
struct nfp_eth_table *eth_tbl;
struct nfp_nsp_identify *nspi;
struct device *hwmon_dev;
struct dentry *ddir;
unsigned int max_data_vnics;
unsigned int num_vnics;
struct list_head vnics;
struct list_head ports;
struct workqueue_struct *wq;
struct work_struct port_refresh_work;
struct nfp_shared_buf *shared_bufs;
unsigned int num_shared_bufs;
};
no cap, that's a lot of fields. we're gonna go through every single one, because we are thorough in this house π
π MEMBERS π
here's the member-by-member rundown, and bestie I did not skip a single one:
pdevβ backpointer to the PCI device. it's the "who do I belong to" of the whole struct π«Άdev_infoβ NFP ASIC params. the silicon's little ID card β¨cppβ pointer to the CPP handle.appβ pointer to the APP handle.data_vnic_barβ pointer to the CPP area for the data vNICs' BARs.ctrl_vnic_barβ pointer to the CPP area for the ctrl vNIC's BAR.qc_areaβ pointer to the CPP area for the queues. queues need a home too π₯Ίmac_stats_barβ pointer to the CPP area for the MAC stats.mac_stats_memβ pointer to mapped MAC stats area.vf_cfg_barβ pointer to the CPP area for the VF configuration BAR.vf_cfg_memβ pointer to mapped VF configuration area.vfcfg_tbl2_areaβ pointer to the CPP area for the VF config table.vfcfg_tbl2β pointer to mapped VF config table.mboxβ RTSym of per-PCI PF mailbox (under devlink lock). π¬ note the lock, it's important, iykykirq_entriesβ array of MSI-X entries for all vNICs.limit_vfsβ number of VFs supported by firmware (~0for PCI limit). yes literally~0, that's the special "just use the PCI limit" value πnum_vfsβ number of SR-IOV VFs enabled.fw_loadedβ is the firmware loaded? the eternal question πunload_fw_on_removeβ do we need to unload firmware on driver removal? (it's aboolnamed like a full sentence and honestly, love that for it)ctrl_vnicβ pointer to the control vNIC if available.mipβ MIP handle.rtblβ RTsym table.hwinfoβ HWInfo table.dumpspecβ debug dump specification. for when things go π and we need the receiptsdump_flagβ store dump flag betweenset_dumpandget_dump_flag. it's literally just holding onto the flag between those two calls, king behavior πdump_lenβ store dump length betweenset_dumpandget_dump_flag. same deal, but the length β¨eth_tblβ NSP ETH table.nspiβ NSP identification info.hwmon_devβ pointer to hwmon device. lowercase "pointer" in the original, we respect it πddirβ per-device debugfs directory.max_data_vnicsβ number of data vNICs app firmware supports.num_vnicsβ number of vNICs spawned.vnicsβ linked list of vNIC structures (struct nfp_net).portsβ linked list of port structures (struct nfp_port).wqβ workqueue for running works which need to grab lock. lock-grabbing works, go do your thing π₯port_refresh_workβ work entry for taking netdevs out.shared_bufsβ array of shared buffer structures if FW has any SBs.num_shared_bufsβ number of elements inshared_bufs.
πΈ DESCRIPTION πΈ
so here's the one (1) rule of this struct's mutable era: fields which may change after probe are protected by the devlink instance lock. that's the whole description. that's the tea. β (the page does say "proble" instead of "probe" β we stan a typo, but yeah, it means probe π)
β οΈ bestie please take the devlink instance lock seriously. the fields that can change after probe are guarded by it β this is the kind of caveat that's lowkey boring until it's 3am and everything is on fire π
π¦ SEE ALSO π¦
- Kernel file
./drivers/net/ethernet/netronome/nfp/nfp_main.h struct nfp_dumpspec(9)
and that's the page!! no notes, ate, periodt π
sign-off time π β this lil beauty came from ./drivers/net/ethernet/netrono... (yes it's truncated in the footer, that's just how the footer do) and it's dated October 2026. future-coded documentation, obsessed. πβπ
π¦ 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