Hi, On 05/31/2016 12:08 PM, Adrien Mazarguil wrote: > On Tue, May 31, 2016 at 10:43:29AM +0800, Tan, Jianfeng wrote: >> Why not take care of PKT_RX_IP_CKSUM_BAD? Is it too easy for sw to handle? > > I thought PKT_RX_IP_CKSUM_BAD was to be modified in a similar fashion, but > since you raise the issue, mlx4/mlx5 need this as well. These boards only > report "good" checksums for L3 and L4.
Yep, maybe it was not so clear in my initial mail, but I think the L4 example should apply to IP as well. >> For virtio, there's only one bit, VIRTIO_NET_HDR_F_DATA_VALID, to indicate >> that checksum is valid. Shall we differentiate L3 checksum and L4 checksum >> in rte_mbuf.ol_flags? >From what I understand from the specification, when the driver (virtio-net) receives a packet with the VIRTIO_NET_HDR_F_NEEDS_CSUM flag, it can be assumed that all checksums before hdr->csum_start are valid. Here we would set PKT_RX_IP_CKSUM_GOOD and PKT_RX_L4_CKSUM_NONE. In case of VIRTIO_NET_HDR_F_DATA_VALID, I understand that both L3 and L4 of the outer header is valid. Here we would set PKT_RX_IP_CKSUM_GOOD and PKT_RX_L4_CKSUM_GOOD. Regards, Olivier