[v1 03/12] net/enetc: Optimize ENETC4 data path

Stephen Hemminger stephen at networkplumber.org
Mon Oct 21 02:06:58 CEST 2024


On Fri, 18 Oct 2024 12:56:35 +0530
vanshika.shukla at nxp.com wrote:

> +	while (likely(rx_frm_cnt < work_limit)) {
> +#ifdef RTE_ARCH_32
> +		rte_memcpy(&rxbd_temp, rxbd, 16);

Hardcoding size of the rx buffer descriptor is bad idea.
Why not just use structure assignment?
		rxbd_temp = *rxbd;

> +#else
> +		__uint128_t *dst128 = (__uint128_t *)&rxbd_temp;
> +		const __uint128_t *src128 = (const __uint128_t *)rxbd;
> +		*dst128 = *src128;
> +#endif

When I look at godbolt, it already does the right thing with structure
assignment, you won't need the #ifdef.



More information about the dev mailing list