To allow the use of checksum offloading for packets to and from a VM, this patch changes the following.
- Set the vnet_hdr_len > 0 for tap.
- Report that the tap backend supports receiving packets with partial checksum (VIRTIO_NET_F_CSUM) and that the guest can get packets with partial checksum (VIRTIO_NET_F_GUEST_CSUM).
- Enable transmission checksum offloading (IFCAP_TXCSUM and IFCAP_TXCSUM) on the tap interface if the feature VIRTIO_NET_F_GUEST_CSUM has been negotiated.
Note that if the VM sends a packet with partial checksum and the host sends it out over an interface that does not support checksum offloading, the packet go out with an incorrect checksum. D56564 moves the check of whether an interface supports checksum offloading close to the driver and prevents this issue.