[dpdk-dev] [PATCH v3 1/4] ethdev: add the API for getting burst mode information

Ferruh Yigit ferruh.yigit at intel.com
Mon Oct 14 18:39:09 CEST 2019


On 10/14/2019 4:35 PM, Haiyue Wang wrote:
> Some PMDs have more than one RX/TX burst paths, add the ethdev API
> that allows an application to retrieve the mode information about
> Rx/Tx packet burst such as Scalar or Vector, and Vector technology
> like AVX2.
> 
> Signed-off-by: Haiyue Wang <haiyue.wang at intel.com>
> Acked-by: Bernard Iremonger <bernard.iremonger at intel.com>

As far as I can see Bernard has ack only on testpmd patch, 4/4, not for reset of
the patchset, can you please confirm this offline?

> Reviewed-by: Xiaolong Ye <xiaolong.ye at intel.com>

<...>

> +const char *
> +rte_eth_burst_mode_option_name(uint64_t option)
> +{
> +	switch (option) {
> +	case RTE_ETH_BURST_SCALAR: return "Scalar";
> +	case RTE_ETH_BURST_VECTOR: return "Vector";
> +
> +	case RTE_ETH_BURST_ALTIVEC: return "AltiVec";
> +	case RTE_ETH_BURST_NEON: return "Neon";
> +	case RTE_ETH_BURST_SSE: return "SSE";
> +	case RTE_ETH_BURST_AVX2: return "AVX2";
> +	case RTE_ETH_BURST_AVX512: return "AVX512";
> +
> +	case RTE_ETH_BURST_SCATTERED: return "Scattered";
> +	case RTE_ETH_BURST_BULK_ALLOC: return "Bulk Alloc";
> +	case RTE_ETH_BURST_SIMPLE: return "Simple";
> +
> +	case RTE_ETH_BURST_PER_QUEUE: return "Per Queue";
> +	}
> +
> +	return "";
> +}

Hi Haiyue,

The string representation of a vector mode is a data, and I think better to keep
it separately as an array instead of keeping this information in the function
and make the function use that data.
So that when new type are added it won't require to update the function itself.

'rte_rx_offload_names' and 'rte_eth_dev_rx_offload_name()' is the good sample of
what I mentioned above.

Thanks,
ferruh


More information about the dev mailing list