net/vmxnet3: Fix RX TCP/UDP checksum on partially summed packets
commit80da311d81c389860bc387fbe6677c71f7a3c596
authorDana Rubin <dana.rubin@ravellosystems.com>
Tue, 14 Jul 2015 08:55:16 +0000 (14 11:55 +0300)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 20 Jul 2015 16:39:05 +0000 (20 17:39 +0100)
tree05f1766811520c7c11d8a781ecebafd3f201e8fa
parentfcf0cdc362dd96cb8d2935b892d3dd9ab73ad393
net/vmxnet3: Fix RX TCP/UDP checksum on partially summed packets

Convert partially summed packets to be fully checksummed.

In case csum offloaded packet, vmxnet3 implementation always passes an
RxCompDesc with the "Checksum calculated and found correct" notification
to the OS. This emulates the observed ESXi behavior.

Therefore, if packet has the NEEDS_CSUM bit set, we must calculate and
place a fully computed checksum into the tcp/udp header. Otherwise, the
OS driver will receive a checksum-correct indication but with the actual
tcp/udp checksum field having just the pseudo header csum value.

If host OS performs forwarding, it will forward an incorrectly
checksummed packet.

Signed-off-by: Dana Rubin <dana.rubin@ravellosystems.com>
Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
Message-id: 1436864116-19154-3-git-send-email-shmulik.ladkani@ravellosystems.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/net/vmxnet3.c