net: fix IPv6 checksum with TSO
authorYuying Zhang <yuying.zhang@intel.com>
Tue, 28 Jul 2020 17:09:50 +0000 (17:09 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 29 Jul 2020 22:41:24 +0000 (00:41 +0200)
The ol_flags check lacks of flag for IPv6 which causes checksum
flag configuration error while IPv6/TCP TSO packet is sent.
This patch fixes the issue by adding PKT_TX_TCP_SEG flag.

The rte_net_intel_cksum_flags_prepare() function prepares the
pseudo header checksum in packet data when doing checksum or TSO
offload.

Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well")

Signed-off-by: Yuying Zhang <yuying.zhang@intel.com>
Tested-by: Xi Zhang <xix.zhang@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
lib/librte_net/rte_net.h

index 1edc283..94b06d9 100644 (file)
@@ -125,7 +125,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
         * Mainly it is required to avoid fragmented headers check if
         * no offloads are requested.
         */
-       if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK)))
+       if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | PKT_TX_TCP_SEG)))
                return 0;
 
        if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6))