From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v2] ethdev: add new offload flag to keep CRC Date: Fri, 29 Jun 2018 01:46:52 +0200 Message-ID: <2254507.T9honQIVyD@xps> References: <20180619180230.72585-1-ferruh.yigit@intel.com> <20180621131500.22460-1-ferruh.yigit@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Neil Horman , John McNamara , Marko Kovacevic , "John W. Linville" , Allain Legacy , Matt Peters , Ravi Kumar , Ajit Khaparde , Somnath Kotur , Rahul Lakkireddy , Wenzhuo Lu , Qi Zhang , Xiao Wang , Beilei Xing , Konstantin Ananyev , Adrien Mazarguil , Nelio Laranjeiro , Yongseok Koh , Tomasz Duszynski , Dmitri Epshtein , Natalie Samsonov , Jianbo To: Ferruh Yigit Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 514687CD2 for ; Fri, 29 Jun 2018 01:47:02 +0200 (CEST) In-Reply-To: <20180621131500.22460-1-ferruh.yigit@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 21/06/2018 15:14, Ferruh Yigit: > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -939,6 +939,11 @@ 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 keep CRC > + */ > +#define DEV_RX_OFFLOAD_KEEP_CRC 0x00010000 Can we convert this comment into a doxygen one? > --- a/lib/librte_ethdev/rte_ethdev_driver.h > +++ b/lib/librte_ethdev/rte_ethdev_driver.h > +/** > + * PMD helper function to check if keeping CRC is requested > + * > + * @param rx_offloads > + * offloads variable Maybe more precise: "offload bits to be applied" > + * > + * @return > + * Return positive if keeping CRC is requested, > + * zero if stripping CRC is requested > + */ > +static inline int > +rte_eth_dev_is_keep_crc(uint64_t rx_offloads) I suggest a different name: rte_eth_dev_must_keep_crc > +{ > + if (rx_offloads & DEV_RX_OFFLOAD_CRC_STRIP) > + return 0; > + > + /* no KEEP_CRC or CRC_STRIP offload flags means keep CRC */ > + return 1; > +} Maybe add a comment to explain how the function must be replaced by a check of bit KEEP_CRC in every drivers for 18.11?