From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id CD6D72BBD for ; Tue, 22 May 2018 08:51:46 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 May 2018 23:51:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,429,1520924400"; d="scan'208";a="48842277" Received: from tjozwiax-mobl.ger.corp.intel.com (HELO tojo-VirtualBox.MobicaPL.local) ([10.103.104.44]) by fmsmga002.fm.intel.com with ESMTP; 21 May 2018 23:51:44 -0700 From: Tomasz Jozwiak To: fiona.trahe@intel.com, tomaszx.jozwiak@intel.com, pablo.de.lara.guarch@intel.com, dev@dpdk.org Date: Tue, 22 May 2018 08:51:38 +0200 Message-Id: <1526971901-9281-2-git-send-email-tomaszx.jozwiak@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526971901-9281-1-git-send-email-tomaszx.jozwiak@intel.com> References: <1526971901-9281-1-git-send-email-tomaszx.jozwiak@intel.com> Subject: [dpdk-dev] [PATCH 1/4] crypto/qat: add weak functions X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2018 06:51:47 -0000 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 Acked-by: Fiona Trahe --- 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