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 46A5843C25; Wed, 28 Feb 2024 14:07:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E2E1B42FDD; Wed, 28 Feb 2024 14:07:17 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2043.outbound.protection.outlook.com [40.107.243.43]) by mails.dpdk.org (Postfix) with ESMTP id 1790E40A70 for ; Wed, 28 Feb 2024 14:07:16 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bOZc0jc7B/wsfCuMQlHHeMpkZMqjjie8XSGyFdcZ6hlXOzQensHHgdmdmp2UN9XXIOjmEQnFhfgOikTD5YNv4VtfK7BXJEJPQu85G/pK29fubuxLQt5DdFtwAFbfuW33lXu5DyJ6qtC3HAgckTQxjxESi6Y7MXGVaP9KCtlZveR6Yb6P+k5y0eRGSXzzMAxFrMtRjS75SAcefGV0C4R+Q1CVEyqvOJL8lEZ6KpgptQDgDrnZDieVReBs4vCERyeSoRpCTI8by3NGzam+iq0J8pNi9chQ5Xjs7Vnvjy6eE82GLzPSjdtKzfv3oP2663Q4qdHEDErkZA8KjKbK91eOxg== 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=DoBMbtDLh2Nog1+hQ9lv6qXNELonG2069oX/WvJnF0o=; b=PNw1qZX9CGaU5J9fMWFbTpf+kE/Ko2zBGVAnCNHEmrAr8i4+pvbsAgQnyBiReKfCax2tBPcg9k73JEXuytippsz8KYtHHD8LtvuUPs5XuwcIw23KKMXrUovuw0IvQa3+q00rJ8X/nx+Ahhi1ML8j4QDOIBtZSX3wdi5CV+6F6xIw8OSOZedV6eV71hf3Qo0uLEzeOP0lS0KekooxmKGS5OUaUHbVUIJNvbvdXLboCyhMlLuRlk5dnLxcuOCAzYD6JnXpz8DqJDWzhGWqaLYbp8f4i9js0agvc1U+whu63JD/OeppRkFDqZNVtmOi4l/+gVeK6L6j4PLh+g94cULjBA== 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=DoBMbtDLh2Nog1+hQ9lv6qXNELonG2069oX/WvJnF0o=; b=B9/49ny3CCFCW18t5gwllhPqcZCJwIl5pWM0LKby71HP6CjYwnGzqPC/bzTE5Cz7S+UP7manyJtKLf7BeTX3+0E4w14kWVxCajEoxT1Wi76DqZ169WmnA8sOOImTQo8oLkak4j+sWQBZpxja1OxQm+2FF030TC220Oy85TML7EA= 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 MN6PR12MB8590.namprd12.prod.outlook.com (2603:10b6:208:47c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.39; Wed, 28 Feb 2024 13:07:13 +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.039; Wed, 28 Feb 2024 13:07:13 +0000 Message-ID: Date: Wed, 28 Feb 2024 13:07:08 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net/hns3: fix Rx packet truncation when KEEP CRC enabled Content-Language: en-US To: huangdengdui , Jie Hai , dev@dpdk.org Cc: lihuisong@huawei.com, fengchengwen@huawei.com, liuyonglong@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> <1ec105cf-c8d2-4010-867d-30970c25a2a1@amd.com> <7e376ab0-67a0-4a3c-a528-7928077e7b56@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+z33QNnHp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h+QOrHGZvpWXLTmffVf/AQ81wspzbfxJ7sYM4P8Mg5kKOsaoUdyA/2qVe cMh1CLUHXF1GlofpGbe1lj4KUJVse5g3qwV7i9VrseA8c4VIZewdIjkzAhmmbxl+8rM/LKBH dZUMTzME5PFCXJIZ83qkZQ795MTe2YScp9dIV7fsS5tpDwIs7BZNVM1l3NAdK+DLHqNxKuyO 8Zk= In-Reply-To: <7e376ab0-67a0-4a3c-a528-7928077e7b56@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0069.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:153::20) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|MN6PR12MB8590:EE_ X-MS-Office365-Filtering-Correlation-Id: 555c5653-e08c-4f9d-3c42-08dc385e2df3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aw7AguRy8SlLaOApvhbJ/nmhXGWLZiuombNuMf3tsv8tgX/9gKic8mMjv9rO1V6dFEHfrjCczFOy63RXp/jcC7K4nNeMREz3A3rEVhPmnX50SoQkQsWL6C+k1h/ENjLYJ7Orafim2uxqDVQCX8B/7AFAgbOGHkaGnUj2VfC/LxGEKZXwBVb2JUfhSwTtpLT0aAPn9g2PS7JOcbmRiDIZbf8I58N0zGIq9zoXZQF7Tag0IOrDviVpXlDOsy7Cy54fabIjDYTSf2UXwsyhI6mzyCAXUs2PK4oqr9EwF3hg020kOnO5+nSBWQVauYEIhqwoQgUeQG4bs4QWrsWsQwqZMnF6W/Ard/iwCkLuUM8NsdX7LdKg8II5S2J8Kun1U4fGh4X4I2fXvNudwm5szWMcpcBDzHDjqFQv1CkE3DAAz66I4ocu5Z6ZNgr6GnrwqxeOlQuTffSRbbVgXxbVpMzeo0xEATrheGwf3aharHwBwEnUlkGBBPfELfsjAXip3xX/37XJSPIGcRfGcz666HuJWPWCEJSZS19hEOYmbOASg3Yc18EJFGFWa4dhWhewkcVDy4FfvQaIh8nvgGrpAVvFWA== 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?WmFaVjRMN014cDNRcWI5eGM3ay93OTBLOTQ4dzkvbVEvSWhMY0hHVHdIWElC?= =?utf-8?B?Q2RHSlMwaUZJNUpWc2hMczJoeHRDVU9WN3Y3YlhYZkYzbDZ6Ris0TlR2T21r?= =?utf-8?B?d2VLd2U1QzB6bmd4blFxWlhSbWRDbUU2R3lkWUp2ajVRcWFPNHNTNDhsNWxs?= =?utf-8?B?YjhDQmxTNUdtSi96S0xLdVVoNnlnazV4VVA2bXVSZTFYeUNaR2JnR29GWmNB?= =?utf-8?B?RnVnTElublBEMEdDV3dSbjV5YkorQUpiMkl1bTJwQ3VnT1V6eDl5UWpDTFlk?= =?utf-8?B?T25pYjNMVEVyaFdyVE1EVDkraGF1Y1JZV2srQUd1T2dHTjI3aElrbC9vRGhk?= =?utf-8?B?RC9DOEJFYlZLdUlNejFFaDl3WUhOaEhvc0hCbFFDNmtPOGxEbWxrNm5rSEpj?= =?utf-8?B?R0FZVEtMLzdUbzIyWmp5Qkg0VXgxblhFSkRMUUNCRDNseDVYOVh3VXhqSHZx?= =?utf-8?B?VkJrdEtmU3c2OVBYQ0thRlU4S0pKUllhZFE5UzZMRXFpemlhY3RMbk1WZFI2?= =?utf-8?B?a2RFNzBXU2poOU4rcm9lVjM0eVZqL25qdDJDbTUyT2czMnQxTzRMUnhIUFVr?= =?utf-8?B?VlRDcHF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f-8?B?UlEzNXQwWkdEWGZKMzNtbW5FMnNDZElZV2R0R2tWYnk1eG92S2JhRlN2cTV4?= =?utf-8?B?TktKWWFSS2NSRkx2cmhwSUFYMHJqK0o2anFJajFkeXFwSHE5YjU2VWZDdy9q?= =?utf-8?B?K1YyNGxESThUSHpINHJ1OW51Ymx4ZE5lLzhzd2JOeENFOUpWOWc5UzdHcGE3?= =?utf-8?B?c2ZOQjloYlhHSFNGNUd6a2huLzVJdWptbnc5Mm5MblhsT3NMazZYdVQ3VWZC?= =?utf-8?B?aW5uZDI3OG1oeVUrQVJvd0VmVTBCaVlOQmdnYmJKVHpOZHZDVHJNVlJtcG5D?= =?utf-8?B?RFRkTXU3RU1HYjIyVytQdWNKdUxlMlhnRXVrRUhHVmxzek8yUEZiQ0VqY1dE?= =?utf-8?B?OGtHM2RXV2lXdU9VbjhXU2ZFT1ZpRmJzK3dyS2xjbTZjQkxqY0NpN3I5QU1s?= =?utf-8?B?YTJZY0REMWwxZktzMGN4MHVRMDNLUWVYOWhTU2IyejQ1U1Y2dnZ4TXEyZ2tR?= =?utf-8?B?Yk00eVg0R0JkTE1aVmtuclprRmFvM3JoR09yYklsT2MzRGxtSGFDUVNDNnQx?= =?utf-8?B?WVVIU1didzltRzdpNE9OV3NlRVplZVpMYU5xNGJ0SXZ0YStrRXh4bS9jendY?= =?utf-8?Q?WfHXC/blF8yWpN/yLqyRWWnbq?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 555c5653-e08c-4f9d-3c42-08dc385e2df3 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2024 13:07:13.0919 (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: /xSZ1fUqovlCa3kqgbpLJtQ1L42sD8TKmZUmi571XkiyKzIw/rEUXxVbE9XCgZwO X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR12MB8590 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/28/2024 2:27 AM, huangdengdui wrote: > > > On 2024/2/27 0:43, Ferruh Yigit wrote: >> 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. >> > I agree with you. > > But the implementation of other PMDs supported KEEP_CRC is like this. > In addition, there are probably many users that are already using it. > If we modify it, it may cause applications incompatible. > > what do you think? > This is documented in the ethdev [1], better to follow the documentation for all PMDs, can you please highlight the relevant driver code, we can discuss it with their maintainers. Alternatively we can document this additionally in the KEEP_CRC feature document if it helps for the applications. [1] https://git.dpdk.org/dpdk/tree/lib/ethdev/rte_ethdev.h?h=v23.11#n257