> -----Original Message-----
> From: Mittal, Anuj <[email protected]>
> Sent: Thursday, December 7, 2023 16:03
> To: Liu, Yongxin <[email protected]>; Lee, Chee Yang
> <[email protected]>; [email protected]
> Subject: Re: [meta-intel][meta-intel-qat][PATCH] qatlib: add recipe for
> QATlib 23.11.0 release.
> 
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and
> know the content is safe.
> 
> On Thu, 2023-12-07 at 07:37 +0000, Liu, Yongxin wrote:
> >
> > > -----Original Message-----
> > > From: Mittal, Anuj <[email protected]>
> > > Sent: Thursday, December 7, 2023 15:24
> > > To: Liu, Yongxin <[email protected]>; Lee, Chee Yang
> > > <[email protected]>; [email protected]
> > > Subject: Re: [meta-intel][meta-intel-qat][PATCH] qatlib: add recipe
> > > for QATlib 23.11.0 release.
> > >
> > > CAUTION: This email comes from a non Wind River email account!
> > > Do not click links or open attachments unless you recognize the
> > > sender and know the content is safe.
> > >
> > > On Wed, 2023-12-06 at 23:13 +0800, Yongxin Liu wrote:
> > > > 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/files/qatlib.sh |  2 +
> > > >  recipes-extended/qatlib/qatlib_git.bb   | 84
> > > > +++++++++++++++++++++++++
> > > >  2 files changed, 86 insertions(+)  create mode 100755
> > > > recipes-extended/qatlib/files/qatlib.sh
> > > >  create mode 100644 recipes-extended/qatlib/qatlib_git.bb
> > > >
> > > > diff --git a/recipes-extended/qatlib/files/qatlib.sh b/recipes-
> > > > extended/qatlib/files/qatlib.sh new file mode 100755 index
> > > > 0000000..b4439ce
> > > > --- /dev/null
> > > > +++ b/recipes-extended/qatlib/files/qatlib.sh
> > > > @@ -0,0 +1,2 @@
> > > > +export PATH=/opt/intel/qatlib/bin:$PATH export
> > > > +LD_LIBRARY_PATH=/opt/intel/qatlib/lib:$LD_LIBRARY_PATH
> > > > diff --git a/recipes-extended/qatlib/qatlib_git.bb b/recipes-
> > > > extended/qatlib/qatlib_git.bb new file mode 100644 index
> > > > 0000000..89e2d7e
> > > > --- /dev/null
> > > > +++ b/recipes-extended/qatlib/qatlib_git.bb
> > > > @@ -0,0 +1,84 @@
> > > > +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 \
> > > > +           file://qatlib.sh \
> > > > +          "
> > > > +SRCREV = "142e305970ec66a860945d20bb7c330f99ed900b"
> > > > +PV = "23.11.0+git${SRCPV}"
> > > > +S = "${WORKDIR}/git"
> > > > +
> > > > +inherit autotools systemd useradd
> > > > +
> > > > +DEPENDS = "openssl zlib nasm-native"
> > > > +
> > > > +USERADD_PACKAGES = "${PN}"
> > > > +GROUPADD_PARAM:${PN} = "qat"
> > > > +
> > > > +PREFIX = "/opt/intel/qatlib"
> > >
> > > Why are we installing this explicitly in /opt?
> >
> > No specific reason.
> > Just like qat17, installing to independent folder in /opt makes the
> > system look clean.
> >
> 
> If there is no reason to, then we should install to standard directories
> and get rid of all the extra things we are doing to package it and make it
> work from /opt.
> 
> > >
> > > Thanks,
> > >
> > > Anuj
> > >
> > > > +SYSTEMD_SERVICE:${PN} = "qat.service"
> > > > +SYSTEMD_AUTO_ENABLE = "enable"
> > > > +
> > > > +do_configure () {
> > > > +    cd ${S}
> > > > +    ./autogen.sh
> > > > +
> > > > +    # 1) The systemd unit path "/lib/systemd/system" cannot be
> > > > correctly passed to build system of QATlib. So hardcoded here.
> > > > +    # 2) Checking "cross_compiling" is not smart and sometimes
> > > > causes fatal error due to wrong path of ELF file interpreter.
> > > > +    ./configure --enable-service --prefix=${PREFIX}
> > > > systemdsystemunitdir=${systemd_unitdir}/system
> > > > cross_compiling=yes
> > > > +}
> > > > +
> > > > +do_compile () {
> > > > +    cd ${S}
> > > > +    oe_runmake
> > > > +    oe_runmake samples
> > >
> > > Should this recipe be inheriting autotools-brokensep instead and
> > > this can just be:
> > >
> > > do_compile:append () {
> > >     oe_runmake samples
> > > }
> >
> > Currently it is built and installed from ${S}.
> > If we change like yours, it will be built in sperate build dir, and
> > the do_install cannot be so directly, we need to install many files
> > ourselves, instead of using makefile directly.
> >
> 
> If you inherit autotools-brokensep, it should build from ${S}.


Thanks Anuj. Will fix those two issues in V2.

Thanks,
Yongxin

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

Reply via email to