FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
cpu.h File Reference
+ Include dependency graph for cpu.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define foreach_march_variant
 
#define CLIB_MULTIARCH_FN(fn)   fn
 
#define CLIB_MARCH_SFX   CLIB_MULTIARCH_FN
 
#define CLIB_MARCH_FN_POINTER(fn)   (__typeof__ (fn) *) clib_march_select_fn_ptr (fn##_march_fn_registrations);
 
#define CLIB_MARCH_FN_REGISTRATION(fn)
 
#define foreach_x86_64_flags
 
#define foreach_aarch64_flags
 
#define AARCH64_CPU_IMPLEMENTER_CAVIUM   0x43
 
#define AARCH64_CPU_PART_THUNDERX2   0x0af
 
#define AARCH64_CPU_PART_OCTEONTX2T96   0x0b2
 
#define AARCH64_CPU_PART_OCTEONTX2T98   0x0b1
 
#define AARCH64_CPU_IMPLEMENTER_QDF24XX   0x51
 
#define AARCH64_CPU_PART_QDF24XX   0xc00
 
#define AARCH64_CPU_IMPLEMENTER_CORTEXA72   0x41
 
#define AARCH64_CPU_PART_CORTEXA72   0xd08
 
#define AARCH64_CPU_IMPLEMENTER_NEOVERSEN1   0x41
 
#define AARCH64_CPU_PART_NEOVERSEN1   0xd0c
 
#define CLIB_MARCH_FN_PRIORITY()   0
 
#define CLIB_MARCH_FN_CONSTRUCTOR(fn)
 
#define CLIB_MARCH_FN(fn, rtype, _args...)
 
#define CLIB_MARCH_FN_SELECT(fn)   (* fn ## _selected)
 

Typedefs

typedef struct _clib_march_fn_registration clib_march_fn_registration
 
typedef int(* clib_cpu_supports_func_t) ()
 

Enumerations

enum  clib_march_variant_type_t { CLIB_MARCH_VARIANT_TYPE = 0, CLIB_MARCH_TYPE_N_VARIANTS }
 

Functions

static_always_inline void * clib_march_select_fn_ptr (clib_march_fn_registration *r)
 
u32 clib_get_current_cpu_id ()
 
u32 clib_get_current_numa_node ()
 
static int clib_get_cpuid (const u32 lev, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)
 
static foreach_aarch64_flags int clib_cpu_supports_aes ()
 
static int clib_cpu_march_priority_icl ()
 
static int clib_cpu_march_priority_skx ()
 
static int clib_cpu_march_priority_trm ()
 
static int clib_cpu_march_priority_hsw ()
 
static u32 clib_cpu_implementer ()
 
static u32 clib_cpu_part ()
 
static int clib_cpu_march_priority_octeontx2 ()
 
static int clib_cpu_march_priority_thunderx2t99 ()
 
static int clib_cpu_march_priority_qdf24xx ()
 
static int clib_cpu_march_priority_cortexa72 ()
 
static int clib_cpu_march_priority_neoversen1 ()
 

Variables

format_function_t format_cpu_uarch
 
format_function_t format_cpu_model_name
 
format_function_t format_cpu_flags
 
format_function_t format_march_variant
 

Macro Definition Documentation

◆ AARCH64_CPU_IMPLEMENTER_CAVIUM

#define AARCH64_CPU_IMPLEMENTER_CAVIUM   0x43

Definition at line 324 of file cpu.h.

◆ AARCH64_CPU_IMPLEMENTER_CORTEXA72

#define AARCH64_CPU_IMPLEMENTER_CORTEXA72   0x41

Definition at line 330 of file cpu.h.

◆ AARCH64_CPU_IMPLEMENTER_NEOVERSEN1

#define AARCH64_CPU_IMPLEMENTER_NEOVERSEN1   0x41

Definition at line 332 of file cpu.h.

◆ AARCH64_CPU_IMPLEMENTER_QDF24XX

#define AARCH64_CPU_IMPLEMENTER_QDF24XX   0x51

Definition at line 328 of file cpu.h.

◆ AARCH64_CPU_PART_CORTEXA72

#define AARCH64_CPU_PART_CORTEXA72   0xd08

Definition at line 331 of file cpu.h.

◆ AARCH64_CPU_PART_NEOVERSEN1

#define AARCH64_CPU_PART_NEOVERSEN1   0xd0c

Definition at line 333 of file cpu.h.

◆ AARCH64_CPU_PART_OCTEONTX2T96

#define AARCH64_CPU_PART_OCTEONTX2T96   0x0b2

Definition at line 326 of file cpu.h.

◆ AARCH64_CPU_PART_OCTEONTX2T98

#define AARCH64_CPU_PART_OCTEONTX2T98   0x0b1

Definition at line 327 of file cpu.h.

◆ AARCH64_CPU_PART_QDF24XX

#define AARCH64_CPU_PART_QDF24XX   0xc00

Definition at line 329 of file cpu.h.

◆ AARCH64_CPU_PART_THUNDERX2

#define AARCH64_CPU_PART_THUNDERX2   0x0af

Definition at line 325 of file cpu.h.

◆ CLIB_MARCH_FN

#define CLIB_MARCH_FN (   fn,
  rtype,
  _args... 
)
Value:
static rtype CLIB_MARCH_SFX (fn##_ma) (_args); \
rtype (*fn##_selected) (_args) = &CLIB_MARCH_SFX (fn##_ma); \
int fn##_selected_priority = 0; \
static inline rtype CLIB_MARCH_SFX (fn##_ma) (_args)

Definition at line 400 of file cpu.h.

◆ CLIB_MARCH_FN_CONSTRUCTOR

#define CLIB_MARCH_FN_CONSTRUCTOR (   fn)
Value:
CLIB_MARCH_SFX(fn ## _march_constructor) (void) \
{ \
if (CLIB_MARCH_FN_PRIORITY() > fn ## _selected_priority) \
{ \
fn ## _selected = & CLIB_MARCH_SFX (fn ## _ma); \
fn ## _selected_priority = CLIB_MARCH_FN_PRIORITY(); \
} \
} \

Definition at line 388 of file cpu.h.

◆ CLIB_MARCH_FN_POINTER

#define CLIB_MARCH_FN_POINTER (   fn)    (__typeof__ (fn) *) clib_march_select_fn_ptr (fn##_march_fn_registrations);

Definition at line 84 of file cpu.h.

◆ CLIB_MARCH_FN_PRIORITY

#define CLIB_MARCH_FN_PRIORITY ( )    0

Definition at line 384 of file cpu.h.

◆ CLIB_MARCH_FN_REGISTRATION

#define CLIB_MARCH_FN_REGISTRATION (   fn)
Value:
clib_march_fn_registration *fn##_march_fn_registrations = 0; \
_CLIB_MARCH_FN_REGISTRATION(fn)

Definition at line 110 of file cpu.h.

◆ CLIB_MARCH_FN_SELECT

#define CLIB_MARCH_FN_SELECT (   fn)    (* fn ## _selected)

Definition at line 414 of file cpu.h.

◆ CLIB_MARCH_SFX

#define CLIB_MARCH_SFX   CLIB_MULTIARCH_FN

Definition at line 56 of file cpu.h.

◆ CLIB_MULTIARCH_FN

#define CLIB_MULTIARCH_FN (   fn)    fn

Definition at line 53 of file cpu.h.

◆ foreach_aarch64_flags

#define foreach_aarch64_flags
Value:
_ (fp, 0) \
_ (asimd, 1) \
_ (evtstrm, 2) \
_ (aarch64_aes, 3) \
_ (pmull, 4) \
_ (sha1, 5) \
_ (sha2, 6) \
_ (crc32, 7) \
_ (atomics, 8) \
_ (fphp, 9) \
_ (asimdhp, 10) \
_ (cpuid, 11) \
_ (asimdrdm, 12) \
_ (jscvt, 13) \
_ (fcma, 14) \
_ (lrcpc, 15) \
_ (dcpop, 16) \
_ (sha3, 17) \
_ (sm3, 18) \
_ (sm4, 19) \
_ (asimddp, 20) \
_ (sha512, 21) \
_ (sve, 22)

Definition at line 139 of file cpu.h.

◆ foreach_march_variant

#define foreach_march_variant
Value:
_ (hsw, "Intel Haswell") \
_ (trm, "Intel Tremont") \
_ (skx, "Intel Skylake (server) / Cascade Lake") \
_ (icl, "Intel Ice Lake")

Definition at line 23 of file cpu.h.

◆ foreach_x86_64_flags

#define foreach_x86_64_flags
Value:
_ (sse3, 1, ecx, 0) \
_ (pclmulqdq, 1, ecx, 1) \
_ (ssse3, 1, ecx, 9) \
_ (sse41, 1, ecx, 19) \
_ (sse42, 1, ecx, 20) \
_ (avx, 1, ecx, 28) \
_ (rdrand, 1, ecx, 30) \
_ (avx2, 7, ebx, 5) \
_ (rtm, 7, ebx, 11) \
_ (pqm, 7, ebx, 12) \
_ (pqe, 7, ebx, 15) \
_ (avx512f, 7, ebx, 16) \
_ (rdseed, 7, ebx, 18) \
_ (x86_aes, 1, ecx, 25) \
_ (sha, 7, ebx, 29) \
_ (vaes, 7, ecx, 9) \
_ (vpclmulqdq, 7, ecx, 10) \
_ (avx512_vnni, 7, ecx, 11) \
_ (avx512_bitalg, 7, ecx, 12) \
_ (avx512_vpopcntdq, 7, ecx, 14) \
_ (movdiri, 7, ecx, 27) \
_ (movdir64b, 7, ecx, 28) \
_ (invariant_tsc, 0x80000007, edx, 8)

Definition at line 114 of file cpu.h.

Typedef Documentation

◆ clib_cpu_supports_func_t

typedef int(* clib_cpu_supports_func_t) ()

Definition at line 182 of file cpu.h.

◆ clib_march_fn_registration

typedef struct _clib_march_fn_registration clib_march_fn_registration

Enumeration Type Documentation

◆ clib_march_variant_type_t

Enumerator
CLIB_MARCH_VARIANT_TYPE 
CLIB_MARCH_TYPE_N_VARIANTS 

Definition at line 39 of file cpu.h.

Function Documentation

◆ clib_cpu_implementer()

static u32 clib_cpu_implementer ( )
inlinestatic

Definition at line 269 of file cpu.h.

+ Here is the caller graph for this function:

◆ clib_cpu_march_priority_cortexa72()

static int clib_cpu_march_priority_cortexa72 ( )
inlinestatic

Definition at line 364 of file cpu.h.

+ Here is the call graph for this function:

◆ clib_cpu_march_priority_hsw()

static int clib_cpu_march_priority_hsw ( )
inlinestatic

Definition at line 261 of file cpu.h.

◆ clib_cpu_march_priority_icl()

static int clib_cpu_march_priority_icl ( )
inlinestatic

Definition at line 237 of file cpu.h.

◆ clib_cpu_march_priority_neoversen1()

static int clib_cpu_march_priority_neoversen1 ( )
inlinestatic

Definition at line 373 of file cpu.h.

+ Here is the call graph for this function:

◆ clib_cpu_march_priority_octeontx2()

static int clib_cpu_march_priority_octeontx2 ( )
inlinestatic

Definition at line 336 of file cpu.h.

+ Here is the call graph for this function:

◆ clib_cpu_march_priority_qdf24xx()

static int clib_cpu_march_priority_qdf24xx ( )
inlinestatic

Definition at line 355 of file cpu.h.

+ Here is the call graph for this function:

◆ clib_cpu_march_priority_skx()

static int clib_cpu_march_priority_skx ( )
inlinestatic

Definition at line 245 of file cpu.h.

◆ clib_cpu_march_priority_thunderx2t99()

static int clib_cpu_march_priority_thunderx2t99 ( )
inlinestatic

Definition at line 346 of file cpu.h.

+ Here is the call graph for this function:

◆ clib_cpu_march_priority_trm()

static int clib_cpu_march_priority_trm ( )
inlinestatic

Definition at line 253 of file cpu.h.

◆ clib_cpu_part()

static u32 clib_cpu_part ( )
inlinestatic

Definition at line 297 of file cpu.h.

+ Here is the caller graph for this function:

◆ clib_cpu_supports_aes()

static foreach_aarch64_flags int clib_cpu_supports_aes ( )
inlinestatic

Definition at line 225 of file cpu.h.

+ Here is the caller graph for this function:

◆ clib_get_cpuid()

static int clib_get_cpuid ( const u32  lev,
u32 eax,
u32 ebx,
u32 ecx,
u32 edx 
)
inlinestatic

Definition at line 171 of file cpu.h.

◆ clib_get_current_cpu_id()

u32 clib_get_current_cpu_id ( )

Definition at line 226 of file cpu.c.

+ Here is the caller graph for this function:

◆ clib_get_current_numa_node()

u32 clib_get_current_numa_node ( )

Definition at line 234 of file cpu.c.

+ Here is the caller graph for this function:

◆ clib_march_select_fn_ptr()

static_always_inline void* clib_march_select_fn_ptr ( clib_march_fn_registration r)

Definition at line 67 of file cpu.h.

Variable Documentation

◆ format_cpu_flags

format_function_t format_cpu_flags

Definition at line 418 of file cpu.h.

◆ format_cpu_model_name

format_function_t format_cpu_model_name

Definition at line 417 of file cpu.h.

◆ format_cpu_uarch

format_function_t format_cpu_uarch

Definition at line 416 of file cpu.h.

◆ format_march_variant

format_function_t format_march_variant

Definition at line 419 of file cpu.h.

CLIB_MARCH_SFX
#define CLIB_MARCH_SFX
Definition: cpu.h:56
clib_march_fn_registration
struct _clib_march_fn_registration clib_march_fn_registration
CLIB_MARCH_FN_PRIORITY
#define CLIB_MARCH_FN_PRIORITY()
Definition: cpu.h:384