[dpdk-dev] [PATCH v2] ethdev: add new offload flag to keep CRC
Thomas Monjalon
thomas at monjalon.net
Fri Jun 29 01:46:52 CEST 2018
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?
More information about the dev
mailing list