[dpdk-users] Invalid TCP/UDP checksum for IPV4 packets

Julien Castets castets.j at gmail.com
Wed May 31 10:16:55 CEST 2017


I had a running application on DPDK 2.2.0 which offloads IP/TCP/UDP
checksums to the NIC. A few days ago, I started the migration to 17.02
and started to see invalid TCP/UDP checksum.

I called the new API rte_eth_tx_prepare() but checksums were still invalid.

After digging for a few hours in DPDK source code, I discovered the
flag PKT_TX_IPV4 needs to be set in ol_flags.

Basically, the function rte_net_intel_cksum_flags_prepare of rte_net.h
(http://dpdk.org/doc/api/rte__net_8h_source.html) does the following:

if (offload TCP checksum flag is set) {
  if (PKT_TX_IPV4 in ol_flags) {
     // compute ipv4 checksum
   }
   else {
     // compute ipv6 checksum
   }
}

Because I didn't set PKT_TX_IPV4 in ol_flags, I was going into the
"else" clause and the checksum was computed as if my packet was an
IPV6 packet.

Don't you think it would be preferable to assert instead of
considering a non-explicitely-declared-IPV4-packet as being an IPV6
packet?

-- 
Julien Castets
+33 (0)6.85.20.10.03


More information about the users mailing list