[dpdk-dev] [RFC 00/16] enhance checksum offload API

Olivier MATZ olivier.matz at 6wind.com
Thu Jan 22 00:41:03 CET 2015


Test done on testpmd on x86_64-native-linuxapp-gcc

platform:

  Tester (linux)   <---->   DUT (DPDK)
         ixgbe6             port0 (i40e or ixgbe)

Run testpmd on DUT:

  cd dpdk.org/
  make install T=x86_64-native-linuxapp-gcc
  cd x86_64-native-linuxapp-gcc/
  modprobe uio
  insmod kmod/igb_uio.ko
  python ../tools/dpdk_nic_bind.py -b igb_uio 0000:02:00.0
  echo 0 > /proc/sys/kernel/randomize_va_space
  echo 1000 >
/sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages
  echo 1000 >
/sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages
  mount -t hugetlbfs none /mnt/huge
  ./app/testpmd -c 0x55 -n 4 -m 800 -- -i --port-topology=chained
--enable-rx-cksum

Disable all offload feature on Tester, and start capture:

  ethtool -K ixgbe6 rx off tx off tso off gso off gro off lro off
  ip l set ixgbe6 up
  tcpdump -n -e -i ixgbe6 -s 0 -w /tmp/cap

We use the attached scapy script (dpdk-cksum-test.py) for testing.

In each attached capture file, odd packets are generated by scapy and
even ones are generated by the dpdk (except for TSO where several tx
packet corresponds to one rx packet).

In some conditions, the checksum cannot be calculated, for instance when
inner checksum is done in hw and outer checksum in sw, or if it is not
supported by hardware.

Notes:
- case 6 is not present for ixgbe (inner + outer)
- case 5 is not present for i40e (tso)
- some strange behavior to be analyzed for first packets of tso on ixgbe
- ipip tunnel is not working in case 6 of i40e

----------------------------------------------

case 1) calculate checksum of out_ip  (was case A in [1])

mb->l2_len = len(out_eth)
mb->l3_len = len(out_ip)
mb->ol_flags |= PKT_TX_IPV4 | PKT_TX_IP_CSUM
set out_ip checksum to 0 in the packet

Testpmd commands:

stop
csum parse_tunnel off 0
csum set ip hw 0
csum set tcp sw 0
csum set udp sw 0
csum set sctp sw 0
tso set 0 0
set fwd csum
set verbose 1
start

----------------------------------------------

case 2) calculate checksum of out_ip and out_udp

mb->l2_len = len(out_eth)
mb->l3_len = len(out_ip)
mb->ol_flags |= PKT_TX_IPV4 | PKT_TX_IP_CSUM | PKT_TX_UDP_CKSUM
set out_ip checksum to 0 in the packet
set out_udp checksum to pseudo header using rte_ipv4_phdr_cksum()

Testpmd commands:

stop
csum parse_tunnel off 0
csum set ip hw 0
csum set tcp hw 0
csum set udp hw 0
csum set sctp hw 0
tso set 0 0
set fwd csum
set verbose 1
start

----------------------------------------------

case 3) calculate checksum of in_ip

mb->l2_len = len(out_eth + out_ip + out_udp + vxlan + in_eth)
mb->l3_len = len(in_ip)
mb->ol_flags |= PKT_TX_IPV4 | PKT_TX_IP_CSUM
set in_ip checksum to 0 in the packet

Testpmd commands:

stop
csum parse_tunnel on 0
csum set ip hw 0
csum set tcp sw 0
csum set udp sw 0
csum set sctp sw 0
csum set outer-ip sw 0
tso set 0 0
set fwd csum
set verbose 1
start

----------------------------------------------

case 4) calculate checksum of in_ip and in_tcp  (was case B.2 in [1])

mb->l2_len = len(out_eth + out_ip + out_udp + vxlan + in_eth)
mb->l3_len = len(in_ip)
mb->ol_flags |= PKT_TX_IPV4 | PKT_TX_IP_CSUM | PKT_TX_TCP_CKSUM
set in_ip checksum to 0 in the packet
set in_tcp checksum to pseudo header using rte_ipv4_phdr_cksum()

Testpmd commands:

stop
csum parse_tunnel on 0
csum set ip hw 0
csum set tcp hw 0
csum set udp hw 0
csum set sctp hw 0
csum set outer-ip sw 0
tso set 0 0
set fwd csum
set verbose 1
start

----------------------------------------------

case 5) segment inner TCP

mb->l2_len = len(out_eth + out_ip + out_udp + vxlan + in_eth)
mb->l3_len = len(in_ip)
mb->l4_len = len(in_tcp)
mb->ol_flags |= PKT_TX_IPV4 | PKT_TX_IP_CKSUM | PKT_TX_TCP_CKSUM |
  PKT_TX_TCP_SEG;
set in_ip checksum to 0 in the packet
set in_tcp checksum to pseudo header without including the IP
  payload length using rte_ipv4_phdr_cksum()

Testpmd commands:

stop
csum parse_tunnel on 0
csum set ip hw 0
csum set tcp hw 0
csum set udp hw 0
csum set sctp hw 0
csum set outer-ip sw 0
tso set 500 0
set fwd csum
set verbose 1
start

----------------------------------------------

case 6) calculate checksum of out_ip, in_ip, in_tcp (was case C in [1])

mb->outer_l2_len = len(out_eth)
mb->outer_l3_len = len(out_ip)
mb->l2_len = len(out_udp + vxlan + in_eth)
mb->l3_len = len(in_ip)
mb->ol_flags |= PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IP_CKSUM  | \
  PKT_TX_IP_CKSUM |  PKT_TX_TCP_CKSUM;
set out_ip checksum to 0 in the packet
set in_ip checksum to 0 in the packet
set in_tcp checksum to pseudo header using rte_ipv4_phdr_cksum()

Testpmd commands:

stop
csum parse_tunnel on 0
csum set ip hw 0
csum set tcp hw 0
csum set udp hw 0
csum set sctp hw 0
csum set outer-ip hw 0
tso set 0 0
set fwd csum
set verbose 1
start
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i40e_case1.cap
Type: application/vnd.tcpdump.pcap
Size: 60080 bytes
Desc: not available
URL: <http://dpdk.org/ml/archives/dev/attachments/20150122/5639b261/attachment-0010.cap>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i40e_case2.cap
Type: application/vnd.tcpdump.pcap
Size: 60080 bytes
Desc: not available
URL: <http://dpdk.org/ml/archives/dev/attachments/20150122/5639b261/attachment-0011.cap>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i40e_case3.cap
Type: application/vnd.tcpdump.pcap
Size: 60080 bytes
Desc: not available
URL: <http://dpdk.org/ml/archives/dev/attachments/20150122/5639b261/attachment-0012.cap>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i40e_case4.cap
Type: application/vnd.tcpdump.pcap
Size: 60080 bytes
Desc: not available
URL: <http://dpdk.org/ml/archives/dev/attachments/20150122/5639b261/attachment-0013.cap>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i40e_case6.cap
Type: application/vnd.tcpdump.pcap
Size: 60080 bytes
Desc: not available
URL: <http://dpdk.org/ml/archives/dev/attachments/20150122/5639b261/attachment-0014.cap>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ixgbe_case1.cap
Type: application/vnd.tcpdump.pcap
Size: 60080 bytes
Desc: not available
URL: <http://dpdk.org/ml/archives/dev/attachments/20150122/5639b261/attachment-0015.cap>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ixgbe_case2.cap
Type: application/vnd.tcpdump.pcap
Size: 60080 bytes
Desc: not available
URL: <http://dpdk.org/ml/archives/dev/attachments/20150122/5639b261/attachment-0016.cap>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ixgbe_case3.cap
Type: application/vnd.tcpdump.pcap
Size: 60080 bytes
Desc: not available
URL: <http://dpdk.org/ml/archives/dev/attachments/20150122/5639b261/attachment-0017.cap>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ixgbe_case4.cap
Type: application/vnd.tcpdump.pcap
Size: 60080 bytes
Desc: not available
URL: <http://dpdk.org/ml/archives/dev/attachments/20150122/5639b261/attachment-0018.cap>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ixgbe_case5.cap
Type: application/vnd.tcpdump.pcap
Size: 63856 bytes
Desc: not available
URL: <http://dpdk.org/ml/archives/dev/attachments/20150122/5639b261/attachment-0019.cap>


More information about the dev mailing list