[PATCH v5 05/22] mbuf: stop using mbuf cacheline marker fields

Thomas Monjalon thomas at monjalon.net
Sat Feb 24 11:58:59 CET 2024


24/02/2024 09:21, Tyler Retzlaff:
> Update prefetch inline functions to access rte_mbuf struct fields
> directly instead of via cacheline{0,1} marker extension fields.
> 
> Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
[...]
>  rte_mbuf_prefetch_part1(struct rte_mbuf *m)
>  {
> -	rte_prefetch0(&m->cacheline0);
> +	rte_prefetch0(&m->buf_addr);

Should be simply "m", no need to point to the first field explicitly.

[...]
>  rte_mbuf_prefetch_part2(struct rte_mbuf *m)
>  {
>  #if RTE_CACHE_LINE_SIZE == 64
> -	rte_prefetch0(&m->cacheline1);
> +#if RTE_IOVA_IN_MBUF
> +	rte_prefetch0(&m->next);
> +#else
> +	rte_prefetch0(&m->dynfield2);
> +#endif

I think it is better to calculate m + min cache line size
instead of relying on fields.




More information about the dev mailing list