QATlib provides user space libraries that allow access to Intel QuickAssist
devices and expose the Intel QuickAssist APIs and samples.

Supported hardware:
  4xxx (QAT gen 4 devices)

Usage of QATlib:
  1) Enable Intel IOMMU with intel_iommu=on in kernel boot cmdline.
  2) Driver qat_4xxx and vfio-pci from kernel.
  3) Firmware qat_4xxx.bin and qat_4xxx_mmp.bin in /lib/firmware from upstream.
  4) Installed qatlib, qatlib-dev and qatlib-samples in your target image.
  4) Enabled /lib/systemd/system/qat.service.
  5) Run samples, such as cpa_sample_code.

Tested with kernel v6.1.62 and systemd installed on target.

Signed-off-by: Yongxin Liu <[email protected]>
---
 recipes-extended/qatlib/qatlib_git.bb | 64 +++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
 create mode 100644 recipes-extended/qatlib/qatlib_git.bb

diff --git a/recipes-extended/qatlib/qatlib_git.bb 
b/recipes-extended/qatlib/qatlib_git.bb
new file mode 100644
index 0000000..1b7dca3
--- /dev/null
+++ b/recipes-extended/qatlib/qatlib_git.bb
@@ -0,0 +1,64 @@
+DESCRIPTION = "Intel QuickAssist Technology Library (QATlib)"
+HOMEPAGE = "https://github.com/intel/qatlib";
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=64dc5eee9d532c8a1633bb63ed0d1aac"
+
+COMPATIBLE_MACHINE = "null"
+COMPATIBLE_HOST:x86-x32 = 'null'
+COMPATIBLE_HOST:libc-musl:class-target = 'null'
+
+SRC_URI = "git://github.com/intel/qatlib.git;protocol=https;branch=main"
+SRCREV = "142e305970ec66a860945d20bb7c330f99ed900b"
+
+PV = "23.11.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep systemd useradd
+
+DEPENDS = "openssl zlib nasm-native"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM:${PN} = "qat"
+
+SYSTEMD_SERVICE:${PN} = "qat.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+# The systemd unit path "/lib/systemd/system" cannot be correctly passed to 
build system of QATlib. So hardcode here.
+# Checking "cross_compiling" is not smart and sometimes causes fatal error due 
to wrong path of ELF file interpreter.
+EXTRA_OECONF += "--enable-service 
systemdsystemunitdir=${systemd_unitdir}/system cross_compiling=yes"
+
+do_compile:append () {
+    oe_runmake samples
+}
+
+do_install () {
+    export DESTDIR=${D}
+    oe_runmake install-exec
+    oe_runmake install-dist_systemd_scriptsSCRIPTS
+    oe_runmake install-man
+    oe_runmake install-pkgincludeHEADERS
+    oe_runmake samples-install
+
+    install -d ${D}${systemd_unitdir}/system
+    install -m 0644 quickassist/utilities/service/qat.service 
${D}${systemd_unitdir}/system
+}
+
+FILES:${PN}-dbg = "${bindir}/.debug/* \
+                   ${libdir}/.debug/* \
+                   ${sbindir}/.debug/* \
+                  "
+
+FILES:${PN}-doc = "${datadir}/man"
+
+FILES:${PN}-staticdev = "${includedir}/qat/* \
+                         ${libdir}/*.a \
+                        "
+
+FILES:${PN} = "${sbindir} \
+               ${libdir}/*.so* \
+               ${datadir}/qat \
+               ${systemd_unitdir}/system \
+               ${bindir}/*sample* \
+              "
-- 
2.39.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8187): 
https://lists.yoctoproject.org/g/meta-intel/message/8187
Mute This Topic: https://lists.yoctoproject.org/mt/103037555/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to