crypto/qat: add weak functions
authorTomasz Jozwiak <tomaszx.jozwiak@intel.com>
Mon, 2 Jul 2018 09:39:11 +0000 (11:39 +0200)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Tue, 10 Jul 2018 22:55:30 +0000 (00:55 +0200)
This patch adds following weak functions to facilitate conditional
compilation of code for those services:
  -  qat_sym_dev_create
  -  qat_asym_dev_create
  -  qat_comp_dev_create
  -  qat_sym_dev_destroy
  -  qat_asym_dev_destroy
  -  qat_comp_dev_destroy
and removes unused files with empty definitions of above functions.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
drivers/crypto/qat/Makefile
drivers/crypto/qat/meson.build
drivers/crypto/qat/qat_asym_pmd.c [deleted file]
drivers/crypto/qat/qat_asym_pmd.h [deleted file]
drivers/crypto/qat/qat_comp_pmd.c [deleted file]
drivers/crypto/qat/qat_comp_pmd.h [deleted file]
drivers/crypto/qat/qat_device.c
drivers/crypto/qat/qat_device.h

index ef4a567..64f39fd 100644 (file)
@@ -28,8 +28,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_sym_session.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_common.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_logs.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_sym_pmd.c
-SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_asym_pmd.c
-SRCS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += qat_comp_pmd.c
 
 # export include files
 SYMLINK-y-include +=
index bcab16e..6d01dac 100644 (file)
@@ -9,9 +9,7 @@ sources = files('qat_common.c',
                'qat_qp.c',
                'qat_device.c',
                'qat_logs.c',
-               'qat_sym_pmd.c', 'qat_sym.c', 'qat_sym_session.c',
-               'qat_asym_pmd.c',
-               'qat_comp_pmd.c')
+               'qat_sym_pmd.c', 'qat_sym.c', 'qat_sym_session.c')
 includes += include_directories('qat_adf')
 deps += ['bus_pci']
 ext_deps += dep
diff --git a/drivers/crypto/qat/qat_asym_pmd.c b/drivers/crypto/qat/qat_asym_pmd.c
deleted file mode 100644 (file)
index 8d36300..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Intel Corporation
- */
-
-#include "qat_asym_pmd.h"
-
-int
-qat_asym_dev_create(struct qat_pci_device *qat_pci_dev __rte_unused)
-{
-       return 0;
-}
-
-int
-qat_asym_dev_destroy(struct qat_pci_device *qat_pci_dev __rte_unused)
-{
-       return 0;
-}
diff --git a/drivers/crypto/qat/qat_asym_pmd.h b/drivers/crypto/qat/qat_asym_pmd.h
deleted file mode 100644 (file)
index 0465e03..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Intel Corporation
- */
-
-#ifndef _QAT_ASYM_PMD_H_
-#define _QAT_ASYM_PMD_H_
-
-#include "qat_device.h"
-
-int
-qat_asym_dev_create(struct qat_pci_device *qat_pci_dev);
-
-int
-qat_asym_dev_destroy(struct qat_pci_device *qat_pci_dev);
-#endif /* _QAT_ASYM_PMD_H_ */
diff --git a/drivers/crypto/qat/qat_comp_pmd.c b/drivers/crypto/qat/qat_comp_pmd.c
deleted file mode 100644 (file)
index 547b3db..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Intel Corporation
- */
-
-#include "qat_comp_pmd.h"
-
-
-int
-qat_comp_dev_create(struct qat_pci_device *qat_pci_dev __rte_unused)
-{
-       return 0;
-}
-
-int
-qat_comp_dev_destroy(struct qat_pci_device *qat_pci_dev __rte_unused)
-{
-       return 0;
-}
diff --git a/drivers/crypto/qat/qat_comp_pmd.h b/drivers/crypto/qat/qat_comp_pmd.h
deleted file mode 100644 (file)
index cc31246..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Intel Corporation
- */
-
-#ifndef _QAT_COMP_PMD_H_
-#define _QAT_COMP_PMD_H_
-
-#include "qat_device.h"
-
-
-/**< Intel(R) QAT Compression PMD device name */
-#define COMPRESSDEV_NAME_QAT_PMD       comp_qat
-
-
-/** private data structure for a QAT compression device.
- * This QAT device is a device offering only a compression service,
- * there can be one of these on each qat_pci_device (VF).
- */
-struct qat_comp_dev_private {
-       struct qat_pci_device *qat_dev;
-       /**< The qat pci device hosting the service */
-};
-
-int
-qat_comp_dev_create(struct qat_pci_device *qat_pci_dev);
-
-int
-qat_comp_dev_destroy(struct qat_pci_device *qat_pci_dev);
-#endif /* _QAT_COMP_PMD_H_ */
index 4b97c84..64f236e 100644 (file)
@@ -5,8 +5,6 @@
 #include "qat_device.h"
 #include "adf_transport_access_macros.h"
 #include "qat_sym_pmd.h"
-#include "qat_asym_pmd.h"
-#include "qat_comp_pmd.h"
 
 /* Hardware device information per generation */
 __extension__
@@ -238,5 +236,42 @@ static struct rte_pci_driver rte_qat_pmd = {
        .probe = qat_pci_probe,
        .remove = qat_pci_remove
 };
+
+__attribute__((weak)) int
+qat_sym_dev_create(struct qat_pci_device *qat_pci_dev __rte_unused)
+{
+       return 0;
+}
+
+__attribute__((weak)) int
+qat_asym_dev_create(struct qat_pci_device *qat_pci_dev __rte_unused)
+{
+       return 0;
+}
+
+__attribute__((weak)) int
+qat_sym_dev_destroy(struct qat_pci_device *qat_pci_dev __rte_unused)
+{
+       return 0;
+}
+
+__attribute__((weak)) int
+qat_asym_dev_destroy(struct qat_pci_device *qat_pci_dev __rte_unused)
+{
+       return 0;
+}
+
+__attribute__((weak)) int
+qat_comp_dev_create(struct qat_pci_device *qat_pci_dev __rte_unused)
+{
+       return 0;
+}
+
+__attribute__((weak)) int
+qat_comp_dev_destroy(struct qat_pci_device *qat_pci_dev __rte_unused)
+{
+       return 0;
+}
+
 RTE_PMD_REGISTER_PCI(QAT_PCI_NAME, rte_qat_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(QAT_PCI_NAME, pci_id_qat_map);
index e18c8a7..0cb370c 100644 (file)
@@ -69,10 +69,30 @@ extern struct qat_gen_hw_data qat_gen_config[];
 
 struct qat_pci_device *
 qat_pci_device_allocate(struct rte_pci_device *pci_dev);
+
 int
 qat_pci_device_release(struct rte_pci_device *pci_dev);
+
 struct qat_pci_device *
 qat_get_qat_dev_from_pci_dev(struct rte_pci_device *pci_dev);
 
+/* declaration needed for weak functions */
+int
+qat_sym_dev_create(struct qat_pci_device *qat_pci_dev __rte_unused);
+
+int
+qat_asym_dev_create(struct qat_pci_device *qat_pci_dev __rte_unused);
+
+int
+qat_sym_dev_destroy(struct qat_pci_device *qat_pci_dev __rte_unused);
+
+int
+qat_asym_dev_destroy(struct qat_pci_device *qat_pci_dev __rte_unused);
+
+int
+qat_comp_dev_create(struct qat_pci_device *qat_pci_dev __rte_unused);
+
+int
+qat_comp_dev_destroy(struct qat_pci_device *qat_pci_dev __rte_unused);
 
 #endif /* _QAT_DEVICE_H_ */