From b2ff54257677c6c2bc4f816db3b9c4677e1b0ab6 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Tue, 2 Mar 2021 11:13:04 +0100 Subject: [PATCH] pkgdep/git: Apply pci_aer_centos patch The latest QAT driver version which we support attempts to define pci_cleanup_aer_uncorrect_error_status() whenever <= 5.7.0 kernels are detected. However, in case of centos8, the latest 4.18 build of the kernel which is available there includes patches which completely removed use of this call. To make sure this function is not built into the driver, apply the patch on top of QAT which will remove this definition entirely. This patch is meant to be applied only in case <= 5.7.0 kernel are picked up and which are missing pci_cleanup_aer_uncorrect_error_status() symbol definitions. Signed-off-by: Michal Berger Change-Id: Ieb09d5a1dc8936d6e266c6cadfdf9d70620a3bca Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6620 Tested-by: SPDK CI Jenkins Reviewed-by: Karol Latecki Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki --- test/common/config/pkgdep/git | 13 ++++++++-- .../patches/qat/0001-pci_aer_centos.patch | 26 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 test/common/config/pkgdep/patches/qat/0001-pci_aer_centos.patch diff --git a/test/common/config/pkgdep/git b/test/common/config/pkgdep/git index 0f426013e..291f12ddc 100644 --- a/test/common/config/pkgdep/git +++ b/test/common/config/pkgdep/git @@ -168,8 +168,17 @@ function install_qat() { # Patch name of the pci_aer function which was renamed in kernels >= 5.7.1. See .patch for details if ((kernel_ver >= 0x050701)) || ! in_syms pci_cleanup_aer_uncorrect_error_status; then # Patch only the driver version that was tested - [[ ${DRIVER_LOCATION_QAT##*/} == qat1.7.l.4.9.0-00008.tar.gz ]] && patch --dir="$GIT_REPOS/QAT" -p1 - fi < "$rootdir/test/common/config/pkgdep/patches/qat/0001-pci_aer.patch" + if [[ ${DRIVER_LOCATION_QAT##*/} == qat1.7.l.4.9.0-00008.tar.gz ]]; then + patch --dir="$GIT_REPOS/QAT" -p1 + fi < "$rootdir/test/common/config/pkgdep/patches/qat/0001-pci_aer.patch" + if ((kernel_ver < 0x050701)); then + # Older kernel build without pci_cleanup_aer_uncorrect_error_status()? This might be + # centos8's build. + if [[ ${DRIVER_LOCATION_QAT##*/} == qat1.7.l.4.12.0-00011.tar.gz ]]; then + patch --dir="$GIT_REPOS/QAT" -p1 + fi < "$rootdir/test/common/config/pkgdep/patches/qat/0001-pci_aer_centos.patch" + fi + fi # Patch use of cryptohash.h which was removed in favor of crypto/sha.h in kernels >= 5.8. See .patch for details if ((kernel_ver >= 0x050800)); then diff --git a/test/common/config/pkgdep/patches/qat/0001-pci_aer_centos.patch b/test/common/config/pkgdep/patches/qat/0001-pci_aer_centos.patch new file mode 100644 index 000000000..580f68a64 --- /dev/null +++ b/test/common/config/pkgdep/patches/qat/0001-pci_aer_centos.patch @@ -0,0 +1,26 @@ +Latest kernels available for centos8 (4.18) include backport patches which +dropped use of pci_cleanup_aer_uncorrect_error_status(). Make sure this +call won't be referenced for kernels older than 5.7. To make it work, this +patch is going to be applied only when pci_cleanup_aer_uncorrect_error_status() +is not detected in older kernels (like the centos8's builds). +--- + quickassist/qat/compat/qat_compat.h | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/quickassist/qat/compat/qat_compat.h b/quickassist/qat/compat/qat_compat.h +index 06d640d..cee298c 100644 +--- a/quickassist/qat/compat/qat_compat.h ++++ b/quickassist/qat/compat/qat_compat.h +@@ -478,12 +478,6 @@ static inline void pci_ignore_hotplug(struct pci_dev *dev) + #define QAT_KPT_CAP_DISCOVERY + #endif + +-#if ((SLE_VERSION_CODE && (SLE_VERSION(15, 2, 0) > SLE_VERSION_CODE)) || \ +- (!SLE_VERSION_CODE && KERNEL_VERSION(5, 7, 0) > LINUX_VERSION_CODE)) +-#define pci_aer_clear_nonfatal_status(pdev) \ +- pci_cleanup_aer_uncorrect_error_status(pdev) +-#endif /* SUSE15 SP2 */ +- + #if (KERNEL_VERSION(3, 17, 0) > LINUX_VERSION_CODE) + #ifndef ktime_get_real_ts64 + #define ktime_get_real_ts64 getnstimeofday