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 5D30543A9F; Wed, 7 Feb 2024 15:15:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EEB3B40295; Wed, 7 Feb 2024 15:15:14 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2078.outbound.protection.outlook.com [40.107.92.78]) by mails.dpdk.org (Postfix) with ESMTP id 2764F40279 for ; Wed, 7 Feb 2024 15:15:13 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OjRDuqRmlKIGQur/fXlSuVTZxcQJHZEIelOx5CQzcs/IRQv9fkpmHH3wu+MB82NyIPy2uUGJ5KoLOnz9lA0NWLG4SkiFjo8avFR/PTiCXzGbXhwmQuAcdjwaZNxno0y+G0OgfjO+PXrmHTE9AanIEKxj6BnTQPYV4LKYcB7rkJNecGCPVxYmb+78gbMwtpG7SOaVuz5OiWio+dtQaujiKtlwl0SVvntgaVV5Fio7aQZ5EuMzECtuos6jW9DLOfmE+otHnTh4aZWFAn+hD8ZBqmdMpbBlp52mbK+bJ90VzZRFB/+rnREhXjhu6SG8IeX97fNSUl5GqShDzDlQOUxqMw== 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=N8/VyAczacRT3CDIyfXOaBwBDcsUSOklK/YDkKUO76o=; b=l8bVUo801I1Y/nMeNCR5U/8hx1q8X8CUobeEDQz7PbWp9QP/A+Um5/BcAQBz48wYmpa0X8FGZTK29pJg4oObHTo5GlnAvx6sBujG70e3XWHmc2eL4nN02G2tb/VYdb9NTON7HUWhtDGeRqfwcySwmLdAKBqrUDGKIklo95bcdefpksgioX/25aCQWRDDPOeG3d0Bx9MrxA/1s8Yv42mKQjMClbv7aGJccWePJbq3vywYTZWdjNLBWeWkXGgKz/t9DXAvfKuWbLkuc8+mgEiZff94caV5w1rGk0Wi1+qLorvZmwQmR5QHLCjSpuedWyvHUHSBuMObFSs4fxbFDj23Yw== 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=N8/VyAczacRT3CDIyfXOaBwBDcsUSOklK/YDkKUO76o=; b=TYswqXLyE+vvXzZndho8Ta3wsLy9dLzIVQ99nNhz5cjB0Qlsye7dQzNUauv8Y2px6fYSCPtIl1TCMzNpNOLxOn/1BD48vXDqrLqQ925UOlFYlkLl1XAzOFM/h2uOuUByI0E4Jpjo/s9J1E2Dx9UpofHKCjOMEYYV6FAsFMziJuY= 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 CYYPR12MB8939.namprd12.prod.outlook.com (2603:10b6:930:b8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.17; Wed, 7 Feb 2024 14:15:09 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::815a:45e6:cf5e:479f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::815a:45e6:cf5e:479f%4]) with mapi id 15.20.7270.016; Wed, 7 Feb 2024 14:15:09 +0000 Message-ID: <11b8feac-4a9e-4d2c-8995-ed492d684750@amd.com> Date: Wed, 7 Feb 2024 14:15:05 +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> 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 AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCKKm/6BQJkdyEEBQ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S5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <20240206011030.2007689-1-haijie1@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0363.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a3::15) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CYYPR12MB8939:EE_ X-MS-Office365-Filtering-Correlation-Id: a49266ff-d26a-4683-e4d6-08dc27e7310a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 349c1xA6Fcx89LEi0Q1pQ08UWBK/P7AcrzNsgstjM4dPE5bkPvrpQqLzXHtQ6030XWo7XjIsdTonBdG1omWaz2FW6uw+/IDqR7pby7hA1xz1aFh9kM3MI425JlxUOwPWg7QYNkbEKdxOWBDoa6DPoEUg5uioZgGp8grjd7Wac89+Cjq/bfiyUPLsjpz4vvhP0d7ACYNBYM9KodaY7wjK9mOfk2ITakd6ZnpydxxurdebmsTbYbE8KkG3TK/txNTYboy+fWOBUOiyW2kM2E/9SrkTcn7QDYdQ3xgLObf8XtlpBbTO7cIQVUQFmjvYW0JlONMgsxRL2pJd+jqaYX3cdB7KORg1HMzXEs1p5BTikZYiPMVMofiK+3lIbnnLkL/QWVTOZuV/EEO/iomOm95hSDN75TV9vkQBiMNMr7k34FLy8Gw/4SgiEmpAPHq31Q2P8IfBJEg+H3WcCm/Rm8KceOywyGFu8Tt/By/sQs2uBsLlDckWSPO9chjWlRN+1eTeGcwJJZckhFDRm0BuYe0djCZ8QpZrDabk4TadFRw8KXte73TwtsrDFrV29kKROyvB+881BH1zWKtJuq5N3bTtBugZinsBPqWflTv7Z+QWwvQsmm4ys/Xk/QZs21yxV56XLQzYDzxgSsW0+GajNpfRJw== 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)(376002)(136003)(346002)(396003)(39860400002)(366004)(230922051799003)(64100799003)(451199024)(1800799012)(186009)(66946007)(2906002)(6512007)(41300700001)(66476007)(38100700002)(5660300002)(8936002)(4326008)(6486002)(36756003)(8676002)(66556008)(86362001)(6666004)(44832011)(31696002)(478600001)(2616005)(6506007)(316002)(83380400001)(26005)(53546011)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OHhIdElySGE3eVJyY1JHY2prRVpIaUpubjJ4ZEQ4aU5yQ004OW9Xa1cyR2FH?= =?utf-8?B?SWhSQ01UTlE2d2p2Ung1RXVkbHZ4T1N0RGZtRFJqc2hLL0QycldPcXJNZURP?= =?utf-8?B?aGU2SEtybFVTSDFQK3hhYkZGWDcwL1lYUmkvVTRVSjBaRDI3NWg3OXpaNU5I?= =?utf-8?B?NFRkOXdJSjJrcGVTcUhlMWh3cmltdEpIS2RBTmRBSHRHV0JyK0JVMlNxeUx0?= =?utf-8?B?d0RLZUNNM1VRMGoyQXFwc1JvOGYvd3lNVWJmWmhPSVBWWnNLdjlhUHhzNXRS?= =?utf-8?B?SjlWRE9WMEZHa0VEbEVqNGZnK29lWWVzTWxSV0hic0pRWThmc0NaUjZJVU1y?= =?utf-8?B?a0RkOUJ2NUMvQ1FlUFowdi9zNGppckFQd01ZcTBsaUViM0plMFBmRHpzK3Vw?= =?utf-8?B?eWtXQXMzYXZyczZGWE5veXh2dWtaT2l0b2w4QWdRWStGeUQ4OUhqdE0wNS9C?= =?utf-8?B?RnVaQnFaNFdwUHN1U0NNTkJ0anM1blBIMkQyN3hUU2gwWlhac1V6V1lVaTRy?= =?utf-8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liT1ErZC9y?= =?utf-8?B?TU1YQ3l2RlJKUnJGQXpiQ0FRd05pOTAraGNpd25NcnZYZVFlSmVldzFHaG8w?= =?utf-8?B?KzN0d01HYXdaTXY5MGpkZ09jTEhOazhvVm1CcEg2M0RReWhDbmUrVk01U1lz?= =?utf-8?B?djdoV01mQ1VKem5GbjhWUW9LM0swMElwT3RRMHBRcWhDU1NaMlNFaHd2RDBO?= =?utf-8?B?MC84bkNhZGFYSU1uUklYQzNjRWZoNjR2bFc2cEdnMk9BVlI0ZTl5R2h0bjAw?= =?utf-8?B?azJRVUozUkduQWNvVGNvVWZLL0phZUhidFh4RDRPaksrZlN0d09qTDdrNDc2?= =?utf-8?B?WTVHNktTUFZpOXA1b09wTmtQK1ZBTGFnUk41SXVGNENJU0FKbkJmSEJta0tW?= =?utf-8?B?bEJWU0F6SmpFT1hETlpkQzVLUWJ2ZFplZGdhUytBcEFBd01HU0xwbklnWE92?= =?utf-8?B?NlpvKzRsaXhZMzQ1R2RzWHF6Z2c1MGREdldBV21NTExyQllRQ0xCcE9oNFVi?= =?utf-8?B?YWVNcDA5bmNHcWRMT2pBVGFMMjRuYVBrUzlCNUZQakZwMnpXNEEvc1ZFRnJF?= =?utf-8?B?aW41emE1UEhLVXhSS1ZuUHA2RTY2dGU3Nm5oRTFVMG9ucXFSdXlqa2lIRTlG?= =?utf-8?B?NmVTclU3ZEVFbkdodFpKUFdRcjFMTzIwaGQrZjhxQnMvMk5XYmlxcTlNcFBK?= =?utf-8?Q?pPcVaykhkBobBPzIs8oxXdelt?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a49266ff-d26a-4683-e4d6-08dc27e7310a X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 14:15:09.6471 (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: xL3vSKNyXzGJcWv9cwwlASUYncGJYbmjuLj/eDXVqeWnEQjDv5dloO7e27dnlVBQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8939 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/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. Unless you have a specific usecase, or requirement to support the 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.