gve
— Ethernet
driver for Google Virtual NIC (gVNIC)
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):
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:
- RX checksum offload
- TX chesksum offload
- TCP Segmentation Offload (TSO)
- Large Receive Offload (LRO) in software
- Jumbo frames
- Receive Side Scaling (RSS)
For more information on configuring this device, see
ifconfig(8).
gve
binds to a single PCI device ID
presented by gVNIC:
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
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).
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.
gve
does not support the transmission of
VLAN-tagged packets. All VLAN-tagged traffic is dropped.
gve
features different datapath modes
called queue formats:
- 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.
- 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.
- DQO_QPL: The next generation descriptor format in the "QPL"
mode.
Please email gvnic-drivers@google.com with the specifics of the
issue encountered.
The gve
device driver first appeared in
FreeBSD 14.0.
The gve
driver was written by Google.