Skip to contentSkip to conversation

Add CPU flags

PATCH In review Kevin Laatz 8 participants 49 messages Mar 24, 2020 – May 7, 2020

lore
Share & tools
lore
#0 lore raw

cover Add CPU flags

This patch set adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

The CPUID leaf information can be found in Section 1.7 of this document:
https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf

Kevin Laatz (17):
eal/cpuflags: add avx512 doubleword and quadword eal/cpuflags: add avx512 integer fused multiply-add eal/cpuflags: add avx512 conflict detection eal/cpuflags: add avx512 byte and word eal/cpuflags: add avx512 vector length eal/cpuflags: add avx512 vector bit manipulation eal/cpuflags: add avx512 vector bit manipulation 2 eal/cpuflags: add galois field new instructions eal/cpuflags: add vector AES
eal/cpuflags: add vector carry-less multiply eal/cpuflags: add avx512 vector neural network instructions eal/cpuflags: add avx512 bit algorithms eal/cpuflags: add avx512 vector popcount eal/cpuflags: add cache line demote
eal/cpuflags: add direct store instructions eal/cpuflags: add direct store instructions 64B eal/cpuflags: add avx512 two register intersection

 lib/librte_eal/common/arch/x86/rte_cpuflags.c  | 18 ++++++++++++++++++
 .../common/include/arch/x86/rte_cpuflags.h     | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/17 eal/cpuflags: add avx512 doubleword and quadword

Add the CPU flag for AVX-512 doubleword and quadword instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 2 ++
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 2 ++
 2 files changed, 4 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +2 -0
index 6492df556..2e2fbec1c 100644
@@ -120,6 +120,8 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(EM64T, 0x80000001, 0, RTE_REG_EDX, 29)
 
 	FEAT_DEF(INVTSC, 0x80000007, 0, RTE_REG_EDX,  8)
+
+	FEAT_DEF(AVX512DQ, 0x00000007, 0, RTE_REG_EBX, 17)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +2 -0
index 25ba47b96..cec45c382 100644
@@ -113,6 +113,8 @@ enum rte_cpu_flag_t {
 	/* (EAX 80000007h) EDX features */
 	RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
+	RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and Quadword */
+
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
 };
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/17 eal/cpuflags: add avx512 integer fused multiply-add

In reply to Kevin Laatz

Add the CPU flag for AVX-512 integer fused multiply-add instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index 2e2fbec1c..d56bd57f9 100644
@@ -122,6 +122,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(INVTSC, 0x80000007, 0, RTE_REG_EDX,  8)
 
 	FEAT_DEF(AVX512DQ, 0x00000007, 0, RTE_REG_EBX, 17)
+	FEAT_DEF(AVX512IFMA, 0x00000007, 0, RTE_REG_EBX, 21)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index cec45c382..81f510299 100644
@@ -114,6 +114,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
 	RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and Quadword */
+	RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused Multiply-Add */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#3 lore raw

PATCH 3/17 eal/cpuflags: add avx512 conflict detection

In reply to Kevin Laatz

Add the CPU flag for AVX-512 conflict detection instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index d56bd57f9..928b3513e 100644
@@ -123,6 +123,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 
 	FEAT_DEF(AVX512DQ, 0x00000007, 0, RTE_REG_EBX, 17)
 	FEAT_DEF(AVX512IFMA, 0x00000007, 0, RTE_REG_EBX, 21)
+	FEAT_DEF(AVX512CD, 0x00000007, 0, RTE_REG_EBX, 28)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index 81f510299..248a198a6 100644
@@ -115,6 +115,7 @@ enum rte_cpu_flag_t {
 
 	RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and Quadword */
 	RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused Multiply-Add */
+	RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict Detection*/
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#4 lore raw

PATCH 4/17 eal/cpuflags: add avx512 byte and word

In reply to Kevin Laatz

Add the CPU flag for AVX-512 byte and word instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index 928b3513e..c0bb1bd5c 100644
@@ -124,6 +124,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(AVX512DQ, 0x00000007, 0, RTE_REG_EBX, 17)
 	FEAT_DEF(AVX512IFMA, 0x00000007, 0, RTE_REG_EBX, 21)
 	FEAT_DEF(AVX512CD, 0x00000007, 0, RTE_REG_EBX, 28)
+	FEAT_DEF(AVX512BW, 0x00000007, 0, RTE_REG_EBX, 30)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index 248a198a6..97eeeb247 100644
@@ -116,6 +116,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and Quadword */
 	RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused Multiply-Add */
 	RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict Detection*/
+	RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#5 lore raw

PATCH 5/17 eal/cpuflags: add avx512 vector length

In reply to Kevin Laatz

Add the CPU flag for AVX-512 vector length instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index c0bb1bd5c..21cb4b649 100644
@@ -125,6 +125,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(AVX512IFMA, 0x00000007, 0, RTE_REG_EBX, 21)
 	FEAT_DEF(AVX512CD, 0x00000007, 0, RTE_REG_EBX, 28)
 	FEAT_DEF(AVX512BW, 0x00000007, 0, RTE_REG_EBX, 30)
+	FEAT_DEF(AVX512VL, 0x00000007, 0, RTE_REG_EBX, 31)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index 97eeeb247..42181e32c 100644
@@ -117,6 +117,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused Multiply-Add */
 	RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict Detection*/
 	RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
+	RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#6 lore raw

PATCH 6/17 eal/cpuflags: add avx512 vector bit manipulation

In reply to Kevin Laatz

Add the CPU flag for AVX-512 vector bit manipulation instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index 21cb4b649..773b14074 100644
@@ -126,6 +126,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(AVX512CD, 0x00000007, 0, RTE_REG_EBX, 28)
 	FEAT_DEF(AVX512BW, 0x00000007, 0, RTE_REG_EBX, 30)
 	FEAT_DEF(AVX512VL, 0x00000007, 0, RTE_REG_EBX, 31)
+	FEAT_DEF(AVX512VBMI, 0x00000007, 0, RTE_REG_ECX, 1)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index 42181e32c..453193875 100644
@@ -118,6 +118,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict Detection*/
 	RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
 	RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
+	RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit Manipulation */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#7 lore raw

PATCH 7/17 eal/cpuflags: add avx512 vector bit manipulation 2

In reply to Kevin Laatz

Add the CPU flag for AVX-512 vector bit manipulation 2 instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index 773b14074..d1ef7e229 100644
@@ -127,6 +127,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(AVX512BW, 0x00000007, 0, RTE_REG_EBX, 30)
 	FEAT_DEF(AVX512VL, 0x00000007, 0, RTE_REG_EBX, 31)
 	FEAT_DEF(AVX512VBMI, 0x00000007, 0, RTE_REG_ECX, 1)
+	FEAT_DEF(AVX512VBMI2, 0x00000007, 0, RTE_REG_ECX, 6)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index 453193875..8544f9dca 100644
@@ -119,6 +119,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
 	RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
 	RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit Manipulation */
+	RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit Manipulation 2 */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#8 lore raw

PATCH 8/17 eal/cpuflags: add galois field new instructions

In reply to Kevin Laatz

Add the CPU flag for Galois field new instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index d1ef7e229..c2a484789 100644
@@ -128,6 +128,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(AVX512VL, 0x00000007, 0, RTE_REG_EBX, 31)
 	FEAT_DEF(AVX512VBMI, 0x00000007, 0, RTE_REG_ECX, 1)
 	FEAT_DEF(AVX512VBMI2, 0x00000007, 0, RTE_REG_ECX, 6)
+	FEAT_DEF(GFNI, 0x00000007, 0, RTE_REG_ECX, 8)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index 8544f9dca..94714c98b 100644
@@ -120,6 +120,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
 	RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit Manipulation */
 	RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit Manipulation 2 */
+	RTE_CPUFLAG_GFNI,                   /**< Galois Field New Instructions */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#9 lore raw

PATCH 9/17 eal/cpuflags: add vector AES

In reply to Kevin Laatz

Add the CPU flag for vector AES instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index c2a484789..d4caf76d8 100644
@@ -129,6 +129,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(AVX512VBMI, 0x00000007, 0, RTE_REG_ECX, 1)
 	FEAT_DEF(AVX512VBMI2, 0x00000007, 0, RTE_REG_ECX, 6)
 	FEAT_DEF(GFNI, 0x00000007, 0, RTE_REG_ECX, 8)
+	FEAT_DEF(VAES, 0x00000007, 0, RTE_REG_ECX, 9)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index 94714c98b..22efc166f 100644
@@ -121,6 +121,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit Manipulation */
 	RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit Manipulation 2 */
 	RTE_CPUFLAG_GFNI,                   /**< Galois Field New Instructions */
+	RTE_CPUFLAG_VAES,                   /**< Vector AES */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#10 lore raw

PATCH 10/17 eal/cpuflags: add vector carry-less multiply

In reply to Kevin Laatz

Add the CPU flag for vector carry-less multiply instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index d4caf76d8..b01f35e1a 100644
@@ -130,6 +130,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(AVX512VBMI2, 0x00000007, 0, RTE_REG_ECX, 6)
 	FEAT_DEF(GFNI, 0x00000007, 0, RTE_REG_ECX, 8)
 	FEAT_DEF(VAES, 0x00000007, 0, RTE_REG_ECX, 9)
+	FEAT_DEF(VPCLMULQDQ, 0x00000007, 0, RTE_REG_ECX, 10)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index 22efc166f..cbcb1cf71 100644
@@ -122,6 +122,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit Manipulation 2 */
 	RTE_CPUFLAG_GFNI,                   /**< Galois Field New Instructions */
 	RTE_CPUFLAG_VAES,                   /**< Vector AES */
+	RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less Multiply */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#11 lore raw

PATCH 11/17 eal/cpuflags: add avx512 vector neural network instructions

In reply to Kevin Laatz

Add the CPU flag for AVX-512 vector neural network instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index b01f35e1a..f82d45647 100644
@@ -131,6 +131,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(GFNI, 0x00000007, 0, RTE_REG_ECX, 8)
 	FEAT_DEF(VAES, 0x00000007, 0, RTE_REG_ECX, 9)
 	FEAT_DEF(VPCLMULQDQ, 0x00000007, 0, RTE_REG_ECX, 10)
+	FEAT_DEF(AVX512VNNI, 0x00000007, 0, RTE_REG_ECX, 11)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index cbcb1cf71..caf92b9f3 100644
@@ -123,6 +123,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_GFNI,                   /**< Galois Field New Instructions */
 	RTE_CPUFLAG_VAES,                   /**< Vector AES */
 	RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less Multiply */
+	RTE_CPUFLAG_AVX512VNNI,             /**< AVX512 Vector Neural Network Instructions */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#12 lore raw

PATCH 12/17 eal/cpuflags: add avx512 bit algorithms

In reply to Kevin Laatz

Add the CPU flag AVX-512 for bit algorithm instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index f82d45647..472becfed 100644
@@ -132,6 +132,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(VAES, 0x00000007, 0, RTE_REG_ECX, 9)
 	FEAT_DEF(VPCLMULQDQ, 0x00000007, 0, RTE_REG_ECX, 10)
 	FEAT_DEF(AVX512VNNI, 0x00000007, 0, RTE_REG_ECX, 11)
+	FEAT_DEF(AVX512BITALG, 0x00000007, 0, RTE_REG_ECX, 12)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index caf92b9f3..fe4144fc0 100644
@@ -124,6 +124,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_VAES,                   /**< Vector AES */
 	RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less Multiply */
 	RTE_CPUFLAG_AVX512VNNI,             /**< AVX512 Vector Neural Network Instructions */
+	RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#13 lore raw

PATCH 13/17 eal/cpuflags: add avx512 vector popcount

In reply to Kevin Laatz

Add the CPU flag for AVX-512 vector popcount instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index 472becfed..0b1458d77 100644
@@ -133,6 +133,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(VPCLMULQDQ, 0x00000007, 0, RTE_REG_ECX, 10)
 	FEAT_DEF(AVX512VNNI, 0x00000007, 0, RTE_REG_ECX, 11)
 	FEAT_DEF(AVX512BITALG, 0x00000007, 0, RTE_REG_ECX, 12)
+	FEAT_DEF(AVX512VPOPCNTDQ, 0x00000007, 0, RTE_REG_ECX,  14)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index fe4144fc0..63281ef5e 100644
@@ -125,6 +125,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less Multiply */
 	RTE_CPUFLAG_AVX512VNNI,             /**< AVX512 Vector Neural Network Instructions */
 	RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms */
+	RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#14 lore raw

PATCH 14/17 eal/cpuflags: add cache line demote

In reply to Kevin Laatz

Add the CPU flag for cache line demote instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index 0b1458d77..ac1de715d 100644
@@ -134,6 +134,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(AVX512VNNI, 0x00000007, 0, RTE_REG_ECX, 11)
 	FEAT_DEF(AVX512BITALG, 0x00000007, 0, RTE_REG_ECX, 12)
 	FEAT_DEF(AVX512VPOPCNTDQ, 0x00000007, 0, RTE_REG_ECX,  14)
+	FEAT_DEF(CLDEMOTE, 0x00000007, 0, RTE_REG_ECX, 25)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index 63281ef5e..3a60f3e68 100644
@@ -126,6 +126,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_AVX512VNNI,             /**< AVX512 Vector Neural Network Instructions */
 	RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms */
 	RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount */
+	RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#15 lore raw

PATCH 15/17 eal/cpuflags: add direct store instructions

In reply to Kevin Laatz

Add the CPU flag for direct store instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index ac1de715d..eb9f6b59d 100644
@@ -135,6 +135,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(AVX512BITALG, 0x00000007, 0, RTE_REG_ECX, 12)
 	FEAT_DEF(AVX512VPOPCNTDQ, 0x00000007, 0, RTE_REG_ECX,  14)
 	FEAT_DEF(CLDEMOTE, 0x00000007, 0, RTE_REG_ECX, 25)
+	FEAT_DEF(MOVDIRI, 0x00000007, 0, RTE_REG_ECX, 27)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index 3a60f3e68..b39abfc38 100644
@@ -127,6 +127,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms */
 	RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount */
 	RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
+	RTE_CPUFLAG_MOVDIRI,                /**< Direct Store Instructions */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#16 lore raw

PATCH 16/17 eal/cpuflags: add direct store instructions 64B

In reply to Kevin Laatz

Add the CPU flag for direct store 64B instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index eb9f6b59d..164381684 100644
@@ -136,6 +136,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(AVX512VPOPCNTDQ, 0x00000007, 0, RTE_REG_ECX,  14)
 	FEAT_DEF(CLDEMOTE, 0x00000007, 0, RTE_REG_ECX, 25)
 	FEAT_DEF(MOVDIRI, 0x00000007, 0, RTE_REG_ECX, 27)
+	FEAT_DEF(MOVDIR64B, 0x00000007, 0, RTE_REG_ECX, 28)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index b39abfc38..2379d073d 100644
@@ -128,6 +128,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount */
 	RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
 	RTE_CPUFLAG_MOVDIRI,                /**< Direct Store Instructions */
+	RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store Instructions 64B */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#17 lore raw

PATCH 17/17 eal/cpuflags: add avx512 two register intersection

In reply to Kevin Laatz

Add the CPU flag for AVX-512 two register intersection instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c         | 1 +
 lib/librte_eal/common/include/arch/x86/rte_cpuflags.h | 1 +
 2 files changed, 2 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +1 -0
index 164381684..30439e795 100644
@@ -137,6 +137,7 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(CLDEMOTE, 0x00000007, 0, RTE_REG_ECX, 25)
 	FEAT_DEF(MOVDIRI, 0x00000007, 0, RTE_REG_ECX, 27)
 	FEAT_DEF(MOVDIR64B, 0x00000007, 0, RTE_REG_ECX, 28)
+	FEAT_DEF(AVX512VP2INTERSECT, 0x00000007, 0, RTE_REG_EDX, 8)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
index 2379d073d..f8f73b19f 100644
@@ -129,6 +129,7 @@ enum rte_cpu_flag_t {
 	RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
 	RTE_CPUFLAG_MOVDIRI,                /**< Direct Store Instructions */
 	RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store Instructions 64B */
+	RTE_CPUFLAG_AVX512VP2INTERSECT,     /**< AVX512 Two Register Intersection */
 
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
Signature · 1 line
2.17.1
#18 lore raw
In reply to Kevin Laatz
Quoted 26 lines · Kevin Laatz

This patch set adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

The CPUID leaf information can be found in Section 1.7 of this document:
https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf

Kevin Laatz (17):
eal/cpuflags: add avx512 doubleword and quadword eal/cpuflags: add avx512 integer fused multiply-add eal/cpuflags: add avx512 conflict detection eal/cpuflags: add avx512 byte and word eal/cpuflags: add avx512 vector length eal/cpuflags: add avx512 vector bit manipulation eal/cpuflags: add avx512 vector bit manipulation 2 eal/cpuflags: add galois field new instructions eal/cpuflags: add vector AES
eal/cpuflags: add vector carry-less multiply eal/cpuflags: add avx512 vector neural network instructions eal/cpuflags: add avx512 bit algorithms eal/cpuflags: add avx512 vector popcount eal/cpuflags: add cache line demote
eal/cpuflags: add direct store instructions eal/cpuflags: add direct store instructions 64B eal/cpuflags: add avx512 two register intersection

Quoted 3 lines
 lib/librte_eal/common/arch/x86/rte_cpuflags.c  | 18 ++++++++++++++++++
 .../common/include/arch/x86/rte_cpuflags.h     | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)

You are just adding definitions, the review should be straightforward for guys in the know.
I can see little value in splitting in that many patches.

Signature · 1 line
David Marchand
#19 lore raw

PATCH v2 1/1 eal/cpuflags: add x86 based cpu flags

In reply to Kevin Laatz

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

The CPUID leaf information can be found in Section 1.7 of this document:
https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf

The following CPU flags are added in this patch:
- AVX-512 doubleword and quadword instructions.
- AVX-512 integer fused multiply-add instructions.
- AVX-512 conflict detection instructions.
- AVX-512 byte and word instructions.
- AVX-512 vector length instructions.
- AVX-512 vector bit manipulation instructions.
- AVX-512 vector bit manipulation 2 instructions.
- Galois field new instructions.
- Vector AES instructions.
- Vector carry-less multiply instructions.
- AVX-512 vector neural network instructions.
- AVX-512 for bit algorithm instructions.
- AVX-512 vector popcount instructions.
- Cache line demote instructions.
- Direct store instructions.
- Direct store 64B instructions.
- AVX-512 two register intersection instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c  | 18 ++++++++++++++++++
 .../common/include/arch/x86/rte_cpuflags.h     | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +18 -0
index 6492df556..30439e795 100644
@@ -120,6 +120,24 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(EM64T, 0x80000001, 0, RTE_REG_EDX, 29)
 
 	FEAT_DEF(INVTSC, 0x80000007, 0, RTE_REG_EDX,  8)
+
+	FEAT_DEF(AVX512DQ, 0x00000007, 0, RTE_REG_EBX, 17)
+	FEAT_DEF(AVX512IFMA, 0x00000007, 0, RTE_REG_EBX, 21)
+	FEAT_DEF(AVX512CD, 0x00000007, 0, RTE_REG_EBX, 28)
+	FEAT_DEF(AVX512BW, 0x00000007, 0, RTE_REG_EBX, 30)
+	FEAT_DEF(AVX512VL, 0x00000007, 0, RTE_REG_EBX, 31)
+	FEAT_DEF(AVX512VBMI, 0x00000007, 0, RTE_REG_ECX, 1)
+	FEAT_DEF(AVX512VBMI2, 0x00000007, 0, RTE_REG_ECX, 6)
+	FEAT_DEF(GFNI, 0x00000007, 0, RTE_REG_ECX, 8)
+	FEAT_DEF(VAES, 0x00000007, 0, RTE_REG_ECX, 9)
+	FEAT_DEF(VPCLMULQDQ, 0x00000007, 0, RTE_REG_ECX, 10)
+	FEAT_DEF(AVX512VNNI, 0x00000007, 0, RTE_REG_ECX, 11)
+	FEAT_DEF(AVX512BITALG, 0x00000007, 0, RTE_REG_ECX, 12)
+	FEAT_DEF(AVX512VPOPCNTDQ, 0x00000007, 0, RTE_REG_ECX,  14)
+	FEAT_DEF(CLDEMOTE, 0x00000007, 0, RTE_REG_ECX, 25)
+	FEAT_DEF(MOVDIRI, 0x00000007, 0, RTE_REG_ECX, 27)
+	FEAT_DEF(MOVDIR64B, 0x00000007, 0, RTE_REG_ECX, 28)
+	FEAT_DEF(AVX512VP2INTERSECT, 0x00000007, 0, RTE_REG_EDX, 8)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +18 -0
index 25ba47b96..f8f73b19f 100644
@@ -113,6 +113,24 @@ enum rte_cpu_flag_t {
 	/* (EAX 80000007h) EDX features */
 	RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
+	RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and Quadword */
+	RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused Multiply-Add */
+	RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict Detection*/
+	RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
+	RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
+	RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit Manipulation */
+	RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit Manipulation 2 */
+	RTE_CPUFLAG_GFNI,                   /**< Galois Field New Instructions */
+	RTE_CPUFLAG_VAES,                   /**< Vector AES */
+	RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less Multiply */
+	RTE_CPUFLAG_AVX512VNNI,             /**< AVX512 Vector Neural Network Instructions */
+	RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms */
+	RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount */
+	RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
+	RTE_CPUFLAG_MOVDIRI,                /**< Direct Store Instructions */
+	RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store Instructions 64B */
+	RTE_CPUFLAG_AVX512VP2INTERSECT,     /**< AVX512 Two Register Intersection */
+
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
 };
Signature · 1 line
2.17.1
#20 lore raw

Re: [dpdk-dev] [PATCH v2] eal/cpuflags: add x86 based cpu flags

Quoted 80 lines · Kevin Laatz

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

The CPUID leaf information can be found in Section 1.7 of this document:
https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf

The following CPU flags are added in this patch:
- AVX-512 doubleword and quadword instructions.
- AVX-512 integer fused multiply-add instructions.
- AVX-512 conflict detection instructions.
- AVX-512 byte and word instructions.
- AVX-512 vector length instructions.
- AVX-512 vector bit manipulation instructions.
- AVX-512 vector bit manipulation 2 instructions.
- Galois field new instructions.
- Vector AES instructions.
- Vector carry-less multiply instructions.
- AVX-512 vector neural network instructions.
- AVX-512 for bit algorithm instructions.
- AVX-512 vector popcount instructions.
- Cache line demote instructions.
- Direct store instructions.
- Direct store 64B instructions.
- AVX-512 two register intersection instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c  | 18 ++++++++++++++++++
 .../common/include/arch/x86/rte_cpuflags.h     | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +18 -0
index 6492df556..30439e795 100644
@@ -120,6 +120,24 @@ const struct feature_entry rte_cpu_feature_table[] = {
        FEAT_DEF(EM64T, 0x80000001, 0, RTE_REG_EDX, 29)
 
        FEAT_DEF(INVTSC, 0x80000007, 0, RTE_REG_EDX,  8)
+
+       FEAT_DEF(AVX512DQ, 0x00000007, 0, RTE_REG_EBX, 17)
+       FEAT_DEF(AVX512IFMA, 0x00000007, 0, RTE_REG_EBX, 21)
+       FEAT_DEF(AVX512CD, 0x00000007, 0, RTE_REG_EBX, 28)
+       FEAT_DEF(AVX512BW, 0x00000007, 0, RTE_REG_EBX, 30)
+       FEAT_DEF(AVX512VL, 0x00000007, 0, RTE_REG_EBX, 31)
+       FEAT_DEF(AVX512VBMI, 0x00000007, 0, RTE_REG_ECX, 1)
+       FEAT_DEF(AVX512VBMI2, 0x00000007, 0, RTE_REG_ECX, 6)
+       FEAT_DEF(GFNI, 0x00000007, 0, RTE_REG_ECX, 8)
+       FEAT_DEF(VAES, 0x00000007, 0, RTE_REG_ECX, 9)
+       FEAT_DEF(VPCLMULQDQ, 0x00000007, 0, RTE_REG_ECX, 10)
+       FEAT_DEF(AVX512VNNI, 0x00000007, 0, RTE_REG_ECX, 11)
+       FEAT_DEF(AVX512BITALG, 0x00000007, 0, RTE_REG_ECX, 12)
+       FEAT_DEF(AVX512VPOPCNTDQ, 0x00000007, 0, RTE_REG_ECX,  14)
+       FEAT_DEF(CLDEMOTE, 0x00000007, 0, RTE_REG_ECX, 25)
+       FEAT_DEF(MOVDIRI, 0x00000007, 0, RTE_REG_ECX, 27)
+       FEAT_DEF(MOVDIR64B, 0x00000007, 0, RTE_REG_ECX, 28)
+       FEAT_DEF(AVX512VP2INTERSECT, 0x00000007, 0, RTE_REG_EDX, 8)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +10 -0
index 25ba47b96..f8f73b19f 100644
@@ -113,6 +113,24 @@ enum rte_cpu_flag_t {
        /* (EAX 80000007h) EDX features */
        RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
+       RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and Quadword */
+       RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused Multiply-Add */
+       RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict Detection*/
+       RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
+       RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
+       RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit Manipulation */
+       RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit Manipulation 2 */
+       RTE_CPUFLAG_GFNI,                   /**< Galois Field New Instructions */
+       RTE_CPUFLAG_VAES,                   /**< Vector AES */
+       RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less Multiply */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 135

Quoted 10 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +8 -0
+       RTE_CPUFLAG_AVX512VNNI,             /**< AVX512 Vector Neural Network Instructions */
+       RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms */
+       RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount */
+       RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
+       RTE_CPUFLAG_MOVDIRI,                /**< Direct Store Instructions */
+       RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store Instructions 64B */
+       RTE_CPUFLAG_AVX512VP2INTERSECT,     /**< AVX512 Two Register Intersection */
+
        /* The last item */
        RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */

This is seen as an ABI break because of the change on _NUMFLAGS:
https://travis-ci.com/github/ovsrobot/dpdk/jobs/302524264#L2351

Signature · 1 line
David Marchand
#21 lore raw

Re: [dpdk-dev] [PATCH v2] eal/cpuflags: add x86 based cpu flags

Quoted 110 lines

-----Original Message-----
From: David Marchand <[email protected]>
Sent: Friday, March 27, 2020 12:24 PM
To: Laatz, Kevin <[email protected]>
Cc: dev <[email protected]>; Richardson, Bruce <[email protected]>; Van Haaren, Harry <[email protected]>; Neil Horman <[email protected]>; Thomas Monjalon <[email protected]>; Honnappa Nagarahalli <[email protected]>; Dodji Seketeli <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] eal/cpuflags: add x86 based cpu flags

Quoted 7 lines · Kevin Laatz

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

The CPUID leaf information can be found in Section 1.7 of this document:
https://software.intel.com/sites/default/files/managed/c5/15/architecture-

instruction-set-extensions-programming-reference.pdf

Quoted 20 lines

The following CPU flags are added in this patch:
- AVX-512 doubleword and quadword instructions.
- AVX-512 integer fused multiply-add instructions.
- AVX-512 conflict detection instructions.
- AVX-512 byte and word instructions.
- AVX-512 vector length instructions.
- AVX-512 vector bit manipulation instructions.
- AVX-512 vector bit manipulation 2 instructions.
- Galois field new instructions.
- Vector AES instructions.
- Vector carry-less multiply instructions.
- AVX-512 vector neural network instructions.
- AVX-512 for bit algorithm instructions.
- AVX-512 vector popcount instructions.
- Cache line demote instructions.
- Direct store instructions.
- Direct store 64B instructions.
- AVX-512 two register intersection instructions.

Review

Quoted 7 lines
---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c  | 18 ++++++++++++++++++
 .../common/include/arch/x86/rte_cpuflags.h     | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)
(quoted diff) +0 -0

b/lib/librte_eal/common/arch/x86/rte_cpuflags.c

Review

Quoted 29 lines

index 6492df556..30439e795 100644

lib/librte_eal/common/arch/x86/rte_cpuflags.c +18 -0
@@ -120,6 +120,24 @@ const struct feature_entry rte_cpu_feature_table[] = {
        FEAT_DEF(EM64T, 0x80000001, 0, RTE_REG_EDX, 29)
 
        FEAT_DEF(INVTSC, 0x80000007, 0, RTE_REG_EDX,  8)
+
+       FEAT_DEF(AVX512DQ, 0x00000007, 0, RTE_REG_EBX, 17)
+       FEAT_DEF(AVX512IFMA, 0x00000007, 0, RTE_REG_EBX, 21)
+       FEAT_DEF(AVX512CD, 0x00000007, 0, RTE_REG_EBX, 28)
+       FEAT_DEF(AVX512BW, 0x00000007, 0, RTE_REG_EBX, 30)
+       FEAT_DEF(AVX512VL, 0x00000007, 0, RTE_REG_EBX, 31)
+       FEAT_DEF(AVX512VBMI, 0x00000007, 0, RTE_REG_ECX, 1)
+       FEAT_DEF(AVX512VBMI2, 0x00000007, 0, RTE_REG_ECX, 6)
+       FEAT_DEF(GFNI, 0x00000007, 0, RTE_REG_ECX, 8)
+       FEAT_DEF(VAES, 0x00000007, 0, RTE_REG_ECX, 9)
+       FEAT_DEF(VPCLMULQDQ, 0x00000007, 0, RTE_REG_ECX, 10)
+       FEAT_DEF(AVX512VNNI, 0x00000007, 0, RTE_REG_ECX, 11)
+       FEAT_DEF(AVX512BITALG, 0x00000007, 0, RTE_REG_ECX, 12)
+       FEAT_DEF(AVX512VPOPCNTDQ, 0x00000007, 0, RTE_REG_ECX,  14)
+       FEAT_DEF(CLDEMOTE, 0x00000007, 0, RTE_REG_ECX, 25)
+       FEAT_DEF(MOVDIRI, 0x00000007, 0, RTE_REG_ECX, 27)
+       FEAT_DEF(MOVDIR64B, 0x00000007, 0, RTE_REG_ECX, 28)
+       FEAT_DEF(AVX512VP2INTERSECT, 0x00000007, 0, RTE_REG_EDX, 8)
 };
 
 int
(quoted diff) +0 -0

b/lib/librte_eal/common/include/arch/x86/rte_cpuflags.h

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 116

Quoted 8 lines

index 25ba47b96..f8f73b19f 100644

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
@@ -113,6 +113,24 @@ enum rte_cpu_flag_t {
        /* (EAX 80000007h) EDX features */
        RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
+       RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and

Quadword */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 117

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused

Multiply-Add */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t {

Quoted 4 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +4 -0
+       RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict Detection*/
+       RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
+       RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
+       RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit

Manipulation */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 122

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit

Manipulation 2 */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 123

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_GFNI,                   /**< Galois Field New

Instructions */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 125

Quoted 2 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +2 -0
+       RTE_CPUFLAG_VAES,                   /**< Vector AES */
+       RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less Multiply

*/

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 126

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VNNI,             /**< AVX512 Vector Neural

Network Instructions */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t {

Quoted 4 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +4 -0
+       RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms */
+       RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount */
+       RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
+       RTE_CPUFLAG_MOVDIRI,                /**< Direct Store Instructions

*/

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 131

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store Instructions

64B */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 132

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VP2INTERSECT,     /**< AVX512 Two Register
Quoted 8 lines

Intersection */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t {

Quoted 3 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+
        /* The last item */
        RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the

last! */

This is seen as an ABI break because of the change on _NUMFLAGS:
https://travis-ci.com/github/ovsrobot/dpdk/jobs/302524264#L2351

Correct a publicly exposed enum max value has changed - I don't believe this is an ABI break, but a backward compatible ABI change was expected with this patchset.

Code compiled against eg 19.11 or 20.02 is expected to continue operating correctly.
The new flags were only added at the end of the enum, ensuring to not change the meaning of any existing flags which would be compiled-in constants to the application binary.

The actual size of the CPU flags array is a DPDK internal structure (in a .c file), and is hidden from the application, and never allocated by an application - so no possible mismatch in ABI there? Applications compiled against the older ABI will just not know about the newer flags - but suffer no breakage.

@ABI compatibility folks, please review too - but to the best of my understanding this is not an ABI break, but a backwards compatible update of CPU flag lists?

Thanks for flagging the CI results David!

Regards, -Harry

#22 lore raw

Re: [dpdk-dev] [PATCH v2] eal/cpuflags: add x86 based cpu flags

Quoted 115 lines · Harry
Quoted 115 lines

-----Original Message-----
From: David Marchand <[email protected]>
Sent: Friday, March 27, 2020 12:24 PM
To: Laatz, Kevin <[email protected]>
Cc: dev <[email protected]>; Richardson, Bruce <[email protected]>; Van Haaren, Harry <[email protected]>; Neil Horman <[email protected]>; Thomas Monjalon <[email protected]>; Honnappa Nagarahalli <[email protected]>; Dodji Seketeli <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] eal/cpuflags: add x86 based cpu flags

Quoted 7 lines · Kevin Laatz

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

The CPUID leaf information can be found in Section 1.7 of this document:
https://software.intel.com/sites/default/files/managed/c5/15/architecture-

instruction-set-extensions-programming-reference.pdf

Quoted 20 lines

The following CPU flags are added in this patch:
- AVX-512 doubleword and quadword instructions.
- AVX-512 integer fused multiply-add instructions.
- AVX-512 conflict detection instructions.
- AVX-512 byte and word instructions.
- AVX-512 vector length instructions.
- AVX-512 vector bit manipulation instructions.
- AVX-512 vector bit manipulation 2 instructions.
- Galois field new instructions.
- Vector AES instructions.
- Vector carry-less multiply instructions.
- AVX-512 vector neural network instructions.
- AVX-512 for bit algorithm instructions.
- AVX-512 vector popcount instructions.
- Cache line demote instructions.
- Direct store instructions.
- Direct store 64B instructions.
- AVX-512 two register intersection instructions.

Review

Quoted 7 lines
---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c  | 18 ++++++++++++++++++
 .../common/include/arch/x86/rte_cpuflags.h     | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)
(quoted diff) +0 -0

b/lib/librte_eal/common/arch/x86/rte_cpuflags.c

Review

Quoted 29 lines

index 6492df556..30439e795 100644

lib/librte_eal/common/arch/x86/rte_cpuflags.c +18 -0
@@ -120,6 +120,24 @@ const struct feature_entry rte_cpu_feature_table[] = {
        FEAT_DEF(EM64T, 0x80000001, 0, RTE_REG_EDX, 29)
 
        FEAT_DEF(INVTSC, 0x80000007, 0, RTE_REG_EDX,  8)
+
+       FEAT_DEF(AVX512DQ, 0x00000007, 0, RTE_REG_EBX, 17)
+       FEAT_DEF(AVX512IFMA, 0x00000007, 0, RTE_REG_EBX, 21)
+       FEAT_DEF(AVX512CD, 0x00000007, 0, RTE_REG_EBX, 28)
+       FEAT_DEF(AVX512BW, 0x00000007, 0, RTE_REG_EBX, 30)
+       FEAT_DEF(AVX512VL, 0x00000007, 0, RTE_REG_EBX, 31)
+       FEAT_DEF(AVX512VBMI, 0x00000007, 0, RTE_REG_ECX, 1)
+       FEAT_DEF(AVX512VBMI2, 0x00000007, 0, RTE_REG_ECX, 6)
+       FEAT_DEF(GFNI, 0x00000007, 0, RTE_REG_ECX, 8)
+       FEAT_DEF(VAES, 0x00000007, 0, RTE_REG_ECX, 9)
+       FEAT_DEF(VPCLMULQDQ, 0x00000007, 0, RTE_REG_ECX, 10)
+       FEAT_DEF(AVX512VNNI, 0x00000007, 0, RTE_REG_ECX, 11)
+       FEAT_DEF(AVX512BITALG, 0x00000007, 0, RTE_REG_ECX, 12)
+       FEAT_DEF(AVX512VPOPCNTDQ, 0x00000007, 0, RTE_REG_ECX,  14)
+       FEAT_DEF(CLDEMOTE, 0x00000007, 0, RTE_REG_ECX, 25)
+       FEAT_DEF(MOVDIRI, 0x00000007, 0, RTE_REG_ECX, 27)
+       FEAT_DEF(MOVDIR64B, 0x00000007, 0, RTE_REG_ECX, 28)
+       FEAT_DEF(AVX512VP2INTERSECT, 0x00000007, 0, RTE_REG_EDX, 8)
 };
 
 int
(quoted diff) +0 -0

b/lib/librte_eal/common/include/arch/x86/rte_cpuflags.h

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 116

Quoted 8 lines

index 25ba47b96..f8f73b19f 100644

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
@@ -113,6 +113,24 @@ enum rte_cpu_flag_t {
        /* (EAX 80000007h) EDX features */
        RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
+       RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and

Quadword */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 117

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused

Multiply-Add */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t {

Quoted 4 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +4 -0
+       RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict Detection*/
+       RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
+       RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
+       RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit

Manipulation */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 122

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit

Manipulation 2 */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 123

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_GFNI,                   /**< Galois Field New

Instructions */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 125

Quoted 2 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +2 -0
+       RTE_CPUFLAG_VAES,                   /**< Vector AES */
+       RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less Multiply

*/

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 126

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VNNI,             /**< AVX512 Vector Neural

Network Instructions */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t {

Quoted 4 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +4 -0
+       RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms */
+       RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount */
+       RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
+       RTE_CPUFLAG_MOVDIRI,                /**< Direct Store Instructions

*/

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 131

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store Instructions

64B */

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 132

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VP2INTERSECT,     /**< AVX512 Two Register

Intersection */

Quoted 3 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+
        /* The last item */
        RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the
Quoted 6 lines
Quoted 4 lines

last! */

This is seen as an ABI break because of the change on _NUMFLAGS:
https://travis-ci.com/github/ovsrobot/dpdk/jobs/302524264#L2351

Correct a publicly exposed enum max value has changed - I don't believe this is an ABI break, but a backward compatible ABI change was expected with this patchset.

A change is that if an application was passing incorrect values to the functions taking this enum as input, then now it would succeed. I don't really see the point in doing this :-).

Quoted 9 lines

Code compiled against eg 19.11 or 20.02 is expected to continue operating correctly.
The new flags were only added at the end of the enum, ensuring to not change the meaning of any existing flags which would be compiled-in constants to the application binary.

The actual size of the CPU flags array is a DPDK internal structure (in a .c file), and is hidden from the application, and never allocated by an application - so no possible mismatch in ABI there? Applications compiled against the older ABI will just not know about the newer flags - but suffer no breakage.

@ABI compatibility folks, please review too - but to the best of my understanding this is not an ABI break, but a backwards compatible update of CPU flag lists?

Thanks for flagging the CI results David!

I'd like people to look at this by themselves, not wait for Thomas, Aaron or me to check.

When a failure is caught by the robot, a mail is sent to the submitter afaiu (I suppose with Travis instability wrt ARM jobs, the mail might not have been sent this time).
It is then the responsibility of the submitter to either discuss the report on the mailing or/and waive it in devtools/libabigail.abignore.

Thanks.

Signature · 1 line
David Marchand
#23 lore raw

Re: [dpdk-dev] [PATCH v2] eal/cpuflags: add x86 based cpu flags

In reply to David Marchand
Quoted 86 lines · David Marchand
Quoted 85 lines · Kevin Laatz

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

The CPUID leaf information can be found in Section 1.7 of this document:
https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf

The following CPU flags are added in this patch:
- AVX-512 doubleword and quadword instructions.
- AVX-512 integer fused multiply-add instructions.
- AVX-512 conflict detection instructions.
- AVX-512 byte and word instructions.
- AVX-512 vector length instructions.
- AVX-512 vector bit manipulation instructions.
- AVX-512 vector bit manipulation 2 instructions.
- Galois field new instructions.
- Vector AES instructions.
- Vector carry-less multiply instructions.
- AVX-512 vector neural network instructions.
- AVX-512 for bit algorithm instructions.
- AVX-512 vector popcount instructions.
- Cache line demote instructions.
- Direct store instructions.
- Direct store 64B instructions.
- AVX-512 two register intersection instructions.

---
 lib/librte_eal/common/arch/x86/rte_cpuflags.c  | 18 ++++++++++++++++++
 .../common/include/arch/x86/rte_cpuflags.h     | 18 ++++++++++++++++++
 2 files changed, 36 insertions(+)
lib/librte_eal/common/arch/x86/rte_cpuflags.c +18 -0
index 6492df556..30439e795 100644
@@ -120,6 +120,24 @@ const struct feature_entry rte_cpu_feature_table[] = {
        FEAT_DEF(EM64T, 0x80000001, 0, RTE_REG_EDX, 29)
 
        FEAT_DEF(INVTSC, 0x80000007, 0, RTE_REG_EDX,  8)
+
+       FEAT_DEF(AVX512DQ, 0x00000007, 0, RTE_REG_EBX, 17)
+       FEAT_DEF(AVX512IFMA, 0x00000007, 0, RTE_REG_EBX, 21)
+       FEAT_DEF(AVX512CD, 0x00000007, 0, RTE_REG_EBX, 28)
+       FEAT_DEF(AVX512BW, 0x00000007, 0, RTE_REG_EBX, 30)
+       FEAT_DEF(AVX512VL, 0x00000007, 0, RTE_REG_EBX, 31)
+       FEAT_DEF(AVX512VBMI, 0x00000007, 0, RTE_REG_ECX, 1)
+       FEAT_DEF(AVX512VBMI2, 0x00000007, 0, RTE_REG_ECX, 6)
+       FEAT_DEF(GFNI, 0x00000007, 0, RTE_REG_ECX, 8)
+       FEAT_DEF(VAES, 0x00000007, 0, RTE_REG_ECX, 9)
+       FEAT_DEF(VPCLMULQDQ, 0x00000007, 0, RTE_REG_ECX, 10)
+       FEAT_DEF(AVX512VNNI, 0x00000007, 0, RTE_REG_ECX, 11)
+       FEAT_DEF(AVX512BITALG, 0x00000007, 0, RTE_REG_ECX, 12)
+       FEAT_DEF(AVX512VPOPCNTDQ, 0x00000007, 0, RTE_REG_ECX,  14)
+       FEAT_DEF(CLDEMOTE, 0x00000007, 0, RTE_REG_ECX, 25)
+       FEAT_DEF(MOVDIRI, 0x00000007, 0, RTE_REG_ECX, 27)
+       FEAT_DEF(MOVDIR64B, 0x00000007, 0, RTE_REG_ECX, 28)
+       FEAT_DEF(AVX512VP2INTERSECT, 0x00000007, 0, RTE_REG_EDX, 8)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +15 -0
index 25ba47b96..f8f73b19f 100644
@@ -113,6 +113,24 @@ enum rte_cpu_flag_t {
        /* (EAX 80000007h) EDX features */
        RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
+       RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and Quadword */
+       RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused Multiply-Add */
+       RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict Detection*/
+       RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
+       RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
+       RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit Manipulation */
+       RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit Manipulation 2 */
+       RTE_CPUFLAG_GFNI,                   /**< Galois Field New Instructions */
+       RTE_CPUFLAG_VAES,                   /**< Vector AES */
+       RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less Multiply */
+       RTE_CPUFLAG_AVX512VNNI,             /**< AVX512 Vector Neural Network Instructions */
+       RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms */
+       RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount */
+       RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
+       RTE_CPUFLAG_MOVDIRI,                /**< Direct Store Instructions */
Quoted 9 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 135

Quoted 5 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +3 -0
+       RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store Instructions 64B */
+       RTE_CPUFLAG_AVX512VP2INTERSECT,     /**< AVX512 Two Register Intersection */
+
        /* The last item */
        RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */

This is seen as an ABI break because of the change on _NUMFLAGS:
https://travis-ci.com/github/ovsrobot/dpdk/jobs/302524264#L2351

It shouldn't be, as the only API calls we expose that use rte_cpu_flag_t accept it as an integer parameter to see if the flag is enabled. Theres no use of the enum in a public array or any struct that is sized based on the number of flags, so you should be good to go
Neil

Quoted 5 lines
Signature · 2 lines
-- 
David Marchand
#24 lore raw

Re: [dpdk-dev] [PATCH v2] eal/cpuflags: add x86 based cpu flags

27/03/2020 14:44, Neil Horman:

Quoted 32 lines · David Marchand
Quoted 22 lines · Kevin Laatz
Quoted 21 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +15 -0
@@ -113,6 +113,24 @@ enum rte_cpu_flag_t {
        /* (EAX 80000007h) EDX features */
        RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
+       RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and Quadword */
+       RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused Multiply-Add */
+       RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict Detection*/
+       RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
+       RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
+       RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit Manipulation */
+       RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit Manipulation 2 */
+       RTE_CPUFLAG_GFNI,                   /**< Galois Field New Instructions */
+       RTE_CPUFLAG_VAES,                   /**< Vector AES */
+       RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less Multiply */
+       RTE_CPUFLAG_AVX512VNNI,             /**< AVX512 Vector Neural Network Instructions */
+       RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms */
+       RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount */
+       RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
+       RTE_CPUFLAG_MOVDIRI,                /**< Direct Store Instructions */
Quoted 9 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 135

Quoted 5 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +3 -0
+       RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store Instructions 64B */
+       RTE_CPUFLAG_AVX512VP2INTERSECT,     /**< AVX512 Two Register Intersection */
+
        /* The last item */
        RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */

This is seen as an ABI break because of the change on _NUMFLAGS:
https://travis-ci.com/github/ovsrobot/dpdk/jobs/302524264#L2351

Quoted 4 lines

It shouldn't be, as the only API calls we expose that use rte_cpu_flag_t accept it as an integer parameter to see if the flag is enabled. Theres no use of the enum in a public array or any struct that is sized based on the number of flags, so you should be good to go

Indeed I cannot imagine an ABI incompatibility in this case. The only behaviour change is to accept new (higher) RTE_CPUFLAG values in functions rte_cpu_get_flag_enabled() and rte_cpu_get_flag_name(). Is changing the range of valid values an ABI break?
Why is it flagged by libabigail?

#25 lore raw

Re: [dpdk-dev] [PATCH v2] eal/cpuflags: add x86 based cpu flags

Quoted 64 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Friday, March 27, 2020 2:16 PM
To: Neil Horman <[email protected]>; Dodji Seketeli <[email protected]>; [email protected]
Cc: David Marchand <[email protected]>; Laatz, Kevin <[email protected]>; dev <[email protected]>; Richardson, Bruce <[email protected]>; Van Haaren, Harry <[email protected]>; Honnappa Nagarahalli <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] eal/cpuflags: add x86 based cpu flags

27/03/2020 14:44, Neil Horman:

Quoted 2 lines · David Marchand
Quoted 1 line

On Wed, Mar 25, 2020 at 12:11 PM Kevin Laatz <[email protected]>

Quoted 7 lines · wrote:
Quoted 7 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 116

Quoted 7 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
@@ -113,6 +113,24 @@ enum rte_cpu_flag_t {
        /* (EAX 80000007h) EDX features */
        RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
+       RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and

Quadword */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 117

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused

Multiply-Add */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 118

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict

Detection*/

Quoted 3 lines
Quoted 3 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t {

Quoted 3 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +3 -0
+       RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
+       RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
+       RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit

Manipulation */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 122

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit

Manipulation 2 */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 123

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_GFNI,                   /**< Galois Field New

Instructions */

Quoted 2 lines
Quoted 2 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 125

Quoted 2 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +2 -0
+       RTE_CPUFLAG_VAES,                   /**< Vector AES */
+       RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less

Multiply */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 126

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VNNI,             /**< AVX512 Vector Neural

Network Instructions */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 127

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms

*/

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 128

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount

*/

Quoted 2 lines
Quoted 2 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 130

Quoted 2 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +2 -0
+       RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
+       RTE_CPUFLAG_MOVDIRI,                /**< Direct Store

Instructions */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 131

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store

Instructions 64B */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 132

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VP2INTERSECT,     /**< AVX512 Two Register

Intersection */

Quoted 3 lines
Quoted 3 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t {

Quoted 3 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+
        /* The last item */
        RTE_CPUFLAG_NUMFLAGS,               /**< This should always be

the last! */

Quoted 5 lines
Quoted 4 lines

This is seen as an ABI break because of the change on _NUMFLAGS:
https://travis-ci.com/github/ovsrobot/dpdk/jobs/302524264#L2351

It shouldn't be, as the only API calls we expose that use rte_cpu_flag_t

accept

Quoted 1 line

it as an integer parameter to see if the flag is enabled. Theres no use of

the

Quoted 1 line

enum in a public array or any struct that is sized based on the number of

Quoted 8 lines

flags,

Quoted 1 line

so you should be good to go

Indeed I cannot imagine an ABI incompatibility in this case. The only behaviour change is to accept new (higher) RTE_CPUFLAG values in functions rte_cpu_get_flag_enabled() and rte_cpu_get_flag_name(). Is changing the range of valid values an ABI break?
Why is it flagged by libabigail?

If this enum _MAX value was used by the application to allocate an array, that later our DPDK code would write to it could cause out-of-bounds array accesses of the application supplied array. Abigail doesn't know what applications could use the value for, so it flags it.

IMO Abigail is right to flag it to us - a manual review to understand what that _MAX enum value is used for, and then decide on a case by case basis seems the best way forward to me.

Thanks Neil/Thomas for reviewing, as reply in this thread, I also believe this is not going to break ABI.

#26 lore raw

Re: [dpdk-dev] [PATCH v2] eal/cpuflags: add x86 based cpu flags

Quoted 73 lines · Harry
Quoted 64 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Friday, March 27, 2020 2:16 PM
To: Neil Horman <[email protected]>; Dodji Seketeli <[email protected]>; [email protected]
Cc: David Marchand <[email protected]>; Laatz, Kevin <[email protected]>; dev <[email protected]>; Richardson, Bruce <[email protected]>; Van Haaren, Harry <[email protected]>; Honnappa Nagarahalli <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] eal/cpuflags: add x86 based cpu flags

27/03/2020 14:44, Neil Horman:

Quoted 2 lines · David Marchand
Quoted 1 line

On Wed, Mar 25, 2020 at 12:11 PM Kevin Laatz <[email protected]>

Quoted 7 lines · wrote:
Quoted 7 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 116

Quoted 7 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
@@ -113,6 +113,24 @@ enum rte_cpu_flag_t {
        /* (EAX 80000007h) EDX features */
        RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
+       RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and

Quadword */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 117

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused

Multiply-Add */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 118

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict

Detection*/

Quoted 3 lines
Quoted 3 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t {

Quoted 3 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +3 -0
+       RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
+       RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
+       RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit

Manipulation */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 122

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit

Manipulation 2 */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 123

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_GFNI,                   /**< Galois Field New

Instructions */

Quoted 2 lines
Quoted 2 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 125

Quoted 2 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +2 -0
+       RTE_CPUFLAG_VAES,                   /**< Vector AES */
+       RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less

Multiply */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 126

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VNNI,             /**< AVX512 Vector Neural

Network Instructions */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 127

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms

*/

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 128

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount

*/

Quoted 2 lines
Quoted 2 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 130

Quoted 2 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +2 -0
+       RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
+       RTE_CPUFLAG_MOVDIRI,                /**< Direct Store

Instructions */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 131

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store

Instructions 64B */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 132

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VP2INTERSECT,     /**< AVX512 Two Register

Intersection */

Quoted 3 lines
Quoted 3 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t {

Quoted 3 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+
        /* The last item */
        RTE_CPUFLAG_NUMFLAGS,               /**< This should always be

the last! */

Quoted 5 lines
Quoted 4 lines

This is seen as an ABI break because of the change on _NUMFLAGS:
https://travis-ci.com/github/ovsrobot/dpdk/jobs/302524264#L2351

It shouldn't be, as the only API calls we expose that use rte_cpu_flag_t

accept

Quoted 1 line

it as an integer parameter to see if the flag is enabled. Theres no use of

the

Quoted 1 line

enum in a public array or any struct that is sized based on the number of

Quoted 8 lines

flags,

Quoted 1 line

so you should be good to go

Indeed I cannot imagine an ABI incompatibility in this case. The only behaviour change is to accept new (higher) RTE_CPUFLAG values in functions rte_cpu_get_flag_enabled() and rte_cpu_get_flag_name(). Is changing the range of valid values an ABI break?
Why is it flagged by libabigail?

Quoted 6 lines

If this enum _MAX value was used by the application to allocate an array, that later our DPDK code would write to it could cause out-of-bounds array accesses of the application supplied array. Abigail doesn't know what applications could use the value for, so it flags it.

IMO Abigail is right to flag it to us - a manual review to understand what that _MAX enum value is used for, and then decide on a case by case basis seems the best way forward to me.

Thanks Neil/Thomas for reviewing, as reply in this thread, I also believe this is not going to break ABI.

+1 to Harrry's comments.
I can't immediately see how this might break the ABI either.

#27 lore raw

Re: [dpdk-dev] [PATCH v2] eal/cpuflags: add x86 based cpu flags

27/03/2020 15:36, Ray Kinsella:

Quoted 66 lines · Harry
Quoted 65 lines

From: Thomas Monjalon <[email protected]>

Quoted 53 lines

27/03/2020 14:44, Neil Horman:

Quoted 2 lines · David Marchand
Quoted 1 line

On Wed, Mar 25, 2020 at 12:11 PM Kevin Laatz <[email protected]>

Quoted 7 lines · wrote:
Quoted 7 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 116

Quoted 7 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
@@ -113,6 +113,24 @@ enum rte_cpu_flag_t {
        /* (EAX 80000007h) EDX features */
        RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
+       RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and

Quadword */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 117

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused

Multiply-Add */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 118

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict

Detection*/

Quoted 3 lines
Quoted 3 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t {

Quoted 3 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +3 -0
+       RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
+       RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
+       RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit

Manipulation */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 122

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit

Manipulation 2 */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 123

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_GFNI,                   /**< Galois Field New

Instructions */

Quoted 2 lines
Quoted 2 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 125

Quoted 2 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +2 -0
+       RTE_CPUFLAG_VAES,                   /**< Vector AES */
+       RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less

Multiply */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 126

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VNNI,             /**< AVX512 Vector Neural

Network Instructions */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 127

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms

*/

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 128

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount

*/

Quoted 2 lines
Quoted 2 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 130

Quoted 2 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +2 -0
+       RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
+       RTE_CPUFLAG_MOVDIRI,                /**< Direct Store

Instructions */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 131

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store

Instructions 64B */

Quoted 1 line
Quoted 1 line

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t { · line 132

Quoted 1 line
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+       RTE_CPUFLAG_AVX512VP2INTERSECT,     /**< AVX512 Two Register

Intersection */

Quoted 3 lines
Quoted 3 lines

lib/librte_eal/common/include/arch/x86/rte_cpuflags.h enum rte_cpu_flag_t {

Quoted 3 lines
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +1 -0
+
        /* The last item */
        RTE_CPUFLAG_NUMFLAGS,               /**< This should always be

the last! */

Quoted 5 lines
Quoted 4 lines

This is seen as an ABI break because of the change on _NUMFLAGS:
https://travis-ci.com/github/ovsrobot/dpdk/jobs/302524264#L2351

It shouldn't be, as the only API calls we expose that use rte_cpu_flag_t

accept

Quoted 1 line

it as an integer parameter to see if the flag is enabled. Theres no use of

the

Quoted 1 line

enum in a public array or any struct that is sized based on the number of

Quoted 8 lines

flags,

Quoted 1 line

so you should be good to go

Indeed I cannot imagine an ABI incompatibility in this case. The only behaviour change is to accept new (higher) RTE_CPUFLAG values in functions rte_cpu_get_flag_enabled() and rte_cpu_get_flag_name(). Is changing the range of valid values an ABI break?
Why is it flagged by libabigail?

If this enum _MAX value was used by the application to allocate an array, that later our DPDK code would write to it could cause out-of-bounds array accesses of the application supplied array. Abigail doesn't know what applications could use the value for, so it flags it.

Quoted 7 lines
Quoted 4 lines

IMO Abigail is right to flag it to us - a manual review to understand what that _MAX enum value is used for, and then decide on a case by case basis seems the best way forward to me.

Thanks Neil/Thomas for reviewing, as reply in this thread, I also believe this is not going to break ABI.

+1 to Harrry's comments.
I can't immediately see how this might break the ABI either.

So we all agree that increasing the range of valid rte_cpu_flag_t values is OK for ABI compatibility.
This conclusion must be written as a libabigail exception in this patch.

#28 lore raw

PATCH v3 1/1 eal/cpuflags: add x86 based cpu flags

In reply to Kevin Laatz

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

The CPUID leaf information can be found in Section 1.7 of this document:
https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf

The following CPU flags are added in this patch:
- AVX-512 doubleword and quadword instructions.
- AVX-512 integer fused multiply-add instructions.
- AVX-512 conflict detection instructions.
- AVX-512 byte and word instructions.
- AVX-512 vector length instructions.
- AVX-512 vector bit manipulation instructions.
- AVX-512 vector bit manipulation 2 instructions.
- Galois field new instructions.
- Vector AES instructions.
- Vector carry-less multiply instructions.
- AVX-512 vector neural network instructions.
- AVX-512 for bit algorithm instructions.
- AVX-512 vector popcount instructions.
- Cache line demote instructions.
- Direct store instructions.
- Direct store 64B instructions.
- AVX-512 two register intersection instructions.

---
v2:
- Squashed patch set into single patch.

v3:
- Add abignore entry for 'rte_cpu_flag_t'.

---
 devtools/libabigail.abignore                   |  5 +++++
 lib/librte_eal/common/arch/x86/rte_cpuflags.c  | 18 ++++++++++++++++++
 .../common/include/arch/x86/rte_cpuflags.h     | 18 ++++++++++++++++++
 3 files changed, 41 insertions(+)
devtools/libabigail.abignore +5 -0
index a59df8f13..eb252ae0e 100644
@@ -11,3 +11,8 @@
         type_kind = enum
         name = rte_crypto_asym_xform_type
         changed_enumerators = RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
+; Ignore this enum update as it should not be allocated by the application
+[suppress_type]
+	type_kind = enum
+	name = rte_cpu_flag_t
+	changed_enumerators = RTE_CPUFLAG_NUMFLAGS
lib/librte_eal/common/arch/x86/rte_cpuflags.c +18 -0
index 6492df556..30439e795 100644
@@ -120,6 +120,24 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(EM64T, 0x80000001, 0, RTE_REG_EDX, 29)
 
 	FEAT_DEF(INVTSC, 0x80000007, 0, RTE_REG_EDX,  8)
+
+	FEAT_DEF(AVX512DQ, 0x00000007, 0, RTE_REG_EBX, 17)
+	FEAT_DEF(AVX512IFMA, 0x00000007, 0, RTE_REG_EBX, 21)
+	FEAT_DEF(AVX512CD, 0x00000007, 0, RTE_REG_EBX, 28)
+	FEAT_DEF(AVX512BW, 0x00000007, 0, RTE_REG_EBX, 30)
+	FEAT_DEF(AVX512VL, 0x00000007, 0, RTE_REG_EBX, 31)
+	FEAT_DEF(AVX512VBMI, 0x00000007, 0, RTE_REG_ECX, 1)
+	FEAT_DEF(AVX512VBMI2, 0x00000007, 0, RTE_REG_ECX, 6)
+	FEAT_DEF(GFNI, 0x00000007, 0, RTE_REG_ECX, 8)
+	FEAT_DEF(VAES, 0x00000007, 0, RTE_REG_ECX, 9)
+	FEAT_DEF(VPCLMULQDQ, 0x00000007, 0, RTE_REG_ECX, 10)
+	FEAT_DEF(AVX512VNNI, 0x00000007, 0, RTE_REG_ECX, 11)
+	FEAT_DEF(AVX512BITALG, 0x00000007, 0, RTE_REG_ECX, 12)
+	FEAT_DEF(AVX512VPOPCNTDQ, 0x00000007, 0, RTE_REG_ECX,  14)
+	FEAT_DEF(CLDEMOTE, 0x00000007, 0, RTE_REG_ECX, 25)
+	FEAT_DEF(MOVDIRI, 0x00000007, 0, RTE_REG_ECX, 27)
+	FEAT_DEF(MOVDIR64B, 0x00000007, 0, RTE_REG_ECX, 28)
+	FEAT_DEF(AVX512VP2INTERSECT, 0x00000007, 0, RTE_REG_EDX, 8)
 };
 
 int
lib/librte_eal/common/include/arch/x86/rte_cpuflags.h +18 -0
index 25ba47b96..f8f73b19f 100644
@@ -113,6 +113,24 @@ enum rte_cpu_flag_t {
 	/* (EAX 80000007h) EDX features */
 	RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
+	RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and Quadword */
+	RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused Multiply-Add */
+	RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict Detection*/
+	RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
+	RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
+	RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit Manipulation */
+	RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit Manipulation 2 */
+	RTE_CPUFLAG_GFNI,                   /**< Galois Field New Instructions */
+	RTE_CPUFLAG_VAES,                   /**< Vector AES */
+	RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less Multiply */
+	RTE_CPUFLAG_AVX512VNNI,             /**< AVX512 Vector Neural Network Instructions */
+	RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms */
+	RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount */
+	RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
+	RTE_CPUFLAG_MOVDIRI,                /**< Direct Store Instructions */
+	RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store Instructions 64B */
+	RTE_CPUFLAG_AVX512VP2INTERSECT,     /**< AVX512 Two Register Intersection */
+
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
 };
Signature · 1 line
2.17.1
Acked-by on v3 1/1
#29 lore raw

Re: [dpdk-dev] [PATCH v3] eal/cpuflags: add x86 based cpu flags

Quoted 10 lines

-----Original Message-----
From: Laatz, Kevin <[email protected]>
Sent: Monday, March 30, 2020 1:15 PM
To: [email protected]
Cc: Richardson, Bruce <[email protected]>; Van Haaren, Harry <[email protected]>; [email protected]; Kinsella, Ray <[email protected]>; [email protected]; [email protected]; Laatz, Kevin <[email protected]>
Subject: [PATCH v3] eal/cpuflags: add x86 based cpu flags

Quoted 7 lines

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

The CPUID leaf information can be found in Section 1.7 of this document:
https://software.intel.com/sites/default/files/managed/c5/15/architecture-
instruction-set-extensions-programming-reference.pdf

Section numbering has been updated, and there doesn't seem to be a stable link to a specific version of the doc, recommend to refer to table name instead? Table 1-2. "Information Returned by CPUID Instruction"

Quoted 19 lines

The following CPU flags are added in this patch:
- AVX-512 doubleword and quadword instructions.
- AVX-512 integer fused multiply-add instructions.
- AVX-512 conflict detection instructions.
- AVX-512 byte and word instructions.
- AVX-512 vector length instructions.
- AVX-512 vector bit manipulation instructions.
- AVX-512 vector bit manipulation 2 instructions.
- Galois field new instructions.
- Vector AES instructions.
- Vector carry-less multiply instructions.
- AVX-512 vector neural network instructions.
- AVX-512 for bit algorithm instructions.
- AVX-512 vector popcount instructions.
- Cache line demote instructions.
- Direct store instructions.
- Direct store 64B instructions.
- AVX-512 two register intersection instructions.

Quoted 1 line

Required a git am --3way due to some file movements in master, but applied cleanly on auto-merge.

Add a VNNI documentation line wrap on new line:
RTE_CPU_FLAG_AVX512VNNI,
/**< AVX512 Vector ... */

With the above changes/updates;

#30 lore raw

PATCH v4 1/1 eal/cpuflags: add x86 based cpu flags

In reply to Kevin Laatz

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

The CPUID leaf information can be found in
Table 1-2. "Information Returned by CPUID Instruction" of this document:
https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf

The following CPU flags are added in this patch:
- AVX-512 doubleword and quadword instructions.
- AVX-512 integer fused multiply-add instructions.
- AVX-512 conflict detection instructions.
- AVX-512 byte and word instructions.
- AVX-512 vector length instructions.
- AVX-512 vector bit manipulation instructions.
- AVX-512 vector bit manipulation 2 instructions.
- Galois field new instructions.
- Vector AES instructions.
- Vector carry-less multiply instructions.
- AVX-512 vector neural network instructions.
- AVX-512 for bit algorithm instructions.
- AVX-512 vector popcount instructions.
- Cache line demote instructions.
- Direct store instructions.
- Direct store 64B instructions.
- AVX-512 two register intersection instructions.

---
v2:
- Squashed patch set into single patch.

v3:
- Add abignore entry for 'rte_cpu_flag_t'.

v4:
- Updated commit message to reflect updated ISA doc linked.
- Fixed line wrap for VNNI comment.
- Rebased on master.

---
 devtools/libabigail.abignore              |  5 +++++
 lib/librte_eal/x86/include/rte_cpuflags.h | 19 +++++++++++++++++++
 lib/librte_eal/x86/rte_cpuflags.c         | 18 ++++++++++++++++++
 3 files changed, 42 insertions(+)
devtools/libabigail.abignore +5 -0
index a59df8f13..eb252ae0e 100644
@@ -11,3 +11,8 @@
         type_kind = enum
         name = rte_crypto_asym_xform_type
         changed_enumerators = RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
+; Ignore this enum update as it should not be allocated by the application
+[suppress_type]
+	type_kind = enum
+	name = rte_cpu_flag_t
+	changed_enumerators = RTE_CPUFLAG_NUMFLAGS
lib/librte_eal/x86/include/rte_cpuflags.h +19 -0
index 25ba47b96..c1d20364d 100644
@@ -113,6 +113,25 @@ enum rte_cpu_flag_t {
 	/* (EAX 80000007h) EDX features */
 	RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
+	RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and Quadword */
+	RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused Multiply-Add */
+	RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict Detection*/
+	RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
+	RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
+	RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit Manipulation */
+	RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit Manipulation 2 */
+	RTE_CPUFLAG_GFNI,                   /**< Galois Field New Instructions */
+	RTE_CPUFLAG_VAES,                   /**< Vector AES */
+	RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less Multiply */
+	RTE_CPUFLAG_AVX512VNNI,
+	/**< AVX512 Vector Neural Network Instructions */
+	RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms */
+	RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount */
+	RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
+	RTE_CPUFLAG_MOVDIRI,                /**< Direct Store Instructions */
+	RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store Instructions 64B */
+	RTE_CPUFLAG_AVX512VP2INTERSECT,     /**< AVX512 Two Register Intersection */
+
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
 };
lib/librte_eal/x86/rte_cpuflags.c +18 -0
index 6492df556..30439e795 100644
@@ -120,6 +120,24 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(EM64T, 0x80000001, 0, RTE_REG_EDX, 29)
 
 	FEAT_DEF(INVTSC, 0x80000007, 0, RTE_REG_EDX,  8)
+
+	FEAT_DEF(AVX512DQ, 0x00000007, 0, RTE_REG_EBX, 17)
+	FEAT_DEF(AVX512IFMA, 0x00000007, 0, RTE_REG_EBX, 21)
+	FEAT_DEF(AVX512CD, 0x00000007, 0, RTE_REG_EBX, 28)
+	FEAT_DEF(AVX512BW, 0x00000007, 0, RTE_REG_EBX, 30)
+	FEAT_DEF(AVX512VL, 0x00000007, 0, RTE_REG_EBX, 31)
+	FEAT_DEF(AVX512VBMI, 0x00000007, 0, RTE_REG_ECX, 1)
+	FEAT_DEF(AVX512VBMI2, 0x00000007, 0, RTE_REG_ECX, 6)
+	FEAT_DEF(GFNI, 0x00000007, 0, RTE_REG_ECX, 8)
+	FEAT_DEF(VAES, 0x00000007, 0, RTE_REG_ECX, 9)
+	FEAT_DEF(VPCLMULQDQ, 0x00000007, 0, RTE_REG_ECX, 10)
+	FEAT_DEF(AVX512VNNI, 0x00000007, 0, RTE_REG_ECX, 11)
+	FEAT_DEF(AVX512BITALG, 0x00000007, 0, RTE_REG_ECX, 12)
+	FEAT_DEF(AVX512VPOPCNTDQ, 0x00000007, 0, RTE_REG_ECX,  14)
+	FEAT_DEF(CLDEMOTE, 0x00000007, 0, RTE_REG_ECX, 25)
+	FEAT_DEF(MOVDIRI, 0x00000007, 0, RTE_REG_ECX, 27)
+	FEAT_DEF(MOVDIR64B, 0x00000007, 0, RTE_REG_ECX, 28)
+	FEAT_DEF(AVX512VP2INTERSECT, 0x00000007, 0, RTE_REG_EDX, 8)
 };
 
 int
Signature · 1 line
2.25.1
#31 lore raw

Re: [dpdk-dev] [PATCH v4] eal/cpuflags: add x86 based cpu flags

16/04/2020 13:00, Kevin Laatz:

Quoted 2 lines

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

[...]

devtools/libabigail.abignore line 18

Quoted 7 lines
devtools/libabigail.abignore +5 -0
+; Ignore this enum update as it should not be allocated by the application
+[suppress_type]
+	type_kind = enum
+	name = rte_cpu_flag_t
+	changed_enumerators = RTE_CPUFLAG_NUMFLAGS

The justification is not correct.
The application is allowed to use RTE_CPUFLAG_NUMFLAGS in array allocation. But no API is returning a CPU flag, so the new flags will remain unknown to the application.

However, there is a behaviour change:
The functions rte_cpu_get_flag_name() and rte_cpu_get_flag_enabled() will now accept new values, which were previously considered as an error. Is it an ABI breakage? I would say no.

PS: Who is REALLY maintaining the ABI?
We really miss someone who carefully check all these things, and take care of the doc and tooling.

#32 lore raw

Re: [dpdk-dev] [PATCH v4] eal/cpuflags: add x86 based cpu flags

(replying this time to the list)

Quoted 17 lines · Thomas Monjalon

16/04/2020 13:00, Kevin Laatz:

Quoted 2 lines

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

[...]

devtools/libabigail.abignore line 18

Quoted 7 lines
devtools/libabigail.abignore +5 -0
+; Ignore this enum update as it should not be allocated by the application
+[suppress_type]
+	type_kind = enum
+	name = rte_cpu_flag_t
+	changed_enumerators = RTE_CPUFLAG_NUMFLAGS

The justification is not correct.
The application is allowed to use RTE_CPUFLAG_NUMFLAGS in array allocation. But no API is returning a CPU flag, so the new flags will remain unknown to the application.

Quoted 4 lines

However, there is a behaviour change:
The functions rte_cpu_get_flag_name() and rte_cpu_get_flag_enabled() will now accept new values, which were previously considered as an error. Is it an ABI breakage? I would say no.

We saw something similar with the Cryptodev's rte_crypto_sym_xform_type also. Libabigail appears to be particularly sensitive to changes to enumerations. Leaving it to the user to decide if there is a problem.

I am seeing a bit of weirdness though between versions of libabigail. 1.7.1 seems to fine with the change, however 1.2 is reporting an issue.

Kevin - what version are you using?

Quoted 6 lines

PS: Who is REALLY maintaining the ABI?
We really miss someone who carefully check all these things, and take care of the doc and tooling.

I would say that I am missing these changes to libabigail.ignore, which would be useful. Should we consolidate the ABI Policy and ABI Versioning sections of the MAINTAINERS file?

#33 lore raw

Re: [dpdk-dev] [PATCH v4] eal/cpuflags: add x86 based cpu flags

Quoted 32 lines

(replying this time to the list)

Quoted 4 lines · Thomas Monjalon

16/04/2020 13:00, Kevin Laatz:

Quoted 2 lines

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

[...]

Quoted 10 lines

devtools/libabigail.abignore line 18

Quoted 7 lines
devtools/libabigail.abignore +5 -0
+; Ignore this enum update as it should not be allocated by the
+application [suppress_type]
+	type_kind = enum
+	name = rte_cpu_flag_t
+	changed_enumerators = RTE_CPUFLAG_NUMFLAGS

The justification is not correct.
The application is allowed to use RTE_CPUFLAG_NUMFLAGS in array

allocation.

Quoted 7 lines

But no API is returning a CPU flag, so the new flags will remain unknown to the application.

However, there is a behaviour change:
The functions rte_cpu_get_flag_name() and rte_cpu_get_flag_enabled() will now accept new values, which were previously considered as an error. Is it an ABI breakage? I would say no.

We saw something similar with the Cryptodev's rte_crypto_sym_xform_type also.
Libabigail appears to be particularly sensitive to changes to enumerations. Leaving it to the user to decide if there is a problem.

Quoted 4 lines

I am seeing a bit of weirdness though between versions of libabigail. 1.7.1 seems to fine with the change, however 1.2 is reporting an issue.

Kevin - what version are you using?

I'm using version 1.6.0

Quoted 12 lines
Quoted 7 lines

PS: Who is REALLY maintaining the ABI?
We really miss someone who carefully check all these things, and take care of the doc and tooling.

I would say that I am missing these changes to libabigail.ignore, which would be useful.
Should we consolidate the ABI Policy and ABI Versioning sections of the MAINTAINERS file?

#34 lore raw

Re: [dpdk-dev] [PATCH v4] eal/cpuflags: add x86 based cpu flags

Quoted 32 lines · Kevin
Quoted 32 lines

(replying this time to the list)

Quoted 4 lines · Thomas Monjalon

16/04/2020 13:00, Kevin Laatz:

Quoted 2 lines

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

[...]

Quoted 10 lines

devtools/libabigail.abignore line 18

Quoted 7 lines
devtools/libabigail.abignore +5 -0
+; Ignore this enum update as it should not be allocated by the
+application [suppress_type]
+	type_kind = enum
+	name = rte_cpu_flag_t
+	changed_enumerators = RTE_CPUFLAG_NUMFLAGS

The justification is not correct.
The application is allowed to use RTE_CPUFLAG_NUMFLAGS in array

allocation.

Quoted 7 lines

But no API is returning a CPU flag, so the new flags will remain unknown to the application.

However, there is a behaviour change:
The functions rte_cpu_get_flag_name() and rte_cpu_get_flag_enabled() will now accept new values, which were previously considered as an error. Is it an ABI breakage? I would say no.

We saw something similar with the Cryptodev's rte_crypto_sym_xform_type also.
Libabigail appears to be particularly sensitive to changes to enumerations. Leaving it to the user to decide if there is a problem.

Quoted 6 lines
Quoted 4 lines

I am seeing a bit of weirdness though between versions of libabigail. 1.7.1 seems to fine with the change, however 1.2 is reporting an issue.

Kevin - what version are you using?

I'm using version 1.6.0

right you are either on Fedora 31 or some Ubuntu v19.xx, right?

Quoted 14 lines
Quoted 13 lines
Quoted 8 lines

PS: Who is REALLY maintaining the ABI?
We really miss someone who carefully check all these things, and take care of the doc and tooling.

I would say that I am missing these changes to libabigail.ignore, which would be useful.
Should we consolidate the ABI Policy and ABI Versioning sections of the MAINTAINERS file?

#35 lore raw

Re: [dpdk-dev] [PATCH v4] eal/cpuflags: add x86 based cpu flags

Quoted 35 lines · Kevin
Quoted 18 lines
Quoted 18 lines

(replying this time to the list)

Quoted 14 lines · Thomas Monjalon

16/04/2020 13:00, Kevin Laatz:

Quoted 2 lines

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

[...]

devtools/libabigail.abignore line 18

Quoted 7 lines
devtools/libabigail.abignore +5 -0
+; Ignore this enum update as it should not be allocated by the
+application [suppress_type]
+	type_kind = enum
+	name = rte_cpu_flag_t
+	changed_enumerators = RTE_CPUFLAG_NUMFLAGS

The justification is not correct.
The application is allowed to use RTE_CPUFLAG_NUMFLAGS in array

Quoted 6 lines
Quoted 6 lines

allocation.

Quoted 5 lines

But no API is returning a CPU flag, so the new flags will remain unknown to the application.

However, there is a behaviour change:
The functions rte_cpu_get_flag_name() and

rte_cpu_get_flag_enabled()

Quoted 1 line
Quoted 1 line
Quoted 1 line

will now accept new values, which were previously considered as an

error.

Quoted 7 lines
Quoted 7 lines
Quoted 1 line

Is it an ABI breakage? I would say no.

We saw something similar with the Cryptodev's rte_crypto_sym_xform_type also.
Libabigail appears to be particularly sensitive to changes to enumerations. Leaving it to the user to decide if there is a problem.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

I am seeing a bit of weirdness though between versions of libabigail. 1.7.1 seems to fine with the change, however 1.2 is reporting an issue.

Kevin - what version are you using?

I'm using version 1.6.0

right you are either on Fedora 31 or some Ubuntu v19.xx, right?

At the time of making the patch: Ubuntu 18.04 with a manually upgraded libabigail Currently Ubuntu 20.04 (beta).

Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Quoted 9 lines

PS: Who is REALLY maintaining the ABI?
We really miss someone who carefully check all these things, and take care of the doc and tooling.

I would say that I am missing these changes to libabigail.ignore, which would be useful.
Should we consolidate the ABI Policy and ABI Versioning sections of the MAINTAINERS file?

#36 lore raw

Re: [dpdk-dev] [PATCH v4] eal/cpuflags: add x86 based cpu flags

In reply to Ray Kinsella

27/04/2020 11:27, Ray Kinsella:

Quoted 7 lines · Thomas Monjalon
Quoted 3 lines

PS: Who is REALLY maintaining the ABI?
We really miss someone who carefully check all these things, and take care of the doc and tooling.

I would say that I am missing these changes to libabigail.ignore, which would be useful. Should we consolidate the ABI Policy and ABI Versioning sections of the MAINTAINERS file?

Yes, I think it does not make sense spliting ABI topic in 2 sections in MAINTAINERS file.
We need to have a clear ownership covering policy, libs, tooling and doc. Let's agree to merge all in one section please.

#37 lore raw

Re: [dpdk-dev] [PATCH v4] eal/cpuflags: add x86 based cpu flags

Quoted 6 lines · Thomas Monjalon

27/04/2020 11:27, Ray Kinsella:

Quoted 5 lines · Thomas Monjalon
Quoted 3 lines

PS: Who is REALLY maintaining the ABI?
We really miss someone who carefully check all these things, and take care of the doc and tooling.

Quoted 8 lines
Quoted 2 lines

I would say that I am missing these changes to libabigail.ignore, which would be useful. Should we consolidate the ABI Policy and ABI Versioning sections of the MAINTAINERS file?

Yes, I think it does not make sense spliting ABI topic in 2 sections in MAINTAINERS file.
We need to have a clear ownership covering policy, libs, tooling and doc. Let's agree to merge all in one section please.

I would suggest merging and listing myself and Neil as maintainers? Unless you are aware of another potential owner?

Ray K

#38 lore raw

Re: [dpdk-dev] [PATCH v4] eal/cpuflags: add x86 based cpu flags

Quoted 12 lines · Ray Kinsella
Quoted 9 lines · Thomas Monjalon

27/04/2020 11:27, Ray Kinsella:

Quoted 7 lines · Thomas Monjalon
Quoted 3 lines

PS: Who is REALLY maintaining the ABI?
We really miss someone who carefully check all these things, and take care of the doc and tooling.

I would say that I am missing these changes to libabigail.ignore, which would be useful. Should we consolidate the ABI Policy and ABI Versioning sections of the MAINTAINERS file?

Quoted 9 lines
Quoted 5 lines

Yes, I think it does not make sense spliting ABI topic in 2 sections in MAINTAINERS file.
We need to have a clear ownership covering policy, libs, tooling and doc. Let's agree to merge all in one section please.

I would suggest merging and listing myself and Neil as maintainers? Unless you are aware of another potential owner?

I'm ok with this
Neil

Quoted 3 lines

Ray K

#39 lore raw

Re: [dpdk-dev] [PATCH v4] eal/cpuflags: add x86 based cpu flags

Quoted 19 lines · Neil Horman
Quoted 18 lines · Ray Kinsella
Quoted 14 lines · Thomas Monjalon

27/04/2020 11:27, Ray Kinsella:

Quoted 7 lines · Thomas Monjalon
Quoted 3 lines

PS: Who is REALLY maintaining the ABI?
We really miss someone who carefully check all these things, and take care of the doc and tooling.

I would say that I am missing these changes to libabigail.ignore, which would be useful. Should we consolidate the ABI Policy and ABI Versioning sections of the MAINTAINERS file?

Yes, I think it does not make sense spliting ABI topic in 2 sections in MAINTAINERS file.
We need to have a clear ownership covering policy, libs, tooling and doc. Let's agree to merge all in one section please.

Quoted 5 lines
Quoted 3 lines

I would suggest merging and listing myself and Neil as maintainers? Unless you are aware of another potential owner?

I'm ok with this
Neil

ok I will take care of it in the next rev of the

"[PATCH] abi: change references to abi 20.0.1 to abi v21"

Quoted 3 lines
Quoted 3 lines

Ray K

#40 lore raw

Re: [dpdk-dev] [PATCH v4] eal/cpuflags: add x86 based cpu flags

In reply to Thomas Monjalon
Quoted 30 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Saturday 25 April 2020 17:04
To: Kinsella, Ray <[email protected]>; [email protected]; Laatz, Kevin <[email protected]>
Cc: [email protected]; Richardson, Bruce <[email protected]>; Van Haaren, Harry <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v4] eal/cpuflags: add x86 based cpu flags

16/04/2020 13:00, Kevin Laatz:

Quoted 2 lines

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

[...]

devtools/libabigail.abignore line 18

Quoted 7 lines
devtools/libabigail.abignore +5 -0
+; Ignore this enum update as it should not be allocated by the
+application [suppress_type]
+	type_kind = enum
+	name = rte_cpu_flag_t
+	changed_enumerators = RTE_CPUFLAG_NUMFLAGS

The justification is not correct.
The application is allowed to use RTE_CPUFLAG_NUMFLAGS in array allocation.
But no API is returning a CPU flag, so the new flags will remain unknown to the application.

Quoted 5 lines

However, there is a behaviour change:
The functions rte_cpu_get_flag_name() and rte_cpu_get_flag_enabled() will now accept new values, which were previously considered as an error.
Is it an ABI breakage? I would say no.

We saw something similar with the Cryptodev's rte_crypto_sym_xform_type also. Libabigail appears to be particularly sensitive to changes to enumerations. Leaving it to the user to decide if there is a problem.

I am seeing a bit of weirdness though between versions of libabigail. 1.7.1 seems to fine with the change, however 1.2 is reporting an issue.

Kevin - what version are you using?

Quoted 4 lines

PS: Who is REALLY maintaining the ABI?
We really miss someone who carefully check all these things, and take care of the doc and tooling.

I would say that I am missing these changes to libabigail.ignore, which would be useful. Should we consolidate the ABI Policy and ABI Versioning sections of the MAINTAINERS file?

#41 lore raw

PATCH v5 1/1 eal/cpuflags: add x86 based cpu flags

In reply to Kevin Laatz

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

The CPUID leaf information can be found in
Table 1-2. "Information Returned by CPUID Instruction" of this document:
https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf

The following CPU flags are added in this patch:
- AVX-512 doubleword and quadword instructions.
- AVX-512 integer fused multiply-add instructions.
- AVX-512 conflict detection instructions.
- AVX-512 byte and word instructions.
- AVX-512 vector length instructions.
- AVX-512 vector bit manipulation instructions.
- AVX-512 vector bit manipulation 2 instructions.
- Galois field new instructions.
- Vector AES instructions.
- Vector carry-less multiply instructions.
- AVX-512 vector neural network instructions.
- AVX-512 for bit algorithm instructions.
- AVX-512 vector popcount instructions.
- Cache line demote instructions.
- Direct store instructions.
- Direct store 64B instructions.
- AVX-512 two register intersection instructions.

---
v2:
- Squashed patch set into single patch.

v3:
- Add abignore entry for 'rte_cpu_flag_t'.

v4:
- Updated commit message to reflect updated ISA doc linked.
- Fixed line wrap for VNNI comment.
- Rebased on master.

v5:
- Update abignore entry justification.

---
 devtools/libabigail.abignore              |  5 +++++
 lib/librte_eal/x86/include/rte_cpuflags.h | 19 +++++++++++++++++++
 lib/librte_eal/x86/rte_cpuflags.c         | 18 ++++++++++++++++++
 3 files changed, 42 insertions(+)
devtools/libabigail.abignore +5 -0
index a59df8f13..045f436fb 100644
@@ -11,3 +11,8 @@
         type_kind = enum
         name = rte_crypto_asym_xform_type
         changed_enumerators = RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
+; Ignore this enum update as new flags remain unknown to applications
+[suppress_type]
+	type_kind = enum
+	name = rte_cpu_flag_t
+	changed_enumerators = RTE_CPUFLAG_NUMFLAGS
lib/librte_eal/x86/include/rte_cpuflags.h +19 -0
index 25ba47b96..c1d20364d 100644
@@ -113,6 +113,25 @@ enum rte_cpu_flag_t {
 	/* (EAX 80000007h) EDX features */
 	RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
+	RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and Quadword */
+	RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused Multiply-Add */
+	RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict Detection*/
+	RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
+	RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
+	RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit Manipulation */
+	RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit Manipulation 2 */
+	RTE_CPUFLAG_GFNI,                   /**< Galois Field New Instructions */
+	RTE_CPUFLAG_VAES,                   /**< Vector AES */
+	RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less Multiply */
+	RTE_CPUFLAG_AVX512VNNI,
+	/**< AVX512 Vector Neural Network Instructions */
+	RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms */
+	RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount */
+	RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
+	RTE_CPUFLAG_MOVDIRI,                /**< Direct Store Instructions */
+	RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store Instructions 64B */
+	RTE_CPUFLAG_AVX512VP2INTERSECT,     /**< AVX512 Two Register Intersection */
+
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
 };
lib/librte_eal/x86/rte_cpuflags.c +18 -0
index 6492df556..30439e795 100644
@@ -120,6 +120,24 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(EM64T, 0x80000001, 0, RTE_REG_EDX, 29)
 
 	FEAT_DEF(INVTSC, 0x80000007, 0, RTE_REG_EDX,  8)
+
+	FEAT_DEF(AVX512DQ, 0x00000007, 0, RTE_REG_EBX, 17)
+	FEAT_DEF(AVX512IFMA, 0x00000007, 0, RTE_REG_EBX, 21)
+	FEAT_DEF(AVX512CD, 0x00000007, 0, RTE_REG_EBX, 28)
+	FEAT_DEF(AVX512BW, 0x00000007, 0, RTE_REG_EBX, 30)
+	FEAT_DEF(AVX512VL, 0x00000007, 0, RTE_REG_EBX, 31)
+	FEAT_DEF(AVX512VBMI, 0x00000007, 0, RTE_REG_ECX, 1)
+	FEAT_DEF(AVX512VBMI2, 0x00000007, 0, RTE_REG_ECX, 6)
+	FEAT_DEF(GFNI, 0x00000007, 0, RTE_REG_ECX, 8)
+	FEAT_DEF(VAES, 0x00000007, 0, RTE_REG_ECX, 9)
+	FEAT_DEF(VPCLMULQDQ, 0x00000007, 0, RTE_REG_ECX, 10)
+	FEAT_DEF(AVX512VNNI, 0x00000007, 0, RTE_REG_ECX, 11)
+	FEAT_DEF(AVX512BITALG, 0x00000007, 0, RTE_REG_ECX, 12)
+	FEAT_DEF(AVX512VPOPCNTDQ, 0x00000007, 0, RTE_REG_ECX,  14)
+	FEAT_DEF(CLDEMOTE, 0x00000007, 0, RTE_REG_ECX, 25)
+	FEAT_DEF(MOVDIRI, 0x00000007, 0, RTE_REG_ECX, 27)
+	FEAT_DEF(MOVDIR64B, 0x00000007, 0, RTE_REG_ECX, 28)
+	FEAT_DEF(AVX512VP2INTERSECT, 0x00000007, 0, RTE_REG_EDX, 8)
 };
 
 int
Signature · 1 line
2.25.1
#42 lore raw

Re: [dpdk-dev] [PATCH v5] eal/cpuflags: add x86 based cpu flags

devtools/libabigail.abignore

Quoted 53 lines · Kevin Laatz

This patch adds CPU flags which will enable the detection of ISA features available on more recent x86 based CPUs.

The CPUID leaf information can be found in
Table 1-2. "Information Returned by CPUID Instruction" of this document:
https://software.intel.com/sites/default/files/managed/c5/15/architecture-instruction-set-extensions-programming-reference.pdf

The following CPU flags are added in this patch:
- AVX-512 doubleword and quadword instructions.
- AVX-512 integer fused multiply-add instructions.
- AVX-512 conflict detection instructions.
- AVX-512 byte and word instructions.
- AVX-512 vector length instructions.
- AVX-512 vector bit manipulation instructions.
- AVX-512 vector bit manipulation 2 instructions.
- Galois field new instructions.
- Vector AES instructions.
- Vector carry-less multiply instructions.
- AVX-512 vector neural network instructions.
- AVX-512 for bit algorithm instructions.
- AVX-512 vector popcount instructions.
- Cache line demote instructions.
- Direct store instructions.
- Direct store 64B instructions.
- AVX-512 two register intersection instructions.

---
v2:
- Squashed patch set into single patch.

v3:
- Add abignore entry for 'rte_cpu_flag_t'.

v4:
- Updated commit message to reflect updated ISA doc linked.
- Fixed line wrap for VNNI comment.
- Rebased on master.

v5:
- Update abignore entry justification.

---
 devtools/libabigail.abignore              |  5 +++++
 lib/librte_eal/x86/include/rte_cpuflags.h | 19 +++++++++++++++++++
 lib/librte_eal/x86/rte_cpuflags.c         | 18 ++++++++++++++++++
 3 files changed, 42 insertions(+)
devtools/libabigail.abignore +0 -0
index a59df8f13..045f436fb 100644

Kevin - you still have the surpession.
I am testing locally with 1.7.1, and it doesn't complain when I disable the supression. Are you seeing something different?

Quoted 69 lines
devtools/libabigail.abignore +5 -0
@@ -11,3 +11,8 @@
         type_kind = enum
         name = rte_crypto_asym_xform_type
         changed_enumerators = RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
+; Ignore this enum update as new flags remain unknown to applications
+[suppress_type]
+	type_kind = enum
+	name = rte_cpu_flag_t
+	changed_enumerators = RTE_CPUFLAG_NUMFLAGS
lib/librte_eal/x86/include/rte_cpuflags.h +19 -0
index 25ba47b96..c1d20364d 100644
@@ -113,6 +113,25 @@ enum rte_cpu_flag_t {
 	/* (EAX 80000007h) EDX features */
 	RTE_CPUFLAG_INVTSC,                 /**< INVTSC */
 
+	RTE_CPUFLAG_AVX512DQ,               /**< AVX512 Doubleword and Quadword */
+	RTE_CPUFLAG_AVX512IFMA,             /**< AVX512 Integer Fused Multiply-Add */
+	RTE_CPUFLAG_AVX512CD,               /**< AVX512 Conflict Detection*/
+	RTE_CPUFLAG_AVX512BW,               /**< AVX512 Byte and Word */
+	RTE_CPUFLAG_AVX512VL,               /**< AVX512 Vector Length */
+	RTE_CPUFLAG_AVX512VBMI,             /**< AVX512 Vector Bit Manipulation */
+	RTE_CPUFLAG_AVX512VBMI2,            /**< AVX512 Vector Bit Manipulation 2 */
+	RTE_CPUFLAG_GFNI,                   /**< Galois Field New Instructions */
+	RTE_CPUFLAG_VAES,                   /**< Vector AES */
+	RTE_CPUFLAG_VPCLMULQDQ,             /**< Vector Carry-less Multiply */
+	RTE_CPUFLAG_AVX512VNNI,
+	/**< AVX512 Vector Neural Network Instructions */
+	RTE_CPUFLAG_AVX512BITALG,           /**< AVX512 Bit Algorithms */
+	RTE_CPUFLAG_AVX512VPOPCNTDQ,        /**< AVX512 Vector Popcount */
+	RTE_CPUFLAG_CLDEMOTE,               /**< Cache Line Demote */
+	RTE_CPUFLAG_MOVDIRI,                /**< Direct Store Instructions */
+	RTE_CPUFLAG_MOVDIR64B,              /**< Direct Store Instructions 64B */
+	RTE_CPUFLAG_AVX512VP2INTERSECT,     /**< AVX512 Two Register Intersection */
+
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
 };
lib/librte_eal/x86/rte_cpuflags.c +18 -0
index 6492df556..30439e795 100644
@@ -120,6 +120,24 @@ const struct feature_entry rte_cpu_feature_table[] = {
 	FEAT_DEF(EM64T, 0x80000001, 0, RTE_REG_EDX, 29)
 
 	FEAT_DEF(INVTSC, 0x80000007, 0, RTE_REG_EDX,  8)
+
+	FEAT_DEF(AVX512DQ, 0x00000007, 0, RTE_REG_EBX, 17)
+	FEAT_DEF(AVX512IFMA, 0x00000007, 0, RTE_REG_EBX, 21)
+	FEAT_DEF(AVX512CD, 0x00000007, 0, RTE_REG_EBX, 28)
+	FEAT_DEF(AVX512BW, 0x00000007, 0, RTE_REG_EBX, 30)
+	FEAT_DEF(AVX512VL, 0x00000007, 0, RTE_REG_EBX, 31)
+	FEAT_DEF(AVX512VBMI, 0x00000007, 0, RTE_REG_ECX, 1)
+	FEAT_DEF(AVX512VBMI2, 0x00000007, 0, RTE_REG_ECX, 6)
+	FEAT_DEF(GFNI, 0x00000007, 0, RTE_REG_ECX, 8)
+	FEAT_DEF(VAES, 0x00000007, 0, RTE_REG_ECX, 9)
+	FEAT_DEF(VPCLMULQDQ, 0x00000007, 0, RTE_REG_ECX, 10)
+	FEAT_DEF(AVX512VNNI, 0x00000007, 0, RTE_REG_ECX, 11)
+	FEAT_DEF(AVX512BITALG, 0x00000007, 0, RTE_REG_ECX, 12)
+	FEAT_DEF(AVX512VPOPCNTDQ, 0x00000007, 0, RTE_REG_ECX,  14)
+	FEAT_DEF(CLDEMOTE, 0x00000007, 0, RTE_REG_ECX, 25)
+	FEAT_DEF(MOVDIRI, 0x00000007, 0, RTE_REG_ECX, 27)
+	FEAT_DEF(MOVDIR64B, 0x00000007, 0, RTE_REG_ECX, 28)
+	FEAT_DEF(AVX512VP2INTERSECT, 0x00000007, 0, RTE_REG_EDX, 8)
 };
 
 int
#43 lore raw

Re: [dpdk-dev] [PATCH v5] eal/cpuflags: add x86 based cpu flags

<snip>

Quoted 6 lines
Quoted 6 lines
---
 devtools/libabigail.abignore              |  5 +++++
 lib/librte_eal/x86/include/rte_cpuflags.h | 19 +++++++++++++++++++
 lib/librte_eal/x86/rte_cpuflags.c         | 18 ++++++++++++++++++
 3 files changed, 42 insertions(+)
Quoted 10 lines

devtools/libabigail.abignore

Quoted 4 lines
(quoted diff) +0 -0

b/devtools/libabigail.abignore index a59df8f13..045f436fb 100644

devtools/libabigail.abignore +0 -0

Kevin - you still have the surpession.
I am testing locally with 1.7.1, and it doesn't complain when I disable the supression.
Are you seeing something different?

Ray,
I have re-tested and with libabigail 1.6 and it reports the addition of the flags as an ABI break without the abignore suppression. With the suppression, it will still report changes to existing flags (e.g. inserting a new flag somewhere in the middle) in the enum as an ABI break, as expected.

The Travis CI is also based on Ubuntu 18.04 LTS, which uses libabigail 1.2-1. Without the suppression the community Travis CI builds fail on this false positive.

-Kevin

#44 lore raw

Re: [dpdk-dev] [PATCH v5] eal/cpuflags: add x86 based cpu flags

28/04/2020 20:11, Laatz, Kevin:

Quoted 9 lines
Quoted 8 lines

devtools/libabigail.abignore

Quoted 2 lines
devtools/libabigail.abignore +0 -0

Kevin - you still have the surpession.
I am testing locally with 1.7.1, and it doesn't complain when I disable the supression.
Are you seeing something different?

Quoted 5 lines

Ray,
I have re-tested and with libabigail 1.6 and it reports the addition of the flags as an ABI break without the abignore suppression. With the suppression, it will still report changes to existing flags (e.g. inserting a new flag somewhere in the middle) in the enum as an ABI break, as expected.

The Travis CI is also based on Ubuntu 18.04 LTS, which uses libabigail 1.2-1. Without the suppression the community Travis CI builds fail on this false positive.

I think Travis uses libabigail 1.6:
http://git.dpdk.org/dpdk/tree/.ci/linux-build.sh#n61

#45 lore raw

Re: [dpdk-dev] [PATCH v5] eal/cpuflags: add x86 based cpu flags

In reply to Ray Kinsella
Quoted 4 lines · On Tue, 28 Apr 2020 17:39:24 +0100 Ray Kinsella <[email protected]> wrote:

lib/librte_eal/x86/include/rte_cpuflags.h enum rte_cpu_flag_t { · line 137

Quoted 4 lines
lib/librte_eal/x86/include/rte_cpuflags.h +1 -0
+
 	/* The last item */
 	RTE_CPUFLAG_NUMFLAGS,               /**< This should always be the last! */
 };

These kind of enums break API's. We should remove them all in 20.11.

#46 lore raw

Re: [dpdk-dev] [PATCH v5] eal/cpuflags: add x86 based cpu flags

In reply to Ray Kinsella
Quoted 8 lines · Ray Kinsella

devtools/libabigail.abignore

Quoted 4 lines
devtools/libabigail.abignore +0 -0
index a59df8f13..045f436fb 100644

Kevin - you still have the surpession.
I am testing locally with 1.7.1, and it doesn't complain when I disable the supression. Are you seeing something different?

Using current master libabigail, without the rule Kevin included, I get the warning:

1 function with some indirect sub-type change:

[C] 'function int rte_cpu_get_flag_enabled(rte_cpu_flag_t)' at
rte_cpuflags.c:144:1 has some indirect sub-type changes:

    parameter 1 of type 'enum rte_cpu_flag_t' has sub-type changes:
      type size hasn't changed
      17 enumerator insertions:
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512DQ' value '87'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512IFMA' value '88'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512CD' value '89'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512BW' value '90'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512VL' value '91'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512VBMI' value '92'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512VBMI2' value '93'
        'rte_cpu_flag_t::RTE_CPUFLAG_GFNI' value '94'
        'rte_cpu_flag_t::RTE_CPUFLAG_VAES' value '95'
        'rte_cpu_flag_t::RTE_CPUFLAG_VPCLMULQDQ' value '96'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512VNNI' value '97'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512BITALG' value '98'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512VPOPCNTDQ' value '99'
        'rte_cpu_flag_t::RTE_CPUFLAG_CLDEMOTE' value '100'
        'rte_cpu_flag_t::RTE_CPUFLAG_MOVDIRI' value '101'
        'rte_cpu_flag_t::RTE_CPUFLAG_MOVDIR64B' value '102'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512VP2INTERSECT' value '103'
      1 enumerator change:
        'rte_cpu_flag_t::RTE_CPUFLAG_NUMFLAGS' from value '87' to

'104' at rte_cpuflags.h:12:1

Ray, could you check that the reference and new dumps in your env contain this enum?

$ grep RTE_CPUFLAG_NUMFLAGS
$HOME/abi/v20.02/x86_64-native-linux-gcc+shared+debug+ASSERT+RTE_IBVERBS_LINK_DLOPEN/dump/librte_eal.dump
      <enumerator name='RTE_CPUFLAG_NUMFLAGS' value='87'/>
$ grep RTE_CPUFLAG_NUMFLAGS
$HOME/builds/x86_64-native-linux-gcc+shared+debug+ASSERT+RTE_IBVERBS_LINK_DLOPEN/install/dump/librte_eal.dump
      <enumerator name='RTE_CPUFLAG_NUMFLAGS' value='104'/>

If you are missing those, you might have built dpdk without debuginfo.

Signature · 1 line
David Marchand
Acked-by
#47 lore raw

Re: [dpdk-dev] [PATCH v5] eal/cpuflags: add x86 based cpu flags

So that isn't the issue either.

$ grep RTE_CPUFLAG_NUMFLAGS build-gcc-shared/install/dump/librte_eal.dump
4646:      <enumerator name='RTE_CPUFLAG_NUMFLAGS' value='104'/>
$ grep RTE_CPUFLAG_NUMFLAGS /build/dpdk/reference/v20.02/build-gcc-shared/dump/librte_eal.dump
3296:      <enumerator name='RTE_CPUFLAG_NUMFLAGS' value='87'/>
                                     1.7-1.fc31                             @updates

I finally got libabigail complaining about rte_cpu_flag_t, after doing a complete clear down. So the suppression _is_ required.

I then spent the following hour trying to identify the gremlin in the system with no luck. In anycase, added my ack below.

Quoted 45 lines · David Marchand
Quoted 8 lines · Ray Kinsella

devtools/libabigail.abignore

Quoted 4 lines
devtools/libabigail.abignore +0 -0
index a59df8f13..045f436fb 100644

Kevin - you still have the surpession.
I am testing locally with 1.7.1, and it doesn't complain when I disable the supression. Are you seeing something different?

Using current master libabigail, without the rule Kevin included, I get the warning:

1 function with some indirect sub-type change:

[C] 'function int rte_cpu_get_flag_enabled(rte_cpu_flag_t)' at
rte_cpuflags.c:144:1 has some indirect sub-type changes:

    parameter 1 of type 'enum rte_cpu_flag_t' has sub-type changes:
      type size hasn't changed
      17 enumerator insertions:
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512DQ' value '87'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512IFMA' value '88'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512CD' value '89'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512BW' value '90'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512VL' value '91'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512VBMI' value '92'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512VBMI2' value '93'
        'rte_cpu_flag_t::RTE_CPUFLAG_GFNI' value '94'
        'rte_cpu_flag_t::RTE_CPUFLAG_VAES' value '95'
        'rte_cpu_flag_t::RTE_CPUFLAG_VPCLMULQDQ' value '96'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512VNNI' value '97'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512BITALG' value '98'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512VPOPCNTDQ' value '99'
        'rte_cpu_flag_t::RTE_CPUFLAG_CLDEMOTE' value '100'
        'rte_cpu_flag_t::RTE_CPUFLAG_MOVDIRI' value '101'
        'rte_cpu_flag_t::RTE_CPUFLAG_MOVDIR64B' value '102'
        'rte_cpu_flag_t::RTE_CPUFLAG_AVX512VP2INTERSECT' value '103'
      1 enumerator change:
        'rte_cpu_flag_t::RTE_CPUFLAG_NUMFLAGS' from value '87' to

'104' at rte_cpuflags.h:12:1

Ray, could you check that the reference and new dumps in your env contain this enum?

Quoted 9 lines
$ grep RTE_CPUFLAG_NUMFLAGS
$HOME/abi/v20.02/x86_64-native-linux-gcc+shared+debug+ASSERT+RTE_IBVERBS_LINK_DLOPEN/dump/librte_eal.dump
      <enumerator name='RTE_CPUFLAG_NUMFLAGS' value='87'/>
$ grep RTE_CPUFLAG_NUMFLAGS
$HOME/builds/x86_64-native-linux-gcc+shared+debug+ASSERT+RTE_IBVERBS_LINK_DLOPEN/install/dump/librte_eal.dump
      <enumerator name='RTE_CPUFLAG_NUMFLAGS' value='104'/>

If you are missing those, you might have built dpdk without debuginfo.