xref: /freebsd/share/man/man9/PCI_IOV_INIT.9 (revision bce295fcbe533d46d2f600168403c7968599b86b)
1f3bb9251SJohn Baldwin.\"
2f3bb9251SJohn Baldwin.\" Copyright (c) 2014 Sandvine Inc.
3f3bb9251SJohn Baldwin.\" All rights reserved.
4f3bb9251SJohn Baldwin.\"
5f3bb9251SJohn Baldwin.\" Redistribution and use in source and binary forms, with or without
6f3bb9251SJohn Baldwin.\" modification, are permitted provided that the following conditions
7f3bb9251SJohn Baldwin.\" are met:
8f3bb9251SJohn Baldwin.\" 1. Redistributions of source code must retain the above copyright
9f3bb9251SJohn Baldwin.\"    notice, this list of conditions and the following disclaimer.
10f3bb9251SJohn Baldwin.\" 2. Redistributions in binary form must reproduce the above copyright
11f3bb9251SJohn Baldwin.\"    notice, this list of conditions and the following disclaimer in the
12f3bb9251SJohn Baldwin.\"    documentation and/or other materials provided with the distribution.
13f3bb9251SJohn Baldwin.\"
14f3bb9251SJohn Baldwin.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15f3bb9251SJohn Baldwin.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16f3bb9251SJohn Baldwin.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17f3bb9251SJohn Baldwin.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18f3bb9251SJohn Baldwin.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19f3bb9251SJohn Baldwin.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20f3bb9251SJohn Baldwin.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21f3bb9251SJohn Baldwin.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22f3bb9251SJohn Baldwin.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23f3bb9251SJohn Baldwin.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24f3bb9251SJohn Baldwin.\" SUCH DAMAGE.
25f3bb9251SJohn Baldwin.\"
26f3bb9251SJohn Baldwin.Dd May 28, 2015
27f3bb9251SJohn Baldwin.Dt PCI_IOV_INIT 9
28f3bb9251SJohn Baldwin.Os
29f3bb9251SJohn Baldwin.Sh NAME
30f3bb9251SJohn Baldwin.Nm PCI_IOV_INIT
31f3bb9251SJohn Baldwin.Nd enable SR-IOV on a PF device
32f3bb9251SJohn Baldwin.Sh SYNOPSIS
33f3bb9251SJohn Baldwin.In sys/bus.h
34f3bb9251SJohn Baldwin.In machine/stdarg.h
35f3bb9251SJohn Baldwin.In sys/nv.h
36f3bb9251SJohn Baldwin.In dev/pci/pci_iov.h
37f3bb9251SJohn Baldwin.Ft int
38f3bb9251SJohn Baldwin.Fn PCI_IOV_INIT "device_t dev" "uint16_t num_vfs" "const nvlist_t *pf_config"
39f3bb9251SJohn Baldwin.Sh DESCRIPTION
40f3bb9251SJohn BaldwinThe
41f3bb9251SJohn Baldwin.Fn PCI_IOV_INIT
42f3bb9251SJohn Baldwinmethod is called by the PCI Single-Root I/O Virtualization (SR-IOV)
43*bce295fcSGordon Berglinginfrastructure when the user requests that SR-IOV be enabled on a Physical
44f3bb9251SJohn BaldwinFunction (PF).
45f3bb9251SJohn BaldwinThe number of Virtual Functions (VFs) that will be created is passed to this
46f3bb9251SJohn Baldwinmethod in the
47f3bb9251SJohn Baldwin.Fa num_vfs
48f3bb9251SJohn Baldwinargument.
49f3bb9251SJohn Baldwin.Pp
50f3bb9251SJohn BaldwinIf the driver requested device-specific PF configuration parameters via a PF
51f3bb9251SJohn Baldwinschema in its call to
52f3bb9251SJohn Baldwin.Xr pci_iov_attach 9 ,
53f3bb9251SJohn Baldwinthose parameters will be available in the
54f3bb9251SJohn Baldwin.Fa pf_config
55f3bb9251SJohn Baldwinargument.
56f3bb9251SJohn BaldwinAll configuration parameters that were either set as required parameters or that
57f3bb9251SJohn Baldwinhad a default value set in the PF schema are guaranteed to be present in
58f3bb9251SJohn Baldwin.Fa pf_config .
59f3bb9251SJohn BaldwinConfiguration parameters that were neither set as required nor were given a
60f3bb9251SJohn Baldwindefault value are optional and may or may not be present in
61f3bb9251SJohn Baldwin.Fa pf_config .
62f3bb9251SJohn Baldwin.Fa pf_config
63f3bb9251SJohn Baldwinwill not contain any configuration parameters that were not specified in the PF
64f3bb9251SJohn Baldwinschema.
65f3bb9251SJohn BaldwinAll configuration parameters will have the correct type and are in the range of
66f3bb9251SJohn Baldwinvalid values specified in the schema.
67f3bb9251SJohn Baldwin.Pp
68f3bb9251SJohn BaldwinIf this method returns successfully, then this method will not be called again
69f3bb9251SJohn Baldwinon the same device until after a call to
702958b3a4SEnji Cooper.Xr PCI_IOV_UNINIT 9 .
71f3bb9251SJohn Baldwin.Sh RETURN VALUES
72f3bb9251SJohn BaldwinReturns 0 on success, otherwise an appropriate error is returned.
73f3bb9251SJohn BaldwinIf this method returns an error then the SR-IOV configuration will be aborted
74f3bb9251SJohn Baldwinand no VFs will be created.
75f3bb9251SJohn Baldwin.Sh SEE ALSO
76f3bb9251SJohn Baldwin.Xr nv 9 ,
77f3bb9251SJohn Baldwin.Xr pci 9 ,
78f3bb9251SJohn Baldwin.Xr PCI_IOV_ADD_VF 9 ,
79548afe2bSChristian Brueffer.Xr pci_iov_schema 9 ,
80f3bb9251SJohn Baldwin.Xr PCI_IOV_UNINIT 9
81f3bb9251SJohn Baldwin.Sh AUTHORS
82f3bb9251SJohn BaldwinThis manual page was written by
83f3bb9251SJohn Baldwin.An Ryan Stone Aq Mt rstone@FreeBSD.org .
84