1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
|
<table class="head">
<tr>
<td class="head-ltitle">GVE(4)</td>
<td class="head-vol">Device Drivers Manual</td>
<td class="head-rtitle">GVE(4)</td>
</tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">gve</code> — <span class="Nd">Ethernet
driver for Google Virtual NIC (gVNIC)</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp">To compile this driver into the kernel, place the following lines
in your kernel configuration file:</p>
<div class="Bd Pp Bd-indent"><code class="Cd">device gve</code></div>
<p class="Pp">Alternatively, to load the driver as a module at boot time, place
the following line in <a class="Xr">loader.conf(5)</a>:</p>
<div class="Bd Pp Bd-indent Li">
<pre>if_gve_load="YES"</pre>
</div>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">gVNIC is a virtual network interface designed specifically for
Google Compute Engine (GCE). It is required to support per-VM Tier-1
networking performance, and for using certain VM shapes on GCE.</p>
<p class="Pp"><code class="Nm">gve</code> is the driver for gVNIC. It supports
the following features:</p>
<p class="Pp"></p>
<ul class="Bl-bullet Bl-compact">
<li>RX checksum offload</li>
<li>TX chesksum offload</li>
<li>TCP Segmentation Offload (TSO)</li>
<li>Large Receive Offload (LRO) in software</li>
<li>Jumbo frames</li>
<li>Receive Side Scaling (RSS)</li>
</ul>
<p class="Pp">For more information on configuring this device, see
<a class="Xr">ifconfig(8)</a>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="HARDWARE"><a class="permalink" href="#HARDWARE">HARDWARE</a></h1>
<p class="Pp"><code class="Nm">gve</code> binds to a single PCI device ID
presented by gVNIC:</p>
<p class="Pp"></p>
<ul class="Bl-bullet Bl-compact">
<li>0x1AE0:0x0042</li>
</ul>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
<p class="Pp">Change the TX queue count to 4 for the gve0 interface:</p>
<div class="Bd Bd-indent">sysctl dev.gve.0.num_tx_queues=4</div>
<p class="Pp">Change the RX queue count to 4 for the gve0 interface:</p>
<div class="Bd Bd-indent">sysctl dev.gve.0.num_rx_queues=4</div>
<p class="Pp">Change the TX ring size to 512 for the gve0 interface:</p>
<div class="Bd Bd-indent">sysctl dev.gve.0.tx_ring_size=512</div>
<p class="Pp">Change the RX ring size to 512 for the gve0 interface:</p>
<div class="Bd Bd-indent">sysctl dev.gve.0.rx_ring_size=512</div>
</section>
<section class="Sh">
<h1 class="Sh" id="DIAGNOSTICS"><a class="permalink" href="#DIAGNOSTICS">DIAGNOSTICS</a></h1>
<p class="Pp">The following messages are recorded during driver
initialization:</p>
<dl class="Bl-diag">
<dt>Enabled MSIX with %d vectors</dt>
<dd></dd>
<dt>Configured device resources</dt>
<dd></dd>
<dt>Successfully attached %s</dt>
<dd></dd>
<dt>Deconfigured device resources</dt>
<dd></dd>
</dl>
<p class="Pp">These messages are seen if driver initialization fails. Global
(across-queues) allocation failures:</p>
<dl class="Bl-diag">
<dt>Failed to configure device resources: err=%d</dt>
<dd></dd>
<dt>No compatible queue formats</dt>
<dd></dd>
<dt>Failed to allocate ifnet struct</dt>
<dd></dd>
<dt>Failed to allocate admin queue mem</dt>
<dd></dd>
<dt>Failed to alloc DMA mem for DescribeDevice</dt>
<dd></dd>
<dt>Failed to allocate QPL page</dt>
<dd></dd>
</dl>
<p class="Pp">irq and BAR allocation failures:</p>
<dl class="Bl-diag">
<dt>Failed to acquire any msix vectors</dt>
<dd></dd>
<dt>Tried to acquire %d msix vectors, got only %d</dt>
<dd></dd>
<dt>Failed to setup irq %d for Tx queue %d </dt>
<dd></dd>
<dt>Failed to setup irq %d for Rx queue %d </dt>
<dd></dd>
<dt>Failed to allocate irq %d for mgmnt queue</dt>
<dd></dd>
<dt>Failed to setup irq %d for mgmnt queue, err: %d</dt>
<dd></dd>
<dt>Failed to allocate BAR0</dt>
<dd></dd>
<dt>Failed to allocate BAR2</dt>
<dd></dd>
<dt>Failed to allocate msix table</dt>
<dd></dd>
</dl>
<p class="Pp">Rx queue-specific allocation failures:</p>
<dl class="Bl-diag">
<dt>No QPL left for rx ring %d</dt>
<dd></dd>
<dt>Failed to alloc queue resources for rx ring %d</dt>
<dd></dd>
<dt>Failed to alloc desc ring for rx ring %d</dt>
<dd></dd>
<dt>Failed to alloc data ring for rx ring %d</dt>
<dd></dd>
</dl>
<p class="Pp">Tx queue-specific allocation failures:</p>
<dl class="Bl-diag">
<dt>No QPL left for tx ring %d</dt>
<dd></dd>
<dt>Failed to alloc queue resources for tx ring %d</dt>
<dd></dd>
<dt>Failed to alloc desc ring for tx ring %d</dt>
<dd></dd>
<dt>Failed to vmap fifo, qpl_id = %d</dt>
<dd></dd>
</dl>
<p class="Pp">The following messages are recorded when the interface detach
fails:</p>
<dl class="Bl-diag">
<dt>Failed to deconfigure device resources: err=%d</dt>
<dd></dd>
</dl>
<p class="Pp">If bootverbose is on, the following messages are recorded when the
interface is being brought up:</p>
<dl class="Bl-diag">
<dt>Created %d rx queues</dt>
<dd></dd>
<dt>Created %d tx queues</dt>
<dd></dd>
<dt>MTU set to %d</dt>
<dd></dd>
</dl>
<p class="Pp">The following messages are recorded when the interface is being
brought down:</p>
<dl class="Bl-diag">
<dt>Destroyed %d rx queues</dt>
<dd></dd>
<dt>Destroyed %d tx queues</dt>
<dd></dd>
</dl>
<p class="Pp">These messages are seen if errors are encountered when bringing
the interface up or down:</p>
<dl class="Bl-diag">
<dt>Failed to destroy rxq %d, err: %d</dt>
<dd></dd>
<dt>Failed to destroy txq %d, err: %d</dt>
<dd></dd>
<dt>Failed to create rxq %d, err: %d</dt>
<dd></dd>
<dt>Failed to create txq %d, err: %d</dt>
<dd></dd>
<dt>Failed to set MTU to %d</dt>
<dd></dd>
<dt>Invalid new MTU setting. new mtu: %d max mtu: %d min mtu: %d</dt>
<dd></dd>
<dt>Cannot bring the iface up when detached</dt>
<dd></dd>
<dt>Reached max number of registered pages %lu > %lu</dt>
<dd></dd>
<dt>Failed to init lro for rx ring %d</dt>
<dd></dd>
</dl>
<p class="Pp">These messages are seen if any admin queue command fails:</p>
<dl class="Bl-diag">
<dt>AQ command(%u): failed with status %d</dt>
<dd></dd>
<dt>AQ command(%u): unknown status code %d</dt>
<dd></dd>
<dt>AQ commands timed out, need to reset AQ</dt>
<dd></dd>
<dt>Unknown AQ command opcode %d</dt>
<dd></dd>
</dl>
<p class="Pp">These messages appear if a TX timeout is detected:</p>
<dl class="Bl-diag">
<dt>Found %d timed out packet(s) on txq%d, kicking it for completions</dt>
<dd></dd>
<dt>Found %d timed out packet(s) on txq%d with its last kick %ld sec ago which
is less than the cooldown period %d. Resetting device</dt>
<dd></dd>
</dl>
<p class="Pp">These messages are recorded when the device is being reset due to
an error:</p>
<dl class="Bl-diag">
<dt>Scheduling reset task!</dt>
<dd></dd>
<dt>Waiting until admin queue is released.</dt>
<dd></dd>
<dt>Admin queue released</dt>
<dd></dd>
</dl>
<p class="Pp">If it was the NIC that requested the reset, this message is
recorded:</p>
<dl class="Bl-diag">
<dt>Device requested reset</dt>
<dd></dd>
</dl>
<p class="Pp">If the reset fails during the reinitialization phase, this message
is recorded:</p>
<dl class="Bl-diag">
<dt>Restore failed!</dt>
<dd></dd>
</dl>
<p class="Pp">These two messages correspond to the NIC alerting the driver to
link state changes:</p>
<dl class="Bl-diag">
<dt>Device link is up.</dt>
<dd></dd>
<dt>Device link is down.</dt>
<dd></dd>
</dl>
<p class="Pp">Apart from these messages, the driver exposes per-queue packet and
error counters as sysctl nodes. Global (across queues) counters can be read
using <a class="Xr">netstat(1)</a>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYSCTL_VARIABLES"><a class="permalink" href="#SYSCTL_VARIABLES">SYSCTL
VARIABLES</a></h1>
<p class="Pp"><code class="Nm">gve</code> exposes the following
<a class="Xr">sysctl(8)</a> variables:</p>
<dl class="Bl-tag">
<dt id="hw.gve.driver_version"><var class="Va">hw.gve.driver_version</var></dt>
<dd>The driver version. This is read-only.</dd>
<dt id="hw.gve.queue_format"><var class="Va">hw.gve.queue_format</var></dt>
<dd>The queue format in use. This is read-only.</dd>
<dt id="hw.gve.disable_hw_lro"><var class="Va">hw.gve.disable_hw_lro</var></dt>
<dd>Setting this boot-time tunable to 1 disables Large Receive Offload (LRO)
in the NIC. The default value is 0, which means hardware LRO is enabled by
default. The software LRO stack in the kernel is always used. This sysctl
variable needs to be set before loading the driver, using
<a class="Xr">loader.conf(5)</a>.</dd>
<dt id="hw.gve.allow_4k_rx_buffers"><var class="Va">hw.gve.allow_4k_rx_buffers</var></dt>
<dd>Setting this boot-time tunable to 1 enables support for 4K RX Buffers. The
default value is 0, which means 2K RX Buffers will be used. 4K RX Buffers
are only supported on DQO_RDA and DQO_QPL queue formats. When enabled, 4K
RX Buffers will be used either when HW LRO is enabled or mtu is greated
than 2048. This sysctl variable needs to be set before loading the driver,
using <a class="Xr">loader.conf(5)</a>.</dd>
<dt id="dev.gve.X.num_rx_queues"><var class="Va">dev.gve.X.num_rx_queues and
dev.gve.X.num_tx_queues</var></dt>
<dd>Run-time tunables that represent the number of currently used RX/TX
queues. The default value is the max number of RX/TX queues the device can
support.
<p class="Pp">This call turns down the interface while setting up the new
queues, which may potentially cause any new packets to be dropped. This
call can fail if the system is not able to provide the driver with
enough resources. In that situation, the driver will revert to the
previous number of RX/TX queues. If this also fails, a device reset will
be triggered.</p>
<p class="Pp">Note: sysctl nodes for queue stats remain available even if a
queue is removed.</p>
</dd>
<dt id="dev.gve.X.rx_ring_size"><var class="Va">dev.gve.X.rx_ring_size and
dev.gve.X.tx_ring_size</var></dt>
<dd>Run-time tunables that represent the current ring size for RX/TX queues.
The default value is set to device defaults for ring size.
<p class="Pp">This call turns down the interface while setting up the queues
with the new ring size, which may potentially cause any new packets to
be dropped. This call can fail if the system is not able to provide the
driver with enough resources. In that situation, the driver will try to
revert to the previous ring size for RX/TX queues. If this also fails,
the device will be in an unhealthy state and will need to be reloaded.
This value must be a power of 2 and within the defined range.</p>
</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="LIMITATIONS"><a class="permalink" href="#LIMITATIONS">LIMITATIONS</a></h1>
<p class="Pp"><code class="Nm">gve</code> does not support the transmission of
VLAN-tagged packets. All VLAN-tagged traffic is dropped.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="QUEUE_FORMATS"><a class="permalink" href="#QUEUE_FORMATS">QUEUE
FORMATS</a></h1>
<p class="Pp"><code class="Nm">gve</code> features different datapath modes
called queue formats:</p>
<p class="Pp"></p>
<ul class="Bl-bullet Bl-compact">
<li>GQI_QPL: "QPL" stands for "Queue Page List" and refers
to the fact that hardware expects a fixed bounce buffer and cannot access
arbitrary memory. GQI is the older descriptor format. The G in
"GQI" refers to an older generation of hardware, and the
"QI" stands for "Queue In-order" referring to the fact
that the NIC sends Tx and Rx completions in the same order as the one in
which the corresponding descriptors were posted by the driver.</li>
<li>DQO_RDA: DQO is the descriptor format required to take full advantage of
next generation VM shapes. "RDA" stands for "Raw DMA
Addressing" and refers to the fact that hardware can work with DMA-ed
packets and does not expect them to be copied into or out of a fixed
bounce buffer. The D in "DQO" refers to a newer generation of
hardware, and the "QO" stands for "Queue Out-of-order"
referring to the fact that the NIC might send Tx and Rx completions in an
order different from the one in which the corresponding descriptors were
posted by the driver.</li>
<li>DQO_QPL: The next generation descriptor format in the "QPL"
mode.</li>
</ul>
</section>
<section class="Sh">
<h1 class="Sh" id="SUPPORT"><a class="permalink" href="#SUPPORT">SUPPORT</a></h1>
<p class="Pp">Please email gvnic-drivers@google.com with the specifics of the
issue encountered.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<p class="Pp"><a class="Xr">netstat(1)</a>, <a class="Xr">loader.conf(5)</a>,
<a class="Xr">ifconfig(8)</a>, <a class="Xr">sysctl(8)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">The <code class="Nm">gve</code> device driver first appeared in
<span class="Ux">FreeBSD 13.3</span>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp">The <code class="Nm">gve</code> driver was written by Google.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">May 20, 2025</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|