]> git.droids-corp.org - dpdk.git/commitdiff
mk: add crypto capability for armv8a and thunderx
authorAshwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Tue, 4 Jul 2017 09:24:05 +0000 (02:24 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 4 Jul 2017 13:56:58 +0000 (15:56 +0200)
armv8-a has optional CRYPTO extension which adds the
AES, PMULL, SHA1 and SHA2 capabilities. -march=armv8-a+crypto
enables code generation for the ARMv8-A architecture together
with the optional CRYPTO extensions.

Added the following flags to detect the corresponding
capability at compile time.
 * RTE_MACHINE_CPUFLAG_AES
 * RTE_MACHINE_CPUFLAG_PMULL
 * RTE_MACHINE_CPUFLAG_SHA1
 * RTE_MACHINE_CPUFLAG_SHA2

At run-time, the following flags can be used to detect the
capabilities.
 * RTE_CPUFLAG_AES
 * RTE_CPUFLAG_PMULL
 * RTE_CPUFLAG_SHA1
 * RTE_CPUFLAG_SHA2

Signed-off-by: Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>
Reviewed-by: Jan Viktorin <viktorin@rehivetech.com>
mk/machine/armv8a/rte.vars.mk
mk/machine/thunderx/rte.vars.mk
mk/rte.cpuflags.mk
mk/toolchain/gcc/rte.toolchain-compat.mk

index d5049e1f13da078b3461585c498127c041dfb3d6..51966a5b6ee8c1c2b94b1103248baa3e6f9898ad 100644 (file)
@@ -55,4 +55,4 @@
 # CPU_LDFLAGS =
 # CPU_ASFLAGS =
 
-MACHINE_CFLAGS += -march=armv8-a+crc
+MACHINE_CFLAGS += -march=armv8-a+crc+crypto
index ad5a379b0fee4210bc2249ae92b9e904beb1f176..678410581ede45baa4ae87698995f3af45673159 100644 (file)
@@ -55,4 +55,4 @@
 # CPU_LDFLAGS =
 # CPU_ASFLAGS =
 
-MACHINE_CFLAGS += -march=armv8-a+crc -mcpu=thunderx
+MACHINE_CFLAGS += -march=armv8-a+crc+crypto -mcpu=thunderx
index 4288c1470b534aa001cd4ccfa42076811608a06d..a813c91f4c9aeaf982d506df614e96050be638ea 100644 (file)
@@ -125,6 +125,12 @@ ifneq ($(filter $(AUTO_CPUFLAGS),__ARM_FEATURE_CRC32),)
 CPUFLAGS += CRC32
 endif
 
+ifneq ($(filter $(AUTO_CPUFLAGS),__ARM_FEATURE_CRYPTO),)
+CPUFLAGS += AES
+CPUFLAGS += PMULL
+CPUFLAGS += SHA1
+CPUFLAGS += SHA2
+endif
 
 MACHINE_CFLAGS += $(addprefix -DRTE_MACHINE_CPUFLAG_,$(CPUFLAGS))
 
index 280dde2a65118eb10993bddc6d68d4d3755c9cd1..01ac7e2325df550ecc2463a2161df7f035c92d97 100644 (file)
@@ -60,6 +60,7 @@ else
 #
        ifeq ($(shell test $(GCC_VERSION) -le 49 && echo 1), 1)
                MACHINE_CFLAGS := $(patsubst -march=armv8-a+crc,-march=armv8-a+crc -D__ARM_FEATURE_CRC32=1,$(MACHINE_CFLAGS))
+               MACHINE_CFLAGS := $(patsubst -march=armv8-a+crc+crypto,-march=armv8-a+crc+crypto -D__ARM_FEATURE_CRC32=1,$(MACHINE_CFLAGS))
        endif
        ifeq ($(shell test $(GCC_VERSION) -le 47 && echo 1), 1)
                MACHINE_CFLAGS := $(patsubst -march=core-avx-i,-march=corei7-avx,$(MACHINE_CFLAGS))