vhost: fix IP checksum
authorJianfeng Tan <jianfeng.tan@intel.com>
Wed, 7 Jun 2017 06:41:37 +0000 (06:41 +0000)
committerYuanhan Liu <yliu@fridaylinux.org>
Sat, 1 Jul 2017 23:28:34 +0000 (01:28 +0200)
commitb08b8cfeb2aea2a703d201ad8c4b258e8a0bde12
tree67f86745f03c5e9135519b35dc0f2912395fef54
parent46b7a8372d42506c6ed5e2a3940e7881090c3c90
vhost: fix IP checksum

There is no way to bypass IP checksum verification in Linux
kernel, no matter skb->ip_summed is assigned as CHECKSUM_UNNECESSARY
or CHECKSUM_PARTIAL.

So any packets with bad IP checksum will be dropped at VM IP layer.

To correct, we check this flag PKT_TX_IP_CKSUM to calculate IP 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