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 CC905A04FD; Thu, 10 Nov 2022 12:11:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70F1240150; Thu, 10 Nov 2022 12:11:56 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 61C8A400EF for ; Thu, 10 Nov 2022 12:11:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668078714; x=1699614714; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=PHwNCLa8oiJ0zsWuRG4MKWqk0U/oTFO7hRbi2/EMb8M=; b=iWY9moNi4KWwq57amYQ9d9gTmYDH6Ex+RYlWHA0M0LlcxquBBl+m9t1N WVEbxKvunPRZS1eS0wxTqwTRJCZ1j2hnB7RFKom3JF2oSKnOCcZhNub2E uffTXSnjrCgVamyG4J302vTpnNXAZ9L4ZzAh+v58WtDgUwQCB9N2vuvty PWWY/pmWAET8zCl/Fyt9COvjqH+trV3aF0SWFY8ONrZc0UCiE3rrVJNnq O1LXZ9CdsLibVVSl6Q3L0aGF1jqByYIEMXB4LWMx/jIKe4UWx4i1Pq4K6 C1auO1lzK3Xj9LMZze/kmApib53xJu1V9VpoA2Gpwidb3BDXLGIhMxmoQ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="397578240" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="397578240" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 03:11:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="668370593" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="668370593" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga008.jf.intel.com with ESMTP; 10 Nov 2022 03:11:52 -0800 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 10 Nov 2022 03:11:51 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Thu, 10 Nov 2022 03:11:51 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.105) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Thu, 10 Nov 2022 03:11:51 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N2CUHxjpG8SIoTYA7S0DiyZ9yYSpLiKBVShVRk21zQcKAFbzFM1w7/r4pQL+jRAwWPzoBG13oiFd0pvsX5YrILcvr5MQoXgl+oLyPRtyPlkhoBcWORPIb2bhmUIFEvhxHKyO00SDgMsSpStk1Tfx83WotW2mZPFxpkJV4sQJwePYKE8U1X3srZRqAIazOTl1QWLyS2gcBk/emzO8nUySnMenXH2uu3kIW5ACrEzYuQmTbjaLiNvbEvMuJjZISKaMsBusksCaI5AqGF/e9g36cNecgbW7XCoacSkVqEmWkj4iqGhHSzlTfWpjqBuSFD6EhkHm9I9hLw43R2eKzDKk3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WpWwMeeaUNik5CV8qQXl6Hd8KbGanyYP2tcyZs0q/5A=; b=d2QO2DUvkCbfDtjozLl+/GLIqg/XRCo4m9kAsZI9JnHVfCkgjh+bS6nJQfwVMobTiRshsf7hVhMAHX2Ao7X6FpGMuL56tzRSYhONys4EiubwxE/fBOAYi3y8jPMLJd7OuRKSIBNYb2D6IiSgMGDXcMglc023KJMBIWnlV9YBZapM2dW9useYK4cdcZ0B+TnayaQsjic38YFGfGi49y2wJJ09UxbnxmpCTgeJb/KYnoRrEuEqHVeULkUtA3yIB//UoYvyvnzXiH5RxklNmLbBVL6iDx0rhTcXmLEq7RDgUP8fFM8vev2J2ByVCw/o+p+jk9V4AtQBvFMFdJRbLELD0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) by CH0PR11MB5521.namprd11.prod.outlook.com (2603:10b6:610:d4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.27; Thu, 10 Nov 2022 11:11:49 +0000 Received: from MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::d136:9b16:f5d7:30e3]) by MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::d136:9b16:f5d7:30e3%3]) with mapi id 15.20.5813.013; Thu, 10 Nov 2022 11:11:49 +0000 Date: Thu, 10 Nov 2022 11:11:42 +0000 From: Bruce Richardson To: Morten =?iso-8859-1?Q?Br=F8rup?= CC: Andrew Rybchenko , , "Olivier Matz" , Konstantin Ananyev , Stephen Hemminger , Jerin Jacob Kollanukkaran , Ferruh Yigit , Thomas Monjalon , David Marchand Subject: Re: Is it correct to report checksum good when there is no checksum? Message-ID: References: <8bea1ef1-1977-f24f-f549-0c2126c23e3c@oktetlabs.ru> <98CBD80474FA8B44BF855DF32C47DC35D874AA@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35D874AC@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35D874AD@smartserver.smartshare.dk> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D874AD@smartserver.smartshare.dk> X-ClientProxiedBy: LO4P123CA0426.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18b::17) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR11MB1629:EE_|CH0PR11MB5521:EE_ X-MS-Office365-Filtering-Correlation-Id: 8156cf8f-e7e2-4e17-6bbd-08dac30c5c99 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KG21ZPtr19e5vPoeV1eQOknQI97iskziRpoNG4jFrYtXqxlA7EUYhnjwAXy73RJQdIzylk6H0DA1DGew3lLBIkQtJncnX29kHFzgHFctdNuJ96cjR7Hzl300Dx/6e0DcLl7c+ZqwQML5qwP+rZQW6xTG0ELUFZbDWv7TFTnh4cBFpDDssouytYAJIel1h4qMC+ZvZOvO3BkdRehGmFqX+5427XdR9QrT/hRz/3qN1XCebqZVDijMCehfNTxo17/d3R70wcHTgM+1/NKA382GRM5yt4SbviZSrH6xjQZBjHt/lL3JzfW9ISLaHBUI6vB0rG6WRyXsid1l1vtQyjAaoTlvHZ9z+hMcj5XWv2LRp9LY9C+N5yo7WFU7k3yWS/5D9OQrIUpflCoQnZWgJb49SQLrSyM1SUXK0YBuCtC9sqg3aH5o0SePgplj0IDhUcNC+6s7Rb6GHMo+qB5pPnl4zL/0jrekGQEOYhcz6LZPruPl7NRzkoxdWWXT+Xg6jUJ/iyw0kjeMc4/bD5GYUhRqlOBefZNr+g3oAAzAX59m2F5e15Zz2t2Dy2c4Q7RUPSml1pLS78aF3sHBY9bStKCDMGt9RkHrkdTSe+lpVvlJQhoLx2XwR7I0xmDDahGnCQzcFUgx4Kt/GFBzOLDmP3gfNi1yggXFV+WnNjTCEpSpYwkP+VyLeURGKCm/5ji4mS9Jv8wT6GkC8u6q36OrubJw3A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1629.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(39860400002)(366004)(396003)(346002)(136003)(451199015)(6916009)(83380400001)(38100700002)(86362001)(41300700001)(66574015)(82960400001)(66556008)(54906003)(186003)(478600001)(53546011)(6666004)(6486002)(66476007)(4326008)(316002)(8676002)(6512007)(6506007)(2906002)(26005)(44832011)(8936002)(66946007)(7416002)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?zTzUru3oksk8Y5TaiyYmiF6WBeXc6rpyP7t+mAkBwrThXz2gsycYZk1LK0?= =?iso-8859-1?Q?XsACkkCJMStEpFFqnAb0viEDNX3x1ZZ5is/hTzuONuKNfhIMnZT3rlVoBp?= =?iso-8859-1?Q?5cukSw/x6Qdr9y1GA98AdQ+J7MhNvF2vxhiSNydwo1L9jyYku/f3YEhd5b?= =?iso-8859-1?Q?wILPGR0qC8S898Y7Zf8lLJgkFbHo7XN0BLtemIK6fU2HQVNSD2fdknD0U+?= =?iso-8859-1?Q?saJqaP59MQijpIVL4C/runyUWeRtRg62K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q?sg7loD3bw/ZQ4Kui3mj79N3u7aj2kU8mOU2VQxCFVlNPKZe7YUND23riO5?= =?iso-8859-1?Q?7RbZe/skE3FtgrEBtsNU3G+2GzIG2RYlFhFEX0lcr/gsQ1hPcTocwHcDbq?= =?iso-8859-1?Q?oMWz/xlVaPGGJPeEGDJooh8oo9eQYKxmtdAv6ASewJ5yxOg7/HWd5zIaZd?= =?iso-8859-1?Q?MGZQstmz7PUm44GjNCFNkHe5/3qo672rjufk2Z8GsLWLlPPx08LTIJYoGV?= =?iso-8859-1?Q?nE75t++CKip3cw1sjmS5y0USYpMC8ls4j08tjBuhrZ6TPdqF9lj9C6cN0o?= =?iso-8859-1?Q?/l+Zn7DHF008vupTa8MeHET29LlNELXfXlyW0c55COA209u2J6ge24ZpMN?= =?iso-8859-1?Q?K9McQVQozDFqguGgL+Ttku2v0Htn0R3oZziTFXCKaNDK8YZCsZk/c8w8lV?= =?iso-8859-1?Q?MlL/Wv0/pBD4Cx+aCS0qD8KcUZiPOUNSESeZ3FXJ2H1q5pSuLi9Iq1/H2R?= =?iso-8859-1?Q?RezZxyWXSPrmNh716IjQv+WyMyar1dy1AfYmcbJF/m9ZQ/o485WUIVAw?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 8156cf8f-e7e2-4e17-6bbd-08dac30c5c99 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2022 11:11:48.9667 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6ONUQzWnFYADc81gEK8Dh612HGTkahWugi02iXjZHIZw7NlgmnIaxPSnCjSqow0j/YLPyv5xfGCbwV+XwE5KmlFvGH1Upys7GveCJ28G7Io= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5521 X-OriginatorOrg: intel.com 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 Thu, Nov 10, 2022 at 12:02:48PM +0100, Morten Brørup wrote: > > From: Andrew Rybchenko [mailto:andrew.rybchenko@oktetlabs.ru] > > Sent: Thursday, 10 November 2022 11.34 > > > > 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. > > It cannot be UNKNOWN, because we do have information: The checksum was intentionally omitted. > > I would prefer GOOD, using the same logic as for the IPv6 header checksum. > > Trying very hard to tweak the meaning of NONE's description ("the L4 checksum is not correct in the packet data, but the integrity of the L4 data is verified."), we could argue that "not correct" != "intentionally omitted" (and an intentional omission is absolutely correct), and conclude that it cannot be NONE. A seasoned politician would say this without blinking, but it is up to individual interpretation. > > We should settle on either GOOD or NONE, and write it in the documentation. > > In a perfect world, the PMD DPDK compliance tests should also check things like this. > I would think that for cases where the checksum is intentionally omitted we either add a new flag for "not applicable" or else just go with "good" as you suggest. I think for simplicity to go with the latter. Can we redefine "GOOD" to just mean "does not need to be checked by software", rather than trying to define it in terms of what was done by hardware? /Bruce