---
name: "if_vtnet"
section: "4"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/if_vtnet"
---

# if\_vtnet(4)

VirtIO Ethernet driver

## NAME

**vtnet** – VirtIO Ethernet driver

## SYNOPSIS

**device** **vtnet**

In [loader.conf(5)](/loader.conf/5.md): **hw.vtnet.csum\_disable** **hw.vtnet.***X**.csum\_disable* **hw.vtnet.tso\_disable** **hw.vtnet.***X**.tso\_disable* **hw.vtnet.lro\_disable** **hw.vtnet.***X**.lro\_disable* **hw.vtnet.mq\_disable** **hw.vtnet.***X**.mq\_disable* **hw.vtnet.mq\_max\_pairs** **hw.vtnet.***X**.mq\_max\_pairs* **hw.vtnet.tso\_maxlen** **hw.vtnet.***X**.tso\_maxlen* **hw.vtnet.rx\_process\_limit** **hw.vtnet.***X**.rx\_process\_limit* **hw.vtnet.lro\_entry\_count** **hw.vtnet.***X**.lro\_entry\_count* **hw.vtnet.lro\_mbufq\_depth** **hw.vtnet.***X**.lro\_mbufq\_depth* **hw.vtnet.altq\_disable** **if\_vtnet\_load="YES"**

## DESCRIPTION

The **vtnet** device driver provides support for VirtIO Ethernet devices.

If the hypervisor advertises the appropriate features, the **vtnet** driver supports TCP/UDP checksum offload for both transmit and receive, TCP segmentation offload (TSO), TCP large receive offload (LRO), hardware VLAN tag stripping/insertion features, a multicast hash filter, as well as Jumbo Frames (up to 9216 bytes), which can be configured via the interface MTU setting.

Two flavors of TCP LRO are supported: Hardware TCP LRO, which is performed by the host providing TCP segments larger than the MTU to the guest, and Software TCP LRO, which is performed by the network stack of the guest processing TCP segments in an optimized way. Only one flavour of TCP LRO should be used. Since hardware TCP LRO can have bad interactions with IP forwarding and software TCP LRO mitigates several drawbacks of hardware TCP LRO, the default setting is to disable hardware TCP LRO. See the loader tunable *hw.vtnet.**X**.lro\_disable*.

TCP/UDP receive checksum offload cannot be configured independently for IPv4 and IPv6. Selecting an MTU larger than 1500 bytes with the [ifconfig(8)](/ifconfig/8.md) utility configures the adapter to receive and transmit Jumbo Frames.

For more information on configuring this device, see [ifconfig(8)](/ifconfig/8.md).

## HARDWARE

The **vtnet** driver supports VirtIO Ethernet devices.

## LOADER TUNABLES

Tunables can be set at the [loader(8)](/loader/8.md) prompt before booting the kernel or stored in [loader.conf(5)](/loader.conf/5.md).

- *hw.vtnet.csum\_disable*

  - *hw.vtnet.**X**.csum\_disable*

  This tunable disables receive and transmit checksum offloading for TCP and UDP. This also implies that TCP segmentation offloading and large receive offload are disabled. The default value is 0.

- *hw.vtnet.tso\_disable*

  - *hw.vtnet.**X**.tso\_disable*

  This tunable disables TCP segmentation offloading. The default value is 0.

- *hw.vtnet.lro\_disable*

  - *hw.vtnet.**X**.lro\_disable*

  This tunable disables hardware TCP LRO. The default value is 1.

- *hw.vtnet.mq\_disable*

  - *hw.vtnet.**X**.mq\_disable*

  This tunable disables multiqueue. The default value is 0.

- *hw.vtnet.mq\_max\_pairs*

  - *hw.vtnet.**X**.mq\_max\_pairs*

  This tunable sets the maximum number of transmit and receive queue pairs. Multiple queues are only supported when the Multiqueue feature is negotiated. This driver supports a maximum of 8 queue pairs. The number of queue pairs used is the lesser of the maximum supported by the driver and the hypervisor, the number of CPUs present in the guest, and this tunable if not zero. The default value is 0.

- *hw.vtnet.tso\_maxlen*

  - *hw.vtnet.**X**.tso\_maxlen*

  This tunable sets the TSO burst limit. The default value is 65535.

- *hw.vtnet.rx\_process\_limit*

  - *hw.vtnet.**X**.rx\_process\_limit*

  This tunable sets the number of RX segments processed in one pass. The default value is 1024.

- *hw.vtnet.lro\_entry\_count*

  - *hw.vtnet.**X**.lro\_entry\_count*

  This tunable sets the software TCP LRO entry count. The default value is 128, the minimum value is 8.

- *hw.vtnet.lro\_mbufq\_depth*

  - *hw.vtnet.**X**.lro\_mbufq\_depth*

  This tunable sets the depth of the software TCP LRO mbuf queue. The default value is 0.

- *hw.vtnet.altq\_disable*

  This tunable disables ALTQ support, allowing the use of multiqueue instead. This option applies to all interfaces. The default value is 0.

## TRANSMIT QUEUE STATISTICS

For each transmit queue of each interface the following read-only statistics are provided:

- *dev.vtnet.**X**.txq**Y**.rescheduled*

  The number of times the transmit interrupt handler was rescheduled.

- *dev.vtnet.**X**.txq**Y**.tso*

  The number of times TCP segment offloading was performed.

- *dev.vtnet.**X**.txq**Y**.csum*

  The number of times transmit checksum offloading for UDP or TCP was performed.

- *dev.vtnet.**X**.txq**Y**.omcasts*

  The number of multicast packets that were transmitted.

- *dev.vtnet.**X**.txq**Y**.obytes*

  The number of bytes that were transmitted (based on Ethernet frames).

- *dev.vtnet.**X**.txq**Y**.opackets*

  The number of packets that were transmitted (Ethernet frames).

## RECEIVE QUEUE STATISTICS

For each receive queue of each interface the following read-only statistics are provided:

- *dev.vtnet.**X**.rxq**Y**.rescheduled*

  The number of times the receive interrupt handler was rescheduled.

- *dev.vtnet.**X**.rxq**Y**.host\_lro*

  The number of times TCP large receive offload was performed.

- *dev.vtnet.**X**.rxq**Y**.csum\_failed*

  The number of times a packet with a request for receive or transmit checksum offloading was received and this request failed. The different reasons for the failure are counted by *dev.vtnet.**X**.rx\_csum\_inaccessible\_ipproto*, *dev.vtnet.**X**.rx\_csum\_bad\_ipproto*, and *dev.vtnet.**X**.rx\_csum\_bad\_ethtype*.

- *dev.vtnet.**X**.rxq**Y**.csum*

  The number of times receive checksum offloading for UDP or TCP was performed.

- *dev.vtnet.**X**.rxq**Y**.ierrors*

  The number of times an error occurred during input processing.

- *dev.vtnet.**X**.rxq**Y**.iqdrops*

  The number of times a packet was dropped during input processing.

- *dev.vtnet.**X**.rxq**Y**.ibytes*

  The number of bytes that were received (based on Ethernet frames).

- *dev.vtnet.**X**.rxq**Y**.ipackets*

  The number of packets that were received (Ethernet frames).

## INTERFACE TRANSMIT STATISTICS

For each interface the following read-only transmit statistics are provided:

- *dev.vtnet.**X**.tx\_task\_rescheduled*

  The sum of *dev.vtnet.**X**.txq**Y**.rescheduled* over all transmit queues of the interface.

- *dev.vtnet.**X**.tx\_tso\_offloaded*

  The sum of *dev.vtnet.**X**.txq**Y**.tso* over all transmit queues of the interface.

- *dev.vtnet.**X**.tx\_csum\_offloaded*

  The sum of *dev.vtnet.**X**.txq**Y**.csum* over all transmit queues of the interface.

- *dev.vtnet.**X**.tx\_defrag\_failed*

  The number of times an attempt to defragment an mbuf chain failed during a transmit operation.

- *dev.vtnet.**X**.tx\_defragged*

  The number of times an mbuf chain was defragmented during a transmit operation.

- *dev.vtnet.**X**.tx\_tso\_without\_csum*

  The number of times TCP segment offloading was attempted without transmit checksum offloading.

- *dev.vtnet.**X**.tx\_tso\_not\_tcp*

  The number of times TCP segment offloading was attempted for a non-TCP packet.

- *dev.vtnet.**X**.tx\_csum\_proto\_mismatch*

  The number of times the IP protocol version of the transmit checksum offloading request did not match the IP protocol version of the packet.

- *dev.vtnet.**X**.tx\_csum\_unknown\_ethtype*

  The number of times a transmit offload operation was requested for an ethernet frame for which the EtherType was neither IPv4 nor IPv6 (considering simple VLAN tagging).

## INTERFACE RECEIVE STATISTICS

For each interface the following read-only receive statistics are provided:

- *dev.vtnet.**X**.rx\_task\_rescheduled*

  The sum of *dev.vtnet.**X**.rxq**Y**.rescheduled* over all receive queues of the interface.

- *dev.vtnet.**X**.rx\_csum\_offloaded*

  The sum of *dev.vtnet.**X**.rxq**Y**.csum* over all receive queues of the interface.

- *dev.vtnet.**X**.rx\_csum\_failed*

  The sum of *dev.vtnet.**X**.rxq**Y**.csum\_failed* over all receive queues of the interface.

- *dev.vtnet.**X**.rx\_csum\_inaccessible\_ipproto*

  The number of times a packet with a request for receive or transmit checksum offloading was received where the IP protocol was not accessible.

- *dev.vtnet.**X**.rx\_csum\_bad\_ipproto*

  The number of times a packet with a request for receive or transmit checksum offloading was received where the IP protocol was neither TCP nor UDP.

- *dev.vtnet.**X**.rx\_csum\_bad\_ethtype*

  The number of times a packet with a request for receive or transmit checksum offloading was received where the EtherType was neither IPv4 nor IPv6.

- *dev.vtnet.**X**.rx\_mergeable\_failed*

  The number of times receiving a mergable buffer failed.

- *dev.vtnet.**X**.rx\_enq\_replacement\_failed*

  The number of times the enqueuing the replacement receive mbuf chain failed.

- *dev.vtnet.**X**.rx\_frame\_too\_large*

  The number of times the frame was loger than the mbuf chain during large receive offload without mergeable buffers.

- *dev.vtnet.**X**.mbuf\_alloc\_failed*

  The number of times an mbuf cluster allocation for the receive buffer failed.

## INTERFACE CONFIGURATION PARAMETER

For each interface the following read-only configuration parameters are provided:

- *dev.vtnet.**X**.act\_vq\_pairs*

  The number of active virtqueue pairs.

- *dev.vtnet.**X**.req\_vq\_pairs*

  The number of requested virtqueue pairs.

- *dev.vtnet.**X**.max\_vq\_pairs*

  The maximum number of supported virtqueue pairs.

- *dev.vtnet.**X**.flags*

  The flags of the interface. Mostly for debugging purposes.

- *dev.vtnet.**X**.features*

  The features of the interface as defined by the virtio specification.

## SEE ALSO

[arp(4)](/arp/4.md), [netintro(4)](/netintro/4.md), [ng\_ether(4)](/ng_ether/4.md), [virtio(4)](/virtio/4.md), [vlan(4)](/vlan/4.md), [ifconfig(8)](/ifconfig/8.md)

## HISTORY

The **vtnet** driver was written by Bryan Venteicher ⟨*bryanv@FreeBSD.org*⟩. It first appeared in FreeBSD 9.0.

## CAVEATS

The **vtnet** driver only supports LRO when the hypervisor advertises the mergeable buffer feature.
