From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: about rx checksum flags Date: Tue, 31 May 2016 21:11:43 +0200 Message-ID: <574DE1EF.8020504@6wind.com> References: <574C5B9D.4080006@6wind.com> <20160531100851.GK1428@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit To: "Tan, Jianfeng" , "dev@dpdk.org" , "Ananyev, Konstantin" , Yuanhan Liu , "Richardson, Bruce" Return-path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id B06E32E8E for ; Tue, 31 May 2016 21:11:46 +0200 (CEST) Received: by mail-wm0-f53.google.com with SMTP id z87so507220wmh.0 for ; Tue, 31 May 2016 12:11:46 -0700 (PDT) In-Reply-To: <20160531100851.GK1428@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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