From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shahaf Shuler Subject: Re: [PATCH v2 2/2] ethdev: add new offload flag to keep CRC Date: Thu, 29 Mar 2018 05:38:02 +0000 Message-ID: References: <20180320112631.107105-1-ferruh.yigit@intel.com> <20180321194730.52068-1-ferruh.yigit@intel.com> <20180321194730.52068-2-ferruh.yigit@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: Ferruh Yigit , Neil Horman , John McNamara , "Marko Kovacevic" , Thomas Monjalon Return-path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50089.outbound.protection.outlook.com [40.107.5.89]) by dpdk.org (Postfix) with ESMTP id B61F02965 for ; Thu, 29 Mar 2018 07:38:04 +0200 (CEST) In-Reply-To: <20180321194730.52068-2-ferruh.yigit@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Wednesday, March 21, 2018 9:48 PM, Ferruh Yigit: > DEV_RX_OFFLOAD_KEEP_CRC offload flag added. >=20 > DEV_RX_OFFLOAD_CRC_STRIP flag will remain one more release but default > behavior in PMDs is to strip the CRC independent from this flag. >=20 > Until DEV_RX_OFFLOAD_CRC_STRIP flag is removed: > - Setting both KEEP_CRC & CRC_STRIP is INVALID > - Setting only CRC_STRIP PMD should strip the CRC > - Setting only KEEP_CRC PMD should keep the CRC > - Not setting both PMD should strip the CRC We cannot have such default behavior, it may break existing applications. The API of ethdev offloads says (even though it is not well documented) : = DEV_RX_OFFLOAD_CRC_STRIP (emphasis the STRIP).=20 meaning, if set -> STRIP, if not set -> don't strip. I am aware to at leas= t one application which wants to have the CRC, and for that purpose it natu= rally don't set the offload flag.=20 The fact some PMDs lack the ability to toggle the CRC stripping should be e= xposed in the "limitations" section of their related guide.=20 Up to here, this is the behavior as defined by the API.=20 Now, we want to change it, and I think it makes sense. However I think we s= hould take similar approach to what we did with the ethdev offloads API: 1. at first stage a new offload flag is exposed DEV_RX_OFFLOAD_KEEP_CRC and= implemented on the PMDs.=20 2. there is a conversion function on ethdev. Which for example converts ~DE= V_RX_OFFLOAD_CRC_STRIP -> DEV_RX_OFFLOAD_KEEP_CRC for the PMDs. 3. deprecation of DEV_RX_OFFLOAD_CRC_STRIP for applications and remove of t= he conversion functions.=20 More below, >=20 > Signed-off-by: Ferruh Yigit > --- > lib/librte_ether/rte_ethdev.h | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.= h > index 5e13dca6a..ab1030d42 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -939,6 +939,9 @@ struct rte_eth_conf { > #define DEV_RX_OFFLOAD_SCATTER 0x00002000 > #define DEV_RX_OFFLOAD_TIMESTAMP 0x00004000 > #define DEV_RX_OFFLOAD_SECURITY 0x00008000 > +/* Invalid to set both DEV_RX_OFFLOAD_CRC_STRIP and > +DEV_RX_OFFLOAD_KEEP_CRC > + * No DEV_RX_OFFLOAD_CRC_STRIP flag means stripping CRC */ > +#define DEV_RX_OFFLOAD_KEEP_CRC 0x00010000 Need also comment on DEV_RX_OFFLOAD_CRC_STRIP to say it is deprecated. > #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | > \ > DEV_RX_OFFLOAD_UDP_CKSUM | \ > DEV_RX_OFFLOAD_TCP_CKSUM) > -- > 2.13.6