Changeset View
Standalone View
share/man/man9/PCI_IOV_ADD_VF.9
- This file was moved from share/man/man9/PCI_ADD_VF.9.
Show All 20 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd May 24, 2014 | .Dd May 24, 2014 | ||||
.Dt PCI_ADD_VF 9 | .Dt PCI_IOV_ADD_VF 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm PCI_ADD_VF | .Nm PCI_IOV_ADD_VF | ||||
.Nd inform a PF driver that a VF is being created | .Nd inform a PF driver that a VF is being created | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/bus.h | .In sys/bus.h | ||||
rstone: We probably should document that "pci_iov_if.h" needs to be included to implement the method? | |||||
Not Done Inline ActionsYes, though we generally don't require drivers to explicitly include foo_if.h headers. We normally have a wrapper header that includes them (e.g. sys/bus.h pulls in device_if.h and bus_if.h, and pcivar.h pulls in pci_if.h). I think it would be too disruptive to make pcivar.h pull his header in since we'd have to change umpteen different module Makefiles. One option I had thought about was creating a sys/dev/pci/pci_iov.h and moving the pci_iov_attach/detach wrapper functions into that. It would also have the nested include of pci_iov_if.h. jhb: Yes, though we generally don't require drivers to explicitly include foo_if.h headers. We… | |||||
Not Done Inline Actionsthat sounds fine rstone: that sounds fine | |||||
Not Done Inline ActionsOk, I've done that. I think that in theory a driver would only need to include pci_iov.h and not jhb: Ok, I've done that. I think that in theory a driver would only need to include pci_iov.h and… | |||||
.In machine/stdarg.h | .In machine/stdarg.h | ||||
.In sys/nv.h | .In sys/nv.h | ||||
.In dev/pci/pcireg.h | .In dev/pci/pci_iov.h | ||||
.In dev/pci/pcivar.h | |||||
.Ft int | .Ft int | ||||
.Fn PCI_ADD_VF "device_t dev" "uint16_t vfnum" "const nvlist_t *vf_config" | .Fn PCI_IOV_ADD_VF "device_t dev" "uint16_t vfnum" "const nvlist_t *vf_config" | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Fn PCI_ADD_VF | .Fn PCI_IOV_ADD_VF | ||||
method is called by the PCI Single-Root I/O Virtualization | method is called by the PCI Single-Root I/O Virtualization | ||||
.Pq SR-IOV | .Pq SR-IOV | ||||
infrastructure when it is initializating a new Virtual Function (VF) as a child | infrastructure when it is initializating a new Virtual Function (VF) as a child | ||||
of the given Physical Function (PF) device. | of the given Physical Function (PF) device. | ||||
This method will not be called until a successful call to | This method will not be called until a successful call to | ||||
.Xr PCI_INIT_IOV 9 | .Xr PCI_IOV_INIT 9 | ||||
has been made. | has been made. | ||||
It is not guaranteed that this method will be called following a successful call | It is not guaranteed that this method will be called following a successful call | ||||
to | to | ||||
.Xr PCI_INIT_IOV 9 . | .Xr PCI_IOV_INIT 9 . | ||||
If the infrastructure encounters a failure to allocate resources following the | If the infrastructure encounters a failure to allocate resources following the | ||||
call to | call to | ||||
.Xr PCI_INIT_IOV 9 , | .Xr PCI_IOV_INIT 9 , | ||||
the VF creation will be aborted and | the VF creation will be aborted and | ||||
.Xr PCI_UNINIT_IOV 9 | .Xr PCI_IOV_UNINIT 9 | ||||
will be called immediately without any preceding calls to | will be called immediately without any preceding calls to | ||||
.Nm . | .Nm . | ||||
.Pp | .Pp | ||||
The index of the VF being initialized is passed in the | The index of the VF being initialized is passed in the | ||||
.Fa vfnum | .Fa vfnum | ||||
argument. | argument. | ||||
VFs are always numbered sequentially starting at 0. | VFs are always numbered sequentially starting at 0. | ||||
.Pp | .Pp | ||||
Show All 14 Lines | |||||
schema. | schema. | ||||
All configuration parameters will have the correct type and will be in the range | All configuration parameters will have the correct type and will be in the range | ||||
of valid values specified in the schema. | of valid values specified in the schema. | ||||
.Pp | .Pp | ||||
Note that it is possible for the user to set different configuration values on | Note that it is possible for the user to set different configuration values on | ||||
different VF devices that are children of the same PF. | different VF devices that are children of the same PF. | ||||
The PF driver must not cache configuration parameters passed in previous calls | The PF driver must not cache configuration parameters passed in previous calls | ||||
to | to | ||||
.Fn PCI_ADD_VF | .Fn PCI_IOV_ADD_VF | ||||
for other VFs and apply those parameters to the current VF. | for other VFs and apply those parameters to the current VF. | ||||
.Pp | .Pp | ||||
This function will not be called twice for the same | This function will not be called twice for the same | ||||
.Fa vf_num | .Fa vf_num | ||||
on the same PF device without | on the same PF device without | ||||
.Xr PCI_UNINIT_IOV 9 | .Xr PCI_IOV_UNINIT 9 | ||||
and | and | ||||
.Xr PCI_INIT_IOV 9 | .Xr PCI_IOV_INIT 9 | ||||
first being called, in that order. | first being called, in that order. | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
This method returns 0 on success, otherwise an appropriate error is returned. | This method returns 0 on success, otherwise an appropriate error is returned. | ||||
If this method returns an error then the current VF device will be destroyed | If this method returns an error then the current VF device will be destroyed | ||||
but the rest of the VF devices will be created and SR-IOV will be enabled on | but the rest of the VF devices will be created and SR-IOV will be enabled on | ||||
the PF. | the PF. | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr nv 9 , | .Xr nv 9 , | ||||
.Xr pci 9 , | .Xr pci 9 , | ||||
.Xr pci_iov_schema 9 , | .Xr pci_iov_schema 9 , | ||||
.Xr PCI_INIT_IOV 9 , | .Xr PCI_IOV_INIT 9 , | ||||
.Xr PCI_UNINIT_IOV 9 | .Xr PCI_IOV_UNINIT 9 | ||||
.Sh AUTHORS | .Sh AUTHORS | ||||
This manual page was written by | This manual page was written by | ||||
.An Ryan Stone Aq Mt rstone@FreeBSD.org . | .An Ryan Stone Aq Mt rstone@FreeBSD.org . |
We probably should document that "pci_iov_if.h" needs to be included to implement the method?