From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 81889A04FD; Thu, 10 Nov 2022 11:08:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7306140A7D; Thu, 10 Nov 2022 11:08:37 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 41A154021D for ; Thu, 10 Nov 2022 11:08:36 +0100 (CET) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 936DA66; Thu, 10 Nov 2022 13:08:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 936DA66 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1668074915; bh=f+16rOgheKLiAY56DnSaMjG1MC9Fr+Xk3VI4cRIUlv8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=xVNfhf4ezrmsAAnBzRTMVm+jA7aF2ToCPlgJfwds460SmzrMAIEVI3e/s1uCI8uqi mhb7Q4JteAPv7Nl5udrHusax2HBmSZGiz6fcDBNQM5Gx77g+ClR/ZGSs8l5mc3eqeI Ps5CjBtJpibWfZ3tBPuTtqS3hMB7QlR2mcEvhftg= Message-ID: Date: Thu, 10 Nov 2022 13:08:35 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: Is it correct to report checksum good when there is no checksum? Content-Language: en-US To: =?UTF-8?Q?Morten_Br=c3=b8rup?= , dev@dpdk.org Cc: Olivier Matz , "Ananyev, Konstantin" , Stephen Hemminger , Jerin Jacob Kollanukkaran , Ferruh Yigit , Thomas Monjalon , David Marchand References: <8bea1ef1-1977-f24f-f549-0c2126c23e3c@oktetlabs.ru> <98CBD80474FA8B44BF855DF32C47DC35D874AA@smartserver.smartshare.dk> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D874AA@smartserver.smartshare.dk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 11/10/22 12:55, Morten Brørup wrote: >> From: Andrew Rybchenko [mailto:andrew.rybchenko@oktetlabs.ru] >> Sent: Thursday, 10 November 2022 10.26 >> >> Hi all, >> >> some drivers report RTE_MBUF_F_RX_IP_CKSUM_GOOD for IPv6 packets. >> For me it looks strange, but I see some technical reasons behind. > > Please note: IPv6 packets by definition have no IP checksum. > >> Documentation in lib/mbuf/rte_mbuf_core.h is a bit vague. >> Should UNKNOWN or NONE be used instead? > > Certainly not NONE. Its description says: "the IP checksum is *not* correct in the packet [...]". But there is no incorrect IP checksum in the packet. > Thanks, I should read the definition of none more careful. > I will argue against UNKNOWN. Its description says: "no information about the RX IP checksum". But we do have information about it! We know that the IP checksum is not there (the value is "NULL"), and that it is not supposed to be there (the value is supposed to be "NULL"). > I thought that "no checksum" => "no information" => UNKNOWN > So I consider GOOD the correct response here. > > GOOD also means that the application can proceed processing the packet normally without further IP header checksum checking, so it's good for performance. > It is very important point and would be nice to have in GOOD case definition (both IP and L4 cases). It is the right motivation why GOOD makes sense for IPv6. > It should be added to the description of RTE_MBUF_F_RX_IP_CKSUM_GOOD that IPv6 packets always return this value, because IPv6 packets have no IP header checksum, and that is what is expected of them. > Could you make a patch? Bonus question is UDP checksum 0 case. GOOD as well? (just want to clarify the documentation while we're on it). Thanks a lot, Andrew.