Compare commits

...

2 Commits

Author SHA1 Message Date
AlmaLinux RelEng Bot
5366d1e54a import CS qat-zstd-plugin-1.0.0-1.el9 2026-03-30 10:56:40 -04:00
8c68de1a48 import CS qat-zstd-plugin-0.2.0-3.el9 2025-03-19 07:27:42 +00:00
13 changed files with 188 additions and 204 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
/qat-zstd-plugin-*.tar.gz
SOURCES/qat-zstd-plugin-1.0.0.tar.gz

View File

@ -0,0 +1 @@
cfdcb9b4a3308da2d7e8a29b19519bcd41fc13e2 SOURCES/qat-zstd-plugin-1.0.0.tar.gz

View File

@ -1,16 +1,20 @@
--- a/src/Makefile 2024-10-30 22:20:03.296178391 +0100
+++ b/src/Makefile 2024-10-30 22:21:43.915301707 +0100
@@ -52,11 +52,11 @@ ifneq ($(ICP_ROOT), )
@@ -53,7 +53,7 @@ ifneq ($(ICP_ROOT), )
-I$(ICP_ROOT)/quickassist/include/dc \
-I$(ICP_ROOT)/quickassist/lookaside/access_layer/include \
-I$(ICP_ROOT)/quickassist/utilities/libusdm_drv
- LDFLAGS = -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build -lqat_s \
+ LDFLAGS += -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build -lqat_s \
-lusdm_drv_s
-lusdm_drv_s -lnuma
else
QATFLAGS = -DINTREE
- LDFLAGS = -lqat -lusdm
+ LDFLAGS += -lqat -lusdm
# In-tree - look for headers in standard locations
@@ -63,7 +63,7 @@ else
else
$(error QAT headers not found in Standard path, Please install QATLib development package or set ICP_ROOT for out-of-tree driver)
endif
- LDFLAGS = -lqat -lusdm -lnuma
+ LDFLAGS += -lqat -lusdm -lnuma
endif
ifdef ZSTDLIB
@ -24,4 +28,4 @@
+LDFLAGS += -L$(LIB) -I$(LIB)
ifneq ($(ICP_ROOT), )
LDFLAGS += -lqat_s -lusdm_drv_s -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build
LDFLAGS += -lqat_s -lusdm_drv_s -lnuma -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build

62
SOURCES/test.patch Normal file
View File

@ -0,0 +1,62 @@
--- a/test/Makefile
+++ b/test/Makefile
@@ -34,42 +34,27 @@
# #######################################################################
LIB = ../src
-LDFLAGS = $(LIB)/libqatseqprod.a -I$(LIB)
+LDFLAGS = -L$(LIB) -I$(LIB)
ifneq ($(ICP_ROOT), )
LDFLAGS += -lqat_s -lusdm_drv_s -lnuma -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build
else
- LDFLAGS += -lqat -lusdm -lnuma
-endif
-
-ifdef ZSTDLIB
-CFLAGS += -I$(ZSTDLIB)
-LDFLAGS += $(ZSTDLIB)/libzstd.a
-else
-ZSTDLIB := $(shell find /usr /lib /local -name 'libzstd.a' 2>/dev/null | head -n 1| xargs dirname)
-LDFLAGS += $(ZSTDLIB)/libzstd.a
+ LDFLAGS += -lzstd -lqatseqprod -lqat -lusdm
endif
default: test benchmark
all: test benchmark
-check_zstdlib:
- @echo checking zstd static libaray '$(ZSTDLIB)/libzstd.a'
- @if [ ! -e $(ZSTDLIB)/libzstd.a ]; then \
- echo libzstd.a is not found, please install libzstd or specify the path manually; \
- exit 1; \
- fi
-
-test: test.c check_zstdlib
+test: test.c
$(Q)$(MAKE) -C $(LIB)
$(CC) $< $(CFLAGS) $(LDFLAGS) -o $@
-benchmark: benchmark.c check_zstdlib
+benchmark: benchmark.c
$(Q)$(MAKE) -C $(LIB)
$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@ -lpthread
clean:
$(Q)$(MAKE) -C $(LIB) $@
$(RM) test benchmark
-.PHONY: clean check_zstdlib
+.PHONY: clean
--- a/test/test.c
+++ b/test/test.c
@@ -44,9 +44,6 @@
#include "qatseqprod.h"
-#ifndef ZSTD_STATIC_LINKING_ONLY
-#define ZSTD_STATIC_LINKING_ONLY
-#endif
#include "zstd.h"
#include "zstd_errors.h"

114
SPECS/qat-zstd-plugin.spec Normal file
View File

@ -0,0 +1,114 @@
## START: Set by rpmautospec
## (rpmautospec version 0.6.5)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
release_number = 1;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec
# SPDX-License-Identifier: MIT
Name: qat-zstd-plugin
Version: 1.0.0
Release: %autorelease
Summary: Intel QuickAssist Technology ZSTD Plugin
License: BSD-3-Clause
URL: https://github.com/intel/QAT-ZSTD-Plugin
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: test.patch
Patch1: rh-makefile.patch
BuildRequires: automake
BuildRequires: gcc
BuildRequires: libzstd-devel
BuildRequires: qatlib-devel
BuildRequires: numactl-devel
# Upstream only supports x86_64
ExclusiveArch: x86_64
%description
Intel QuickAssist Technology ZSTD is a plugin to Zstandard for accelerating
compression by QAT. ZSTD* is a fast lossless compression algorithm, targeting
real-time compression scenarios at zlib-level and better compression ratios.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
applications that use %{name}.
%package static
Summary: Static library for %{name}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%description static
The %{name}-static package contains the static %{name} library.
%prep
%autosetup -p1 -n QAT-ZSTD-Plugin-%{version}
# fedora/rhel path fixes
sed -i -e 's|/usr/local|%{_prefix}|g' src/Makefile
sed -i -e 's|$(PREFIX)/lib|%{_libdir}|g' src/Makefile
sed -i -e 's|$(PREFIX)/include|%{_includedir}|g' src/Makefile
%build
# c9s build system quickfix BEGIN
CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
export CFLAGS
CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
export CXXFLAGS
FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
export FFLAGS
FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
export FCFLAGS
LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 '
export LDFLAGS
LT_SYS_LIBRARY_PATH=/usr/lib64:
export LT_SYS_LIBRARY_PATH
CC=gcc
export CC
CXX=g++
export CXX
# c9s build system quickfix END
%make_build LDFLAGS="$LDFLAGS -lzstd"
make test
%install
%make_install
%check
LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./test/test README.md
%files
%license LICENSE
%{_libdir}/libqatseqprod.so.1
%{_libdir}/libqatseqprod.so.%{version}
%files devel
%{_includedir}/qatseqprod.h
%{_libdir}/libqatseqprod.so
%files static
%license LICENSE
%{_libdir}/libqatseqprod.a
%changelog
## START: Generated by rpmautospec
* Mon Feb 02 2026 Vladislav Dronov <vdronov@redhat.com> - 1.0.0-1
- Update to qat-zstd-plugin 1.0.0 @ 1e8b930c (RHEL-72905)
- NUMA node aware mem allocations and other Code optimizations
- Bug Fixes and Static analysis Fixes (OpenScanhub and Latest Coverity)
- Support ZSTD v1.5.7 and README refactor
- Spec file updates for RPM Packaging
* Tue Oct 29 2024 Vladis Dronov <vdronov@redhat.com> - 0.2.0-1
- Initial commit on c9s (RHEL-46072)
## END: Generated by rpmautospec

View File

@ -1,6 +0,0 @@
--- !Policy
product_versions:
- rhel-10
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -1,46 +0,0 @@
--- a/src/Makefile 2024-10-09 18:14:19.453675299 +0300
+++ b/src/Makefile 2024-10-09 18:25:13.601675269 +0300
@@ -79,18 +79,27 @@
QATFLAGS += -O3
endif
+VERSION_MAJOR=0
+VERSION_MINOR=2
+VERSION_PATCH=0
+VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
+
qatseqprod.o: qatseqprod.c
$(CC) -c $(CFLAGS) $(QATFLAGS) $(DEBUGFLAGS) $^ -o $@
lib: qatseqprod.o
$(AR) rc libqatseqprod.a $^
- $(CC) -shared $^ $(LDFLAGS) -o libqatseqprod.so
+ $(CC) -shared $^ $(LDFLAGS) -Wl,-soname,libqatseqprod.so.$(VERSION_MAJOR) -o libqatseqprod.so.$(VERSION)
+ ln -sf libqatseqprod.so.$(VERSION) libqatseqprod.so.$(VERSION_MAJOR)
+ ln -sf libqatseqprod.so.$(VERSION_MAJOR) libqatseqprod.so
.PHONY: install
install: lib
[ -e $(DESTDIR)$(LIBDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/
[ -e $(DESTDIR)$(INCLUDEDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR)/
- $(INSTALL_PROGRAM) libqatseqprod.so $(DESTDIR)$(LIBDIR)
+ $(INSTALL_PROGRAM) libqatseqprod.so.$(VERSION) $(DESTDIR)$(LIBDIR)
+ ln -sf libqatseqprod.so.$(VERSION) $(DESTDIR)$(LIBDIR)/libqatseqprod.so.$(VERSION_MAJOR)
+ ln -sf libqatseqprod.so.$(VERSION_MAJOR) $(DESTDIR)$(LIBDIR)/libqatseqprod.so
$(INSTALL_DATA) libqatseqprod.a $(DESTDIR)$(LIBDIR)
$(INSTALL_DATA) qatseqprod.h $(DESTDIR)$(INCLUDEDIR)
@echo qatseqprod library successfully installed
@@ -98,10 +107,12 @@
.PHONY: uninstall
uninstall:
$(RM) $(LIBDIR)/libqatseqprod.a
+ $(RM) $(LIBDIR)/libqatseqprod.so.$(VERSION)
+ $(RM) $(LIBDIR)/libqatseqprod.so.$(VERSION_MAJOR)
$(RM) $(LIBDIR)/libqatseqprod.so
$(RM) $(INCLUDEDIR)/qatseqprod.h
@echo qatseqprod library successfully uninstalled
clean:
$(RM) *.o
- $(RM) libqatseqprod.a libqatseqprod.so
+ $(RM) libqatseqprod.a libqatseqprod.so libqatseqprod.so.$(VERSION) libqatseqprod.so.$(VERSION_MAJOR)

View File

@ -1,74 +0,0 @@
Name: qat-zstd-plugin
Version: 0.2.0
Release: %autorelease
Summary: Intel QuickAssist Technology ZSTD Plugin
License: BSD-3-Clause
URL: https://github.com/intel/QAT-ZSTD-Plugin
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: lib-version.patch
Patch1: test.patch
Patch2: rh-makefile.patch
BuildRequires: automake
BuildRequires: gcc
BuildRequires: libzstd-devel
BuildRequires: qatlib-devel
# Upstream only supports x86_64
ExclusiveArch: x86_64
%description
Intel QuickAssist Technology ZSTD is a plugin to Zstandard for accelerating
compression by QAT. ZSTD* is a fast lossless compression algorithm, targeting
real-time compression scenarios at zlib-level and better compression ratios.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
applications that use %{name}.
%package static
Summary: Static library for %{name}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%description static
The %{name}-static package contains the static %{name} library.
%prep
%autosetup -p1 -n QAT-ZSTD-Plugin-%{version}
# fedora/rhel path fixes
sed -i -e 's|/usr/local|%{_prefix}|g' src/Makefile
sed -i -e 's|$(PREFIX)/lib|%{_libdir}|g' src/Makefile
sed -i -e 's|$(PREFIX)/include|%{_includedir}|g' src/Makefile
%build
%make_build LDFLAGS="$LDFLAGS -lzstd"
make test
%install
%make_install
%check
LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./test/test README.md
%files
%license LICENSE
%{_libdir}/libqatseqprod.so.0
%{_libdir}/libqatseqprod.so.%{version}
%files devel
%{_includedir}/qatseqprod.h
%{_libdir}/libqatseqprod.so
%files static
%license LICENSE
%{_libdir}/libqatseqprod.a
%changelog
%autochangelog

View File

@ -1 +0,0 @@
SHA512 (qat-zstd-plugin-0.2.0.tar.gz) = 9039a346d85bed9a84326a6e664de8d0203b92b167468fd5d7d67ff96be08b3edaba92e28a900ba53440eaed66b3621db72c6a3d1200b74b0893b7ba8a6bf21a

View File

@ -1,48 +0,0 @@
--- a/test/Makefile
+++ b/test/Makefile
@@ -34,24 +34,12 @@
# #######################################################################
LIB = ../src
-LDFLAGS = $(LIB)/libqatseqprod.a -I$(LIB)
+LDFLAGS = -L$(LIB) -I$(LIB)
ifneq ($(ICP_ROOT), )
LDFLAGS += -lqat_s -lusdm_drv_s -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build
else
- LDFLAGS += -lqat -lusdm
-endif
-
-ifdef ZSTDLIB
-LDFLAGS += $(ZSTDLIB)/libzstd.a
-else
-ZSTDLIB := $(shell find /usr /lib /local -name 'libzstd.a' 2>/dev/null | head -n 1)
-ZSTDLIB ?= /usr/local/lib/libzstd.a
-ifneq ("$(wildcard $(ZSTDLIB))","")
- LDFLAGS += $(ZSTDLIB)
-else
- $(error libzstd.a not found, please install libzstd or specify the path manually)
-endif
+ LDFLAGS += -lzstd -lqatseqprod -lqat -lusdm
endif
default: test benchmark
--- a/test/test.c
+++ b/test/test.c
@@ -44,9 +44,6 @@
#include "qatseqprod.h"
-#ifndef ZSTD_STATIC_LINKING_ONLY
-#define ZSTD_STATIC_LINKING_ONLY
-#endif
#include "zstd.h"
#include "zstd_errors.h"
@@ -143,4 +140,4 @@
free(dstBuffer);
free(decompBuffer);
return 0;
-}
\ No newline at end of file
+}

View File

@ -1,7 +0,0 @@
A test should be configured as BaseOS CI test (not an OSCI one), as it require
an x86_64 machine with QAT_4XXX (or later) hardware, so it should be run in Beaker.
see: https://one.redhat.com/rhel-development-guide/#proc_enable-gating_assembly_enabling-gating
and: https://docs.engineering.redhat.com/display/RTT/Onboarding+gating+tests
and: https://docs.engineering.redhat.com/pages/viewpage.action?pageId=53110084
and: https://docs.engineering.redhat.com/display/RTT/Creating+and+Updating+beaker+test

View File

@ -1,5 +0,0 @@
#!/bin/bash
# There is a test binary and %check rpm target for testing
echo QAT-ZSTD-Plugin nulltest is PASS
exit 0

View File

@ -1,10 +0,0 @@
---
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
tests:
- nulltest:
dir: .
run: nulltest.sh