pci_resize_resource(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pci_resize_resource(9) β€” the kernel API manual, but make it cute ✨

okay so bestie, welcome to the glow-up era of pci_resize_resource(9) β€” this is the page from the Kernel API Manual and it's literally about reconfiguring a Resizable BAR and its resources. no cap, it's giving main character energy for your PCI device πŸŽ€


✨ SYNOPSIS ✨

int pci_resize_resource (struct pci_dev *dev , int resno , int size ,
       int exclude_bars );

like, that's the whole vibe. one function, four args, let's go 🫢


🌸 ARGUMENTS 🌸

  • dev β€” the PCI device πŸ’– the actual star of the show.
  • resno β€” index of the BAR to be resized ✨ pick your fighter.
  • size β€” new size as defined in the spec (0=1MB, 31=128TB) πŸ“ iconic range honestly, from smol to absolutely massive.
  • exclude_bars β€” a mask of BARs that should not be released πŸ™ˆ hands off these ones.

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea: this reconfigures resno to size and re-runs the resource assignment algorithm with the new size. it's giving "makeover montage" πŸ”₯

Prior to resize, release dev resources that share a bridge window with resno. this unpins the bridge window resource to allow changing it β€” lowkey necessary, you gotta let it breathe πŸ’…

The caller may prevent releasing a particular BAR by providing exclude_bars mask, but this may result in the resize operation failing due to insufficient space. 😭 so yeah, protect a BAR and you might run out of room. choices were made.


⭐ RETURN ⭐

0 on success, or negative on error πŸŽ€ and ngl, in case of an error, the resources are restored to their original places β€” so it puts everything back where it found it, we love a clean exit ✨


πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/pci/rebar.c plus the whole rebar bestie squad:


and that's the whole page, bestie 🌈✨ this iconic little manual lives in ./drivers/pci, dated October 2026 β€” mwah, 10/10, no notes πŸ’‹πŸŽ€πŸ§šπŸ’œ

πŸ“¦ where this page comes from