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 D1FEF43BA9; Fri, 23 Feb 2024 14:53:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B368A402E3; Fri, 23 Feb 2024 14:53:27 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2044.outbound.protection.outlook.com [40.107.220.44]) by mails.dpdk.org (Postfix) with ESMTP id B223C4021E for ; Fri, 23 Feb 2024 14:53:26 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oIKAkUB4leHZxB7a7YYX4yiPziuGR7zsR8+1atCeqTYFqzjxgzpKy8EQ2NPAfIrJF/LU5iG7edakGZZrwysfA2emIPpvC59az9IKGDh6aZ0TVG0RHEChfQJpmumJMFddkSh3hs4FSkX07fgqkwxiBpEBsCUiV9wgTBrZYKw3tI1UqQ3wWocf6l4CApAHNLERCbUzxUq08M6DG+4eYpYUirGTybl3CbgUB8XFciAg8oaP8P/yflf9VzH1oYoIgbUXw+cFcpUO4wAIE6GWxQBkNNuKbfzr4gEtO7z1az6tJXRb9kyLRFBW63RUHPQZFJh5YI/icpbv4nEEPVCCZoFw+A== 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=50+hwlvAT6qHwKl4YLB69LgjBcjKJLUGbdq90Mre7Hk=; b=cYZmmQJHefKZ4nvLRyzKBN3opfqC6iqsv6gOJmiXMS52qqIEw5hnU+QfD8nsE1HpmgWkMQwKNEk5iyHUsFHYVpR3wQASTlEug1tiTqlhXIcvkpPHp5hnAyCnVez8w0iZeuBAZ2Py/N4Ss0Uw0nHznik4bVeonncYOHU8iEbxWdlPkB0qp/JR1CtJqjvmMRcxWB9RLLUTGrPMGUkvRfW1uSWiZjpfWSHykjf8a7EVOUwAViHS9hPYNf9lQb+glMK9rn8ss6v8xAcg694hIHW2Dj6Wub8grqP9JuG7OO6b3R/doAge0LBpxvl0wm+sez2Pv5JtZI9+M8jfi3W0ibP1DA== 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=50+hwlvAT6qHwKl4YLB69LgjBcjKJLUGbdq90Mre7Hk=; b=MC3Z9VgQaJ4u53Nfso5JjYqgzm+vS323SkIJL1g081XA6bUSfDtZRz2QDQGklNYv4PeAh4U1+L+YrUBaHHn/i+xLo/0PIu57/TKw4gBzKAJo+z2JT0Wik72WUG0BSM8FyzfZdfDLVnNspsgV4hT04NbBOg07ISeDE9sVBceErT0= 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 CH0PR12MB5156.namprd12.prod.outlook.com (2603:10b6:610:bb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.27; Fri, 23 Feb 2024 13:53:24 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3ec7:6339:1c14:c529]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3ec7:6339:1c14:c529%5]) with mapi id 15.20.7316.018; Fri, 23 Feb 2024 13:53:24 +0000 Message-ID: <6246e1f8-dcd4-468d-a05d-2e292f6e1714@amd.com> Date: Fri, 23 Feb 2024 13:53:21 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net/hns3: fix Rx packet truncation when KEEP CRC enabled Content-Language: en-US To: Jie Hai , dev@dpdk.org Cc: lihuisong@huawei.com, fengchengwen@huawei.com, liuyonglong@huawei.com, huangdengdui@huawei.com References: <20240206011030.2007689-1-haijie1@huawei.com> <11b8feac-4a9e-4d2c-8995-ed492d684750@amd.com> <7438563e-c7b4-6e13-68bf-74ff423546af@huawei.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 aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULC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rseA8c4VIZewdIjkzAhmmbxl+8rM/LKBH dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <7438563e-c7b4-6e13-68bf-74ff423546af@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DUZPR01CA0043.eurprd01.prod.exchangelabs.com (2603:10a6:10:468::6) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CH0PR12MB5156:EE_ X-MS-Office365-Filtering-Correlation-Id: c3fdf6b4-5618-4615-3f09-08dc3476cdfd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AKnSyqA7ZDWHZkUpt2hEHUfEIQycs3J+Zi+d7agdH7L26rEEf37JNTqiM9JwM50YAZ1sfq/AogcvC9kfSTYz7H/nwNkjB+hfZBxkuhKrkqYFSIoS/T9XZgmV0whqg0DAI9n4tPPvusYuDA6hTB2ujLUtCCQrQBz6CXVa0GzpzDSRwzcunbPZPX9Hea+bEjGCW/Tch3EQyhvWQPRFwd8n18bFUPYrSU6Tot8F/lf1+l9YAShb6K/XD2BSU+ARzi4IQkWBHYBHMsz/GGqLvXxTTW7seZxvPrHbtUkFsVr6WLk4naPkRxk+1AtRP5yEaD3D5QG34rnIq+wDx5QV0gWXEWbu5JS0S3qLGEjh+TKk7Gav0HHDx3ntI8Qf+Zke5YDCgKw/CSjmDSRK6yjPz6kG6vErBKDnzWdiIJ3y+4wPAxvPwTIHklY1mO8qGGe1XYIS5VG/kiMyBMUvyYG318Ch+XhkCtEf7sTIE90jwd/l1qfIO8EevUIPzFfbFffVQIoyjGsNg8wU854I1un8p5d0vL3oDFkY+myL0tkTd34kktU= 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); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?d0RVemhoYlZ6blNZbUsvSm81bTRjd1BJaXU4bUVkU1Y4UTAvRnZJcjg4bHZo?= =?utf-8?B?Mk81dUVwMG0yckcvRlhzMDAzT1dLYnVpNStZSkp6QUVRd291Q2tGdkxCNEMv?= =?utf-8?B?OG9oWEYrWVZKYU5oQ1YvVzlsZTd4dTRJbVRrL0VyMjdoeTNQWkp6dXRpanlN?= =?utf-8?B?bGRhc2lJbnQzZXAzN0VwVnpjU09LcllYQVFsdjVQVk9KMTRZeWJQUkNRVWc5?= =?utf-8?B?clNLZlNiOTBzL3g1eGlQbDR1Z3lCdmpJcXc4aERHeThKQ3VOSFBtRC96RFpM?= =?utf-8?B?NE9mMExwOVlwc0FMYlFMdTNJaXBMZm45RkdZSnVQdFZLbGxjVlRkaG9IRUN4?= =?utf-8?B?TTcrMlVSeERlRlNuM1g2MFVxVTMrczN0R2ZhUnZyZGdEang5cVE5Zk5VNHpu?= =?utf-8?B?cmlMSGxIOXdYeDJ2K3BkNGY3WVB6S1ZkekY0cURkbk9Vd2QxTDFLZ1pyVnNE?= =?utf-8?B?c1Bvam9XQmlLQTRINUtXczlUSG1MNGdSN0RETnBCK3ZPekJVQVQ4SHkyQUc1?= =?utf-8?B?OUxOZDNGZzFTQk55V3NDWWs5VmIrUlRvSkNWRkhhWFVTZE8xWVhHK0pSMi9z?= =?utf-8?B?cUFhZzF2MG40VGFDN2M4Uk8vcndrcE56UjR2TEhCdzRXanJvUGtEYmlEMjFt?= =?utf-8?B?d3g1S1d2b05paHUyUmxKZTRmU3o4SDF4K0QzaXpOMWdWTk5kcXZrbXdsYnVn?= =?utf-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tHK0NQa0dqZU1yMm9XYUo3?= =?utf-8?B?cm0yZE9lTUVjR3RtWFgwajVHVFdTTFNUOE45SVdZeCs0dlhRK2VPa2JLdmtE?= =?utf-8?B?ckYzenNNL3FFZkFPR29NTENZbWNjNmh1U0NRREpMWlNaWmhMbWxyRDIrK08z?= =?utf-8?B?M1ZacnpsNE9kQzlUeW1US1pWYmRZME1MTVAwVUxLRkM2dUpvczl5YnBaOGQv?= =?utf-8?B?L1MySkR3dlFGOERYZ0pUVmpTL201M1RUaWZZaTcxVVVjeDB4eThCOUhSMW8r?= =?utf-8?B?YVJaQkRpV2FLWWpQVkNwd05jQmljOFlOL2t3K21vK1FRbDIwSGE2MWwvbFhP?= =?utf-8?B?Z2o1a3NFOW8yWFBMSDJIU0x6U1N3NEloTHE3a2tpSkJnUWlONHdzKzR4NEtj?= =?utf-8?B?bFVBRHRhbzZ6c0xiZXNjczdTVE9qaWl6QUFwUThjQU96MC9vSEJtNDN6TmFS?= =?utf-8?B?dDBqbDhIZkNNTEFPdDRHTmsrTjZrYWptTFNjdVFBRHhkaWdUYitXUDROTEps?= =?utf-8?Q?RyXmprm8DwiTLw+TlYWfWDnRu?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3fdf6b4-5618-4615-3f09-08dc3476cdfd X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2024 13:53:24.8317 (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: j+JsiWlNDyyVxmyk+McdS82p8ultP2RYMVjgB410C6+/UwHJ8zTgmQMZlcInjBYh X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5156 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 2/20/2024 3:58 AM, Jie Hai wrote: > Hi, Ferruh, > > Thanks for your review. > > On 2024/2/7 22:15, Ferruh Yigit wrote: >> On 2/6/2024 1:10 AM, Jie Hai wrote: >>> From: Dengdui Huang >>> >>> When KEEP_CRC offload is enabled, some packets will be truncated and >>> the CRC is still be stripped in following cases: >>> 1. For HIP08 hardware, the packet type is TCP and the length >>>     is less than or equal to 60B. >>> 2. For other hardwares, the packet type is IP and the length >>>     is less than or equal to 60B. >>> >> >> If a device doesn't support the offload by some packets, it can be >> option to disable offload for that device, instead of calculating it in >> software and append it. > > The KEEP CRC feature of hns3 is faulty only in the specific packet > type and small packet(<60B) case. > What's more, the small ethernet packet is not common. > >> Unless you have a specific usecase, or requirement to support the >> offload. > > Yes, some users of hns3 are already using this feature. > So we cannot drop this offload > >> <...> >> >>> @@ -2492,10 +2544,16 @@ hns3_recv_pkts_simple(void *rx_queue, >>>               goto pkt_err; >>>             rxm->packet_type = hns3_rx_calc_ptype(rxq, l234_info, >>> ol_info); >>> - >>>           if (rxm->packet_type == RTE_PTYPE_L2_ETHER_TIMESYNC) >>>               rxm->ol_flags |= RTE_MBUF_F_RX_IEEE1588_PTP; >>>   +        if (unlikely(rxq->crc_len > 0)) { >>> +            if (hns3_need_recalculate_crc(rxq, rxm)) >>> +                hns3_recalculate_crc(rxq, rxm); >>> +            rxm->pkt_len -= rxq->crc_len; >>> +            rxm->data_len -= rxq->crc_len; >>> >> >> Removing 'crc_len' from 'mbuf->pkt_len' & 'mbuf->data_len' is >> practically same as stripping CRC. >> >> We don't count CRC length in the statistics, but it should be accessible >> in the payload by the user. > Our drivers are behaving exactly as you say. > If so I missed why mbuf 'pkt_len' and 'data_len' reduced by 'rxq->crc_len', can you please explain what above lines does?