app/testpmd: fix Tx checksum calculation for tunnel
authorGregory Etelson <getelson@nvidia.com>
Thu, 29 Jul 2021 17:01:41 +0000 (20:01 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 30 Jul 2021 12:01:35 +0000 (14:01 +0200)
commitb2a9e4a855d0e5b4e3fdba5b126bcf00aa8f0ada
treefe720d8259262bb443b63007f105d6dcda966c62
parentb3bc560bd6bdf3c9851d25bc0a66cb24aa1fd48c
app/testpmd: fix Tx checksum calculation for tunnel

csumonly engine calculates Tx checksum of a tunnelled packet
for outer headers only or separately for outer and inner headers.
The calculation method is determined by checksum configuration options.
If Tx checksum calculation is separated,
the inner headers are processed before outer headers.

Inner headers processing sets checksum values to 0 unconditionally.
If Tx configuration offloads inner checksums only, outer checksum
calculation in software will read 0 instead of real values
and produce wrong result.

The patch zeroes inner checksums only before software calculation.

Fixes: 6b520d54ebfe ("app/testpmd: use Tx preparation in checksum engine")
Cc: stable@dpdk.org
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
app/test-pmd/csumonly.c