X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvppinfra%2Fcache.h;h=e2c406d843264df4a36bd1de4faf9ef8403cb642;hb=691a3b7f11c41851d747e35c6bc5db9319d92c20;hp=8e1f9483bde6ac4a27b456cd637ce2b2891ddf54;hpb=7cd468a3d7dee7d6c92f69a0bb7061ae208ec727;p=vpp.git diff --git a/src/vppinfra/cache.h b/src/vppinfra/cache.h index 8e1f9483bde..e2c406d8432 100644 --- a/src/vppinfra/cache.h +++ b/src/vppinfra/cache.h @@ -41,21 +41,13 @@ #include /* - * Allow CFLAGS to override the arch-specific cache line size + * Allow CFLAGS to override the configured / deduced cache line size */ #ifndef CLIB_LOG2_CACHE_LINE_BYTES -#if defined(__x86_64__) || defined(__ARM_ARCH_7A__) -#define CLIB_LOG2_CACHE_LINE_BYTES 6 -#endif - -#ifdef __aarch64__ -#define CLIB_LOG2_CACHE_LINE_BYTES 7 -#endif - -/* Default cache line size of 32 bytes. */ +/* Default cache line size of 64 bytes. */ #ifndef CLIB_LOG2_CACHE_LINE_BYTES -#define CLIB_LOG2_CACHE_LINE_BYTES 5 +#define CLIB_LOG2_CACHE_LINE_BYTES 6 #endif #endif /* CLIB_LOG2_CACHE_LINE_BYTES defined */ @@ -66,6 +58,12 @@ #define CLIB_CACHE_LINE_BYTES (1 << CLIB_LOG2_CACHE_LINE_BYTES) #define CLIB_CACHE_LINE_ALIGN_MARK(mark) u8 mark[0] __attribute__((aligned(CLIB_CACHE_LINE_BYTES))) +#define CLIB_CACHE_LINE_ROUND(x) ((x + CLIB_CACHE_LINE_BYTES - 1) & ~(CLIB_CACHE_LINE_BYTES - 1)) + +/* Default cache line fill buffers. */ +#ifndef CLIB_N_PREFETCHES +#define CLIB_N_PREFETCHES 16 +#endif /* Read/write arguments to __builtin_prefetch. */ #define CLIB_PREFETCH_READ 0