Commit ea0a034b authored by Michal Berger's avatar Michal Berger Committed by Tomasz Zawadzki
Browse files

pkgdep/git: [QAT] Patch use of timespec



timespec and other time related types were hidden in 5.6 kernel,
details here:

git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c766d1472c70d25ad475cf56042af1652e792b23
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=412c53a680a97cb1ae2c0ab60230e193bee86387

Change-Id: I02ed16f9047337c77cc9ad344bbb40c52b3202be
Signed-off-by: default avatarMichal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3505


Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarMaciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
parent c7bd3cb4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -91,6 +91,11 @@ function install_qat() {

	tar -C "$GIT_REPOS/QAT" -xzof - < <(wget -O- "$DRIVER_LOCATION_QAT")

	# Patch use of hidden types in kernels >= 5.6.3. See .patch for details
	if ((kernel_ver >= 0x050603)); then
		patch --dir="$GIT_REPOS/QAT" -p1 < "$rootdir/test/common/config/pkgdep/patches/qat/0001-timespec.patch"
	fi

	(cd "$GIT_REPOS/QAT" && sudo ./configure --enable-icp-sriov=host && sudo make install)

	if sudo service qat_service start; then
+35 −0
Original line number Diff line number Diff line
This patch attempts to expose timespec and getnstimeofday which were
explicitly hidden in the 5.6 kernel with the introduction of the
following commits:

git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c766d1472c70d25ad475cf56042af1652e792b23
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=412c53a680a97cb1ae2c0ab60230e193bee86387

Code received from users@dpdk.org, issue tracked under QATE-59888.

---
diff --git a/quickassist/lookaside/access_layer/src/sample_code/performance/framework/linux/kernel_space/cpa_sample_code_utils.c b/quickassist/lookaside/access_layer/src/sample_code/performance/framework/linux/kernel_space/cpa_sample_code_utils.c
index 4639834..523e376 100644
--- a/quickassist/lookaside/access_layer/src/sample_code/performance/framework/linux/kernel_space/cpa_sample_code_utils.c
+++ b/quickassist/lookaside/access_layer/src/sample_code/performance/framework/linux/kernel_space/cpa_sample_code_utils.c
@@ -107,6 +107,8 @@ atomic_t arrived;
 extern struct device perf_device;
 #endif
 
+#define timespec timespec64
+#define getnstimeofday ktime_get_real_ts64
 
 /* Define a number for timeout */
 #define SAMPLE_CODE_MAX_LONG (0x7FFFFFFF)
diff --git a/quickassist/qat/compat/qat_compat.h b/quickassist/qat/compat/qat_compat.h
index 2a02eaf..3515092 100644
--- a/quickassist/qat/compat/qat_compat.h
+++ b/quickassist/qat/compat/qat_compat.h
@@ -466,4 +466,7 @@ static inline void pci_ignore_hotplug(struct pci_dev *dev)
 #if (RHEL_RELEASE_CODE && RHEL_RELEASE_VERSION(7, 3) <= RHEL_RELEASE_CODE)
 #define QAT_KPT_CAP_DISCOVERY
 #endif
+
+#define timespec timespec64
+#define getnstimeofday ktime_get_real_ts64
 #endif /* _QAT_COMPAT_H_ */