From 0f8bff29f8de61c54b2345aa61bd262c523565a7 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Tue, 23 Mar 2021 12:53:12 +0100 Subject: [PATCH] pkgpdep/git: Patch QAT to adjust for changes in recent kernels 5.11.x Most notably, crypto/sha.h was split into two separate header files, crypto/sha1.h and crypto/sha2.h. Signed-off-by: Michal Berger Change-Id: I43ae61034f743bf4aae7f2f29919eec92d851f01 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7010 Tested-by: SPDK CI Jenkins Reviewed-by: Karol Latecki Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki Community-CI: Mellanox Build Bot --- test/common/config/pkgdep/git | 6 ++ .../config/pkgdep/patches/qat/0001-sha.patch | 66 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 test/common/config/pkgdep/patches/qat/0001-sha.patch diff --git a/test/common/config/pkgdep/git b/test/common/config/pkgdep/git index 3626f3441..993418b26 100644 --- a/test/common/config/pkgdep/git +++ b/test/common/config/pkgdep/git @@ -190,6 +190,12 @@ function install_qat() { if ((kernel_ver >= 0x050a01)); then patch --dir="$GIT_REPOS/QAT" -p1 fi < "$rootdir/test/common/config/pkgdep/patches/qat/0001-set-obj-m.patch" + + # sha.h was split into two separate files, sha1.h and sha2.h in kernels >= 5.11 + if ((kernel_ver >= 0x050b01)); then + # 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" || : (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-sha.patch b/test/common/config/pkgdep/patches/qat/0001-sha.patch new file mode 100644 index 000000000..6a27dcd5f --- /dev/null +++ b/test/common/config/pkgdep/patches/qat/0001-sha.patch @@ -0,0 +1,66 @@ +sha.h was split in >= 5.11.x kernel into sha1.h and sha2.h via the following commit: + +git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a24d22b225ce158651378869a6b88105c4bdb887 + + +--- + quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c | 2 +- + .../qat/drivers/crypto/qat/qat_common/qat_algs_ablkcipher.c | 2 +- + quickassist/qat/drivers/crypto/qat/qat_common/qat_algs_old.c | 2 +- + .../osal/src/linux/kernel_space/OsalCryptoInterface.c | 3 ++- + 4 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c +index 37ac11e..b07982c 100644 +--- a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c ++++ b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs.c +@@ -52,7 +52,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs_ablkcipher.c b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs_ablkcipher.c +index 417e0db..0236d52 100644 +--- a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs_ablkcipher.c ++++ b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs_ablkcipher.c +@@ -51,7 +51,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs_old.c b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs_old.c +index e30dead..5941f4c 100644 +--- a/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs_old.c ++++ b/quickassist/qat/drivers/crypto/qat/qat_common/qat_algs_old.c +@@ -53,7 +53,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +diff --git a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c +index 9d2e85c..4088eda 100644 +--- a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c ++++ b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c +@@ -69,7 +69,8 @@ + #include + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) + #include +-#include ++#include ++#include + + #define OSAL_MAX_SHASH_DECSIZE 512 + +--