[dpdk-users] How to make virtual NIC (virtio and vmxnet3) support IP header checksum?

Stephen Hemminger stephen at networkplumber.org
Tue Feb 26 16:48:15 CET 2019


On Tue, 26 Feb 2019 16:29:00 +0800
宋捷 <songj at zctt.com> wrote:

> Hi All
> 
>     I test the DPDK virtual nics both in Esxi and KVM, I used DPDK  vmxnet3,
> virtio and e1000 nic. I need create IP packets and TX them.
> 
>  
> 
> I set the rte_mbuf as below before TX.
> 
> mb->l2_len = len(out_eth)
> 
> mb->l3_len = len(out_ip)
> 
> mb->ol_flags |= PKT_TX_IPV4 | PKT_TX_IP_CSUM
> 
>  
> 
> It worked well with DPDK virtual e1000 nic, the IP header checksum will be
> set correct value. but vmxnet3 and virtio just keep 0 for IP header
> checksum. 
> 
> I disable above code and call rte_ipv4_cksum for each IP header checksum. it
> worked with vmxnet3 and virtio when TX slowly, but checksum invalid once TX
> quicklyL
> 
>  
> 
> Why the DPDK vmxnet3 and virtio drivers don't support IP checksum?
> 
> If there’s an easy way for adding the IP header checksum with vmxnet3 and
> virtio ?
> 
>  
> 
>  
> 
> Thanks
> 
>  
> 
> Jie
> 

You need to look at the TX_OFFLOAD capability flags in dev_info.
Many drivers do not support IP checksum offload.


More information about the users mailing list