GVE(4) FreeBSD Kernel Interfaces Manual GVE(4)
NAME
gve - Ethernet driver for Google Virtual NIC (gVNIC)
SYNOPSIS
To compile this driver into the kernel, place the following lines in your
kernel configuration file:
device gve
Alternatively, to load the driver as a module at boot time, place the
following line in loader.conf(5):
if_gve_load="YES"
DESCRIPTION
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.
gve is the driver for gVNIC. It supports the following features:
o RX checksum offload
o TX chesksum offload
o TCP Segmentation Offload (TSO)
o Large Receive Offload (LRO) in software
o Jumbo frames
o Receive Side Scaling (RSS)
For more information on configuring this device, see ifconfig(8).
HARDWARE
gve binds to a single PCI device ID presented by gVNIC:
o 0x1AE0:0x0042
EXAMPLES
Change the TX queue count to 4 for the gve0 interface:
sysctl dev.gve.0.num_tx_queues=4
Change the RX queue count to 4 for the gve0 interface:
sysctl dev.gve.0.num_rx_queues=4
Change the TX ring size to 512 for the gve0 interface:
sysctl dev.gve.0.tx_ring_size=512
Change the RX ring size to 512 for the gve0 interface:
sysctl dev.gve.0.rx_ring_size=512
DIAGNOSTICS
The following messages are recorded during driver initialization:
Enabled MSIX with %d vectors
Configured device resources
Successfully attached %s
Deconfigured device resources
These messages are seen if driver initialization fails. Global (across-
queues) allocation failures:
Failed to configure device resources: err=%d
No compatible queue formats
Failed to allocate ifnet struct
Failed to allocate admin queue mem
Failed to alloc DMA mem for DescribeDevice
Failed to allocate QPL page
irq and BAR allocation failures:
Failed to acquire any msix vectors
Tried to acquire %d msix vectors, got only %d
Failed to setup irq %d for Tx queue %d
Failed to setup irq %d for Rx queue %d
Failed to allocate irq %d for mgmnt queue
Failed to setup irq %d for mgmnt queue, err: %d
Failed to allocate BAR0
Failed to allocate BAR2
Failed to allocate msix table
Rx queue-specific allocation failures:
No QPL left for rx ring %d
Failed to alloc queue resources for rx ring %d
Failed to alloc desc ring for rx ring %d
Failed to alloc data ring for rx ring %d
Tx queue-specific allocation failures:
No QPL left for tx ring %d
Failed to alloc queue resources for tx ring %d
Failed to alloc desc ring for tx ring %d
Failed to vmap fifo, qpl_id = %d
The following messages are recorded when the interface detach fails:
Failed to deconfigure device resources: err=%d
If bootverbose is on, the following messages are recorded when the
interface is being brought up:
Created %d rx queues
Created %d tx queues
MTU set to %d
The following messages are recorded when the interface is being brought
down:
Destroyed %d rx queues
Destroyed %d tx queues
These messages are seen if errors are encountered when bringing the
interface up or down:
Failed to destroy rxq %d, err: %d
Failed to destroy txq %d, err: %d
Failed to create rxq %d, err: %d
Failed to create txq %d, err: %d
Failed to set MTU to %d
Invalid new MTU setting. new mtu: %d max mtu: %d min mtu: %d
Cannot bring the iface up when detached
Reached max number of registered pages %lu > %lu
Failed to init lro for rx ring %d
These messages are seen if any admin queue command fails:
AQ command(%u): failed with status %d
AQ command(%u): unknown status code %d
AQ commands timed out, need to reset AQ
Unknown AQ command opcode %d
These messages are recorded when the device is being reset due to an
error:
Scheduling reset task!
Waiting until admin queue is released.
Admin queue released
If it was the NIC that requested the reset, this message is recorded:
Device requested reset
If the reset fails during the reinitialization phase, this message is
recorded:
Restore failed!
These two messages correspoond to the NIC alerting the driver to link
state changes:
Device link is up.
Device link is down.
Apart from these messages, the driver exposes per-queue packet and error
counters as sysctl nodes. Global (across queues) counters can be read
using netstat(1).
SYSCTL VARIABLES
gve exposes the following sysctl(8) variables:
hw.gve.driver_version
The driver version. This is read-only.
hw.gve.queue_format
The queue format in use. This is read-only.
hw.gve.disable_hw_lro
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 loader.conf(5).
dev.gve.X.num_rx_queues and dev.gve.X.num_tx_queues
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.
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.
Note: sysctl nodes for queue stats remain available even if a
queue is removed.
dev.gve.X.rx_ring_size and dev.gve.X.tx_ring_size
Run-time tunables that represent the current ring size for RX/TX
queues. The default value is set to device defaults for ring
size.
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.
LIMITATIONS
gve does not support the transmission of VLAN-tagged packets. All VLAN-
tagged traffic is dropped.
QUEUE FORMATS
gve features different datapath modes called queue formats:
o 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.
o 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.
o DQO_QPL: The next generation descriptor format in the "QPL" mode.
SUPPORT
Please email
[email protected] with the specifics of the issue
encountered.
SEE ALSO
netstat(1), loader.conf(5), ifconfig(8), sysctl(8)
HISTORY
The gve device driver first appeared in FreeBSD 14.0.
AUTHORS
The gve driver was written by Google.
FreeBSD 14.1-RELEASE-p8 October 14, 2024 FreeBSD 14.1-RELEASE-p8