FreeBSD vtnet driver commit (vtnet: improve checksum offloading)

Started by s0x, September 23, 2025, 11:22:28 AM

Previous topic - Next topic
Hello everyone,

It seems that there's some improvement on the FreeBSD side regarding checksum offloading and vtnet driver.

Could this code be merged into OPNsense (or maybe you're already testing it)?

vtnet: improve checksum offloading
When transmitting a packet over the vtnet interface, map the
csum flags CSUM_DATA_VALID | CSUM_PSEUDO_HDR to the virtio
flag VIRTIO_NET_HDR_F_DATA_VALID.
When receiving a packet over the virtio network channel, translate
the virtio flag VIRTIO_NET_HDR_F_NEEDS_CSUM not to CSUM_DATA_VALID |
CSUM_PSEUDO_HDR, but to CSUM_TCP, CSUM_TCP_IPV6, CSUM_UDP, or
CSUM_UDP_IPV6.
The second change fixes a series of issue related to checksum
offloading for if_vtnet.
While there, improve the stats counters to allow a detailed view
on what is going on in relation to checksum offloading.
@ 2025-09-04 11:16:46 +0000

https://cgit.freebsd.org/src/commit/?id=1c23d8f9f39870951c1d0dfbb112fc4e53237737

Thank you


It does not work that way. That code probably has not even made it into official FreeBSD releases. Once it does, the next OpnSense release that will be based on the repective FreeBSD version will incorporate it.

If this were a security-relevant or essential fix, it might get handled differently, but this deficiency is long-standing and well known, see: https://forum.opnsense.org/index.php?topic=44159.0
Intel N100, 4* I226-V, 2* 82559, 16 GByte, 500 GByte NVME, ZTE F6005

1100 down / 800 up, Bufferbloat A+

Hey @meyergru

Oh I know, I've seen and read your guide multiple times now.

Thank you for the insight as to how and when it might come into OPNsense, didn't know it had to be that way.

I've added this to my queue of backports since this also hit stable/14 now on the FreeBSD end. It may take up to 2 months to ship if we factor in a bit of real world testing on our end. I can also publish a test kernel, but not sooner than 25.7.5.


Cheers,
Franco

Hello @franco

That's great news! Thank you for checking this out, and for the work you and the team do on OPNsense.