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 30091A04FD; Thu, 10 Nov 2022 11:34:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 165A040150; Thu, 10 Nov 2022 11:34:27 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id CD777400EF for ; Thu, 10 Nov 2022 11:34:25 +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 5505E7B; Thu, 10 Nov 2022 13:34:25 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 5505E7B DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1668076465; bh=uakXx1dv6FxZkt6ipQQ5AS4erO4Dd9AZ0wVyeG+CnU8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ySJywTI2B9ERcpDKpkpCFyoLQ2UAh0o0kwjmde0Oj2y6t7YQ2l9teaap1EmDQEie4 qPmdCEul052A3PoTO+Bs+D93JdcNuI5nT+lxKmTVNAEkR/uJcYXfr4c83u1Nx9j4l5 UruUGaRoiraQs8ADo9B4iWomjEk9RrJw3Y35Pj0Q= Message-ID: Date: Thu, 10 Nov 2022 13:34:24 +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 , Konstantin Ananyev , Stephen Hemminger , Jerin Jacob Kollanukkaran , Ferruh Yigit , Thomas Monjalon , David Marchand References: <8bea1ef1-1977-f24f-f549-0c2126c23e3c@oktetlabs.ru> <98CBD80474FA8B44BF855DF32C47DC35D874AA@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35D874AC@smartserver.smartshare.dk> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D874AC@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 13:29, Morten Brørup wrote: >> From: Andrew Rybchenko [mailto:andrew.rybchenko@oktetlabs.ru] >> Sent: Thursday, 10 November 2022 11.09 >> >> 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 > > That was my initial interpretation too, and it stuck with me for a while. > > But then I tried hard to read it differently, tweaking it to support the conclusion I was looking for. > >> >>> 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? > > Too busy right now, but I'll put it on my todo list. :-) > >> >> Bonus question is UDP checksum 0 case. GOOD as well? >> (just want to clarify the documentation while we're on it). > > No. The UDP checksum is not optional in IPv6. > > RFC 2460 section 8.1 bullet 4 says: "Unlike IPv4, when UDP packets are originated by an IPv6 node, the UDP checksum is not optional. [...] IPv6 receivers must discard UDP packets containing a zero checksum, and should log the error." > Yes I know, but I'm asking about IPv4 case with UDP checksum 0.