DPDK rte_mbuf enable NIC Offload Compute checksum configuration method

Source: Internet
Author: User
DPDK rte_mbuf enable NIC Offload Compute checksum configuration method Compute IP Checksum
Mb->l2_len = Len (out_eth)
Mb->l3_len = Len (out_ip)
mb->ol_flags |= Pkt_tx_ipv4 | Pkt_tx_ip_csum

Note:
Out_ip.checksum = 0
The NIC supports the Dev_tx_offload_ipv4_cksum feature. Compute IP & UDP checksum

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

Note:
Out_ip.checksum = 0
Out_udp.checksum = Rte_ipv4_phdr_cksum ()
The NIC supports Dev_tx_offload_ipv4_cksum and dev_tx_offload_udp_cksum features. computes an inner-layer encapsulated IP checksum.

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

Note:
In_ip.checksum = 0
The NIC supports Dev_tx_offload_ipv4_cksum ' features.
Note that the it can only work if outer L4 checksum is 0. compute the inner package IP & TCP Checksum

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

Note:
In_ip.checksum = 0
In_tcp.checksum = Rte_ipv4_phdr_cksum ()
The NIC supports Dev_tx_offload_ipv4_cksum and dev_tx_offload_tcp_cksum features.
Note that the it can only work if outer L4 checksum is 0. computes an inner-layer encapsulated IP checksum and enables TSO.

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;

Note:
In_ip.checksum = 0
In_tcp.checksum = Rte_ipv4_phdr_cksum ()
The NIC supports the Dev_tx_offload_tcp_tso feature.
Note that the it can only work if outer L4 checksum is 0. compute the inner IP & memory encapsulated IP & TCP checksum.


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;

Note:
Out_ip.checksum = 0
In_ip.checksum = 0
In_tcp.checksum = Rte_ipv4_phdr_cksum ()

The NIC supports Dev_tx_offload_ipv4_cksum, Dev_tx_offload_udp_cksum, and dev_tx_offload_outer_ipv4_cksum features. All of the above parameters can be referenced in TESTPMD csumonly.c.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.