xe_pci_sriov_get_vf_pdev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– xe_pci_sriov_get_vf_pdev(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual ✨ this one's a lil function from the xe driver that helps you find a specific VF's PCI device, and honestly? it's giving "small function, big responsibility" energy πŸŽ€


🌸 NAME 🌸

xe_pci_sriov_get_vf_pdev β€” literally just looks up the VF's PCI device using the VF identifier πŸ¦‹


✨ SYNOPSIS ✨

struct pci_dev * xe_pci_sriov_get_vf_pdev (struct pci_dev *pdev ,
       unsigned int vfid );

like, you hand it a PF device and a VF id, and it hands you back a struct pci_dev * πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • pdev β€” the PF's pci_dev. yep, the Physical Function, not the VF. important distinction, don't mix them up bestie πŸ™ˆ
  • vfid β€” the VF identifier, and heads up: it's 1-based ⭐ so no sneaky zero-indexing here, okay?

🫢 DESCRIPTION 🫢

so like, the actual description is short and sweet, but it's also the part where you cannot zone out 😭

the caller must decrement the reference count by calling pci_dev_put.

fr fr, this is the whole vibe check of the page β€” you get a reference, you are responsible for putting it back. no cap, if you forget, that reference just... stays. forever. πŸ’€


πŸ”₯ RETURN πŸ”₯

it returns the VF's pci_dev πŸŽ‰ or NULL if the VF device was not found πŸ˜” (so yeah, check for that NULL, bestie, please πŸ™)


πŸ‘‘ SEE ALSO πŸ‘‘

  • the kernel file ./drivers/gpu/drm/xe/xe_pci_sriov.c β€” that's where the magic lives, go read it iykyk 🧚
  • xe_pci_sriov_configure(9) β€” the sibling function, iconic behavior honestly 🌈

aaaand that's the whole page! stay hydrated, put your pci_dev_put where your pci_dev_get is, and remember: reference counting is self care πŸ’œ

sign-off: this cutie lives in ./drivers/gpu/drm/xe, dated October 2026, and yes the manual name is Kernel API Manual in case you were wondering πŸ“ ok bye ily πŸ’–

πŸ“¦ where this page comes from