vhost: fix TCP checksum
authorJianfeng Tan <jianfeng.tan@intel.com>
Wed, 7 Jun 2017 06:41:36 +0000 (06:41 +0000)
committerYuanhan Liu <yliu@fridaylinux.org>
Sat, 1 Jul 2017 23:28:22 +0000 (01:28 +0200)
commit46b7a8372d42506c6ed5e2a3940e7881090c3c90
tree03387e803b0566c26b3e4a1d30b4c4f8d74f2d1e
parent3cb502b31066d13fa4d22f7f1eec5a8459ef1e8f
vhost: fix TCP checksum

As PKT_TX_TCP_SEG flag in mbuf->ol_flags implies PKT_TX_TCP_CKSUM,
applications, e.g., testpmd, don't set PKT_TX_TCP_CKSUM when TSO
is set.

This leads to that packets get dropped in VM tcp stack layer because
of bad TCP csum.

To fix this, we make sure TCP NEEDS_CSUM info is set into virtio net
header when PKT_TX_TCP_SEG is set, so that VM tcp stack will not
check the TCP csum.

Fixes: 859b480d5afd ("vhost: add guest offload setting")
Cc: stable@dpdk.org
Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
lib/librte_vhost/virtio_net.c