app/testpmd: fix TSO with checksum engine
authorOlivier Matz <olivier.matz@6wind.com>
Thu, 13 Oct 2016 13:40:30 +0000 (15:40 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 13 Oct 2016 13:59:38 +0000 (15:59 +0200)
commite834daaf911d79154fbd89bea003a2f4eda17dab
tree65aa563d3e4e4ef8b7b1c9c2692af854c164a329
parent58c82067f1aeeb59301bf22dda1350853ff969da
app/testpmd: fix TSO with checksum engine

The commit that disabled TSO for small packets was broken during the
rebase. The problem is the IP checksum is not calculated in software if:
- TX IP checksum is disabled
- TSO is enabled
- the current packet is smaller than tso segment size

When checking if the PKT_TX_IP_CKSUM flag should be set (in case
of tso), use the local tso_segsz variable, which is set to 0 when the
packet is too small to require tso. Therefore the IP checksum will be
correctly calculated in software.

Moreover, we should not use tunnel segment size for non-tunnel tso, else
TSO will stay disabled for all packets.

Fixes: 97c21329d42b ("app/testpmd: do not use TSO for small packets")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
app/test-pmd/csumonly.c