Google Virtual NIC (gVNIC) is a virtual network interface designed specifically for Compute Engine. It is required to support per VM Tier1 networking performance, and for using certain VM shapes. gve is the driver for gVNIC.
The driver here binds to a single PCI device id used by the virtual Ethernet device found in some Compute Engine VMs.
Field | Value | Comments |
---|---|---|
Vendor ID | 0x1AE0 |
|
Device ID | 0x0042 |
|
Sub-vendor ID | 0x1AE0 |
|
Sub-device ID | 0x0058 |
|
Revision ID | 0x0 |
|
Device Class | 0x200 |
Ethernet |
FreeBSD 13.1 and upwards
gve supports the following features:
- RX checksum offload
- TX chesksum offload
- TSO
- Software LRO
- Hardware LRO when using the DQO queue formats
- Jumbo frames
- RSS
gve does not yet support the following features:
- Ability to change ring sizes
- Ability to change RSS config from userspace
- Hardware LRO
- Netmap (4) support
- Polling (4) support
-
Driver version can be read by running
sysctl hw.gve.driver_version
. -
Queue format in use can be learnt by running
sysctl hw.gve.queue_format
. To make full use of NIC bandwidth on c3 and n4 shapes, this should say DQO. -
Per-queue stats can be viewed by running
sysctl -a | grep gve0
. Aggregated stats can be viewed by runningnetstat -I gve0
. -
If bootverbose is on, the driver logs its version at load time and this can be learnt by running
dmesg | grep gve0
. -
The state of the driver taskqueues can be learnt by running
procstat -ta | grep gve0
.
The following instructions are for installing the driver as an out-of-tree module. They refer to the gcloud command, but many of them can also be performed on the web UI.
-
Create a FreeBSD 13 instance in your project, log into it, and become root.
-
Install bash:
pkg install bash
. -
Install git:
pkg install git
and then clone this repository and cd into it. -
Run
./build_src.sh
; this should create abuild/
directory. -
Run
make -C build/
to compile the driver and verify that agve.ko
exists inbuild/
. -
To have the driver automatically load on boot, run:
cp build/gve.ko /boot/modules/gve.ko
echo 'gve_load="YES"' >> /boot/loader.conf
-
Stop the VM.
-
Using gVNIC on a custom image requires the use of a VM image that has been deliberately tagged with the gVNIC "guest OS feature". To create such an image based off of the VM stopped in the previous step, use the following gcloud command.
gcloud compute images create ${IMAGE_NAME?} \
--source-disk ${DISK_NAME?} \
--guest-os-features=GVNIC
Here DISK_NAME
refers to the boot disk of the instance you just stopped.
This new image IMAGE_NAME
has the gve driver installed and loading with every boot.
- Use the image you have created in the previous step, which now has the gve driver installed, to create and start a VM with a gVNIC network interface.
gcloud compute instances create ${INSTANCE_NAME?} \
--source-image ${IMAGE_NAME?} \
--zone ${PREFERRED_ZONE?} \
--network-interface=nic-type=GVNIC
Note that to use TIER_1 networking an additional flag needs to be supplied:
--network-performance-configs=total-egress-bandwidth-tier=TIER_1