From e9a4350381aa642b474f6774c33f2f12ad0c0105 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Tue, 25 May 2021 11:15:15 +0200 Subject: [PATCH] pkgdep/git: Patch QAT driver for changes in crypto API Details here: git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0eb76ba29d16df2951d37c54ca279c4e5630b071 Signed-off-by: Michal Berger Change-Id: Ica523bc4ec6b68fab2549a02476872b4d250a8f0 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8041 Reviewed-by: Karol Latecki Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- test/common/config/pkgdep/git | 6 ++++ .../pkgdep/patches/qat/0001-cipher-ns.patch | 28 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 test/common/config/pkgdep/patches/qat/0001-cipher-ns.patch diff --git a/test/common/config/pkgdep/git b/test/common/config/pkgdep/git index b5c8d1d8e..b0684fd9e 100644 --- a/test/common/config/pkgdep/git +++ b/test/common/config/pkgdep/git @@ -158,6 +158,12 @@ function install_qat() { # qat_algs_ablkcipher.c doesn't exist in older versions of the driver so simply force the patch patch --force --dir="$GIT_REPOS/QAT" -p1 fi < "$rootdir/test/common/config/pkgdep/patches/qat/0001-sha.patch" || : + + # cipher routines were moved from crypto.h to crypto/internal/cipher.h in kernels >= 5.12 + if ((kernel_ver >= 0x050c00)); then + patch --dir="$GIT_REPOS/QAT" -p1 + fi < "$rootdir/test/common/config/pkgdep/patches/qat/0001-cipher-ns.patch" + (cd "$GIT_REPOS/QAT" && sudo ./configure --enable-icp-sriov=host && sudo make install) if ! sudo service qat_service start; then diff --git a/test/common/config/pkgdep/patches/qat/0001-cipher-ns.patch b/test/common/config/pkgdep/patches/qat/0001-cipher-ns.patch new file mode 100644 index 000000000..8c9f29c5a --- /dev/null +++ b/test/common/config/pkgdep/patches/qat/0001-cipher-ns.patch @@ -0,0 +1,28 @@ +Cipher routines were moved to their own header file and the symbol exports +are now available under a new namespace, CRYPTO_INTERNAL. + +Details: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0eb76ba29d16df2951d37c54ca279c4e5630b071 +--- + +diff --git a/quickassist/lookaside/access_layer/src/linux/icp_qa_module.c b/quickassist/lookaside/access_layer/src/linux/icp_qa_module.c +index 413eb07..f7d09bd 100644 +--- a/quickassist/lookaside/access_layer/src/linux/icp_qa_module.c ++++ b/quickassist/lookaside/access_layer/src/linux/icp_qa_module.c +@@ -120,3 +120,4 @@ module_exit(kapi_mod_exit); + MODULE_DESCRIPTION("Intel(R) Quickassist Technology Acceleration Driver"); + MODULE_AUTHOR("Intel"); + MODULE_LICENSE("Dual BSD/GPL"); ++MODULE_IMPORT_NS(CRYPTO_INTERNAL); +diff --git a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c +index 9d2e85c..f265422 100644 +--- a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c ++++ b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c +@@ -65,7 +65,7 @@ + */ + + #include "Osal.h" +-#include ++#include + #include + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + #include