dpdk: add patch to support i226v
[vpp.git] / src / vppinfra / cpu.h
index c1f2e9e..329e5cc 100644 (file)
@@ -134,6 +134,7 @@ _CLIB_MARCH_FN_REGISTRATION(fn)
   _ (avx512_vpopcntdq, 7, ecx, 14)                                            \
   _ (movdiri, 7, ecx, 27)                                                     \
   _ (movdir64b, 7, ecx, 28)                                                   \
+  _ (avx512_fp16, 7, edx, 23)                                                 \
   _ (invariant_tsc, 0x80000007, edx, 8)
 
 #define foreach_aarch64_flags \
@@ -265,6 +266,24 @@ clib_cpu_march_priority_hsw ()
   return -1;
 }
 
+#define X86_CPU_ARCH_PERF_FUNC 0xA
+
+static inline int
+clib_get_pmu_counter_count (u8 *fixed, u8 *general)
+{
+#if defined(__x86_64__)
+  u32 __clib_unused eax = 0, ebx = 0, ecx = 0, edx = 0;
+  clib_get_cpuid (X86_CPU_ARCH_PERF_FUNC, &eax, &ebx, &ecx, &edx);
+
+  *general = (eax & 0xFF00) >> 8;
+  *fixed = (edx & 0xF);
+
+  return 1;
+#else
+  return 0;
+#endif
+}
+
 static inline u32
 clib_cpu_implementer ()
 {