net/tap: fix Rx checksum flags on TCP packets
authorOlivier Matz <olivier.matz@6wind.com>
Wed, 30 Jun 2021 13:51:56 +0000 (15:51 +0200)
committerAndrew Rybchenko <Andrew.Rybchenko@oktetlabs.ru>
Fri, 2 Jul 2021 17:03:03 +0000 (19:03 +0200)
commit375474b4d9a89456bd0d8baa4b610d3157ee262c
tree6cbe03e551e6cbe32f2b8c4c1541416066c74be5
parenta46bd97f60e6be8ac5d8d3a0657a60e66176a405
net/tap: fix Rx checksum flags on TCP packets

Since commit d5df2ae0428a ("net: fix unneeded replacement of TCP
checksum 0"), the functions rte_ipv4_udptcp_cksum() or
rte_ipv6_udptcp_cksum() can return either 0x0000 or 0xffff when used to
verify a packet containing a valid checksum.

This new behavior broke the checksum verification in tap driver for TCP
packets: these packets are marked with PKT_RX_L4_CKSUM_BAD.

Fix this by checking the 2 possible values. A next commit will introduce
a checksum verification helper to simplify this a bit.

Fixes: d5df2ae0428a ("net: fix unneeded replacement of TCP checksum 0")
Cc: stable@dpdk.org
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
drivers/net/tap/rte_eth_tap.c