compress/qat: add empty driver
authorFiona Trahe <fiona.trahe@intel.com>
Fri, 13 Jul 2018 02:28:11 +0000 (03:28 +0100)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Mon, 23 Jul 2018 23:48:10 +0000 (01:48 +0200)
Add Makefiles, meson files, and empty source files for compression PMD.
Handle cases for building either symmetric crypto PMD
or compression PMD or both and the common files both depend on.

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
14 files changed:
MAINTAINERS
config/common_base
drivers/common/qat/Makefile
drivers/compress/meson.build
drivers/compress/qat/meson.build [new file with mode: 0644]
drivers/compress/qat/qat_comp.c [new file with mode: 0644]
drivers/compress/qat/qat_comp.h [new file with mode: 0644]
drivers/compress/qat/qat_comp_pmd.c [new file with mode: 0644]
drivers/compress/qat/qat_comp_pmd.h [new file with mode: 0644]
drivers/compress/qat/rte_pmd_qat_version.map [new file with mode: 0644]
drivers/crypto/qat/meson.build
drivers/crypto/qat/rte_pmd_qat_version.map [deleted file]
mk/rte.app.mk
test/test/test_cryptodev.c

index 227e32c..31b7fea 100644 (file)
@@ -861,6 +861,11 @@ Compression Drivers
 M: Pablo de Lara <pablo.de.lara.guarch@intel.com>
 T: git://dpdk.org/next/dpdk-next-crypto
 
+Intel QuickAssist
+M: Fiona Trahe <fiona.trahe@intel.com>
+F: drivers/compress/qat/
+F: drivers/common/qat/
+
 ISA-L
 M: Lee Daly <lee.daly@intel.com>
 F: drivers/compress/isal/
index 201cdf6..db6d39f 100644 (file)
@@ -493,7 +493,8 @@ CONFIG_RTE_LIBRTE_DPAA_MAX_CRYPTODEV=4
 #
 # Compile PMD for QuickAssist based devices
 #
-CONFIG_RTE_LIBRTE_PMD_QAT=n
+CONFIG_RTE_LIBRTE_PMD_QAT=y
+CONFIG_RTE_LIBRTE_PMD_QAT_SYM=n
 #
 # Max. number of QuickAssist devices, which can be detected and attached
 #
index 02e83f9..c68a032 100644 (file)
@@ -3,48 +3,64 @@
 
 include $(RTE_SDK)/mk/rte.vars.mk
 
-# library name
-LIB = librte_pmd_qat.a
-
-# library version
-LIBABIVER := 1
-
-# build flags
-CFLAGS += $(WERROR_FLAGS)
-CFLAGS += -O3
-
 # build directories
 QAT_CRYPTO_DIR := $(RTE_SDK)/drivers/crypto/qat
-VPATH=$(QAT_CRYPTO_DIR)
+QAT_COMPRESS_DIR := $(RTE_SDK)/drivers/compress/qat
+VPATH=$(QAT_CRYPTO_DIR):$(QAT_COMPRESS_DIR)
 
 # external library include paths
 CFLAGS += -I$(SRCDIR)/qat_adf
 CFLAGS += -I$(SRCDIR)
 CFLAGS += -I$(QAT_CRYPTO_DIR)
+CFLAGS += -I$(QAT_COMPRESS_DIR)
 
-# library common source files
-SRCS-y += qat_device.c
-SRCS-y += qat_common.c
-SRCS-y += qat_logs.c
-SRCS-y += qat_qp.c
+
+ifeq ($(CONFIG_RTE_LIBRTE_COMPRESSDEV),y)
+       CFLAGS += -DALLOW_EXPERIMENTAL_API
+       LDLIBS += -lrte_compressdev
+       SRCS-y += qat_comp.c
+       SRCS-y += qat_comp_pmd.c
+       build_qat = yes
+endif
 
 # library symmetric crypto source files
 ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
+ifeq ($(CONFIG_RTE_LIBRTE_PMD_QAT_SYM),y)
        LDLIBS += -lrte_cryptodev
        LDLIBS += -lcrypto
        CFLAGS += -DBUILD_QAT_SYM
        SRCS-y += qat_sym.c
        SRCS-y += qat_sym_session.c
        SRCS-y += qat_sym_pmd.c
+       build_qat = yes
+endif
 endif
 
-LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool
-LDLIBS += -lrte_pci -lrte_bus_pci
+ifdef build_qat
 
-# export include files
-SYMLINK-y-include +=
+       # library name
+       LIB = librte_pmd_qat.a
 
-# versioning export map
-EXPORT_MAP := ../../crypto/qat/rte_pmd_qat_version.map
+       # library version
+       LIBABIVER := 1
+       # build flags
+       CFLAGS += $(WERROR_FLAGS)
+       CFLAGS += -O3
+
+       # library common source files
+       SRCS-y += qat_device.c
+       SRCS-y += qat_common.c
+       SRCS-y += qat_logs.c
+       SRCS-y += qat_qp.c
+
+       LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool
+       LDLIBS += -lrte_pci -lrte_bus_pci
+
+       # export include files
+       SYMLINK-y-include +=
+
+       # versioning export map
+       EXPORT_MAP := ../../compress/qat/rte_pmd_qat_version.map
+endif
 
 include $(RTE_SDK)/mk/rte.lib.mk
index fb136e1..2352ad5 100644 (file)
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-drivers = ['isal']
+drivers = ['isal', 'qat']
 
 std_deps = ['compressdev'] # compressdev pulls in all other needed deps
 config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
diff --git a/drivers/compress/qat/meson.build b/drivers/compress/qat/meson.build
new file mode 100644 (file)
index 0000000..9d15076
--- /dev/null
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2017-2018 Intel Corporation
+
+
+# Add our sources files to the list
+allow_experimental_apis = true
+qat_sources += files('qat_comp_pmd.c',
+                    'qat_comp.c')
+qat_includes += include_directories('.')
+qat_deps += 'compressdev'
+qat_ext_deps += dep
+
+# build the whole driver
+sources += qat_sources
+cflags += qat_cflags
+deps += qat_deps
+ext_deps += qat_ext_deps
+includes += qat_includes
diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c
new file mode 100644 (file)
index 0000000..caa1158
--- /dev/null
@@ -0,0 +1,5 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Intel Corporation
+ */
+
+#include "qat_comp.h"
diff --git a/drivers/compress/qat/qat_comp.h b/drivers/compress/qat/qat_comp.h
new file mode 100644 (file)
index 0000000..89c475e
--- /dev/null
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2015-2018 Intel Corporation
+ */
+
+#ifndef _QAT_COMP_H_
+#define _QAT_COMP_H_
+
+#ifdef RTE_LIBRTE_COMPRESSDEV
+
+#include <rte_compressdev.h>
+#include <rte_compressdev_pmd.h>
+
+#endif
+#endif
diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c
new file mode 100644 (file)
index 0000000..fb035d1
--- /dev/null
@@ -0,0 +1,5 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2015-2018 Intel Corporation
+ */
+
+#include "qat_comp_pmd.h"
diff --git a/drivers/compress/qat/qat_comp_pmd.h b/drivers/compress/qat/qat_comp_pmd.h
new file mode 100644 (file)
index 0000000..56b5f18
--- /dev/null
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2015-2018 Intel Corporation
+ */
+
+#ifndef _QAT_COMP_PMD_H_
+#define _QAT_COMP_PMD_H_
+
+#ifdef RTE_LIBRTE_COMPRESSDEV
+
+#include <rte_compressdev.h>
+#include <rte_compressdev_pmd.h>
+
+#endif
+#endif /* _QAT_COMP_PMD_H_ */
diff --git a/drivers/compress/qat/rte_pmd_qat_version.map b/drivers/compress/qat/rte_pmd_qat_version.map
new file mode 100644 (file)
index 0000000..ad6e191
--- /dev/null
@@ -0,0 +1,3 @@
+DPDK_18.08 {
+       local: *;
+};
index 2873637..9cc98d2 100644 (file)
@@ -1,24 +1,18 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2017-2018 Intel Corporation
 
+# this does not build the QAT driver, instead that is done in the compression
+# driver which comes later. Here we just add our sources files to the list
 build = false
 dep = dependency('libcrypto', required: false)
+qat_includes += include_directories('.')
+qat_deps += 'cryptodev'
 if dep.found()
        # Add our sources files to the list
        qat_sources += files('qat_sym_pmd.c',
                             'qat_sym.c',
                             'qat_sym_session.c')
-       qat_includes += include_directories('.')
-       qat_deps += 'cryptodev'
        qat_ext_deps += dep
        pkgconfig_extra_libs += '-lcrypto'
        qat_cflags += '-DBUILD_QAT_SYM'
-
-       # build the whole driver
-       sources += qat_sources
-       cflags += qat_cflags
-       deps += qat_deps
-       ext_deps += qat_ext_deps
-       includes += qat_includes
-       build = true
 endif
diff --git a/drivers/crypto/qat/rte_pmd_qat_version.map b/drivers/crypto/qat/rte_pmd_qat_version.map
deleted file mode 100644 (file)
index bbaf1c8..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-DPDK_2.2 {
-       local: *;
-};
\ No newline at end of file
index d21fb57..1590838 100644 (file)
@@ -199,7 +199,9 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM)   += -lIPSec_MB
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_CCP)         += -lrte_pmd_ccp -lcrypto
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_OPENSSL)     += -lrte_pmd_openssl -lcrypto
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += -lrte_pmd_null_crypto
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT)         += -lrte_pmd_qat -lcrypto
+ifeq ($(CONFIG_RTE_LIBRTE_PMD_QAT),y)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT_SYM)     += -lrte_pmd_qat -lcrypto
+endif # CONFIG_RTE_LIBRTE_PMD_QAT
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G)      += -lrte_pmd_snow3g
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G)      += -L$(LIBSSO_SNOW3G_PATH)/build -lsso_snow3g
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI)      += -lrte_pmd_kasumi
@@ -222,6 +224,10 @@ endif # CONFIG_RTE_LIBRTE_CRYPTODEV
 ifeq ($(CONFIG_RTE_LIBRTE_COMPRESSDEV),y)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ISAL) += -lrte_pmd_isal_comp
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ISAL) += -lisal
+# Link QAT driver if it has not been linked yet
+ifeq ($(CONFIG_RTE_LIBRTE_PMD_QAT_SYM),n)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT)  += -lrte_pmd_qat
+endif # CONFIG_RTE_LIBRTE_PMD_QAT_SYM
 endif # CONFIG_RTE_LIBRTE_COMPRESSDEV
 
 ifeq ($(CONFIG_RTE_LIBRTE_EVENTDEV),y)
index b759e08..cbbdb15 100644 (file)
@@ -9938,9 +9938,9 @@ test_cryptodev_qat(void /*argv __rte_unused, int argc __rte_unused*/)
                        RTE_STR(CRYPTODEV_NAME_QAT_SYM_PMD));
 
        if (gbl_driver_id == -1) {
-               RTE_LOG(ERR, USER1, "QAT PMD must be loaded. Check if "
-                               "CONFIG_RTE_LIBRTE_PMD_QAT is enabled "
-                               "in config file to run this testsuite.\n");
+               RTE_LOG(ERR, USER1, "QAT PMD must be loaded. Check that both "
+               "CONFIG_RTE_LIBRTE_PMD_QAT and CONFIG_RTE_LIBRTE_PMD_QAT_SYM "
+               "are enabled in config file to run this testsuite.\n");
                return TEST_SKIPPED;
        }