From: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
To: fiona.trahe@intel.com, tomaszx.jozwiak@intel.com,
pablo.de.lara.guarch@intel.com, dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/4] crypto/qat: add weak functions
Date: Tue, 22 May 2018 08:51:38 +0200 [thread overview]
Message-ID: <1526971901-9281-2-git-send-email-tomaszx.jozwiak@intel.com> (raw)
In-Reply-To: <1526971901-9281-1-git-send-email-tomaszx.jozwiak@intel.com>
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 | 2 --
drivers/crypto/qat/meson.build | 4 +---
drivers/crypto/qat/qat_asym_pmd.c | 17 -----------------
drivers/crypto/qat/qat_asym_pmd.h | 15 ---------------
drivers/crypto/qat/qat_comp_pmd.c | 18 ------------------
drivers/crypto/qat/qat_comp_pmd.h | 29 -----------------------------
drivers/crypto/qat/qat_device.c | 39 +++++++++++++++++++++++++++++++++++++--
drivers/crypto/qat/qat_device.h | 20 ++++++++++++++++++++
8 files changed, 58 insertions(+), 86 deletions(-)
delete mode 100644 drivers/crypto/qat/qat_asym_pmd.c
delete mode 100644 drivers/crypto/qat/qat_asym_pmd.h
delete mode 100644 drivers/crypto/qat/qat_comp_pmd.c
delete mode 100644 drivers/crypto/qat/qat_comp_pmd.h
diff --git a/drivers/crypto/qat/Makefile b/drivers/crypto/qat/Makefile
index ef4a567..64f39fd 100644
--- a/drivers/crypto/qat/Makefile
+++ b/drivers/crypto/qat/Makefile
@@ -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 +=
diff --git a/drivers/crypto/qat/meson.build b/drivers/crypto/qat/meson.build
index bcab16e..6d01dac 100644
--- a/drivers/crypto/qat/meson.build
+++ b/drivers/crypto/qat/meson.build
@@ -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
index 8d36300..0000000
--- a/drivers/crypto/qat/qat_asym_pmd.c
+++ /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
index 0465e03..0000000
--- a/drivers/crypto/qat/qat_asym_pmd.h
+++ /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
index 547b3db..0000000
--- a/drivers/crypto/qat/qat_comp_pmd.c
+++ /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
index cc31246..0000000
--- a/drivers/crypto/qat/qat_comp_pmd.h
+++ /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_ */
diff --git a/drivers/crypto/qat/qat_device.c b/drivers/crypto/qat/qat_device.c
index 4b97c84..64f236e 100644
--- a/drivers/crypto/qat/qat_device.c
+++ b/drivers/crypto/qat/qat_device.c
@@ -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);
diff --git a/drivers/crypto/qat/qat_device.h b/drivers/crypto/qat/qat_device.h
index e18c8a7..0cb370c 100644
--- a/drivers/crypto/qat/qat_device.h
+++ b/drivers/crypto/qat/qat_device.h
@@ -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_ */
--
2.7.4
next prev parent reply other threads:[~2018-05-22 6:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-22 6:51 [dpdk-dev] [PATCH 0/4] crypto/qat: move files to drivers/common directory Tomasz Jozwiak
2018-05-22 6:51 ` Tomasz Jozwiak [this message]
2018-05-22 6:51 ` [dpdk-dev] [PATCH 2/4] crypto/qat: add libcrypto detection to Makefile Tomasz Jozwiak
2018-05-22 6:51 ` [dpdk-dev] [PATCH 3/4] crypto/qat: move common qat files to common dir Tomasz Jozwiak
2018-05-22 9:20 ` Bruce Richardson
2018-05-22 6:51 ` [dpdk-dev] [PATCH 4/4] doc/qat: document libcrypto detection Tomasz Jozwiak
2018-06-14 11:12 ` [dpdk-dev] [PATCH v2 0/3] crypto/qat: move files to drivers/common directory Tomasz Jozwiak
2018-06-14 11:12 ` [dpdk-dev] [PATCH v2 1/3] crypto/qat: add weak functions Tomasz Jozwiak
2018-06-14 11:12 ` [dpdk-dev] [PATCH v2 2/3] crypto/qat: add libcrypto detection to Makefile Tomasz Jozwiak
2018-06-14 11:12 ` [dpdk-dev] [PATCH v2 3/3] crypto/qat: move common qat files to common dir Tomasz Jozwiak
2018-06-26 8:15 ` [dpdk-dev] [PATCH v3 0/3] crypto/qat: move files to drivers/common directory Tomasz Jozwiak
2018-06-26 8:17 ` Tomasz Jozwiak
2018-06-26 8:17 ` [dpdk-dev] [PATCH v3 1/3] crypto/qat: add weak functions Tomasz Jozwiak
2018-06-26 8:17 ` [dpdk-dev] [PATCH v3 2/3] crypto/qat: re-organise build file content Tomasz Jozwiak
2018-06-26 8:17 ` [dpdk-dev] [PATCH v3 3/3] crypto/qat: move common qat files to common dir Tomasz Jozwiak
2018-06-27 21:13 ` [dpdk-dev] [PATCH v3 0/3] crypto/qat: move files to drivers/common directory De Lara Guarch, Pablo
2018-07-02 9:39 ` [dpdk-dev] [PATCH v4 " Tomasz Jozwiak
2018-07-02 9:39 ` [dpdk-dev] [PATCH v4 1/3] crypto/qat: add weak functions Tomasz Jozwiak
2018-07-02 9:39 ` [dpdk-dev] [PATCH v4 2/3] crypto/qat: re-organise build file content Tomasz Jozwiak
2018-07-02 9:39 ` [dpdk-dev] [PATCH v4 3/3] crypto/qat: move common qat files to common dir Tomasz Jozwiak
2018-07-02 13:06 ` [dpdk-dev] [PATCH v4 0/3] crypto/qat: move files to drivers/common directory De Lara Guarch, Pablo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1526971901-9281-2-git-send-email-tomaszx.jozwiak@intel.com \
--to=tomaszx.jozwiak@intel.com \
--cc=dev@dpdk.org \
--cc=fiona.trahe@intel.com \
--cc=pablo.de.lara.guarch@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).