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 C3F6545D7D; Fri, 22 Nov 2024 18:35:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5DB85402CE; Fri, 22 Nov 2024 18:35:16 +0100 (CET) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mails.dpdk.org (Postfix) with ESMTP id 10F0E402C3 for ; Fri, 22 Nov 2024 18:35:14 +0100 (CET) Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-723db2798caso2188608b3a.0 for ; Fri, 22 Nov 2024 09:35:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1732296914; x=1732901714; 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=2Wcqaz1jTO/GGbVmO9q2199E31B4QUMy3syT7/0fYtU=; b=FZp255xiEl+cM83fTkQk4HMsI7eZ+CkqhZ0uLSBa66zZWYZJJIooNyfgkqq+j+Z7ip 6CA8mqKD1oK9qOtXWYewCo2D6cLi7KcNw1O9eNtE4M9yz1CnqsIuQk4DQFesQL8K7XBH 0w0qDRLFY8209SP2306Ucem1UBBHEzbeyrN8DMLq8sGORI76oAUXdUbmH7LeUjGJ6iC/ Az5OfNZBOPoFIV4OoO1LwpolgY49rsAr07R2bTK0py/ABnwotUuxenIqEeTjq5wzqLec 3YvZ0foBbH5X81846S48qbYCJn3J3nR8pQfge9LmOpxE5Xh0214iqNYzIxwoJO0X1WD9 pLNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732296914; x=1732901714; 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=2Wcqaz1jTO/GGbVmO9q2199E31B4QUMy3syT7/0fYtU=; b=WBLdrtQOJ3pQQmDx8EzRmFiTGK0xwwUVw3Qg2zXh6G0PQeiyO0HT8Y+tbhGTz6KtT+ Km/z/TGHk4X6mFVBFB7vKlv17g5LZjstcG3p2knjozYLgEVhdk9TaMif1ig44cxXFf7o tKmhQj9yDguRSycVAHteq4NP9OrErdhbNRFoRW6CSzsKG+bNOHdP7fyvxHLsTi/LoddO M8ECaIkzqgxQvvDFPsDJnH6w4UIRSCuU42HI/1Bhl2pKsYyvHJr0xcMaDf1X51wkDTsJ h7IponZv3zVg8n6noNNH0lq/J8XtXp/D3muijn/Tw+qKBKS/7lMn9ZEc97YFR62Dz3jh 4COg== X-Gm-Message-State: AOJu0Yw93ZGfdRh63Jg7CkMRDp37Gbnw/ZDW3qrN/FDDSICnmtEYa6Vk vL3DIbozD85WFBYSjByKQZkO8iKuvSjZdHZGlx9G6pKrY2A9ffKlDhqfkQtmQdE= X-Gm-Gg: ASbGnctzZQXeTALbBsf7+5hYSNOdLsniDrDQuHbZY9jvKlSR1adloaZm/2+Pxh1pCL5 s+BOJWKbACnuKj8/WjKJ7nAgh50e7skRpAIUH7oGIVSocoHeGPyn+GNixLVMApBkOPGsznGHIXj Fj+WNsRhe8nt8wju67Cqt7Su7qxETr6rFmSvMzTndNmnryztJQNusbf9wc2VvQpGbQqnZMyaWT5 09JvhZqCLL5Mui4qbuM673zVKncoijPodkd75HNOCSGnbxx+x7QHAhReHg/deW8pFUxLFwqSD0G +Ss5BE5+d1n+H5GDKN1BSj730Ws= X-Google-Smtp-Source: AGHT+IFd2cm82zJmQm+iDwoCjVY7+65x2ofDuxySttHYePYsmWk3b0MPs1eunVZDpq3Bd+hAyqgNhw== X-Received: by 2002:a05:6a00:1789:b0:71e:587d:f268 with SMTP id d2e1a72fcca58-724df3c280cmr4619215b3a.4.1732296913979; Fri, 22 Nov 2024 09:35:13 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7fbcc3dde07sm1919125a12.59.2024.11.22.09.35.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Nov 2024 09:35:13 -0800 (PST) Date: Fri, 22 Nov 2024 09:35:10 -0800 From: Stephen Hemminger To: Jie Hai Cc: , , , , Thomas Monjalon , Allain Legacy , , , Subject: Re: [PATCH v3 1/3] ethdev: add description for KEEP CRC offload Message-ID: <20241122093510.51411f0a@hermes.local> In-Reply-To: <20240719090415.1513301-2-haijie1@huawei.com> References: <20240206011030.2007689-1-haijie1@huawei.com> <20240719090415.1513301-1-haijie1@huawei.com> <20240719090415.1513301-2-haijie1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, 19 Jul 2024 17:04:13 +0800 Jie Hai wrote: > From: Dengdui Huang >=20 > The data exceeds the pkt_len in mbuf is inavailable for user. > When KEEP CRC offload is enabled, CRC field length should be > included in the pkt_len in mbuf. However, almost of drivers > supported KEEP CRC feature didn't add the CRC data length to > pkt_len. So it is very necessary to add comments for this. >=20 > Fixes: 70815c9ecadd ("ethdev: add new offload flag to keep CRC") > Cc: stable@dpdk.org >=20 > Signed-off-by: Dengdui Huang > Acked-by: Morten Br=C3=B8rup > Acked-by: Huisong Li > Acked-by: Jie Hai > --- > lib/ethdev/rte_ethdev.h | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 If you put the information in doc, users would see it. Something like this: diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst index 0508f118fe..63b0331b06 100644 --- a/doc/guides/nics/features.rst +++ b/doc/guides/nics/features.rst @@ -470,8 +470,9 @@ protocol operations. See security library and PMD docum= entation for more details CRC offload ----------- =20 -Supports CRC stripping by hardware. -A PMD assumed to support CRC stripping by default. PMD should advertise if= it supports keeping CRC. +Supports including the CRC in the received packet. +A PMD is assumed to support CRC stripping by default, +PMD should only advertise if it supports keeping CRC. =20 * **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:RTE_ETH_RX_OFFLOAD_= KEEP_CRC``. =20 diff --git a/doc/guides/prog_guide/mbuf_lib.rst b/doc/guides/prog_guide/mbu= f_lib.rst index 4ad2a21f3f..bea9111ba4 100644 --- a/doc/guides/prog_guide/mbuf_lib.rst +++ b/doc/guides/prog_guide/mbuf_lib.rst @@ -207,6 +207,18 @@ The list of flags and their precise meaning is describ= ed in the mbuf API documentation (rte_mbuf.h). Also refer to the testpmd source code (specifically the csumonly.c file) for details. =20 +CRC offload +~~~~~~~~~~~ + +Normally the Ethernet Cyclic Redundancy Check (CRC) is *not* included in t= he mbuf. +Some Poll Mode Driver's support keeping the received CRC in the mbuf. +If a packet is received with keep CRC offload setting: +- the CRC is in included in the mbuf pkt_len and data_len +- the CRC is present but not checked +- the mbuf should not be directly transmitted or the received CRC will be = include + in the transmit + + Dynamic fields and flags ~~~~~~~~~~~~~~~~~~~~~~~~ =20