]> www.infradead.org Git - users/dwmw2/linux.git/commit
virtio_net: checksum offloading handling fix
authorHeng Qi <hengqi@linux.alibaba.com>
Mon, 17 Jun 2024 13:15:23 +0000 (21:15 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Jun 2024 09:52:44 +0000 (10:52 +0100)
commit604141c036e1b636e2a71cf6e1aa09d1e45f40c2
treebf5c880919fa8ef35c7f6d0616a2e6625071e8c0
parent7be4cb7189f747b4e5b6977d0e4387bde3204e62
virtio_net: checksum offloading handling fix

In virtio spec 0.95, VIRTIO_NET_F_GUEST_CSUM was designed to handle
partially checksummed packets, and the validation of fully checksummed
packets by the device is independent of VIRTIO_NET_F_GUEST_CSUM
negotiation. However, the specification erroneously stated:

  "If VIRTIO_NET_F_GUEST_CSUM is not negotiated, the device MUST set flags
   to zero and SHOULD supply a fully checksummed packet to the driver."

This statement is inaccurate because even without VIRTIO_NET_F_GUEST_CSUM
negotiation, the device can still set the VIRTIO_NET_HDR_F_DATA_VALID flag.
Essentially, the device can facilitate the validation of these packets'
checksums - a process known as RX checksum offloading - removing the need
for the driver to do so.

This scenario is currently not implemented in the driver and requires
correction. The necessary specification correction[1] has been made and
approved in the virtio TC vote.
[1] https://lists.oasis-open.org/archives/virtio-comment/202401/msg00011.html

Fixes: 4f49129be6fa ("virtio-net: Set RXCSUM feature if GUEST_CSUM is available")
Signed-off-by: Heng Qi <hengqi@linux.alibaba.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c