On Tue, 13 Feb 2024 15:33:28 -0800
Tyler Retzlaff <roret...@linux.microsoft.com> wrote:

> Here is the latest iteration of the proposed change to allow struct rte_mbuf
> to be consumed by MSVC.
> 
> * Introduce an internal __rte_marker macro conditionally expanded for MSVC
>   vs existing users of the struct. At some point we can uncomment 
> __rte_deprecated
>   to assist migration away from the current marker fields for applications
>   after appropriate announcement periods etc..
> 
> * Introduce anonymous unions to allow aliasing of the previous named
>   offsets by a *new* name.  The intention would be to convert the dpdk tree
>   to use the new names along with this change and enable __rte_deprecated
>   for dpdk builds (not applications) to avoid accidental re-introduction.
> 
> * The anonymous unions are now also used to pad cacheline0 and cacheline1 
> instead
>   of __rte_cache_min_aligned.
> 
> * Converted the type of the fields for the named markers to char[] instead of
>   uint8_t[].
> 
> Tyler Retzlaff (1):
>   mbuf: deprecate GCC marker in rte mbuf struct
> 
>  lib/eal/include/rte_common.h |   6 +
>  lib/mbuf/rte_mbuf_core.h     | 365 
> +++++++++++++++++++++++--------------------
>  2 files changed, 201 insertions(+), 170 deletions(-)
> 

I was never convinced that __rte_marker was good idea in the first place.

It seemed to be only useful as annotation or for use by pre-fetch.
The problem is that for annotation, it can easily be wrong if using different
cache size or structure chagnes.
For prefetch, just using the structure and pointer math based on cacheline
seems like a better option. Plus DPDK does excessive and unproved prefetching.
For real world cases prefetching doesn't help unless there is enough cycles
from when prefetch is issued and when it is used. If too long, the prefetch
is useless, if too close the extra overhead of the prefetch slows down the
intervening execution units.

Reply via email to