[meta-intel] [meta-intel-qat][PATCH v3 1/1] qat: update to qat17_4.1.0-00022

Anuj Mittal anuj.mittal at intel.com
Thu May 31 20:12:38 PDT 2018


Hi Raymond,

This is still failing for me in do_install because of hardcoded paths.
Please see comments below:

On 05/31/2018 12:10 PM, Tan, Raymond wrote:
> - update qat17 version to 4.1.0-00022
> - update previous patch to redefine yocto specific kernel path
> - remove qat17.inc by merging into BB file
> - use static lib to link for cpa_sample_code
> 
> Signed-off-by: Tan, Raymond <raymond.tan at intel.com>
> ---
>  .../files/qat17_0.6.0-1-qat-fix-kernel-patch.patch |  20 +--
>  ....0.1-00022-qat-use-static-lib-for-linking.patch |  25 ++++
>  recipes-extended/qat/qat17.inc                     | 148 -------------------
>  recipes-extended/qat/qat17_1.0.3-42.bb             |  29 ----
>  recipes-extended/qat/qat17_4.1.0-00022.bb          | 156 +++++++++++++++++++++
>  5 files changed, 191 insertions(+), 187 deletions(-)
>  create mode 100644 recipes-extended/qat/files/qat17_4.0.1-00022-qat-use-static-lib-for-linking.patch
>  delete mode 100644 recipes-extended/qat/qat17.inc
>  delete mode 100644 recipes-extended/qat/qat17_1.0.3-42.bb
>  create mode 100644 recipes-extended/qat/qat17_4.1.0-00022.bb
> 
> diff --git a/recipes-extended/qat/files/qat17_0.6.0-1-qat-fix-kernel-patch.patch b/recipes-extended/qat/files/qat17_0.6.0-1-qat-fix-kernel-patch.patch
> index 8b59c0a..423b3e4 100644
> --- a/recipes-extended/qat/files/qat17_0.6.0-1-qat-fix-kernel-patch.patch
> +++ b/recipes-extended/qat/files/qat17_0.6.0-1-qat-fix-kernel-patch.patch
> @@ -1,19 +1,19 @@
> -From 7950a07afaa44eef17b1cab9c036953036878d73 Mon Sep 17 00:00:00 2001
> -From: Wu Chia Chuan <chia.chuan.wu at intel.com>
> -Date: Wed, 28 Oct 2015 16:43:47 +0800
> -Subject: [PATCH]  fix kernel patch
> +From ae306d58c1bfc3d1c01d0e54ecfbfbbce39a0d4e Mon Sep 17 00:00:00 2001
> +From: "Tan, Raymond" <raymond.tan at intel.com>
> +Date: Wed, 30 May 2018 22:17:58 +0800
> +Subject: [PATCH] fix kernel patch

Can you please add Upstream-Status tag here and explain what this patch
does?

>  
> -Signed-off-by: Wu Chia Chuan <chia.chuan.wu at intel.com>
> +Signed-off-by: Tan, Raymond <raymond.tan at intel.com>
>  ---
> - quickassist/qat/Makefile |    6 +++---
> + quickassist/qat/Makefile | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>  
>  diff --git a/quickassist/qat/Makefile b/quickassist/qat/Makefile
> -index 319665d..36db6e6 100755
> +index ab9a381..8608378 100644
>  --- a/quickassist/qat/Makefile
>  +++ b/quickassist/qat/Makefile
> -@@ -6,13 +6,13 @@ export CONFIG_CRYPTO_DEV_QAT_C62X=m
> - export QAT_UIO?=y
> +@@ -61,13 +61,13 @@ $(info Compiling with Heartbeat Failure Simulation feature)
> + endif
>  
>   ifeq ($(KERNELRELEASE),)
>  -KDIR ?= $(INSTALL_MOD_PATH)/lib/modules/$(shell uname -r)/build
> @@ -30,4 +30,4 @@ index 319665d..36db6e6 100755
>  
>   default: modules
>  --
> -1.7.9.5
> +1.9.1
> diff --git a/recipes-extended/qat/files/qat17_4.0.1-00022-qat-use-static-lib-for-linking.patch b/recipes-extended/qat/files/qat17_4.0.1-00022-qat-use-static-lib-for-linking.patch
> new file mode 100644
> index 0000000..f44fe25
> --- /dev/null
> +++ b/recipes-extended/qat/files/qat17_4.0.1-00022-qat-use-static-lib-for-linking.patch
> @@ -0,0 +1,25 @@
> +From 026fd275834ac4e345464c8ce2b0163d052d0262 Mon Sep 17 00:00:00 2001
> +From: "Tan, Raymond" <raymond.tan at intel.com>
> +Date: Wed, 30 May 2018 13:27:03 +0800
> +Subject: [PATCH] qat-use-static-lib-for-linking-under-cpa-sample-code

Same here.

> +
> +Signed-off-by: Tan, Raymond <raymond.tan at intel.com>
> +---
> + quickassist/lookaside/access_layer/src/sample_code/performance/Makefile | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile b/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile
> +index 3a0fb37..5b7b3fa 100644
> +--- a/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile
> ++++ b/quickassist/lookaside/access_layer/src/sample_code/performance/Makefile
> +@@ -209,7 +209,7 @@ ifeq ($(WITH_CMDRV),1)
> +	ifeq ($(WITH_ICP_TARGET),1)
> +	ADDITIONAL_OBJECTS += $(ICP_BUILD_OUTPUT)/libqae_mem.a
> +	else
> +-	ADDITIONAL_OBJECTS += $(ICP_BUILD_OUTPUT)/libusdm_drv_s.so
> ++	ADDITIONAL_OBJECTS += $(ICP_BUILD_OUTPUT)/libusdm_drv.a
> +	endif

[...]

> diff --git a/recipes-extended/qat/qat17_4.1.0-00022.bb b/recipes-extended/qat/qat17_4.1.0-00022.bb
> new file mode 100644
> index 0000000..4e20a5a
> --- /dev/null
> +++ b/recipes-extended/qat/qat17_4.1.0-00022.bb
> @@ -0,0 +1,156 @@
> +DESCRIPTION = "Intel(r) QuickAssist Technology API"
> +HOMEPAGE = "https://01.org/packet-processing/intel%C2%AE-quickassist-technology-drivers-and-patches"
> +
> +#Dual BSD and GPLv2 License
> +LICENSE = "BSD & GPLv2"
> +LIC_FILES_CHKSUM = "\
> +                    file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \
> +                    file://${COMMON_LICENSE_DIR}/BSD;md5=3775480a712fc46a69647678acb234cb \
> +                    "
> +DEPENDS += "boost"
> +DEPENDS += "udev"
> +DEPENDS += "zlib openssl"
> +PROVIDES += "virtual/qat"
> +
> +TARGET_CC_ARCH += "${LDFLAGS}"
> +
> +SRC_URI="https://01.org/sites/default/files/downloads/intelr-quickassist-technology/qat1.7.l.4.1.0-00022.tar.gz \
> +         file://qat16_2.3.0-34-qat-remove-local-path-from-makefile.patch \
> +         file://qat16_2.6.0-65-qat-override-CC-LD-AR-only-when-it-is-not-define.patch \
> +         file://qat17_0.6.0-1-qat-fix-kernel-patch.patch \
> +         file://qat17_0.8.0-37-qat-added-include-dir-path.patch \
> +         file://qat17_0.9.0-4-qat-add-install-target-and-add-folder.patch \
> +         file://qat17_4.0.1-00022-qat-use-static-lib-for-linking.patch \
> +         "
> +
> +SRC_URI[md5sum] = "29ab942f9c151d3c0e025accfd971ee6"
> +SRC_URI[sha256sum] = "6caa72c65b9350f1708b2ed341e40ae3c6881953c501d0fbb7e2f8affaa5e025"
> +
> +COMPATIBLE_MACHINE = "crystalforest|intel-corei7-64|intel-core2-32"

crystalforest is not a valid MACHINE anymore.

> +COMPATIBLE_HOST_x86-x32 = 'null'
> +COMPATIBLE_HOST_libc-musl_class-target = 'null'
> +
> +S = "${WORKDIR}"
> +ICP_TOOLS = "accelcomp"
> +SAMPLE_CODE_DIR = "${S}/quickassist/lookaside/access_layer/src/sample_code"
> +export INSTALL_MOD_PATH = "${D}"
> +export ICP_DRIVER_TYPE = "QAT1.7"
> +export ICP_FIRMWARE_DIR="c3xxx"
> +export ICP_ROOT = "${S}"
> +export ICP_ENV_DIR = "${S}/quickassist/build_system/build_files/env_files"
> +export ICP_BUILDSYSTEM_PATH = "${S}/quickassist/build_system"
> +export ICP_TOOLS_TARGET = "${ICP_TOOLS}"
> +export FUNC_PATH = "${ICP_ROOT}/quickassist/lookaside/access_layer/src/sample_code/functional"
> +export INSTALL_FW_PATH = "${D}${base_libdir}/firmware"
> +export KERNEL_SOURCE_ROOT = "${STAGING_KERNEL_DIR}"
> +export ICP_BUILD_OUTPUT = "${D}"
> +export DEST_LIBDIR = "${libdir}"
> +export DEST_BINDIR = "${bindir}"
> +export QAT_KERNEL_VER = "${KERNEL_VERSION}"
> +export SAMPLE_BUILD_OUTPUT = "${D}"
> +export MODULE_DIR = "${base_libdir}/modules/${KERNEL_VERSION}/kernel/drivers"
> +export INSTALL_MOD_DIR = "${D}${base_libdir}/modules/${KERNEL_VERSION}"
> +export KERNEL_BUILDDIR = "${STAGING_KERNEL_BUILDDIR}"
> +export SC_EPOLL_DISABLED = "1"
> +export WITH_UPSTREAM = "1"
> +export WITH_CMDRV = "1"
> +export KERNEL_SOURCE_DIR = "${ICP_ROOT}/quickassist/qat/"

Are all these exports still necessary?

> +
> +export BIN_LIST="qat_c3xxx.bin qat_c3xxx_mmp.bin qat_c62x.bin qat_c62x_mmp.bin"
> +export BIN_DH895XCC="qat_895xcc.bin qat_895xcc_mmp.bin"
> +export BIN_C62X="qat_c62x.bin qat_c62x_mmp.bin"
> +export BIN_C3XXX="qat_c3xxx.bin qat_c3xxx_mmp.bin"
> +
> +export KO_INTEL_QAT="${S}/quickassist/qat/drivers/crypto/qat/qat_common"
> +export KO_QAT_DH895XCC="${S}/quickassist/qat/drivers/crypto/qat/qat_dh895xcc"
> +export KO_QAT_DH895XCCVF="${S}/quickassist/qat/drivers/crypto/qat/qat_dh895xccvf"
> +export KO_QAT_C62X="${S}/quickassist/qat/drivers/crypto/qat/qat_c62x"
> +export KO_QAT_C62XVF="${S}/quickassist/qat/drivers/crypto/qat/qat_c62xvf"
> +export KO_QAT_C3XXX="${S}/quickassist/qat/drivers/crypto/qat/qat_c3xxx"
> +export KO_QAT_C3XXXVF="${S}/quickassist/qat/drivers/crypto/qat/qat_c3xxxvf"

Why isn;t the modules_install target in quickassist/qat/Makefile being
used to install these modules?

> +
> +inherit module
> +inherit update-rc.d
> +INITSCRIPT_NAME = "qat_service"
> +
> +PARALLEL_MAKE = ""
> +
> +#To get around the double slashes in paths in QAT makefiles
> +PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"

Is this still required?

> +
> +EXTRA_OEMAKE_append = " CFLAGS+='-fgnu89-inline -fPIC'"
> +EXTRA_OEMAKE = "-e MAKEFLAGS="
> +
> +do_compile () {
> +	export LD="${LD} --hash-style=gnu"
> +	export MACHINE="${TARGET_ARCH}"
> +
> +        cd ${S}/quickassist
> +        oe_runmake
> +
> +	cd ${S}/quickassist/qat
> +	oe_runmake 'clean'
> +	oe_runmake 'modules_install'
> +
> +	cd ${S}/quickassist/utilities/adf_ctl
> +	oe_runmake
> +
> +	cd ${S}/quickassist/utilities/libusdm_drv
> +        oe_runmake
> +
> +	#build the whole sample code: per_user only
> +	cd ${SAMPLE_CODE_DIR}
> +	oe_runmake 'perf_user'
> +}
> +
> +do_install() {
> +	cp ${TOPDIR}/downloads/qat1.7.l.${PV}.tar.gz ${S}

Why is this being done? Also, this incorrectly assumes that downloads
directory will always be "${TOPDIR}/downloads" leading to build failures.

> +	export MACHINE="${TARGET_ARCH}"
> +
> +	cd ${S}/quickassist
> +        oe_runmake install
> +
> +        install -d ${D}/etc/udev/rules.d


The formatting for this and others is inconsistent. Tabs or spaces.
Also, /etc should be replaced by ${sysconfdir}.

> +	install -d ${D}${sbindir}
> +	install -d ${D}${sysconfdir}/conf_files
> +	install -d ${D}${prefix}/qat
> +
> +	echo 'KERNEL=="icp_adf_ctl" MODE="0600"' > ${D}/etc/udev/rules.d/00-dh895xcc_qa.rules
> +	echo 'KERNEL=="icp_dev[0-9]*" MODE="0600"' >> ${D}/etc/udev/rules.d/00-dh895xcc_qa.rules
> +	echo 'KERNEL=="icp_dev_mem?" MODE="0600"' >> ${D}/etc/udev/rules.d/00-dh895xcc_qa.rules
> +
> +	install -m 0755 ${S}/qat1.7.l.${PV}.tar.gz ${D}${prefix}/qat

Why is this being done?

> +
> +	install -D -m 0755 ${S}/quickassist/lookaside/access_layer/src/build/linux_2.6/user_space/*.so ${D}${base_libdir}
> +	install -D -m 0755 ${S}/quickassist/utilities/libusdm_drv/libusdm_drv_s.so ${D}${base_libdir}
> +	install -D -m 0750 ${S}/quickassist/utilities/adf_ctl/adf_ctl ${D}${sbindir}
> +	install -D -m 640 ${S}/quickassist/utilities/adf_ctl/conf_files/c3xxx_dev0.conf  ${D}${sysconfdir}
> +	install -D -m 640 ${S}/quickassist/utilities/adf_ctl/conf_files/c3xxx_dev0.conf  ${D}${sysconfdir}/conf_files
> +	install -D -m 640 ${S}/quickassist/utilities/adf_ctl/conf_files/c3xxxvf_dev0.conf.vm  ${D}${sysconfdir}/conf_files
> +	install -m 0755 ${S}/quickassist/qat/fw/qat_c3xxx.bin  ${D}${base_libdir}/firmware
> +	install -m 0755 ${S}/quickassist/qat/fw/qat_c3xxx_mmp.bin  ${D}${base_libdir}/firmware
> +	install -m 0755 ${S}/quickassist/qat/fw/qat_c62x.bin  ${D}${base_libdir}/firmware
> +	install -m 0755 ${S}/quickassist/qat/fw/qat_c62x_mmp.bin  ${D}${base_libdir}/firmware

Can we use the BIN_LIST defined above here?

> +	install -m 0755 ${S}/quickassist/lookaside/access_layer/src/sample_code/performance/compression/calgary  ${D}${base_libdir}/firmware
> +	install -m 0755 ${S}/quickassist/lookaside/access_layer/src/sample_code/performance/compression/calgary32  ${D}${base_libdir}/firmware
> +	install -m 0755 ${S}/quickassist/lookaside/access_layer/src/sample_code/performance/compression/canterbury  ${D}${base_libdir}/firmware
> +}
> +
> +PACKAGES += "${PN}-app"
> +
> +FILES_${PN}-dev = "${includedir}/ \

This is done by default and shouldn't be necessary.

> +                  "
> +FILES_${PN} += "\
> +                ${libdir}/ \
> +                ${base_libdir}/firmware \
> +                ${sysconfdir}/ \
> +		${sbindir}/ \
> +		${base_libdir}/*.so \
> +                "
> +
> +FILES_${PN}-dbg += "${sysconfdir}/init.d/.debug/ \
> +		   "
> +
> +FILES_${PN}-app += "${bindir}/* \
> +		    ${prefix}/qat \
> +		   "
> 



More information about the meta-intel mailing list