> From: Morten Brørup > Sent: Tuesday, 15 September 2026 11.57 > > Hi Maxime, > > A Grout issue [1] regarding RX checksum offload with virtio and vhost > triggered my curiosity... > > AFAIU, in Linux, the VIRTIO_NET_F_GUEST_CSUM flag on a virtio network > device tells the host that it doesn't need to set the correct checksums > in packets it writes to the device, because the guest will do it (when > reading them). > > Now; if a guest application requests RTE_ETH_RX_OFFLOAD_CHECKSUM > offload, the virtio PMD initializes the Linux device with > VIRTIO_NET_F_GUEST_CSUM [2]. > This behavior seems counterintuitive to me... > I would assume that if an application cares about packet checksums on > ingress, it will set RTE_ETH_RX_OFFLOAD_CHECKSUM, so the NIC/PMD checks > them, and the application can discard packets with invalid checksums on > ingress. > But the virtio PMD uses RTE_ETH_RX_OFFLOAD_CHECKSUM to disable > checksums, not enable them? > > Two questions: > 1. What is the use case for a guest application receiving packets > without correct packet checksums from the virtio ports, which motivated > this driver behavior? > 2. What is the performance gain in the Linux host by not setting the > checksums (enabling VIRTIO_NET_F_GUEST_CSUM)? (If the guest application > needs to calculate them instead, the performance cost in the guest > might outweigh the performance gain in the host not doing it when > creating the packet in the Linux kernel.) > > NB: According to the Grout issue, the vhost PMD behaves similarly; but > I haven't checked. > > [1]: https://github.com/DPDK/grout/issues/724 > [2]: > https://github.com/DPDK/dpdk/blob/25.11/drivers/net/virtio/virtio_ethdev.c#L2282-L2284 >
I came across a patch [3], which writes into the packet's checksum field. It seems to be for the virtio PMD running on the host. Is something similar missing for the virtio PMD running in a guest? https://github.com/DPDK/dpdk/commit/8f1750f42e2d2dbf49af59eb058e8412f0e3afa4

