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.