Just following up on two points since I had some time to investigate
further this morning.
1. It is the host that offers TSO without CSUM. vio_attach() always
requests VIRTIO_NET_F_CSUM, so OpenBSD isn't dropping it; the host
just doesn't offer it on some boots. Under a Linux rescue system on
the same VM it did offer CSUM.
2. I checked why only OpenBSD seemed to be affected. My NetBSD VMs
with the same provider are fine because vioif(4) doesn't request
checksum offload or TSO at all.
Linux guards against this broken setup twice. drivers/net/virtio_net.c
only enables TSO inside the CSUM check, like the patch I sent:
if (virtio_has_feature(vdev, VIRTIO_NET_F_CSUM)) {
dev->hw_features |= NETIF_F_HW_CSUM | NETIF_F_SG;
...
if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_TSO4))
dev->hw_features |= NETIF_F_TSO;
if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_TSO6))
dev->hw_features |= NETIF_F_TSO6;
and net/core/dev.c also drops TSO on any interface without checksum
offload, whatever the driver says:
if ((features & NETIF_F_TSO) && !(features & NETIF_F_HW_CSUM) &&
!(features & NETIF_F_IP_CSUM)) {
netdev_dbg(dev, "Dropping TSO features since no CSUM
feature.\n");
features &= ~NETIF_F_TSO;
features &= ~NETIF_F_TSO_ECN;
}
Would a belt and braces approach like that be worth having in
OpenBSD too?
KR
Ali