xref: /freebsd/usr.sbin/iovctl/iovctl.conf.5 (revision 9f8dca7d575a966c917900f1370684e507a5b603)
1b3c03556SRyan Stone.\"
2b3c03556SRyan Stone.\" Copyright (c) 2014 Sandvine Inc.
3b3c03556SRyan Stone.\" All rights reserved.
4b3c03556SRyan Stone.\"
5b3c03556SRyan Stone.\" Redistribution and use in source and binary forms, with or without
6b3c03556SRyan Stone.\" modification, are permitted provided that the following conditions
7b3c03556SRyan Stone.\" are met:
8b3c03556SRyan Stone.\" 1. Redistributions of source code must retain the above copyright
9b3c03556SRyan Stone.\"    notice, this list of conditions and the following disclaimer.
10b3c03556SRyan Stone.\" 2. Redistributions in binary form must reproduce the above copyright
11b3c03556SRyan Stone.\"    notice, this list of conditions and the following disclaimer in the
12b3c03556SRyan Stone.\"    documentation and/or other materials provided with the distribution.
13b3c03556SRyan Stone.\"
14b3c03556SRyan Stone.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15b3c03556SRyan Stone.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16b3c03556SRyan Stone.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17b3c03556SRyan Stone.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18b3c03556SRyan Stone.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19b3c03556SRyan Stone.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20b3c03556SRyan Stone.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21b3c03556SRyan Stone.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22b3c03556SRyan Stone.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23b3c03556SRyan Stone.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24b3c03556SRyan Stone.\" SUCH DAMAGE.
25b3c03556SRyan Stone.\"
26b3c03556SRyan Stone.\" $FreeBSD$
27b3c03556SRyan Stone.\"
28b3c03556SRyan Stone.Dd May 21, 2014
29b3c03556SRyan Stone.Dt IOVCTL.CONF 5
30b3c03556SRyan Stone.Os
31b3c03556SRyan Stone.Sh NAME
32b3c03556SRyan Stone.Nm iovctl.conf
33b3c03556SRyan Stone.Nd IOVCTL configuration file
34b3c03556SRyan Stone.Sh DESCRIPTION
35b3c03556SRyan StoneThe
36b3c03556SRyan Stone.Nm
37b3c03556SRyan Stonefile is the configuration file for the
38b3c03556SRyan Stone.Xr iovctl 8
39b3c03556SRyan Stoneprogram.
40b3c03556SRyan StoneThis file specifies configuration parameters for a single Physical Function
41b3c03556SRyan Stone.Pq PF
42b3c03556SRyan Stonedevice.
43b3c03556SRyan StoneTo configure SR-IOV on multiple PF devices, use one configuration file for each
44b3c03556SRyan StonePF.
45b3c03556SRyan StoneThe locations of all
46b3c03556SRyan Stone.Xr iovctl 9
47b3c03556SRyan Stoneconfiguration files are specified in
48b3c03556SRyan Stone.Xr rc.conf 5 .
49b3c03556SRyan Stone.Pp
50b3c03556SRyan StoneThe
51b3c03556SRyan Stone.Nm
52b3c03556SRyan Stonefile uses UCL format.
53b3c03556SRyan StoneUCL syntax is documented at the official UCL website:
54b3c03556SRyan Stonehttp://github.com/vstakhov/libucl.
55b3c03556SRyan Stone.Pp
56b3c03556SRyan StoneThere are three types of sections in the
57b3c03556SRyan Stone.Nm
58b3c03556SRyan Stonefile.
59b3c03556SRyan StoneA section is a key at the top level of the file with a list as its value.
60b3c03556SRyan StoneThe list may contain the keys specified in the
61b3c03556SRyan Stone.Sx OPTIONS
62b3c03556SRyan Stonesection of this manual page.
63b3c03556SRyan StoneIndividual PF driver implementations may specify additional device-specific
64b3c03556SRyan Stoneconfiguration keys that they will accept.
65b3c03556SRyan StoneThe order in which sections appear in
66b3c03556SRyan Stone.Nm
67b3c03556SRyan Stoneis ignored.
68b3c03556SRyan StoneNo two sections may have the same key.
69b3c03556SRyan StoneFor example, two sections for VF-1 must not be defined.
70b3c03556SRyan Stone.Pp
71b3c03556SRyan StoneThe first section type is the PF section.
72b3c03556SRyan StoneThis section always has the key "PF"; therefore, only one such section may be
73b3c03556SRyan Stonedefined.
74b3c03556SRyan StoneThis section defines configuration parameters that apply to the PF as a whole.
75b3c03556SRyan Stone.Pp
76b3c03556SRyan StoneThe second section type is the VF section.
77b3c03556SRyan StoneThis section has the key "VF-" followed by a VF index.
78b3c03556SRyan StoneVF indices start at 0 and always increment by 1.
79b3c03556SRyan StoneValid VF indices are in the range of 0 to
80b3c03556SRyan Stone.Po num_vfs - 1 Pc .
81b3c03556SRyan StoneThe VF index must be given as a decimal integer with no leading zeros.
82b3c03556SRyan StoneThis section defines configuration parameters that apply to a single VF.
83b3c03556SRyan Stone.Pp
84b3c03556SRyan StoneThe third section type is the default section.
85b3c03556SRyan StoneThis section always has the key "DEFAULT"; therefore, only one such section may
86b3c03556SRyan Stonebe specified.
87b3c03556SRyan StoneThis section defines default configuration parameters that apply to all VFs.
88b3c03556SRyan StoneAll configuration keys that are valid to be applied to a VF are valid in this
89b3c03556SRyan Stonesection.
90b3c03556SRyan StoneAn individual VF section may override a default specified in this section by
91b3c03556SRyan Stoneproviding a different value for the configuration parameter.
92b3c03556SRyan StoneNote that the default section applies to ALL VFs.
93b3c03556SRyan StoneThe default section must appear before any VF sections.
94*9f8dca7dSRyan StoneThe default section may appear before or after the PF section.
95b3c03556SRyan Stone.Pp
96b3c03556SRyan StoneThe following option types are supported:
97b3c03556SRyan Stone.Bl -tag -width indent
98b3c03556SRyan Stone.It boolean
99b3c03556SRyan StoneAccepts a boolean value of true or false.
100b3c03556SRyan Stone.It mac-addr
101b3c03556SRyan StoneAccepts a unicast MAC address specified as a string of the form
102b3c03556SRyan Stonexx:xx:xx:xx:xx:xx, where xx is one or two hexadecimal digits.
103b3c03556SRyan Stone.It string
104b3c03556SRyan StoneAccepts any string value.
105b3c03556SRyan Stone.It uint8_t
106b3c03556SRyan StoneAccepts any integer in the range 0-255, inclusive.
107b3c03556SRyan Stone.It uint16_t
108b3c03556SRyan StoneAccepts any integer in the range 0-65535, inclusive.
109b3c03556SRyan Stone.It uint32_t
110b3c03556SRyan StoneAccepts any integer in the range 0-2**32, inclusive.
111b3c03556SRyan Stone.It uint64_t
112b3c03556SRyan StoneAccepts any integer in the range 0-2**64, inclusive.
113b3c03556SRyan Stone.El
114b3c03556SRyan Stone.Sh OPTIONS
115b3c03556SRyan StoneThe following parameters are accepted by all PF drivers:
116b3c03556SRyan Stone.Bl -tag -width indent
117b3c03556SRyan Stone.It device Pq string
118b3c03556SRyan StoneThis parameter specifies the name of the PF device.
119b3c03556SRyan StoneThis parameter is required to be specified.
120b3c03556SRyan Stone.It num_vfs Pq uint16_t
121b3c03556SRyan StoneThis parameter specifies the number of VF children to create.
122b3c03556SRyan StoneThis parameter may not be zero.
123b3c03556SRyan StoneThe maximum value of this parameter is device-specific.
124b3c03556SRyan Stone.El
125b3c03556SRyan Stone.Pp
126b3c03556SRyan StoneThe following parameters are accepted by all VFs:
127b3c03556SRyan Stone.Bl -tag -width indent
128b3c03556SRyan Stone.It passthrough Pq boolean
129b3c03556SRyan StoneThis parameter controls whether the VF is reserved for the use of the
130b3c03556SRyan Stone.Xr bhyve 8
131b3c03556SRyan Stonehypervisor as a PCI passthrough device.
132b3c03556SRyan StoneIf this parameter is set to true, then the VF will be reserved as a PCI
133b3c03556SRyan Stonepassthrough device and it will not be accessible from the host OS.
134b3c03556SRyan StoneThe default value of this parameter is false.
135b3c03556SRyan Stone.El
136b3c03556SRyan Stone.Pp
137b3c03556SRyan StoneSee the PF driver manual page for configuration parameters specific to
138b3c03556SRyan Stoneparticular hardware.
139b3c03556SRyan Stone.Sh EXAMPLES
140b3c03556SRyan StoneThis sample file will create 3 VFs as children of the ix0 device.
141b3c03556SRyan StoneVF-1 and VF-2 are set as
142b3c03556SRyan Stone.Xr bhyve 8
143b3c03556SRyan Stonepassthrough devices through the use of the default section.
144b3c03556SRyan StoneVF-0 is not configured as a passthrough device as it explicitly overrides the
145b3c03556SRyan Stonedefault.
146b3c03556SRyan StoneVF-0 also sets a device-specific parameter named mac-addr.
147b3c03556SRyan Stone.Bd -literal .offset ident
148b3c03556SRyan StonePF {
149b3c03556SRyan Stone	device : "ix0";
150b3c03556SRyan Stone	num_vfs : 3;
151b3c03556SRyan Stone}
152b3c03556SRyan Stone
153b3c03556SRyan StoneDEFAULT {
154b3c03556SRyan Stone	passthrough : true;
155b3c03556SRyan Stone}
156b3c03556SRyan Stone
157b3c03556SRyan StoneVF-0 {
158b3c03556SRyan Stone	mac-addr : "02:56:48:7e:d9:f7";
159b3c03556SRyan Stone	passthrough : false;
160b3c03556SRyan Stone}
161b3c03556SRyan Stone.Ed
162b3c03556SRyan Stone.Sh SEE ALSO
163b3c03556SRyan Stone.Xr iovctl 8 ,
164b3c03556SRyan Stone.Xr rc.conf 5
165b3c03556SRyan Stone.Sh AUTHORS
166b3c03556SRyan StoneThis manual page was written by
167b3c03556SRyan Stone.An Ryan Stone Aq Mt rstone@FreeBSD.org .
168