pci_iov_vf_bar_set_size(9)
β¨ pci_iov_vf_bar_set_size(9) β¨
okay so bestie, this is a page from the Kernel API Manual β yes, the Kernel API Manual, and the star of the show is pci_iov_vf_bar_set_size(9). Come sit with me, we're learning PCI today π
π NAME π
pci_iov_vf_bar_set_size β set a new size for a VF BAR
like literally, you're resizing a Virtual Function BAR. that's the whole vibe. β¨
π¦ SYNOPSIS π¦
int pci_iov_vf_bar_set_size (struct pci_dev *dev , int resno , int size );
it returns an int, it takes three things, and yes the spacing is a little feral but we love her π«Ά
πΈ ARGUMENTS πΈ
devβ the PCI device. the main character of this whole operation πresnoβ the resource number. which resource? that one. the number of it πsizeβ the new size, as defined in the spec (so0=1MB,31=128TB). yes that range is unhinged and yes it's real π₯
π DESCRIPTION π
so here's the tea β β this sets the new size of a VF BAR, but only for a BAR that supports the VF resizable BAR capability. no capability, no resize, no cap.
and bestie, this is the part where you need to listen: unlike pci_resize_resource, this does not cause the resource that reserves the MMIO space (originally up to total_VFs) to be resized. which meansβ¦ following calls to pci_enable_sriov can fail if the resources no longer fit. π«
ngl that's the important bit β the MMIO reservation does NOT get resized along with the BAR, so if you go shrinking and growing stuff and then try to enable SRIOV and it doesn't fit, that's why. not a bug bestie, just consequences π
β RETURN β
0 on success, or negative on failure. iconic behavior honestly π
π§ SEE ALSO π§
Kernel file ./drivers/pci/iov.c β go read it, it's giving source truth π
pci_iov_get_pf_drvdata(9)pci_iov_init(9)pci_iov_release(9)pci_iov_remove(9)pci_iov_update_resource(9)pci_sriov_resource_alignment(9)pci_restore_iov_state(9)pci_vf_drivers_autoprobe(9)pci_iov_bus_range(9)pci_enable_sriov(9)pci_disable_sriov(9)pci_num_vf(9)pci_vfs_assigned(9)pci_sriov_set_totalvfs(9)pci_sriov_get_totalvfs(9)pci_sriov_configure_simple(9)pci_iov_vf_bar_get_sizes(9)
like, the whole IOV friend group, all here, all slaying π
also real quick: the sister call is pci_iov_vf_bar_get_sizes(9) β she's in the list above, go say hi π
and that's the page!! from ./drivers/pci, dated October 2026, filed under pci_iov_vf_bar_set_size(9) β mwah, go resize responsibly bestie π
ππΈ
π¦ 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