When the router for a FreeBSD guest on KVM is also a FreeBSD guest on the same KVM host, and which is using the virtio network driver from virtio_kmod, ping will work between guests on different subnets, but no userland network daemons will respond. If I switch to the e1000 driver on the router, but change nothing else, everything works correctly. Fix: Unknown. How-To-Repeat: I created three FreeBSD guests on one Linux KVM host. I am using bridged networking on the KVM host, as br0 and br1. One of the guests has two network interfaces and acts as a router between two subnets, as follows: router1: br0, 192.168.1.1; br1, 192.168.2.1 client1: br0, 192.168.1.100; default route 192.168.1.1 client2: br1, 192.168.2.100; default route 192.168.2.1 I configured virtio network interfaces on all three hosts. I enabled forwarding on router1, but no packet filtering. No NAT is in use. Result: * client1 can ping client2, and vice versa. * ssh works from router1 to client1 and vice versa, and from router1 to client2 and vice versa. * ssh from client1 to client2 will fail (and vice versa); the client simply hangs indefinitely while trying to connect. * tcpdump on client2 will show that the SYN is arriving at client2 port 22, but client2 never replies, nor generates any debug or log output that suggests it ever saw the connection attempt. * any other userland network service I try (both tcp and udp) will show the same thing -- packets arrive at client2 from client1, but the daemon seems to never see them. Since ping works, I know the kernel is getting them. * If I switch back to the e1000 driver on router1, but make no other changes, and make no changes at all to client1 and client2, then ssh will work properly from client1 to client2 and the problem is resolved. * If I let router1 continue to use virtio interfaces, but move router1 onto a different KVM host -- so that the traffic from client1 to client2 must leave the KVM host via the bridged interface and then return on a different interface - then ssh will work properly from client1 to client2 and the problem is resolved. KVM guests: FreeBSD 9 virtio-kmod: 0.228301 KVM host: Ubuntu 11.10 qemu-kvm: 0.14.1
Responsible Changed From-To: freebsd-bugs->freebsd-ports-bugs reclassify.
Responsible Changed From-To: freebsd-ports-bugs->kuriyama Over to maintainer (via the GNATS Auto Assign Tool)
Responsible Changed From-To: kuriyama->bryanv Hi Bryan, Is this something you may be acquainted with, as the virtio maintainer? Do you have any recommendations? Please accept my apologies if this isn't something for you... Chris
I wanted to confirm that this bug is present in FreeBSD 8.3-RELEASE_p9 running on SmartOS KVM (a different implementation than the linux KVM).
State Changed From-To: open->feedback Fantastic, thanks for your quick response. Jeffrey, does disabling checksum offloading work for you?
This did not resolve my issue. Thanks, Jeff
Env: Host OS: Debian 7.1 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64 GNU/Linux KVMM: QEMU emulator version 1.1.2 (qemu-kvm-1.1.2+dfsg-6, Debian) Guest: FreeBSD 9.2-R amd64 Disabling checksum offload with ifconfig vtnetX -rxcsum -txcsum on both interfaces (this is a router) solves the issue, but performance becomes terrible (150 KB/sec uses 100% CPU on host). vtnet interfaces are, Host side, bridged to VLANs. Problem does not appear if the traffic is to/from the router itself. Only forwarded traffic is a problem. Can provide more info/feedback if needed.
Phil Regnauld (regnauld) writes: > Env: > Host OS: Debian 7.1 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64 GNU/Linux > KVMM: QEMU emulator version 1.1.2 (qemu-kvm-1.1.2+dfsg-6, Debian) > Guest: FreeBSD 9.2-R amd64 > > Disabling checksum offload with ifconfig vtnetX -rxcsum -txcsum on both > interfaces (this is a router) solves the issue, but performance becomes > terrible (150 KB/sec uses 100% CPU on host). > > vtnet interfaces are, Host side, bridged to VLANs. > > Problem does not appear if the traffic is to/from the router itself. Only > forwarded traffic is a problem. > > Can provide more info/feedback if needed. Same problem has been observed with 10.0-RC4. kern/166645 may be related. This is causing FreeBSD (and pfSense) to be unusable as a network appliance / router on KVM platforms. Phil
Still present on 10.1. Environment: Ubuntu 14.04 KVM hypervisor A FreeBSD 10.01 gateway between the world to three networks. The FreeBSD has a VYOS default gateway with NATTING it. When I remove the txcsum and rxcsum from the interface the packets doesn't get corrupted. The VYOS router blocks INVALID packets ICMP packets are not malformed while TCP do. I had the same issue with OpenBSD 5.7 and it got fixed on current(5.8). Examples of the setup rc.conf and pf rules at: http://wiki.squid-cache.org/ConfigExamples/Intercept/PfPolicyRoute#rc.conf_example_for_a_router
(In reply to elico from comment #9) My testing topology: http://ngtech.co.il/squidblocker/topology1.png
I've seen the same issue on linux kvm guest(w/ FBSD router virtio guest w/ tso) worked around by: pre-up /sbin/ethtool --offload eth0 tx off so I am curious as to how this is identified as a FreeBSD bug. Seems to more like something within the kvm stack. Ubuntu 14.04.3 LTS qemu-kvm 2.0.0+dfsg-2ubuntu1.16 Seems to also be the same issue here: https://forum.pfsense.org/index.php?topic=88467.0 However it's not a PF issue as ipfw kernel nat also did the same.
(In reply to amvandemore from comment #11) My assumption is that if it works with Linux, OpenBSD in many versions then it's not an hypervisor issue. What and how exactly I do not know but maybe the OpenBSD virtio changes can help to understand what was changed. Notice that it's affecting only routing\gateway mode and not regular traffic so it's something special and it's not related at all to FW but to the GW\routing related code.
I do not "need" this since my systems works fine with e1000 and with Linux hosts but I was wondering if there is any progress with it?
(In reply to elico from comment #12) I doubt too that this is a KVM issue as there seem to be similar problems (forwarding tcp packets) on Xen. E.g: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=188261 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202199 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197344
(In reply to Sydney Meyer from comment #14) I had a chance to verify the subject with a special setup which includes debian and found out that the issue is only in a specific scenario: The KVM hypervisor hosting two VM's and sharing the same interfae such as bridge. The bug is that the hypervisor virtio driver doesn't write a checksum for packets which are directed towards an internal interface. The Hypervisor should either write the checksome or the VM should not check it. It's an issue that is partially in the driver and the hypervisor. I am running now on both CentOS and Ubuntu KVM hypervisor sharing the same issue. The solution for my case was to use iptables checksum fill option on the gateway machine. The first step is to allow DHCP traffic pass between VM's and that the DHCP client(ISC) will not drop the packets using: iptables -A POSTROUTING -t mangle -p udp --dport 68 -j CHECKSUM --checksum-fill I will try to test with FreeBSD 11 since with OpenBSD 5.X it didn't but with 5.Y(tip) it was working fine.
This has been a long standing and unfortunate issue. My memory is somewhat fuzzy, but generally speaking the host doesn't need to compute a checksum because it is basically just a memory copy into the guest, but FreeBSD doesn't have a flag (at least at the time I was originally working on the VirtIO drivers) to denote "recompute this checksum if forwarding" the packet.
(In reply to Bryan Venteicher from comment #16) OK So the test environment should be the next: - 1 KVM Hypervier(CentOS 7) - 1 VYOS EDGE GW(eth0=192.168.89.200/24, eth1=192.168.7.254/24, GW=192.168.89.1) - 1 FreeBSD (10.3+11.0) GW for 2 networks(eth0=192.168.7.1/24,eth1=192.168.6.254/24,eth2=192.168.7.254/24, GW=192.168.7.254/23) - Windows+Linux+FreeBSD clients on networks 192.168.6.0/24+192.168.7.0/24 with GW 192.168.6.254 or 192.168.7.254 The expected result should be a working connection from the end user(Win\Lin\BSD) to the local networks and Internet.
batch change: For bugs that match the following - Status Is In progress AND - Untouched since 2018-01-01. AND - Affects Base System OR Documentation DO: Reset to open status. Note: I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
(In reply to Eitan Adler from comment #18) With what version of FreeBSD? Latest stable?
I am probably hit similar issue with Gentoo Linux Host KVM and FreeBSD 9~12 Guest with virtio network adapter, my environment is Linux bacztwo 4.14.101-gentoo libvirt-4.9.0 qemu-3.1.0 under default setting with e1000 series the guest sometimes raising interrupt storm over it with virtio it won't receive any packet and unable to communicate through network. the following option for qemu that just disable all checksum for virtio-net works on my FreeBSD guest -device virtio-net-pci,csum=off,guest_csum=off
(In reply to andcycle-bugs.freebsd.org from comment #20) here are the options for "virsh edit" on the KVM host: <interface type='network'> <source network='private'/> <model type='virtio'/> <driver> <host csum='off'/> <guest csum='off'/> </driver> </interface> eg. "virsh edit freebsd-host" and put this into the config. Jakub
MARKED AS SPAM
(In reply to zain david from comment #22) Why Spam?
Hello FreeBSD maintainers, This bug is still present on 11.3-RELEASE and 12.0-RELEASE Maybe it could be a good idea to upgrade version in the ticket description. Maybe somebody will consider it :) It's so sad that FreeBSD run better on vmware than on linux KVM :/ Thanks in advance for the good job on FreeBSD BR, Grégory
(In reply to Greg A. from comment #24) FreeBsd 12.1 workaround # Gateway Host Ifconfig for WAN interface vtnet0 (vtnet uplink 10g) ---- ifconfig_vtnet0="inet WAN_IP netmask WAN_MASK vlanmtu vlanhwtag vlanhwfilter vlanhwcsum vlanhwtso -rxcsum -txcsum -rxcsum6 -txcsum6 tso6 tso4 lro" ---- disable only -rxcsum -txcsum -rxcsum6 -txcsum6 Ifconfig for LAN interface vtnet1 (vtnet uplink 10g) --- ifconfig_vtnet1="inet 192.168.1.1 netmask 255.255.255.0 vlanmtu vlanhwtag vlanhwfilter vlanhwcsum vlanhwtso rxcsum -txcsum rxcsum6 -txcsum6 tso6 tso4 lro" --- disable only -txcsum -txcsum6 pf.conf - simple nat rule for LAN (scrub rules not need) --- nat on vtnet0 from 192.168.1.0/24 to any -> WAN_IP --- ###################################################################### # LAN Client Host (vtnet uplink 10g) Ifconfig for LAN interface vtnet0 --- ifconfig_vtnet0="inet 10.66.1.2 netmask 255.255.255.0 vlanmtu vlanhwtag vlanhwfilter vlanhwcsum vlanhwtso rxcsum -txcsum rxcsum6 -txcsum6 tso6 tso4 lro" --- disable only -txcsum -txcsum6 ###################################################################### All traffic test passed normal. 1) Gateway LAN -> Client LAN - iperf3 result 14Gbit/s 2) Client Lan -> Gateway Lan - iperf result 14Gbit/s 3) Client Lan download Gateway Lan (NAT) from External source - result max download speed 3) External iperf client -> to Gateway WAN (iperf port) -> redirect to LAN Client iperf server - result max External iperf client speed Please check workaround
^Triage: This issue needs a reproduction on currently supported FreeBSD versions and steps to reproduce (minimum test case). Ideally reproduction confirmation against CURRENT, 13.1 and 12.4 (re)confirmation that disabling RX/TX checksumming works around the issue, or not, would also be great.
(In reply to Kubilay Kocak from comment #26) I will try to test later on. Since Ubuntu 14.04 is not supported anymore I will try to reproduce on later versions of Ubuntu 20.04/22.04 and Oracle Linux 8. I will try to verify with 12.3 and 12.4
(In reply to elico from comment #27) OK so just to mention the NAT related documents are at: http://draft.scyphus.co.jp/freebsd/nat.html and ontop of Oracle Enterprise Linux 8 KVM host the issue exists on 12.3 the setup is very simple: * Alpine 3.16 with ip 192.168.111.1/24 gw 192.168.111.254 DNS 8.8.8.8 * FreeBSD 12.3 with two interfaces: vtnet0 192.168.110.1/24 GW 192.168.110.254 vtnet1 192.168.111.254/24 pf rules to nat on $ext_inf * VyOS 1.3.2 with two interfaces: eth0 192.168.122.183/24 GW 192.168.122.1 eth1: 192.168.110.254/24 ping from Alpine to 8.8.8.8 via FreeBSD (NAT) -> VyOS (NAT) = works (ICMP_ wget from Alpine to 8.8.8.8 via FreeBSD (NAT) -> VyOS (NAT) = doesn't work (TCP) When I am running the next on the vtnet0 and vtnet1 interfaces the TCP works: ifconfig vtnet0 -rxcsum ifconfig vtnet1 -rxcsum It was resolved long ago in OpenBSD so now there only should be a fix and a text.
(In reply to elico from comment #28) Hello, I created a FreeBSD 13.1 STABLE virtual router in a Proxmox 7.1 testing environment and was encountering this issue with my FreeBSD VM. I can confirm that running the following helped me to resolve the issue: ifconfig vtnet0 -rxcsum ifconfig vtnet1 -rxcsum Thank you for helping with my virtual router's NAT not working. Previous to resolution, I was able to ping things, which tells me that ICMP was working fine (I could also see this in my pflogging) - however, I could not say the same for TCP
Hello, I created a FreeBSD 12.3 STABLE virtual router in a Proxmox 7.1 environment and was encountering this issue with my FreeBSD VM. I can confirm that running the following helped to work arround the issue, but the performance is terrible. ifconfig vtnet0 -rxcsum ifconfig vtnet1 -rxcsum
Hello, I came across this bug report while troubleshooting an OPNsense throughput issue when using a VirtIO network card on Proxmox 8. Unfortunately the only way to achieve 10Gbps speed is to enable the HW Checksum Offloading option. Unfortunately, after activating it, access to servers on the same Proxmox server stops working and not only to them, but also for example to the TrueNAS Core server (NOT on the same Proxmox server). I see that this issue has not been resolved since 2012. Is there ever a plan to fix this? This behavior is still present on OPNsense 23.7.9 and therefore FreeBSD 13.2. Thanks
Hello Adding parameters to /boot/loader.conf hw.vtnet.X.tso_disable="1" hw.vtnet.tso_disable="1" hw.vtnet.lro_disable="1" hw.vtnet.X.lro_disable="1" hw.vtnet.csum_disable="1" hw.vtnet.X.csum_disable="1" Solved the problem
^Triage: clear unneeded flags. Nothing has yet been committed to be merged.
Hi, This was highlighted to me as a long standing issue that the foundation might look at. There is a decade of discussion here and it isn't super clear if there are several symptoms that are addressed by disabling checksum offload or if there are multiple issues. I think there are two different cases (if I were writing tests, which I will try to). FreeBSD as a router on Linux KVM incorrectly skips checksum calculations breaking forwarding. FreeBSD as a router with checksum offload disabled is unable to forward suitable traffic rates. can someone confirm by reading of the thread and suggest other failure cases? My preference would be to write tests for issues we can identify, close this bug and track fixing the tests in their own bugs. 10 years of comments is hard to reason about :). Ideally someone(s) running FreeBSD on KVM would help me populate a wiki page with exemplar use cases, that would allow me to find someone to help write tests and put together a test environment.
I run a FreeBSD 14-STABLE router with vtnet under KVM on Arch Linux. I don't disable any checksums or do any other special configuration. I have NOT encountered this issue. The router uses IPFW and does NAT for several subnets (each of which is a different VLAN+bridge on the host and a distinct vtnet interface on the FreeBSD guest). That said if someone has specific failure cases or ways to reproduce I can help test.
(I do have other FreeBSD guests on the same KVM host which rely on the router VM for Internet access.)
This is simply because FreeBSD does not know how to forward and NAT packets with offload. KVM forwards packets to a virtual machine that can be up to 64 kilobytes in size and without checksums. This is optimization!!! Just read the virtio specification: struct virtio_net_hdr { #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 #define VIRTIO_NET_HDR_F_DATA_VALID 2 #define VIRTIO_NET_HDR_F_RSC_INFO 4 u8 flags; #define VIRTIO_NET_HDR_GSO_NONE 0 #define VIRTIO_NET_HDR_GSO_TCPV4 1 #define VIRTIO_NET_HDR_GSO_UDP 3 #define VIRTIO_NET_HDR_GSO_TCPV6 4 #define VIRTIO_NET_HDR_GSO_UDP_L4 5 #define VIRTIO_NET_HDR_GSO_ECN 0x80 u8 gso_type; le16 hdr_len; le16 gso_size; le16 csum_start; le16 csum_offset; le16 num_buffers; le32 hash_value; (Only if VIRTIO_NET_F_HASH_REPORT negotiated) le16 hash_report; (Only if VIRTIO_NET_F_HASH_REPORT negotiated) le16 padding_reserved; (Only if VIRTIO_NET_F_HASH_REPORT negotiated) }; https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html#x1-2170001
(In reply to Aleksandr Fedorov from comment #37) Could the following linked comment be related to this issue? It seems to be saying about the same thing. https://github.com/freebsd/freebsd-src/blob/9efd215411bb5ead2bc0ab208b4c19e46da0d2c9/sys/dev/virtio/network/if_vtnet.c#L1761-L1777
(In reply to John Nielsen from comment #36) I was mistaken, my KVM-hosted router does suffer from this issue. So even more happy to test patches than previously stated. What needs to happen in terms of fixing (or ignoring) the bad checksums for the NAT case and where? In the firewall/NAT code? vtnet driver? Somewhere else?
Some extra info from demido via irc https://termbin.com/et91 is my wireguard setup that works (but has tiny throughput down to wg client) including iperf tests from wg client to wg server over tunnel, wg client to wg server over inet, and wg server to wg client over tunnel. https://termbin.com/07dl is networking info on wg client. FIXED: i isolated the 'solution' to being adding 'hw.vtnet.csum_disable="1"' to /boot/loader.conf. nothing else needed, and download speed of freebsd (and debian) install isos from wg client became nearly as fast as wg server. this seems related but separate from similar suggestions of disabling tso and lro as i /only/ needed to disable csum. keywords: nat, checksum, vtnet. related bugs: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235607, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263229, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=165059, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259249, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=170081 other links: https://lists.freebsd.org/pipermail/freebsd-questions/2021-January/292565.html, https://forums.freebsd.org/threads/wireguard-vpn-slow-speed.73490/page-2#post-584231, https://sourceopen.com/index.php/howto-fix-slow-networking-with-a-wireguard-server-in-a-freebsd-jail-on-a-vps-and-slow-downloads-in-a-jail-on-a-vps/, https://forums.freebsd.org/threads/nat-low-speed-outside-of-local-subnet.49498/, https://serverfault.com/questions/817664/slow-network-fixed-adding-hw-vtnet-csum-disable-1-what-are-the-posible-side-effe, https://imil.net/blog/posts/2019/freebsd-networking-issues-disable-offloading-and-checksum/, https://www.mail-archive.com/freebsd-jail@freebsd.org/msg03651.html, more https://search.brave.com/search?q=freebsd+nat+vtnet+disable+checksum
Is anyone going to just crack on with it? 10 years of people repeatedly saying they having to disable a very basic feature checksum offloading, following by devs asking for one more confirmation before they want to look at it. Ironically I dont know if I have the issue as I have always routinely disabled checksum offloading on vtnet since day 1 following advice from pfSense developers, luckily performance is ok. But it is only today I think I have discovered the reason for this advice.
^Triage: as bugmeister, I'm sorry that this one has fallen through the cracks. Let me try to reassign it to the net@ group to see if the subscribers there can comment. NB for net@: the believed workaround is to disable hw checksum offloading. There are multiple submitters who have reported this. Comment 16 from bryanv@ may be a good place to start.
Timo Völker (who is working with me) is looking at supporting checksum offloading / TS) for bhyve VMs. I guess this problem is at least in this area. So we can look at it. Don't know how simple it is to fix before we understand to code...
(In reply to Mark Linimon from comment #42) In terms of iperf3, i.e. throughput, it's not really a workaround. Setting hw.vtnet.tso_disable="1" hw.vtnet.lro_disable="1" hw.vtnet.csum_disable="1" in the freebsd guest increases throughput by 5-20% but it's never linespeed for *any* version of freebsd guest. It *is* near linespeed for linux guests. The context here is freebsd host.
As Michael wrote, my focus is more on bhyve. However, I have a setup with KVM and qemu to compare behavior. This is my current setup: FreeBSD VM1 FreeBSD VM2 (router) vtnet0 vtnet0 vtnet1 1.1.1.1/24 1.1.1.2/24 2.2.2.2/24 * * * \ / | \ / | \ / | Linux * * * Host bridge0 bridge1 2.2.2.3/24 Ping from VM1 (1.1.1.1) to host's bridge1 (2.2.2.3) works, TCP does not. This is my understanding of what happens, when VM1 sends a TCP segment to Host's bridge1. 1. VM1 TCP/IP Stack: Outgoing interface vtnet0 has txcsum -> do not calculate correct TCP checksum, set flag CSUM_IP_TCP and send with incorrect checksum value. 2. VM1 vtnet0: Outgoing packet still needs a correct checksum (CSUM_IP_TCP set) -> set virtio-net header flag VIRTIO_NET_HDR_F_NEEDS_CSUM. 3. VM2 vtnet0: Incoming packet has VIRTIO_NET_HDR_F_NEEDS_CSUM set -> packet is likely from another VM on the same host -> trust the packet and set flag CSUM_DATA_VALID (basically lie that the checksum has been validated). 4. VM2 TCP/IP Stack: Forward packet out over vtnet1. This is on IP layer, no need to touch the TCP checksum. 5. VM2 vtnet1: Outgoing packet seems to have a correct checksum. No need to set virtio-net header flag VIRTIO_NET_HDR_F_NEEDS_CSUM. 6. Host bridge1: Incoming packet without virtio-net header flag VIRTIO_NET_HDR_F_NEEDS_CSUM set -> pass packet without setting CSUM flags. 7. Host TCP/IP: Incoming TCP segment with incorrect checksum. Drop segment. The problem is the lie at point 3. That's works if the packet is for VM2, but breaks in this case where VM2 only forwards the IP packet. Right now, I don't have a good idea for a fix, but I'm working on it. By the way, the behavior at point 3 is configurable. With `hw.vtnet.fixup_needs_csum=1` set in /boot/loader.conf (and after a restart), VM2 vtnet0 calculates the checksum and write the correct checksum into the TCP header. With that, TCP from VM1 to host's bridge1 works, but this is not better than disabling txcsum on VM1 vtnet0 because the checksum calculation is still done in software, only on another VM.
Code changes that should fix this bug are in review. https://reviews.freebsd.org/D51686
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=1c23d8f9f39870951c1d0dfbb112fc4e53237737 commit 1c23d8f9f39870951c1d0dfbb112fc4e53237737 Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2025-09-04 11:16:46 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2025-09-04 11:16:46 +0000 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. PR: 165059 Reviewed by: tuexen, manpages MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D51686 share/man/man4/vtnet.4 | 28 +++-- sys/dev/virtio/network/if_vtnet.c | 220 ++++++++++++++++++----------------- sys/dev/virtio/network/if_vtnetvar.h | 2 +- 3 files changed, 132 insertions(+), 118 deletions(-)
Please retest and report.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3008f30d2c2cabdd7e17f7fb922139da8681ffbd commit 3008f30d2c2cabdd7e17f7fb922139da8681ffbd Author: Timo Völker <timo.voelker@fh-muenster.de> AuthorDate: 2025-09-08 20:38:49 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2025-09-08 20:38:49 +0000 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. PR: 165059 Reviewed by: tuexen, manpages MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D51686 share/man/man4/vtnet.4 | 28 +++-- sys/dev/virtio/network/if_vtnet.c | 220 ++++++++++++++++++----------------- sys/dev/virtio/network/if_vtnetvar.h | 2 +- 3 files changed, 132 insertions(+), 118 deletions(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=5a8f33f52ae38bbf12f8f45b8e0f75166805c386 commit 5a8f33f52ae38bbf12f8f45b8e0f75166805c386 Author: Timo Völker <timo.voelker@fh-muenster.de> AuthorDate: 2025-09-08 20:38:49 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2025-09-11 06:17:12 +0000 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. PR: 165059 Reviewed by: tuexen, manpages Differential Revision: https://reviews.freebsd.org/D51686 (cherry picked from commit 3008f30d2c2cabdd7e17f7fb922139da8681ffbd) share/man/man4/vtnet.4 | 28 +++-- sys/dev/virtio/network/if_vtnet.c | 220 ++++++++++++++++++----------------- sys/dev/virtio/network/if_vtnetvar.h | 2 +- 3 files changed, 132 insertions(+), 118 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=07625c420dc30cc484018c269bb7a212436ded8a commit 07625c420dc30cc484018c269bb7a212436ded8a Author: Timo Völker <timo.voelker@fh-muenster.de> AuthorDate: 2025-09-08 20:38:49 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2025-09-11 06:35:43 +0000 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. PR: 165059 Reviewed by: tuexen, manpages Differential Revision: https://reviews.freebsd.org/D51686 (cherry picked from commit 3008f30d2c2cabdd7e17f7fb922139da8681ffbd) share/man/man4/vtnet.4 | 28 +++-- sys/dev/virtio/network/if_vtnet.c | 220 ++++++++++++++++++----------------- sys/dev/virtio/network/if_vtnetvar.h | 2 +- 3 files changed, 132 insertions(+), 118 deletions(-)