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 0F5BD45DCF; Fri, 29 Nov 2024 18:12:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DF920402AE; Fri, 29 Nov 2024 18:12:11 +0100 (CET) Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by mails.dpdk.org (Postfix) with ESMTP id 6D4F64014F for ; Fri, 29 Nov 2024 18:12:10 +0100 (CET) Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-7ea8c4ce232so1881302a12.0 for ; Fri, 29 Nov 2024 09:12:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1732900329; x=1733505129; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=4jgZQq8+45oWWq4OI8VLadcZ98IB5klygB695YZcH7A=; b=oacEiPbR3Lnk3fffPRMZZSIWM8dUTzbv+QrlvpdVF+boN0IULrXxeablte37joqowd iVVX3QCHZNCtXWAguOu8yW/crymyXfy/E/ScwwN6rL/u5nH+bsJ9s2SW0tpfQuCbW9VV uiFGpLRccKUY4XYVzLF8Q4Pa8OjPZmq5xMBaYEzOvhfBXReDnQkCyNG2kuCdYpjf6ncp yKC4AdtpnESZxxOxxyLqURfQs1kO0/r7c0Vw7/7mac7N9rLXTTdyVPjv61b+tKyMSC3i h9chNIhBh22xK2/5qMSXpPgjEA8EX32Kf3opvBGGREiscjcNuxjownqnD30f4ZOki+hQ R4kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732900329; x=1733505129; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4jgZQq8+45oWWq4OI8VLadcZ98IB5klygB695YZcH7A=; b=vZRRO+rfVLSiXtWVdJEJ5BDqYFjwaKIsSDtYJ/3pcFOEypDRU/hpX6tibFdNUJbrD7 rE3NJIviN/L0HW/V6UQdm8J+H7N35F8QHXlgZ+Y/oOaG8aFxGXpPO+VH7QbotI8PaFLR Q+KVWWMCjXR0/HxP2REdXBxNTcr/gdOU9EliujmqNU0idmqwIubSAkh5reGJP/AHodtO yUUkj1XYmGZiHmW10XC5zbW0Ou+RBgm1Qj1kcbGTRg4lcUgWsWF3K1YbrpeskeDtsVhH R9Vq4XuYcW87h2CQEx6e9RB7vhxYxWYunwnN5JRaV0aaTef0d0oG+g6GvSkpksAPt7BH 6M7A== X-Gm-Message-State: AOJu0YwyeYelj+8ASTyYb2/yVzB5jwViEFke8HzakQHle57gh6/9aMam OgTTcf0gMBF52YGXRu+CBnErgpyYwMOSay9vW5D0/IKTliRli4Ps+Mflp6r98EI= X-Gm-Gg: ASbGncuUGcSzwdkyWll+0QOGKALhmnPXzIRSw26HHx520PVmULVA6ljT+lay4rnMKHY hQM7/rQiJznKsMCzENr9IjEFrYBitm1zpbjxPlxep40tsrCzNUtasiBzz55IFBGW5jDBTnUx5PL umjdfPtRhYjaBYGKihJkWxu1cmxifrABfWtvCax78aIX5xZKox6+/mIftH6DQZCPFkT/kc3YBge clFWB5XUyV2bF0R9SBZyvqQsWcN4tJxoxJ3YMyHQUmmIo0/zI3UtIeaeoOKCC0o2kfdFBBY5Jre 8cGAhH3pcNEUstANnTq9BmiTL6k= X-Google-Smtp-Source: AGHT+IHrTpH9VAtxvKRfSgY4zC0pPjQKQoG/1zSc8ufygL7eyU4zBetnUq35j1wS75TJBc85euMsJA== X-Received: by 2002:a05:6a20:e613:b0:1db:ec3e:c959 with SMTP id adf61e73a8af0-1e0e0ac3181mr18954585637.10.1732900329250; Fri, 29 Nov 2024 09:12:09 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7254184952csm3827250b3a.185.2024.11.29.09.12.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2024 09:12:09 -0800 (PST) Date: Fri, 29 Nov 2024 09:12:06 -0800 From: Stephen Hemminger To: Jie Hai Cc: , , , Wathsala Vithanage , "Min Hu (Connor)" , "Wei Hu (Xavier)" , , , Subject: Re: [PATCH v4] net/hns3: fix Rx packet without CRC data Message-ID: <20241129091206.02a39633@hermes.local> In-Reply-To: <4a5fa848-e4f4-33ab-5806-ad90ddad9d3f@huawei.com> References: <20240206011030.2007689-1-haijie1@huawei.com> <20241127100807.683461-1-haijie1@huawei.com> <4a5fa848-e4f4-33ab-5806-ad90ddad9d3f@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Fri, 29 Nov 2024 09:36:43 +0800 Jie Hai wrote: > > + > > +static inline void > > +hns3_recalculate_crc(struct rte_mbuf *m) > > +{ > > + char *append_data; > > + uint32_t crc; > > + > > + crc = rte_net_crc_calc(rte_pktmbuf_mtod(m, void *), > > + m->data_len, RTE_NET_CRC32_ETH); > > + > > + /* > > + * After CRC is stripped by hardware, pkt_len and data_len do not > > + * contain the CRC length. Therefore, after CRC data is appended > > + * by PMD again. > > + */ > > + append_data = rte_pktmbuf_append(m, RTE_ETHER_CRC_LEN); > > + > > + /* CRC data is binary data and does not care about the byte order. */ > > + memcpy(append_data, &crc, RTE_ETHER_CRC_LEN); > > +} As mentioned previously. Including CRC in the packet length (pkt_len and data_len) is not the current behavior of most drivers. Therefore hns3 should follow the precedent of other drivers and put it past the data. In the future the KEEP_CRC flag needs more work to be useable. It needs documentation and flag in mbuf (similar to hash and checksum) so that application can no that it is present and valid. Please resend the patch as a bugfix that puts crc after the data.