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 9841043272; Thu, 2 Nov 2023 20:20:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 88E05402C4; Thu, 2 Nov 2023 20:20:24 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2063.outbound.protection.outlook.com [40.107.93.63]) by mails.dpdk.org (Postfix) with ESMTP id 3957140144; Thu, 2 Nov 2023 20:20:22 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lL9vCcfeXhBrSmwBKcJvC1GijeUd+Pjb26V08jFucTISytlZtIVfpr+4Ax2YAtjTfJzz/ZvgLlED/ofkdZWjCNHKU6OtWPBKUueSyNdycUxXVHB2ZLpxkR+fUcXdQsbnk3boyZ4E611LspoCxTjQA45i6WB7tQabjX1NVF3/PhM3nYhRGb9dc6fdZWkL2y/PumycZjdBNRtTeHTvQA5vWHZJhXaWPiIqhuzk3YBNR9wlF0iMSRnGEF/WUEl0MYVZi4hj1jT7WhI2FEtpTnkY2fdOn9tCF8+0SKrHNcJXJgAsJDMXd0TKDhHAzgMwdjJBP/A5f6paoxJ78TlgrF6vlg== 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=U0f2F18luBsJKn7ipWGtwpKlSHSofbtU8SjwvReIGdk=; b=RS4jQqsr4jDAOo5MXt34TLBgPihWMhJghLDQP32pOHbXEI7Nirps3PKRZVg2UNbA3y/+Zyqr61jlz9SzqVN4u4YS181XoXtfy56mmN7rYuvLA4zC49+9aHGgCggkBc9MXIl3mjgoXtPRBwwPwMgHua1U8C5R/bNQmEZzIRzOL1asL5JgB3Qamj70C6C5cPgBEAfD+HTqrl7mfRFUfgINEUutBdF+mcgtR9d4C0XAW9py3iirXneVDVfW9Sn60cPzmcWUU4r53GOp3qZeT5m7uMoOWAY7N6oWwwg4KDTdRW88xYrt/l8CmcSlZv4ZXEEV+aAadCcbbrT+apKv/l7SKQ== 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=U0f2F18luBsJKn7ipWGtwpKlSHSofbtU8SjwvReIGdk=; b=h7qzjtAf3vCgXzUxYcx4X8DM6f5zrGRIUVLM7Jfcz2POaZk5x14bIB7BipMSTnB/uA3yNhSfmpkKFvQ7kynFT4eT/kGs98qFwl4IxWL4oneJxkSJ8cgglxwOhtz3HU1U4KpZ0MteGw/dqIHGVF6df4LGdEYOgrlPC0qWDy1AEpk= 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 PH0PR12MB8800.namprd12.prod.outlook.com (2603:10b6:510:26f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.29; Thu, 2 Nov 2023 19:20:20 +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; Thu, 2 Nov 2023 19:20:19 +0000 Message-ID: <892f0567-e1ee-4283-9726-5db1dd92c2cb@amd.com> Date: Thu, 2 Nov 2023 19:20:07 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] app/test-pmd: fix L4 checksum with padding data Content-Language: en-US To: Kaiwen Deng , dev@dpdk.org Cc: stable@dpdk.org, qiming.yang@intel.com, yidingx.zhou@intel.com, Aman Singh , Yuying Zhang , Olivier Matz , Pablo de Lara References: <20230804082849.533059-1-kaiwenx.deng@intel.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 aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCK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MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <20230804082849.533059-1-kaiwenx.deng@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR2P281CA0018.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::28) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH0PR12MB8800:EE_ X-MS-Office365-Filtering-Correlation-Id: 9faad10b-e3ad-4b7d-a5a8-08dbdbd8c06b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lVZIqqo2RRyZ7WK7+bJG4gMrkWRywbew+U5+7/fOYvzZljOTGunAUupWqfV9h45kYFSww1PDxMaa+nT6uOK+wJaLFm8LJ9ZDRYdARCPS/sScNZGsRjXz3gnV59p4Gp/oHoLA/gbG9tSced3jlCzX1Rzpr3s4NXa9zTp8DxSBx0TTnLvUgHwed+HHVSu9ZnYdwb8Xnw7hCV4GLzDtxa6d+lhQeR2BWSZ69NK27iPZQfjUMzOfZKSD7jddx8uQ/S37b+ZVB1Nabo8+Q6r+T0MMiHjE9NCtBeSLSQek8LwDkE3sl3KNj1iyS3y+PSiYA3Ca2x+13W3mYjv0rEQhzqqDszh/P6c2Vn/LUUFUduwqy7QuuABw9/3pvzlFm8w5VFi/klpUym7vicvlEhhyb+p4T0SU1NjCLzaN688cU878fz0561i5zslCM6C0W0OcVBbzhE661P4CZrpwolDrF2hErBDGl9YIsLIGqka/2Xrx/XFW6oF3UXfahXZtup3jDrjfQxbPVXQzNT5B0/hx05tlJnwJDh4F35k4VJqiYcH8IbSVRwLKv4TUL6/iwMUHBGbyruA3DJA7xLScMR/zs0KXsJSG2s9Hx04+jQonmHlpyL/SRhrTaD04lcGZBP9NlLN6wGRtNFKJs7+zpfH653DyIA== 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)(346002)(366004)(39860400002)(396003)(376002)(230922051799003)(451199024)(1800799009)(64100799003)(186009)(316002)(54906003)(8936002)(66476007)(66556008)(66946007)(8676002)(4326008)(5660300002)(44832011)(2906002)(31686004)(6486002)(41300700001)(6666004)(83380400001)(36756003)(6506007)(6512007)(53546011)(478600001)(2616005)(26005)(31696002)(38100700002)(86362001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SVFSZTg0NmhsYzZqOXdGS0tmU09zbm5kZU95d1p2T2piMTlVZlZzRDNNTDlq?= =?utf-8?B?ZUJTcnQybEJlM0JTZHRrb09GTGNBMGdFbXkyU05sZXdQU3pYcFVKdVFYcDUw?= =?utf-8?B?Zm1GSG1oQUt0MnU5Vi9UTS9sUXBOMWJmVTh1NnVPZzAvMnJUTk5jb0hVNnE2?= =?utf-8?B?VUpwSllTRjZOSTEydjNsaTNJaG9qLzl6SXZHeXhRcnFFUDh3aUJuK0lkTjFE?= =?utf-8?B?Vjh3Tzd2Z3FmWEM3RFd4bVpoWFg1Qm5TWFUwQ1FZT2dPNVM4REJvY1NXdEhX?= =?utf-8?B?aGpIOENzanN6K3JLbFZoR213VmFYT3AxK3NQKytGQ2pSNllRZjBrUjlWWCtm?= =?utf-8?B?VGNvWjUrbC9ZWXdpWU9RNSt1Rk4yR1NpNEJCdUdVWnQ5TG1WS09pVStRbnJr?= =?utf-8?B?RFBvRmhwUTlONWtBV0hUWGdwN3I1dVlQNWpRWlYzZ2Q3NDhUUmoyTEZ1L2NT?= =?utf-8?B?NVZxMTVDSk84cnhPdmJXNC9UW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8?B?VHhQYTY4QWk2M2VVRWJSb1BkZ3ptWWxBZzF3RTVEQzE1UFdBZmtsMGNGNFBr?= =?utf-8?B?TW1RR052U2kydVJ0Q3Z1MU5KRTNWREIyNE9qRmt0SU1VYVJyUkppbzhRK3lW?= =?utf-8?B?QXRWYlMvT1h4eXBMdWRjYzJzaXZtejNmWjd2UDBZZXp6dFlYMjNFS0YxV2J3?= =?utf-8?B?TTVmc1l3SmdiTzhCYmQxQkoxM2JEYjZoQzFkaEpFZHF1eFJGc3R0ekN2UlNm?= =?utf-8?B?WERwRFFsNVdubFhKMndrdU1QSnNOR1E5Wi9XZnE4TFY0Y1VkNE5RWjEvRDly?= =?utf-8?B?dzRMRmY5dHdaQlUreGF0aHRDUzMwUE83eXlvS3Nrell1ckNNUTF1dkpXVkpE?= =?utf-8?B?UjhqTCtMNThQRk5ocG5SSHdkYjAzKzdZZytTSlRzWk1DRlJORnU5eFJVR09t?= =?utf-8?B?Kyt2aDQvcmNxRDkvK3Fyb1V5NHRLMVJ4QWhlbGt6ajBQT1pHYmxDS0xqWEVR?= =?utf-8?B?d0F1TFFscVBGQUF0N1ZBRWpPMEl5bmE5UjlpSGZob2pRVE1JamVaa1M0YkpB?= =?utf-8?B?bTJuQ015SzFzNVJSSzF5QldwQk5EK2F4Zk5tWUZ3RWh4WnlEMzUxQll6MFIr?= =?utf-8?B?b1RLRzJtZEgvUTNiY1BwZWV3WTZxVkNaNk52TDI3b2ZyZmtUTW9sTGJBaEQ5?= =?utf-8?B?a0d1ZkRiYjlKdFFlTDQwbnk2cFdua0hpRGRESWVRYjhlTHVjQjlxdWlsMFVM?= =?utf-8?Q?RuKtAEkPMH9PtuIXgkRvQFISq?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9faad10b-e3ad-4b7d-a5a8-08dbdbd8c06b X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2023 19:20:19.8141 (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: 4cvCtNhjGkDG7eo/GvCF9R7QZfXViptxYeR+pSXz9+tWSjmzk8ItiNOvQWDXTeta X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8800 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 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? > 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