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 AA0854337E for ; Mon, 20 Nov 2023 11:47:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9CC4442DE0; Mon, 20 Nov 2023 11:47:10 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2049.outbound.protection.outlook.com [40.107.223.49]) by mails.dpdk.org (Postfix) with ESMTP id E96A242DB2; Mon, 20 Nov 2023 11:47:07 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JF2ux8O9HxC3qJH1pJJ569FIP52vZcT+8fwPn/GJorl3kuA4oPD3cQM1I0tI0rgt15XjOhR2Zait1YbO2aM5pRdmpqj8OP2edgIBS8905q5r7t0vP9m8ApuQXUNUKpMz1HBBS11miu8DKJaMegvvCK2S4uashzxKLa7ajRenLhy2Z0xzMCNFzTXUOQGFmssNGj/uP91Hxq03QvxCmc/UE+z70GVNBTDVEJ/JE6est2gXgw799nIooJfeSVtQKfiwgbvzX7StDJlLRfZVUU3EHykraFoj4BDxZsLu03pCdEZXS1Mxx0y9OIAZmqw6UzlQyHPo6yxKq2qCDPF46eCZXg== 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=wYlXiaiqWRVao6STUyZAWyHqE/3UrNCN4U2C8V61/Bk=; b=LdzD+bz9KBPpap+LHc7KIQuG91cagrplztrQffkX6laYHQtcNSGYhaF1cnyLaD7MablinZTK6yzrs3GqQPSP7WhGCIc0nSEij/S3C9QJwIAOL9ec3O444gRGcJz6ejSU1GNtZ+AwXkuZjvdg5MsWgS7k7wpBnZF1UetSrjDT71rDUJiBpHFwektNfN3GR2LkWlkkznTIH8xOTQtBhjMCbfsZnOOWkTL4lYvL/TJPtY8hoGenCfNK4n69jkU1W2ezpkeP0G3qWH5MaiPwC3Cj2i1jEi3pEKAP7gFp2R2dLXJPmIM5NrEokPu2GSLMDqqETfY8cilvp9Xc/sNmlazrPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wYlXiaiqWRVao6STUyZAWyHqE/3UrNCN4U2C8V61/Bk=; b=eWn7sUF3I4E/UrtbPtN7Rou9bXVeyqqIyYyBzhKApLAZb3qQaX8BnZmjvs3GEEeDC0gcJTGMi0AGqly7ksFPv8jPfRVgzKTrTX/4zVAXY0JYXWVV8Ejh1p5HW1+QzyWcHw6V4HHaYAsWJsaA1x8AJmdn1C41G6gFmDMsj7rUens= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by DM4PR12MB5391.namprd12.prod.outlook.com (2603:10b6:5:39a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.27; Mon, 20 Nov 2023 10:47:04 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::2569:edb2:670f:816f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::2569:edb2:670f:816f%6]) with mapi id 15.20.7002.027; Mon, 20 Nov 2023 10:47:04 +0000 Message-ID: Date: Mon, 20 Nov 2023 10:46:22 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] app/test-pmd: fix L4 checksum with padding data Content-Language: en-US To: "Deng, KaiwenX" , Stephen Hemminger , =?UTF-8?Q?Morten_Br=C3=B8rup?= Cc: "dev@dpdk.org" , "stable@dpdk.org" , "Yang, Qiming" , "Zhou, YidingX" , "Singh, Aman Deep" , "Zhang, Yuying" , "Matz, Olivier" , "De Lara Guarch, Pablo" References: <20230804082849.533059-1-kaiwenx.deng@intel.com> <892f0567-e1ee-4283-9726-5db1dd92c2cb@amd.com> <20231116145817.78eb0954@hermes.local> <7a41467c-c863-4ea1-bf7c-9206bf56aa34@amd.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSN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YM4P8Mg5kKOsaoUdyA/2qVe cMh1CLUHXF1GlofpGbe1lj4KUJVse5g3qwV7i9VrseA8c4VIZewdIjkzAhmmbxl+8rM/LKBH dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR2P281CA0169.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:99::10) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DM4PR12MB5391:EE_ X-MS-Office365-Filtering-Correlation-Id: 08f79cc6-d377-4c46-0d33-08dbe9b60861 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vByMdZHlSYl+H/QpweNX6oKPIC3zqVdW4Sz1jvlC5pwx0/J0WfOEkwapPJkj9y1t+iCHhlINt3reTNbJhk+QWw+or1POz2gu7k9KbM/jLPZhIa91ugnHiM6RN3c11Rly3f84Jfu5NcWM0n94k/ETqGxWvgpOAeLkTNvQvBNxlqTMIsZgyyfrSiE2g3cBGx43ces+HMvwDAieUXqO92FsDfRty+ew3zg1VGVRdC5ydY0Nw/KMo7cdfTDOg4EnTD+oOfE/Ntvt3sFBy8vEFsw4lpScg699EWS+OiF2SuuzLxtyfDQSFBBc+GsqCz+UYZGvhpVIIOZFcIEKtr5Zoj9KSnSVPILsQ1fZfr2jviotX/5qlOL5e3HDxD7eBRMZ0Y6Yn1wKNqeHEH1qkY0x3BWXtPMH4uwVXPfHyYxh3ZkxvoMlqTsrbIXDK2/fFg8GrMZQIruhPGNtE+EpuUGxOxCdPSH+xjb57HIUX3y3BTnh6cUZLNxtPz/fU/T9tQ2RtaQfLOtBoOtEGAQI0ZfRgMgPwt8sxyuXrNc8CTU8E9iTQcZvr5Of/ia42X2AiJ1kOuvgCFMSWCDSHR14t4Wy8rDymrBbNdhDU6i0H+1xkfDcvtD5lDEPUhV/Eg8hDYDIBeRXxs0peiOJOMK1BK356ZaWUw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(376002)(39860400002)(346002)(366004)(396003)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(2906002)(4326008)(8676002)(8936002)(86362001)(31696002)(7416002)(5660300002)(44832011)(41300700001)(36756003)(26005)(83380400001)(53546011)(6512007)(6506007)(2616005)(38100700002)(31686004)(316002)(66476007)(54906003)(66556008)(66946007)(110136005)(478600001)(6666004)(6486002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WDVQcTdFKzdWaXdCL3oxbXdhM2RsMS9XUHorYWF6eURSRzR2Q0ZmdG5pdXBK?= =?utf-8?B?VFE5UXh3dGVjVFVJMXNjVGNSS3RRTEJaMmVQMWZBT05rMStscWRjY0F1Tytl?= =?utf-8?B?VkRIQ29YNW51QTZFNDVvY2FnUW0wUG5BWFhaelNoc0hXcW1sMDZ1SXJSL1pO?= =?utf-8?B?NCtWais4TkprSXErMkxBZzUzcnY0dzdTbVZBVFZyaEhtYS9vcVVFMFZwRDVN?= =?utf-8?B?ZVZWdWhoeGxwZFowZkhISGE0Ny95cjhGOXNDL3c0bTRERzh0STFDeTc0UTVr?= =?utf-8?B?bUhveXRMcGE2ejVqbXNpWkU3YWRTTi9henR0WTVRd2NWcUV6M0g4Zy9aSTdO?= =?utf-8?B?bkFJa2F1UFpzU1VIQndSOGs0K3dmaWxhSXJwMHU0SnoyZ3pyMWJ5RUlkOHE0?=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ant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2023 10:47:04.1229 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RPbAPfJgf39hxJSMhDMinsapeXfkgnHsK7gAuwMKQgViv9CLby12UOMpsZMZSTds X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5391 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 11/20/2023 9:21 AM, Deng, KaiwenX wrote: > > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Friday, November 17, 2023 8:50 AM >> To: Stephen Hemminger >> Cc: Deng, KaiwenX ; dev@dpdk.org; >> stable@dpdk.org; Yang, Qiming ; Zhou, YidingX >> ; Singh, Aman Deep ; >> Zhang, Yuying ; Matz, Olivier >> ; De Lara Guarch, Pablo >> >> Subject: Re: [PATCH] app/test-pmd: fix L4 checksum with padding data >> >> On 11/16/2023 10:58 PM, Stephen Hemminger wrote: >>> On Thu, 2 Nov 2023 19:20:07 +0000 >>> Ferruh Yigit wrote: >>> >>>> On 8/4/2023 9:28 AM, Kaiwen Deng wrote: >>>>> IEEE 802 packets may have a minimum size limit. The data fields >>>>> should be padded when necessary. In some cases, the padding data is >>>>> not zero. Testpmd does not trim these IP packets to the true length >>>>> of the frame, so errors will occur when calculating TCP or UDP >>>>> checksum. >>>>> >>>> >>>> Hi Kaiwen, >>>> >>>> I am trying to understand the problem, what is the testcase that has >>>> checksum error? >>>> >>>> Are the received mbuf data_len & pkt_len wrong? Instead of trying to >>>> fix the mbuf during forwarding, can we fix where packet generated? >>> >>> The root cause is that get_udptcp_cksum_mbuf is using m->pkt_len which >>> maybe larger than the actual data. The real issue is there and in >>> rte_ip.h checksum code. The correct fix would be to use l3_len instead. >>> >> >> I see, you are right. >> >> In 'rte_ipv4_udptcp_cksum_mbuf()', >> as payload length "mbuf->pkt_len - l4_off" is used, which includes padding >> and if padding is not zero it will end up producing wrong checksum. >> >> >> I agree using 'l3_len' instead is correct fix. >> >> But this requires ABI/API change, >> plus do we have any reason to keep the padding, discarding it as this patch >> does is also simpler alternative. >> >> >> Other alternative can be to zero the padding bytes. I guess standard doesn't >> enforce them to be zero, but we can do this to remove its impact on checksum >> calculation. > I'm not sure if this is ok, it feels like it would reduce performance. > I can try this alternative if needed. > Yes impacts performance, so not a good alternative, please scratch it. As discussion with Stephen and Morten, consensus is to fix SW functions that calculates checksum. 'rte_ipv4_udptcp_cksum_mbuf()' & 'rte_ipv6_udptcp_cksum_mbuf()'. Instead of using packet_len, those functions can use packet length, which will make the checksum correct. Can you please send a patch to fix those functions? I think this can be done without changing function fingerprint, so without causing any ABI/API break. >> >> >> @Kaiwen, did you able to test this with HW offload, what is the behavior of >> the HW, does is remove padding bytes? >> > I tested the HW offload case and the same tcp/udp checksum error occurs when padding is not 0, > But if change pkt_len to the true length of the frame, the checksum is correct. > I was expecting HW not impacted, since padding is part of the spec, my assumption would be HW only take the actual payload size into account, instead of buffer size. Can you please double check? Which HW you are testing with, can you please add maintainer of that HW to this discussion? If HW requires padding to be removed, we may go with your solution. >> >>> It also looks like test-pmd is not validating the IP header. >>> Both parse_ipv4() and parse_ipv6() should check if packet was truncated. >>> Same for both UDP and TCP lengths. >>> >> >