Skip to contentSkip to conversation

received pkts with bad ip-checksum when send ip-checksum=0 pkts

dpdk-dev [email protected] 1 participant 1 message Aug 2, 2021

lore
Share & tools
lore

[email protected]

author Acked-by Ori Kam Acked-by Ajit Khaparde Acked-by Xiaoyun Li Acked-by Olivier Matz
#0 lore raw

https://bugs.dpdk.org/show_bug.cgi?id=768

Bug ID: 768
Summary: [dpdk-21.08] received pkts with bad ip-checksum when
send ip-checksum=0 pkts
Product: DPDK
Version: 21.08
Hardware: x86
OS: Linux
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: testpmd
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---

Bad commit id: b2a9e4a855d0e5b4e3fdba5b126bcf00aa8f0ada commit b2a9e4a855d0e5b4e3fdba5b126bcf00aa8f0ada (HEAD, refs/bisect/good-b2a9e4a855d0e5b4e3fdba5b126bcf00aa8f0ada)

Author: Gregory Etelson <[email protected]>
Date:   Thu Jul 29 20:01:41 2021 +0300

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")

ENV:
21.08-rc3: 90a05c5012049c0973d98d25953ebc600b67105b os:4.18.0-240.el8.x86_64/Red-Hat8.3
Hardware platform: Intel(R) Xeon(R) Gold 6139 CPU @ 2.30GHz
gcc: gcc version 8.4.1 20200928 (Red Hat 8.4.1-1) (GCC) NIC hardware: cvl,fvl

Reproduced Step:
1.
usertools/dpdk-devbind.py --force --bind=vfio-pci 0000:18:00.0 0000:18:00.1

2.
x86_64-native-linuxapp-gcc/app/dpdk-testpmd -l 1,2 -n 4 -a 0000:18:00.0 -a
0000:18:00.1 --file-prefix=dpdk_617_20210803002002 -- -i --portmask=0x1
--enable-rx-cksum --port-topology=loop

set verbose 1
set fwd csum
start

3.
tcpdump -i ens7 'ether src 40:a6:b7:0b:76:28 and ether[12:2] != 0x88cc' -Q in -w /tmp/tester/sniff_ens7.pcap

p = Ether(dst="40:a6:b7:0b:76:28", src="52:00:00:00:00:00")/IP(src="10.0.0.1",chksum=0x0)/UDP(chksum=0xf)/("X"*46) sendp(p,iface='ens7')

check /tmp/tester/sniff_ens7.pcap ip checksum:
p = rdpcap("/tmp/tester/sniff_ens7.pcap")

Quoted 1 line
Quoted 1 line
Quoted 1 line

p[0].show2()

WARNING: wrong value: DNS.qdcount=22616
WARNING: wrong value: DNS.ancount=22616
WARNING: more wrong value: DNS.nscount=22616
###[ Ethernet ]###
dst= 02:00:00:00:00:00
src= 40:a6:b7:0b:76:28
type= IPv4
###[ IP ]###

     version= 4
     ihl= 5
     tos= 0x0
     len= 74
     id= 1
     flags=
     frag= 0
     ttl= 64
     proto= udp
     chksum= 0x0
     src= 10.0.0.1
     dst= 127.0.0.1
     \options\
###[ UDP ]###
        sport= domain
        dport= domain
        len= 54
        chksum= 0x8626

expect output:

Quoted 1 line
Quoted 1 line
Quoted 1 line

p[0].show2()

###[ Ethernet ]###
dst= 02:00:00:00:00:00
src= 40:a6:b7:0b:76:28
type= IPv4
###[ IP ]###

     version= 4
     ihl= 5
     tos= 0x0
     len= 74
     id= 1
     flags=
     frag= 0
     ttl= 64
     proto= udp
     chksum= 0xf1a0
     src= 10.0.0.1
     dst= 127.0.0.1
     \options\
###[ UDP ]###
        sport= domain
        dport= domain
        len= 54
        chksum= 0x8626
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.