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 27DFD43274; Fri, 3 Nov 2023 05:03:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1855D42D7B; Fri, 3 Nov 2023 05:03:38 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2064.outbound.protection.outlook.com [40.107.223.64]) by mails.dpdk.org (Postfix) with ESMTP id 17B22402D7; Fri, 3 Nov 2023 05:03:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EDYYyLhF4gEC4dboZbGeIpqWyOodQWtwYP9ZSage6o/v5/+lkC4F+XmrXJYHdpHMW39jg7/VTu0QeZi7EK47smp7QOQtP/cRsOkgG3o0j1RyeGvnM0RUeiX30smdv8RDOe1n/M0UfKGwDwtmU0TRO1Oyt7ICezH8F211Yje6r8cPb7eH4TkoeRvl1rkN5OHDUxVj4N0Fxj5o7cLaR4XO2HTuUyWXi50ljye0Zw56G1ZB4TqpCvrjKLKFyuOGYSL7EkighcAaZdc+PZcHeduqzrFPQOqNe5kyaVQXC9tPSXzpnwjYUuvBLuAJMZYQqVFoC9pbdyCHZg+9AimIH+JVMQ== 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=3lcUG4MxGMGLOvjto4aprTRUYRlVIOwAK2VhbCN7CHE=; b=k3a6m0D9rhadnBhomk6+61oa8GGzgNzCR44ZE/NzDQiE282b5Pf1Yvp1p1pW4TAm+ckG7U3HTMKMusQLX3Pv2EfohePbSrHdaMuKcIqFcwCpd1StJEZd5dA/HJU/8yEMrf7J0mT5BA3/hoFZuvBmmc0l21y1jfIrLbTgUQJYa/MXKCTcsfHbFGyPLkFjWn3gCQG9gVhcRQk1gIRGEZxVbQsbFUe5S8XyUT0foyg9PTmXRVY3VBm32oOlxdQoCTNJXIEI3TsGqBWcGNpHQvzkd4ANaIYMBvW9V0YpHnvh5pbArAoCj84fbJ/ijJVW9fIswuPxRIA0yyT4oFLlf1KW7g== 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=3lcUG4MxGMGLOvjto4aprTRUYRlVIOwAK2VhbCN7CHE=; b=ZGMBYsl+ul3UsqVfUZ/9IULGi6C3nJQC+DfsJq96fdgLvcDwzZSomNuofzVPyTyfrtB22lRN0OHryS8B4t/UrNYVuhmjd4nKFjmaoZXMta8xp1jnNWlQTj9s8hihnw1AcX6iIVH9C+tt5lhkWg+lH9u/7ixYxj+Awz460eiNxkU= 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 PH7PR12MB6395.namprd12.prod.outlook.com (2603:10b6:510:1fd::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19; Fri, 3 Nov 2023 04:03:34 +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.6954.019; Fri, 3 Nov 2023 04:03:33 +0000 Message-ID: <3aa757eb-23e1-4492-8c14-342540d0899d@amd.com> Date: Fri, 3 Nov 2023 04:03:23 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] app/test-pmd: fix L4 checksum with padding data Content-Language: en-US To: "Deng, KaiwenX" , "dev@dpdk.org" Cc: "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> 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+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLB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4KUJVse5g3qwV7i9VrseA8c4VIZewdIjkzAhmmbxl+8rM/LKBH dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR4P281CA0102.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:cb::9) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH7PR12MB6395:EE_ X-MS-Office365-Filtering-Correlation-Id: 54831138-22fd-47b0-4d48-08dbdc21d8cf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jjmm33YPsPU/A7n9ZADEwA2mN1bfIxd38A6dTXfP+Bw/EhUtZ07yAoG/Vsk3mbQpcoHdjz7Z8WOXLzDYB3BAWYoK43RFNuIrt3XT2XW9YbH46ho1UcB9TMjYxEoLF88ZDguDuzACXncZKNSFo54fT8JKBr4Ctg11gI8O6UfpWMiv9WaKU1arMrLy5nzAZq/iWi3b/0Yckhk8dRRxB+prFVrhQfjBulzea4nmmKW6SPq/7W4YqzvMK7a96l56NE6JBvUbW3AWgakM2dreyh5hCfuLCb/HsesqmxHnilIEN5TJljPKPUCTZWgW46EVh2Q9gf/mbDDer/Rl584kJHEWfrrdayloXL01iBNoYkVSLQjYl80UllBG5SmrHZn7tjRtPwGPIJ+sxDVUbc8JZnvnnoBVGFxBqYez+FGxlUkRJmvdRCNAufPX4y0rOO2wKsNFXnAKkeLYrIP6rU69z4I6q3ALS26NkFfckmQPa7bsUpWzXrnZfWovd4vxAz7jPFYzafHgXDhj97OHnuCsj8EO8lxmUKgO0+nzsOMNTU2/nRmvQYH+wuDbDX3w2BBLWdrOUU0Ump0vn8QTJMzCJKv9rfTFUyUJciWNkpBw3h5WlgqWIZbHxHGHzgBUM0TUMF9SyfkRWp4WQZnHeOpDgo/F2w== 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)(39860400002)(136003)(346002)(396003)(376002)(366004)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(6506007)(8676002)(2906002)(4326008)(8936002)(31686004)(44832011)(6666004)(41300700001)(6486002)(478600001)(316002)(54906003)(66556008)(110136005)(66476007)(66946007)(5660300002)(26005)(53546011)(2616005)(36756003)(83380400001)(6512007)(31696002)(86362001)(38100700002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ek5GaWE0K2hTWXJwS21YZFhxQWI0RTc3WWc1TlgxZTVXdVcrbG5mNnpORnF3?= =?utf-8?B?SEFkQ28wWHRIM1VoVlJWVHVhUzJzdjBXcitCeklzd2ovZkFmOGZUT1kxTVpR?= =?utf-8?B?eHlzOVFUTkdsZmtwYXFTZTZmSGREd3BLN0gzT3FJdTgrNmZZVDlwNXdyR2Yv?= =?utf-8?B?NElBb0hRUEU5RkJ6V2gzdjM2cnUwTVBFZmk3MnluRnRheTRsbEZjUVhIakx6?= =?utf-8?B?a1NDT1VoTTIzTDNSeUUyaEY3NTcwbDVLalgwUVRwc1BEcWZtRitXbnMvY2Mz?= =?utf-8?B?K2R4MENaVk56aHEvU3pqWTZOVVArRTNJbzZzbFhmWGVhZC9GM1hJMFBKaFVq?= =?utf-8?B?a0FTQ0Q2L3VvWnJyZjNENlVmU3IzT3JDUnlvVzlWSDZSYTdYNDZqWC8vcWFD?= =?utf-8?B?QkVxMGpoOVVNRmRsSWJlK0lIOWFGTHdyL1hSdG5SbC9RYWpDOFVpaFB3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CS2VycjNNN1d2?= =?utf-8?B?N2Uxb2xwRGNZVkUrRTVyUDkvRG0rcWpqTUJvbnFjVmtUNHFZMUpFNDh5T0c5?= =?utf-8?B?b1FNZW81bkNRdWM2YzRCa1drQzdweTNxMmk5NzZhMjg1OTBYdFgydjJmZnd5?= =?utf-8?B?NXJBVzlnY1hJTXZjK2gycUxITWtGaDcyR0I0ak4zTy9NUmJuV0lSbWNKdkdN?= =?utf-8?B?cGc3QjdZRTQ2Q1U1YmJQdDNDTmk4emRDUHh1cE5FeGZyRVoybWRWc0tSVzh4?= =?utf-8?B?YmZLWGQydnRJeXV3V1NtMWlBOWxvSUZZM2tKZ0JWYjZSc3FuT1ZRcE9zbHFX?= =?utf-8?B?SXNEQ1VIbzA4TGZhQlFxMmo3Y05ieGdVN1YrTlVFai9ZODUrUWpoaVdubXdD?= =?utf-8?B?c0xEMWxoR0VtNTFHQUdaQWVKZ3pOM1NkdHM5NVlneEtLWTFlN2tUREhMdDRk?= =?utf-8?B?emFodDNJUHhJK1VNb0RPUWFxNG9LUUJUdE1lWS9kNlQ1K241V0l2UndOWWlJ?= =?utf-8?B?cXdhNzlEc2twU3lUZmxtazVybkhnV1M0RTYzdnA5aXhzNCtRRTZQS08zMDVC?= =?utf-8?B?ZlNROUw4VUF6TENJK0RTZWVmOEJTUXVmTCtHMjNHM0pHY1NrMm1DUVR3U0Qw?= =?utf-8?B?WVBNK25RODZjL3RhODZGZzhKYjZyeDJTK0NremNTWEE5MGk5MUFzZjJXTXNQ?= =?utf-8?B?d1BWNC9Yek1mUlRzcG42cnU5L21jcWlZZlBoZXl6WkZoeklXTmF0OVJQck9w?= =?utf-8?Q?jB/O7HaooSQJkUXn48a6MxDdy?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 54831138-22fd-47b0-4d48-08dbdc21d8cf X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2023 04:03:33.4627 (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: 1oz7fzP2DIbo04qcZM/EuRWx09gbeSMJSx8lCjGLwOjq5aUHcZzWHJhKsMK38upv X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6395 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/3/2023 2:49 AM, Deng, KaiwenX wrote: > > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Friday, November 3, 2023 3:20 AM >> To: Deng, KaiwenX ; dev@dpdk.org >> Cc: 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 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? >> > Hi Ferruh, > > In effect, the packet is padded by the switch. > IEEE 802 packets may have a minimum size limit. The data fields should > be padded by switch when necessary. In some switches, the padding data is not zero. > > Csumonly doesn't trim these packets to the true length of the frame. > In csumonly, the received mbuf data_len is the true length of the packet plus the padding data len. > Therefore, padding data is included in the checksum calculation. > When the padding data is not zero, the checksum is wrong. > Thanks for clarification. Even some non-zero padding added, it will calculate the csum successfully, but I assume in this case csum becomes different than expected csum and test fails? In this case why not fix the generated packets, and make them compatible to minimum size requirement? What is generating packets? >>> This commit fixes this issue by triming IP packets to the true length >>> of the frame in testpmd. >>> >>> Fixes: 03d17e4d0179 ("app/testpmd: do not change IP addrs in checksum >>> engine") >>> Cc: stable@dpdk.org >>> >>> Signed-off-by: Kaiwen Deng >>> --- >>> app/test-pmd/csumonly.c | 32 ++++++++++++++++++++++++++++++++ >>> 1 file changed, 32 insertions(+) >>> >>> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index >>> 7af635e3f7..58b72b714a 100644 >>> --- a/app/test-pmd/csumonly.c >>> +++ b/app/test-pmd/csumonly.c >>> @@ -853,12 +853,14 @@ pkt_burst_checksum_forward(struct >> fwd_stream *fs) >>> uint16_t nb_rx; >>> uint16_t nb_prep; >>> uint16_t i; >>> + uint16_t pad_len; >>> uint64_t rx_ol_flags, tx_ol_flags; >>> uint64_t tx_offloads; >>> uint32_t rx_bad_ip_csum; >>> uint32_t rx_bad_l4_csum; >>> uint32_t rx_bad_outer_l4_csum; >>> uint32_t rx_bad_outer_ip_csum; >>> + uint32_t l3_off; >>> struct testpmd_offload_info info; >>> >>> /* receive a burst of packet */ >>> @@ -980,6 +982,36 @@ pkt_burst_checksum_forward(struct fwd_stream >> *fs) >>> l3_hdr = (char *)l3_hdr + info.outer_l3_len + >> info.l2_len; >>> } >>> >>> + if (info.is_tunnel) { >>> + l3_off = info.outer_l2_len + >>> + info.outer_l3_len + >>> + info.l2_len; >>> + } else { >>> + l3_off = info.l2_len; >>> + } >>> + switch (info.ethertype) { >>> + case _htons(RTE_ETHER_TYPE_IPV4): >>> + pad_len = rte_pktmbuf_data_len(m) - >>> + (l3_off + >>> + rte_be_to_cpu_16( >>> + ((struct rte_ipv4_hdr *)l3_hdr)- >>> total_length)); >>> + break; >>> + case _htons(RTE_ETHER_TYPE_IPV6): >>> + pad_len = rte_pktmbuf_data_len(m) - >>> + (l3_off + >>> + rte_be_to_cpu_16( >>> + ((struct rte_ipv6_hdr *)l3_hdr)- >>> payload_len)); >>> + break; >>> + default: >>> + pad_len = 0; >>> + break; >>> + } >>> + >>> + if (pad_len) { >>> + rte_pktmbuf_data_len(m) = >> rte_pktmbuf_data_len(m) - pad_len; >>> + rte_pktmbuf_pkt_len(m) = rte_pktmbuf_data_len(m); >>> + } >>> + >>> /* step 2: depending on user command line configuration, >>> * recompute checksum either in software or flag the >>> * mbuf to offload the calculation to the NIC. If TSO >