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 97B6343BEE; Mon, 26 Feb 2024 17:43:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24E77402C8; Mon, 26 Feb 2024 17:43:47 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 0621A40144 for ; Mon, 26 Feb 2024 17:43:45 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S/mEqMux8e9OCHJGtWkOy01Lm2XMomnYIErn1Qwmf19G60tuXPS2pEfmD+6dfUQAAdlF8zOXz743kjUJbavQNWGF60clISrYyZ1NaFagV8ZhG/giQ4Hkdz1F2mq6q6LFCIA7q0duIIPYYlpUFPWg5xXeeIBtN2wkziDaMWOoYYlSdm4k/WF/apnmb67nUfkGL3MtPUEQ5R8Mlbfm781/d+Kh/ALKyv7hyS0Z1F3P7F8ujS5SZC87hfroMt1MO5Ykl7SAHeMZpva8YN1iTRjbRYRBA0CvXCxNKWJxmES8FlF+wv2Vtu8ESrJ5vBUSsj+21sr9yHZ9yUKNwYpUjhPLQg== 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=r8vb3u7VI/HR+/d1dQLzRog9yOuLWVrPsBHB8CuCSOc=; b=FVCz9HUMImUWrib/+kReSv/Io2bszKAHf22y/rIkrsyO1H75OotcDa9qtzjd++ccDx61O/lHs7oNk7w2F5+fp/TmFmTU263NS47Gqq4fvyW+uBtaeFsyoTR/YWZcrdPElVbcy5eGfS7l7LYEtKAvxlXOz52rugNJt4ZRi7hYFfAEyUroWp/6RG7WmiAXSRxoOn+wBkMCvECXJmghNYQ/mzt0DgDjjGaUAI8ojiS4OGFE9zsqLJMyLb8vH4kqCzobUSNyaoaOPYccQ55DPrPt0fSE0SGJu8VWKIWh8FvIf3mSxbKNE7MwU7ElAreqXBLlGFvP2YXYgXg7bemjv/814w== 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=r8vb3u7VI/HR+/d1dQLzRog9yOuLWVrPsBHB8CuCSOc=; b=lf8nCnrjrfbXpsSxzb2VS9pckqgblI9ZwoPQJQCxWKumVEWkGjq1we1q/VxKfmFZb+s3V4LHYTpnVLAa4R+lERsILSdl+1DdhNwUNnTsn4sZDSbZfRVaMe1fkwhz0qZ71W1X0b9s/dcK43tNkrtE2X1KLvgBanvYYXT2S9qqkmk= 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 PH8PR12MB6818.namprd12.prod.outlook.com (2603:10b6:510:1c9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.34; Mon, 26 Feb 2024 16:43:41 +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.035; Mon, 26 Feb 2024 16:43:41 +0000 Message-ID: <1ec105cf-c8d2-4010-867d-30970c25a2a1@amd.com> Date: Mon, 26 Feb 2024 16:43:37 +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> <6246e1f8-dcd4-468d-a05d-2e292f6e1714@amd.com> <6c831a66-f916-48d4-68d9-4c3bcfcb4979@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+z33QNnHpdLvecMwuzmvqy0jR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ffVf/AQ81wspzbfxJ7sYM4P8Mg5kKOsaoUdyA/2qVe cMh1CLUHXF1GlofpGbe1lj4KUJVse5g3qwV7i9VrseA8c4VIZewdIjkzAhmmbxl+8rM/LKBH dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <6c831a66-f916-48d4-68d9-4c3bcfcb4979@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO2P265CA0105.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::21) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH8PR12MB6818:EE_ X-MS-Office365-Filtering-Correlation-Id: dea59209-191d-401e-6b6e-08dc36ea16f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hClgEWCyUWBqofqL/HbbzXbYmIf18qqxjO0qFH2euyzL/JMtJHkvVRAsU/zKUBwv3W2fGu2Elu6YaiJQ5e1pvCRhTzL5tq8XL/2VcJhTNMZVQQmnaulzQO7fpvgRvAkFnDD/u9V//c4WzCjtl+zPvokwvB9j9XaAygGVIUe/esTIPAmsT9Iote4RM2WXlSIYcA6Dq6u13XfrnhA8e2vtULSxrvjZ5MrosGc8p12EV5Qiy6YU5Wb4sn2LSGm76qxhe6OYCtg6dYlEYhugBLy/GHnn/1aR/NdmtPOnOOVFLcQsS+vLKEUaLfNozxxAL5VnukWjRjKZ8W1bA44brvpgNPKKP0hemgHf5j337zT2j0IDznqgpg/Gm8L4n7KrvfdqBmDvNvfnYW0y9agUkveqdMpfWrL9TX1UksPs/XKjFY6hTmQanBdeHcGqWvxWZohmS+bd8ogDoBUkAnZWR3Mawb76NdGwTzvlry1k9XNuNiISprRBlE8LTR4J8lKKkMIxolOJ0gy0sl+ksjIUAyBdkJ9TxfF62tRt+xYjUnSM4QCziJAFAKPm/h/IHyVCaTqgPkuRaWkVUYlq4Il6uYKQVB81mM68ym7aEfyFllj95xARt75iZ0lIoBn7h49IvqT+K5+fn+ZvSJAxcQuzcEC+eA== 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?WnVRU0xhMSswaUtBS0JnMzFrclQ4RGtON0xqSXYvYnlwbHV3UVNuN2c3Tmli?= =?utf-8?B?aUp3RVdMTHl0Z09uUS9JNnJ6MWR2VEdQa0FxL0YxdzZKQ0MydU9ZNGdraURG?= =?utf-8?B?MW94K1IzK1BaZWhaT25ud0c1QkU2ZDJaVnlkaExaUUFyTndCNXJuWGYyMXY0?= =?utf-8?B?SmpHY0Q2Rkhya3g3RDV1bnp0bUhLcDhldEpLSmtKREtXZEd3L2doc1RNNjBk?= =?utf-8?B?VW5lNE5SZWtGanVtdHpzM0lTcm43a21kNFh6SWNNZXJXaW05N1FzRGQxaXpt?= =?utf-8?B?eitQbHlCUWFCZG50TGkydy9oY0d5WC9pZ095dG1RVnovaGlwY0E0NXhBcG9T?= =?utf-8?B?dElCQjFwZ2xaSVRKVDZRVkJBbUhPdVhzNWVQc0EvV3RKbjBGRjRQVCtkMkR5?= =?utf-8?B?UStEQ2dMcnFUd2hHemRQRWdmUjIvR0ltMDJ4azlBRDhBTGpKT1c0MlJlekU3?= =?utf-8?B?Vjd0ZExzT3U1RWt3bWtzKzQ2a2RoU2dBRm5WMzFGVlh6eFVIc1krcGFSd1Iv?= =?utf-8?B?ZENNbEY3N1AwblJvNFc2NlhLaGQ1c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2Mwc0FMRTFXUGJvMmJlUDE2TW1rM0FhbGRIS0NzNjdq?= =?utf-8?B?MVR6T2VpWEpsRU5JcEhlV3czazRiNzBUTy9iVC9sWXZEdExzeGFpQTdQOEt0?= =?utf-8?B?TWVEOGozMHUwQU9Qa0JWTlE0YVM1NEFVQ3pMTm1ySitGSEt4SmVoT3gydkhM?= =?utf-8?B?TXZ5b2pBR0tOd2xqeHlzMWRyNk0xQU54U0k1K0lCTEczVWRXSVprYnloSVAv?= =?utf-8?B?NGE3bGJlQ28zTStDWmJHVHBDUWhITGx6Ulc1OU41NDN3TlpYREhkUVY5ejJP?= =?utf-8?B?a3k4WjdtQWk2VExvcUtpNXg2bVovNmZpdyt5YVlXRVpMaXNuNVBNbVZaRDZB?= =?utf-8?B?SThmbldjazh4SEFXVnRBOHBrSHhqZnoxay9Ea2J2RjhpZDY4MXZ6MHNmVW9N?= =?utf-8?B?SFBNOE9Ld25KazBzNkc0bXB5UXZwa3JQUFNGU3M5MnVHaDMxYjY5NmZvcEN5?= =?utf-8?B?SVRZMS9iR2dKTGVHQ2pwR3l1WGpXc2t4dzk4SFpkOHErTXZzNHhtSGUrSWVJ?= =?utf-8?B?UWpqUWlmeDFnVlNVcjhKSlZJZ3ZIZGEwUDIwdUo2Wk1jNVBONkdmTGZFWmNl?= =?utf-8?B?N3FJbkFXY0h3ODRoVU5nMVowRHQ1cUVjMDUwaE5OSVB0OWZ3Y3VIWk90ZTBV?= =?utf-8?Q?bB5jNlAF9d+Cv3xwXF/BcxUTK?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: dea59209-191d-401e-6b6e-08dc36ea16f2 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2024 16:43:41.7209 (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: NXaFAL8GPWmB0GLMJ1JOHkndQp6vKznT0HGvYhX9W1i3nEDLjo7kqiGWUaj5x2Zo X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6818 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/26/2024 3:16 AM, Jie Hai wrote: > On 2024/2/23 21:53, Ferruh Yigit wrote: >> 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? >> >> > @@ -2470,8 +2523,7 @@ hns3_recv_pkts_simple(void *rx_queue, >          rxdp->rx.bd_base_info = 0; > >          rxm->data_off = RTE_PKTMBUF_HEADROOM; > -        rxm->pkt_len = (uint16_t)(rte_le_to_cpu_16(rxd.rx.pkt_len)) - > -                rxq->crc_len; > +        rxm->pkt_len = rte_le_to_cpu_16(rxd.rx.pkt_len); > > In the previous code above, the 'pkt_len' is set to the length obtained > from the BD. the length obtained from the BD already contains CRC length. > But as you said above, the DPDK requires that the length of the mbuf > does not contain CRC length . So we subtract 'rxq->crc_len' from > mbuf'pkt_len' and 'data_len'. This patch doesn't change the logic, it > just moves the code around. > Nope, I am not saying mbuf length shouldn't contain CRC length, indeed it is other way around and this is our confusion. CRC length shouldn't be in the statistics, I mean in received bytes stats. Assume that received packet is 128 bytes and we know it has the CRC, Rx received bytes stat should be 124 (rx_bytes = 128 - CRC = 124) But mbuf->data_len & mbuf->pkt_len should have full frame length, including CRC. As application explicitly requested to KEEP CRC, it will know last 4 bytes are CRC. Anything after 'mbuf->data_len' in the mbuf buffer is not valid, so if you reduce 'mbuf->data_len' by CRC size, application can't know if 4 bytes after 'mbuf->data_len' is valid CRC or not.