PCI_IOV_INIT(9)
π PCI_IOV_INIT π
okay bestie, so this is a Kernel Developer's Manual page, PCI_IOV_INIT(9), and it's literally the glow-up moment where SR-IOV gets turned on for a PF device. no cap. let's get into it π«Ά
β¨ NAME β¨
PCI_IOV_INIT β enable SR-IOV on a PF device
πΈ SYNOPSIS πΈ
#include <sys/bus.h>
#include <machine/stdarg.h>
#include <sys/nv.h>
#include <dev/pci/pci_iov.h>
int
PCI_IOV_INIT(device_t dev, uint16_t num_vfs, const nvlist_t *pf_config);
π¦ DESCRIPTION π¦
so the PCI_IOV_INIT() method gets called by the PCI Single-Root I/O Virtualization (SR-IOV) infrastucture when the user is like "hey. enable SR-IOV on this Physical Function (PF)." β¨ and the number of Virtual Functions (VFs) that are about to be created? that gets handed to this method in the num_vfs argument. it's giving headcount, fr fr.
now, if the driver asked for device-specific PF configuration parameters via a PF schema in its call to pci_iov_attach(9), those parameters will be available to you in the pf_config argument. π
and here's the tea on what's guaranteed inside pf_config:
- All configuration parameters that were either set as required parameters, or that had a default value set in the PF schema β those are guaranteed to be present in
pf_config. locked in. π - Configuration parameters that were neither set as required nor given a default value are optional, and they may or may not be present in
pf_config. so like... check before you assume, bestie. π pf_configwill not contain any configuration parameters that were not specified in the PF schema. not one. periodt.- All configuration parameters will have the correct type, and they're all in the range of valid values specified in the schema. so you can trust the vibe. β
and one more thing β if this method returns successfully, it will not be called again on the same device until after a call to PCI_IOV_UNINIT(9). so don't be out here expecting round two. π
π₯ RETURN VALUES π₯
Returns 0 on success β iconic, slay, we love to see it. otherwise an appropriate error is returned. π
and if this method returns an error? then the SR-IOV configuration will be aborted and no VFs will be created. like, zero. none. the whole thing just stops. no cap.
π SEE ALSO π
π AUTHORS π
This manual page was written by Ryan Stone <rstone@FreeBSD.org>. thank you for your service, king π«‘π
and that's the whole page, bestie β this one's from the Debian crew, dated May 28, 2015, and it's PCI_IOV_INIT(9) to the very end. go forth and enable SR-IOV responsibly πβ¨π
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2014 Sandvine Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms