This adds zlib-qat shim layer version 0.4.10-001. This specific version will work with QAT 1.7 hardware and uses the CMN driver(libusdm_drv) provided by QAT17.
Signed-off-by: Tan, Raymond <[email protected]> --- ...mem-build-qat_contig_mem-ko-against-yocto.patch | 33 ++++++ ...4.10-001-zlib-Remove-rpaths-from-makefile.patch | 63 +++++++++++ ...zlib-qat-add-a-install-target-to-makefile.patch | 45 ++++++++ ...rrect-the-order-for-static-linking-libude.patch | 31 +++++ recipes-extended/zlib-qat/zlib-qat_0.4.10-001.bb | 126 +++++++++++++++++++++ 5 files changed, 298 insertions(+) create mode 100644 recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-qat_contig_mem-build-qat_contig_mem-ko-against-yocto.patch create mode 100644 recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-zlib-Remove-rpaths-from-makefile.patch create mode 100644 recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-zlib-qat-add-a-install-target-to-makefile.patch create mode 100644 recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-zlib-qat-correct-the-order-for-static-linking-libude.patch create mode 100644 recipes-extended/zlib-qat/zlib-qat_0.4.10-001.bb diff --git a/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-qat_contig_mem-build-qat_contig_mem-ko-against-yocto.patch b/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-qat_contig_mem-build-qat_contig_mem-ko-against-yocto.patch new file mode 100644 index 0000000..490b1b1 --- /dev/null +++ b/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-qat_contig_mem-build-qat_contig_mem-ko-against-yocto.patch @@ -0,0 +1,33 @@ +From af90f85993558a630b18df17cbf220750f7732af Mon Sep 17 00:00:00 2001 +From: "Tan, Raymond" <[email protected]> +Date: Fri, 10 Aug 2018 15:29:21 +0800 +Subject: [PATCH 1/4] qat_contig_mem: build qat_contig_mem ko against yocto + kernel src + +Upstream-Status: Inappropriate [Configuration] + +This tweaks the kernel source and build path in the makefile +to make sure the module is built against the right source. + +Signed-off-by: Tan, Raymond <[email protected]> +--- + contrib/qat/qat_contig_mem/Makefile | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/contrib/qat/qat_contig_mem/Makefile b/contrib/qat/qat_contig_mem/Makefile +index fdcfefc..519d4f6 100644 +--- a/contrib/qat/qat_contig_mem/Makefile ++++ b/contrib/qat/qat_contig_mem/Makefile +@@ -87,6 +87,9 @@ else + obj-m := $(MODULENAME).o + endif + ++modules_install: ++ $(MAKE) -C $(KDIR) M=$(PWD) modules_install ++ + $(MODULENAME)_test: $(MODULENAME)_test.c + $(CC) -g -o $(MODULENAME)_test $(MODULENAME)_test.c + +-- +1.9.1 + diff --git a/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-zlib-Remove-rpaths-from-makefile.patch b/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-zlib-Remove-rpaths-from-makefile.patch new file mode 100644 index 0000000..fed989b --- /dev/null +++ b/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-zlib-Remove-rpaths-from-makefile.patch @@ -0,0 +1,63 @@ +From e99767608c1bf38dfcf97cf0791528b53aaf2893 Mon Sep 17 00:00:00 2001 +From: "Tan, Raymond" <[email protected]> +Date: Fri, 10 Aug 2018 15:45:38 +0800 +Subject: [PATCH 3/4] zlib: Remove rpaths from makefile + +Upstream-Status: Inappropriate [configuration] + +This removes references to RPATHS that are no longer +necesary when building using bitbake. + +Signed-off-by: Tan, Raymond <[email protected]> +--- + Makefile.in | 9 +++++---- + contrib/qat/qat_zlib_test/Makefile | 3 --- + 2 files changed, 5 insertions(+), 7 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 0100f59..8978ef1 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -59,12 +59,13 @@ ICP_LAC_API_DIR=$(ICP_API_DIR)/lac/ + ICP_DC_API_DIR=$(ICP_API_DIR)/dc/ + CFLAGS+=-D_GNU_SOURCE -I$(ICP_API_DIR) -I$(ICP_DC_API_DIR) -I$(ICP_LAC_API_DIR) -I$(ICP_SAL_API_DIR) + SFLAGS+=-D_GNU_SOURCE -I$(ICP_API_DIR) -I$(ICP_DC_API_DIR) -I$(ICP_LAC_API_DIR) -I$(ICP_SAL_API_DIR) +-ADDITIONAL_LDFLAGS+=-Wl,-rpath,$(ZLIB_ROOT) -lz +-SHARED_APP_FLAGS=-Wl,-rpath,$(ZLIB_ROOT) -L$(ZLIB_ROOT) -lz ++#ADDITIONAL_LDFLAGS+=-Wl,-rpath,$(ZLIB_ROOT) -lz ++#SHARED_APP_FLAGS=-Wl,-rpath,$(ZLIB_ROOT) -L$(ZLIB_ROOT) -lz ++SHARED_APP_FLAGS=-L$(ZLIB_ROOT) -lz + + ifdef ICP_BUILD_OUTPUT + TEST_LDFLAGS+=-L$(ICP_BUILD_OUTPUT) +- ADDITIONAL_LDFLAGS+=-Wl,-rpath,$(ICP_BUILD_OUTPUT) -L$(ICP_BUILD_OUTPUT) ++# ADDITIONAL_LDFLAGS+=-Wl,-rpath,$(ICP_BUILD_OUTPUT) -L$(ICP_BUILD_OUTPUT) + endif + + ifdef UPSTREAM_DRIVER_CMN_ROOT +@@ -91,7 +92,7 @@ ADDITIONAL_SHAREDLIBC=-L$(ICP_BUILD_OUTPUT) -l$(DRIVER)_s -lpthread -lrt + + ifeq ($(ZLIB_MEMORY_DRIVER),usdm_drv) + TEST_LDFLAGS+= $(CMN_ROOT)/libusdm_drv.a +-ADDITIONAL_LDFLAGS+=-Wl,-rpath,$(CMN_ROOT) -L$(CMN_ROOT) -lusdm_drv_s ++#ADDITIONAL_LDFLAGS+=-Wl,-rpath,$(CMN_ROOT) -L$(CMN_ROOT) -lusdm_drv_s + endif + + STATICLIB=libz.a +diff --git a/contrib/qat/qat_zlib_test/Makefile b/contrib/qat/qat_zlib_test/Makefile +index 47829ac..bfcf86d 100644 +--- a/contrib/qat/qat_zlib_test/Makefile ++++ b/contrib/qat/qat_zlib_test/Makefile +@@ -85,9 +85,6 @@ COVERAGE_OBJS = + EXE= + LIBQAT= + UDEV= +-ifdef ICP_BUILD_OUTPUT +- LIBQAT+= -Wl,-rpath,$(ICP_BUILD_OUTPUT) -L$(ICP_BUILD_OUTPUT) +-endif + + ifdef UPSTREAM_DRIVER_CMN_ROOT + DRIVER=qat +-- +1.9.1 + diff --git a/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-zlib-qat-add-a-install-target-to-makefile.patch b/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-zlib-qat-add-a-install-target-to-makefile.patch new file mode 100644 index 0000000..8746f23 --- /dev/null +++ b/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-zlib-qat-add-a-install-target-to-makefile.patch @@ -0,0 +1,45 @@ +From 76f3d46fcc9ad79b82933e1751041d4771a4f4ff Mon Sep 17 00:00:00 2001 +From: "Tan, Raymond" <[email protected]> +Date: Fri, 10 Aug 2018 15:42:08 +0800 +Subject: [PATCH 2/4] zlib-qat: add a install target to makefile + +Upstream-Status: Inappropriate [Configuration] + +This adds an install target to qat_zlib_test and qat_contig_mem makefiles +to facilitate the installation of test binaries to {D}. + +Signed-off-by: Tan, Raymond <[email protected]> +--- + contrib/qat/qat_contig_mem/Makefile | 3 +++ + contrib/qat/qat_zlib_test/Makefile | 2 ++ + 2 files changed, 5 insertions(+) + +diff --git a/contrib/qat/qat_contig_mem/Makefile b/contrib/qat/qat_contig_mem/Makefile +index 519d4f6..1e56aa6 100644 +--- a/contrib/qat/qat_contig_mem/Makefile ++++ b/contrib/qat/qat_contig_mem/Makefile +@@ -87,6 +87,9 @@ else + obj-m := $(MODULENAME).o + endif + ++install: modules_install ++ cp qat_contig_mem_test $(INSTALL_MOD_PATH)$(bindir) ++ + modules_install: + $(MAKE) -C $(KDIR) M=$(PWD) modules_install + +diff --git a/contrib/qat/qat_zlib_test/Makefile b/contrib/qat/qat_zlib_test/Makefile +index 7b86028..47829ac 100644 +--- a/contrib/qat/qat_zlib_test/Makefile ++++ b/contrib/qat/qat_zlib_test/Makefile +@@ -132,5 +132,7 @@ comptestappsh$(EXE): $(OBJS) Makefile + $(CC) -o comptestappsh $(OBJS) $(COVERAGE) \ + $(SHAREDLIBQAT) + ++install: ++ cp comptestapp $(DESTDIR)$(bindir) + clean: + rm -f $(OBJS) $(COVERAGE_OBJS) comptestapp comptestappsh +-- +1.9.1 + diff --git a/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-zlib-qat-correct-the-order-for-static-linking-libude.patch b/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-zlib-qat-correct-the-order-for-static-linking-libude.patch new file mode 100644 index 0000000..62dea3e --- /dev/null +++ b/recipes-extended/zlib-qat/zlib-qat/zlib-qat-0.4.10-001-zlib-qat-correct-the-order-for-static-linking-libude.patch @@ -0,0 +1,31 @@ +From 75b9cff7d80d3007a56b4f43046b97759fa6255d Mon Sep 17 00:00:00 2001 +From: "Tan, Raymond" <[email protected]> +Date: Thu, 16 Aug 2018 14:29:05 +0800 +Subject: [PATCH 4/4] zlib-qat: correct the order for static linking libudev + +Upstream-Status: Inappropriate [Configuration] + +This changes the order of linking command to link libudev after libadf +to avoid undefined reference on udev. + +Signed-off-by: Tan, Raymond <[email protected]> +--- + contrib/qat/qat_zlib_test/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/contrib/qat/qat_zlib_test/Makefile b/contrib/qat/qat_zlib_test/Makefile +index bfcf86d..0498da8 100644 +--- a/contrib/qat/qat_zlib_test/Makefile ++++ b/contrib/qat/qat_zlib_test/Makefile +@@ -101,7 +101,7 @@ ifdef WITH_CPA_MUX + endif + + SHAREDLIBQAT= -Wl,-rpath,$(ZLIB_ROOT) -L$(ZLIB_ROOT) -lz -ldl -lrt -lpthread +-STATICLIBQAT= $(ZLIB_ROOT)/libz.a $(LIBQAT) $(UDEV) -l$(DRIVER) -l$(ADFPROXY) -losal -lcrypto -ldl -lrt -lpthread ++STATICLIBQAT= $(ZLIB_ROOT)/libz.a $(LIBQAT) -l$(DRIVER) -l$(ADFPROXY) -losal -lcrypto -ldl -lrt -lpthread $(UDEV) + + ifeq ($(ZLIB_MEMORY_DRIVER),usdm_drv) + STATICLIBQAT+= $(CMN_ROOT)/libusdm_drv.a +-- +1.9.1 + diff --git a/recipes-extended/zlib-qat/zlib-qat_0.4.10-001.bb b/recipes-extended/zlib-qat/zlib-qat_0.4.10-001.bb new file mode 100644 index 0000000..d7ec581 --- /dev/null +++ b/recipes-extended/zlib-qat/zlib-qat_0.4.10-001.bb @@ -0,0 +1,126 @@ +SUMMARY = "Intel QuickAssist Technology enabled Zlib" + +DESCRIPTION = "This software acelerates the data compression algorithm \ +in the zlib software library via the Intel QuickAssist Technology \ +implemented on Intel QuickAssist Technology for HW ver 1.7" + +HOMEPAGE = "http://zlib.net/" +SECTION = "libs" +LICENSE = "Zlib & GPLv2 & BSD" +LIC_FILES_CHKSUM = "file://${WORKDIR}/zlib-${ZLIB_VERSION}/zlib.h;beginline=4;endline=23;md5=fde612df1e5933c428b73844a0c494fd \ + file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \ + file://${COMMON_LICENSE_DIR}/BSD;md5=3775480a712fc46a69647678acb234cb" + +# For target side versions of openssl enable support for OCF Linux driver +# if they are available. +DEPENDS += "cryptodev-linux pkgconfig virtual/qat udev" + +SRC_URI = "http://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz;name=zlib \ + https://01.org/sites/default/files/downloads/intelr-quickassist-technology/zlibshim0.4.10-001.tar.gz;name=zlibqat \ + file://zlib-qat-0.4.10-001-qat_contig_mem-build-qat_contig_mem-ko-against-yocto.patch \ + file://zlib-qat-0.4.10-001-zlib-qat-add-a-install-target-to-makefile.patch \ + file://zlib-qat-0.4.10-001-zlib-Remove-rpaths-from-makefile.patch \ + file://zlib-qat-0.4.10-001-zlib-qat-correct-the-order-for-static-linking-libude.patch \ + " +SRC_URI_append_libc-musl = " file://0001-qat_zlib.h-Add-pthread.h-for-MUSL.patch" + +SRC_URI[zlib.md5sum] = "44d667c142d7cda120332623eab69f40" +SRC_URI[zlib.sha256sum] = "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d" + +SRC_URI[zlibqat.md5sum] = "449e5b8dd41e49df1cced144b54d5bc1" +SRC_URI[zlibqat.sha256sum] = "d9d288951a1c4b92d3261d2fcbbacf79168b09bd6528fea31fa82bb7c3139f03" + +COMPATIBLE_MACHINE = "null" + +ZLIB_VERSION = "1.2.8" +ZLIB_QAT_VERSION = "0.4.10-001" + +S = "${WORKDIR}/zlib-${ZLIB_VERSION}" + +export ICP_ROOT = "${S}" +export ZLIB_ROOT = "${S}" +export KERNEL_SOURCE_ROOT = "${STAGING_KERNEL_DIR}" +export KERNEL_BUILDDIR = "${STAGING_KERNEL_BUILDDIR}" +export ICP_LAC_API_DIR = "${STAGING_DIR_TARGET}${includedir}/lac" +export ICP_DC_API_DIR = "${STAGING_DIR_TARGET}${includedir}/dc" +export ZLIB_MEMORY_DRIVER = "usdm_drv" +export ICP_BUILD_OUTPUT = "${STAGING_DIR_TARGET}/lib" +export CMN_ROOT = "${STAGING_DIR_TARGET}/lib" +export UPSTREAM_DRIVER_CMN_ROOT = "${STAGING_DIR_TARGET}/lib" +export PATH_AUTOCNF = "include/generated" +EXTRA_OEMAKE = "-e MAKEFLAGS=" +TARGET_CC_ARCH += "${LDFLAGS}" + +inherit module +MEM_PATH = "${S}/contrib/qat" + +zlibqat_do_patch() { + cd ${WORKDIR} + tar -xvzf zlib-${ZLIB_VERSION}-qat.L.${ZLIB_QAT_VERSION}.tar.gz + cd ${S} + if [ ! -d ${S}/debian/patches ]; then + mkdir -p ${S}/debian/patches + cp -f ${WORKDIR}/zlib-${ZLIB_VERSION}-qat.patch ${S}/debian/patches + echo "zlib-${ZLIB_VERSION}-qat.patch -p1" > ${S}/debian/patches/series + fi + quilt pop -a || true + if [ -d ${S}/.pc-zlibqat ]; then + rm -rf ${S}/.pc + mv ${S}/.pc-zlibqat ${S}/.pc + QUILT_PATCHES=${S}/debian/patches quilt pop -a + rm -rf ${S}/.pc + fi + QUILT_PATCHES=${S}/debian/patches quilt push -a + mv ${S}/.pc ${S}/.pc-zlibqat +} + +# We invoke base do_patch at end, to incorporate any local patch +python do_patch() { + bb.build.exec_func('zlibqat_do_patch', d) + bb.build.exec_func('patch_do_patch', d) +} + +do_configure() { + ./configure --prefix=${prefix} --shared --libdir=${libdir} +} + +do_compile() { + + unset CFLAGS CXXFLAGS + oe_runmake + + oe_runmake zpipe + + cd ${S}/contrib/qat/qat_zlib_test + oe_runmake +} + +do_install() { + install -m 0755 -d ${D}${bindir}/ + install -m 0755 -d ${D}${sysconfdir}/zlib_conf/ + + install -m 0755 zpipe ${D}${bindir} + install -m 0755 minigzip ${D}${bindir} + + cd ${S}/contrib/qat/qat_zlib_test + oe_runmake DESTDIR=${D} install + + install -m 660 ${MEM_PATH}/config/c3xxx/multi_thread_optimized/* ${D}${sysconfdir}/zlib_conf/ + install -m 660 ${MEM_PATH}/config/c6xx/multi_thread_optimized/* ${D}${sysconfdir}/zlib_conf/ +} + +PACKAGES += "${PN}-app" + +FILES_${PN} += " \ + ${sysconfdir}/zlib_conf/ \ + " + +FILES_${PN}-app += " \ + ${bindir}/* \ + " + +FILES_${PN}-dbg += " \ + ${bindir}/.debug \ + " + +EXCLUDE_FROM_WORLD_core2-32-intel-common = "1" -- 1.9.1 -- _______________________________________________ meta-intel mailing list [email protected] https://lists.yoctoproject.org/listinfo/meta-intel
