From 3c32e89f68e1f6edfd715b76925b95700e9cd4aa Mon Sep 17 00:00:00 2001 From: Lee Daly Date: Wed, 9 May 2018 17:14:26 +0100 Subject: [PATCH] compress/isal: add skeleton ISA-L compression PMD Adding basic skeleton of the ISA-L compression driver. No compression functionality, but lays the foundation for operations in the rest of the patchset. The ISA-L compression driver utilizes Intel's ISA-L compression library and compressdev API. Signed-off-by: Lee Daly Reviewed-by: Pablo de Lara --- MAINTAINERS | 11 +++++++ config/common_base | 5 ++++ devtools/test-build.sh | 4 +++ doc/guides/rel_notes/release_18_05.rst | 5 ++++ drivers/Makefile | 2 ++ drivers/compress/Makefile | 8 +++++ drivers/compress/isal/Makefile | 30 +++++++++++++++++++ drivers/compress/isal/isal_compress_pmd.c | 29 ++++++++++++++++++ drivers/compress/isal/meson.build | 14 +++++++++ .../compress/isal/rte_pmd_isal_version.map | 3 ++ drivers/compress/meson.build | 8 +++++ drivers/meson.build | 1 + mk/rte.app.mk | 5 ++++ 13 files changed, 125 insertions(+) create mode 100644 drivers/compress/Makefile create mode 100644 drivers/compress/isal/Makefile create mode 100644 drivers/compress/isal/isal_compress_pmd.c create mode 100644 drivers/compress/isal/meson.build create mode 100644 drivers/compress/isal/rte_pmd_isal_version.map create mode 100644 drivers/compress/meson.build diff --git a/MAINTAINERS b/MAINTAINERS index cf67db3405..377043093d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -347,6 +347,7 @@ M: Pablo de Lara M: Ashish Gupta T: git://dpdk.org/next/dpdk-next-crypto F: lib/librte_compressdev/ +F: drivers/compress/ F: test/test/test_compressdev* F: doc/guides/prog_guide/compressdev.rst @@ -818,6 +819,16 @@ F: doc/guides/cryptodevs/zuc.rst F: doc/guides/cryptodevs/features/zuc.ini +Compression Drivers +------------------- +M: Pablo de Lara +T: git://dpdk.org/next/dpdk-next-crypto + +ISA-L +M: Lee Daly +F: drivers/compress/isal/ + + Eventdev Drivers ---------------- M: Jerin Jacob diff --git a/config/common_base b/config/common_base index 5ba67d8ef8..e4041c5c79 100644 --- a/config/common_base +++ b/config/common_base @@ -581,6 +581,11 @@ CONFIG_RTE_COMPRESS_MAX_DEVS=64 # CONFIG_RTE_COMPRESSDEV_TEST=n +# +# Compile PMD for ISA-L compression device +# +CONFIG_RTE_LIBRTE_PMD_ISAL=n + # # Compile generic event device library # diff --git a/devtools/test-build.sh b/devtools/test-build.sh index ebc426c5fe..078e8c905d 100755 --- a/devtools/test-build.sh +++ b/devtools/test-build.sh @@ -37,6 +37,7 @@ default_path=$PATH # - DPDK_BUILD_TEST_CONFIGS (defconfig1+option1+option2 defconfig2) # - DPDK_DEP_ARCHIVE # - DPDK_DEP_CFLAGS +# - DPDK_DEP_ISAL (y/[n]) # - DPDK_DEP_LDFLAGS # - DPDK_DEP_MLX (y/[n]) # - DPDK_DEP_NUMA ([y]/n) @@ -122,6 +123,7 @@ reset_env () unset CROSS unset DPDK_DEP_ARCHIVE unset DPDK_DEP_CFLAGS + unset DPDK_DEP_ISAL unset DPDK_DEP_LDFLAGS unset DPDK_DEP_MLX unset DPDK_DEP_NUMA @@ -171,6 +173,8 @@ config () # sed -ri 's,(BYPASS=)n,\1y,' $1/.config test "$DPDK_DEP_ARCHIVE" != y || \ sed -ri 's,(RESOURCE_TAR=)n,\1y,' $1/.config + test "$DPDK_DEP_ISAL" != y || \ + sed -ri 's,(ISAL_PMD=)n,\1y,' $1/.config test "$DPDK_DEP_MLX" != y || \ sed -ri 's,(MLX._PMD=)n,\1y,' $1/.config test "$DPDK_DEP_SZE" != y || \ diff --git a/doc/guides/rel_notes/release_18_05.rst b/doc/guides/rel_notes/release_18_05.rst index c41fb479f1..2592469aff 100644 --- a/doc/guides/rel_notes/release_18_05.rst +++ b/doc/guides/rel_notes/release_18_05.rst @@ -144,6 +144,11 @@ New Features The compressdev library provides an API for offload of compression and decompression operations to hardware or software accelerator devices. +* **Added a new compression poll mode driver using Intels ISA-L.** + + Added the new ``ISA-L`` compression driver, for compression and decompression + operations in software. + * **Added the Event Timer Adapter Library.** The Event Timer Adapter Library extends the event-based model by introducing diff --git a/drivers/Makefile b/drivers/Makefile index 3d9f86b006..c88638c8f0 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -13,6 +13,8 @@ DIRS-$(CONFIG_RTE_LIBRTE_BBDEV) += baseband DEPDIRS-baseband := common bus mempool DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto DEPDIRS-crypto := common bus mempool +DIRS-$(CONFIG_RTE_LIBRTE_COMPRESSDEV) += compress +DEPDIRS-compress := bus mempool DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event DEPDIRS-event := common bus mempool net DIRS-$(CONFIG_RTE_LIBRTE_RAWDEV) += raw diff --git a/drivers/compress/Makefile b/drivers/compress/Makefile new file mode 100644 index 0000000000..592497f514 --- /dev/null +++ b/drivers/compress/Makefile @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + +include $(RTE_SDK)/mk/rte.vars.mk + +DIRS-$(CONFIG_RTE_LIBRTE_PMD_ISAL) += isal + +include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/compress/isal/Makefile b/drivers/compress/isal/Makefile new file mode 100644 index 0000000000..9b1d86666b --- /dev/null +++ b/drivers/compress/isal/Makefile @@ -0,0 +1,30 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + +include $(RTE_SDK)/mk/rte.vars.mk + +# library name +LIB = librte_pmd_isal_comp.a + +# build flags +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) +CFLAGS += -DALLOW_EXPERIMENTAL_API + +# external library dependencies +LDLIBS += -lisal +LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring +LDLIBS += -lrte_compressdev +LDLIBS += -lrte_bus_vdev + +# library version +LIBABIVER := 1 + +# versioning export map +EXPORT_MAP := rte_pmd_isal_version.map + +# library source files +SRCS-$(CONFIG_RTE_LIBRTE_PMD_ISAL) += isal_compress_pmd.c + +# export include files +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/compress/isal/isal_compress_pmd.c b/drivers/compress/isal/isal_compress_pmd.c new file mode 100644 index 0000000000..d7137fd40d --- /dev/null +++ b/drivers/compress/isal/isal_compress_pmd.c @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Intel Corporation + */ + +#include +#include + +/** Remove compression device */ +static int +compdev_isal_remove_dev(struct rte_vdev_device *vdev __rte_unused) +{ + return 0; +} + +/** Initialise ISA-L compression device */ +static int +compdev_isal_probe(struct rte_vdev_device *dev __rte_unused) +{ + return 0; +} + +static struct rte_vdev_driver compdev_isal_pmd_drv = { + .probe = compdev_isal_probe, + .remove = compdev_isal_remove_dev, +}; + +RTE_PMD_REGISTER_VDEV(COMPDEV_NAME_ISAL_PMD, compdev_isal_pmd_drv); +RTE_PMD_REGISTER_PARAM_STRING(COMPDEV_NAME_ISAL_PMD, + "socket_id="); diff --git a/drivers/compress/isal/meson.build b/drivers/compress/isal/meson.build new file mode 100644 index 0000000000..4447e2046e --- /dev/null +++ b/drivers/compress/isal/meson.build @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2018 Intel Corporation + +dep = dependency('libisal', required: false) +if not dep.found() + build =false +endif + +deps += 'bus_vdev' +sources = files('isal_compress_pmd.c') +ext_deps += dep +pkgconfig_extra_libs += '-lisal' + +allow_experimental_apis = true diff --git a/drivers/compress/isal/rte_pmd_isal_version.map b/drivers/compress/isal/rte_pmd_isal_version.map new file mode 100644 index 0000000000..de8e412ff1 --- /dev/null +++ b/drivers/compress/isal/rte_pmd_isal_version.map @@ -0,0 +1,3 @@ +DPDK_18.05 { + local: *; +}; diff --git a/drivers/compress/meson.build b/drivers/compress/meson.build new file mode 100644 index 0000000000..fb136e1b28 --- /dev/null +++ b/drivers/compress/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Intel Corporation + +drivers = ['isal'] + +std_deps = ['compressdev'] # compressdev pulls in all other needed deps +config_flag_fmt = 'RTE_LIBRTE_@0@_PMD' +driver_name_fmt = 'rte_pmd_@0@' diff --git a/drivers/meson.build b/drivers/meson.build index f879cb6759..ac6c97297a 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -7,6 +7,7 @@ driver_classes = ['common', 'mempool', # depends on common and bus. 'net', # depends on common, bus and mempool. 'crypto', # depends on common, bus and mempool (net in future). + 'compress', # depends on common, bus, mempool. 'event', # depends on common, bus, mempool and net. 'raw'] # depends on common, bus, mempool, net and event. diff --git a/mk/rte.app.mk b/mk/rte.app.mk index 8ef5afba60..680766314b 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -234,6 +234,11 @@ endif # CONFIG_RTE_LIBRTE_DPAA_BUS _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VIRTIO_CRYPTO) += -lrte_pmd_virtio_crypto endif # CONFIG_RTE_LIBRTE_CRYPTODEV +ifeq ($(CONFIG_RTE_LIBRTE_COMPRESSDEV),y) +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ISAL) += -lrte_pmd_isal_comp +_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ISAL) += -lisal +endif # CONFIG_RTE_LIBRTE_COMPRESSDEV + ifeq ($(CONFIG_RTE_LIBRTE_EVENTDEV),y) _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SKELETON_EVENTDEV) += -lrte_pmd_skeleton_event _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += -lrte_pmd_sw_event -- 2.20.1