DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1 0/7] compress: add Octeontx ZIP compression PMD
@ 2018-06-05 10:35 Shally Verma
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 1/7] compress/octeontx: add octeontx zip PMD support Shally Verma
                   ` (6 more replies)
  0 siblings, 7 replies; 25+ messages in thread
From: Shally Verma @ 2018-06-05 10:35 UTC (permalink / raw)
  To: pablo.de.lara.guarch; +Cc: fiona.trahe, dev, pathreya, mchalla

This patch series add compression PMD for cavium octeontx ZIP module
in DPDK compress drivers.
Currently PMD only tested for deflate, stateless compression
and decompression with direct memory buffers.

v1 includes:
Octeontx ZIP PMD implementation
Confuguration and Makefile changes to build Octeontx ZIP PMD
Documentation for Octeontx based ZIP PMD
Changes in driver/compress meson build to support
Octeontx ZIP build

TBDs:
Scatter Gather support,
Stateful compression/decompression,
test for performance

This patchset is dependent upon compressdev API.

Ashish Gupta (6):
  compress/octeontx: add octeontx zip PMD support
  compress/octeontx: add device setup PMD ops
  compress/octeontx: add xform and stream create support
  compress/octeontx: add ops enq deq apis
  test: add octeontx zip PMD for compressdev tests
  doc: add octeontx zip PMD documentation
  drivers/compress: add meson.build support

 config/common_base                                 |   6 +
 doc/guides/compressdevs/features/octeontx.ini      |  22 +
 doc/guides/compressdevs/index.rst                  |   1 +
 doc/guides/compressdevs/octeontx.rst               | 116 ++++
 drivers/compress/Makefile                          |   2 +-
 ...rsion.map => rte_pmd_isal_compress_version.map} |   0
 drivers/compress/meson.build                       |   6 +-
 drivers/compress/octeontx/Makefile                 |  33 +
 drivers/compress/octeontx/include/zip_regs.h       | 721 +++++++++++++++++++++
 drivers/compress/octeontx/meson.build              |  10 +
 .../octeontx/rte_pmd_octeontx_compress_version.map |   3 +
 drivers/compress/octeontx/zip_pmd.c                | 647 ++++++++++++++++++
 drivers/compress/octeontx/zipvf.c                  | 178 +++++
 drivers/compress/octeontx/zipvf.h                  | 343 ++++++++++
 mk/rte.app.mk                                      |   1 +
 usertools/dpdk-devbind.py                          |   9 +
 16 files changed, 2094 insertions(+), 4 deletions(-)
 create mode 100644 doc/guides/compressdevs/features/octeontx.ini
 create mode 100644 doc/guides/compressdevs/octeontx.rst
 rename drivers/compress/isal/{rte_pmd_isal_version.map => rte_pmd_isal_compress_version.map} (100%)
 create mode 100644 drivers/compress/octeontx/Makefile
 create mode 100644 drivers/compress/octeontx/include/zip_regs.h
 create mode 100644 drivers/compress/octeontx/meson.build
 create mode 100644 drivers/compress/octeontx/rte_pmd_octeontx_compress_version.map
 create mode 100644 drivers/compress/octeontx/zip_pmd.c
 create mode 100644 drivers/compress/octeontx/zipvf.c
 create mode 100644 drivers/compress/octeontx/zipvf.h

-- 
2.14.3

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-dev] [PATCH v1 1/7] compress/octeontx: add octeontx zip PMD support
  2018-06-05 10:35 [dpdk-dev] [PATCH v1 0/7] compress: add Octeontx ZIP compression PMD Shally Verma
@ 2018-06-05 10:35 ` Shally Verma
  2018-06-10 10:38   ` Jerin Jacob
  2018-06-19 22:15   ` De Lara Guarch, Pablo
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 2/7] compress/octeontx: add device setup PMD ops Shally Verma
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 25+ messages in thread
From: Shally Verma @ 2018-06-05 10:35 UTC (permalink / raw)
  To: pablo.de.lara.guarch
  Cc: fiona.trahe, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu

Add octeontx zip pmd support in compressdev driver.
Add device probe and remove support.
Update makefile to build octeontx zip pmd

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
---
 config/common_base                                 |   6 +
 drivers/compress/Makefile                          |   2 +-
 drivers/compress/octeontx/Makefile                 |  33 ++++++
 drivers/compress/octeontx/meson.build              |  10 ++
 .../octeontx/rte_pmd_octeontx_compress_version.map |   3 +
 drivers/compress/octeontx/zip_pmd.c                | 129 +++++++++++++++++++++
 drivers/compress/octeontx/zipvf.c                  |  48 ++++++++
 drivers/compress/octeontx/zipvf.h                  |  47 ++++++++
 usertools/dpdk-devbind.py                          |   9 ++
 9 files changed, 286 insertions(+), 1 deletion(-)

diff --git a/config/common_base b/config/common_base
index 6b0d1cbbb..e56d14b7f 100644
--- a/config/common_base
+++ b/config/common_base
@@ -584,6 +584,12 @@ CONFIG_RTE_COMPRESS_MAX_DEVS=64
 #
 CONFIG_RTE_COMPRESSDEV_TEST=n
 
+#
+# Compile PMD for Octeontx ZIPVF compression device
+#
+CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF=n
+CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF_DEBUG=n
+
 #
 # Compile PMD for ISA-L compression device
 #
diff --git a/drivers/compress/Makefile b/drivers/compress/Makefile
index 592497f51..62b4e5abe 100644
--- a/drivers/compress/Makefile
+++ b/drivers/compress/Makefile
@@ -4,5 +4,5 @@
 include $(RTE_SDK)/mk/rte.vars.mk
 
 DIRS-$(CONFIG_RTE_LIBRTE_PMD_ISAL) += isal
-
+DIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF) += octeontx
 include $(RTE_SDK)/mk/rte.subdir.mk
diff --git a/drivers/compress/octeontx/Makefile b/drivers/compress/octeontx/Makefile
new file mode 100644
index 000000000..89078f085
--- /dev/null
+++ b/drivers/compress/octeontx/Makefile
@@ -0,0 +1,33 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2017-2018 Cavium Networks
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+# library name
+LIB = librte_pmd_octeontx_zip.a
+
+# library version
+LIBABIVER := 1
+
+# build flags
+CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -O3
+CFLAGS += -DALLOW_EXPERIMENTAL_API
+CFLAGS += -I$(RTE_SDK)/drivers/compress/octeontx/include
+
+# external library include paths
+LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
+LDLIBS += -lrte_compressdev
+LDLIBS += -lrte_pci -lrte_bus_pci
+
+# library source files
+SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF) += zip_pmd.c
+SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF) += zipvf.c
+
+# export include files
+SYMLINK-y-include +=
+
+# versioning export map
+EXPORT_MAP := rte_pmd_octeontx_compress_version.map
+
+include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/compress/octeontx/meson.build b/drivers/compress/octeontx/meson.build
new file mode 100644
index 000000000..cce404337
--- /dev/null
+++ b/drivers/compress/octeontx/meson.build
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2018 Cavium Networks
+
+sources = files('zipvf.c', 'zip_pmd.c')
+allow_experimental_apis = true
+includes += include_directories('include')
+deps += ['mempool_octeontx', 'bus_pci']
+ext_deps += dep
+
+
diff --git a/drivers/compress/octeontx/rte_pmd_octeontx_compress_version.map b/drivers/compress/octeontx/rte_pmd_octeontx_compress_version.map
new file mode 100644
index 000000000..33c1b976f
--- /dev/null
+++ b/drivers/compress/octeontx/rte_pmd_octeontx_compress_version.map
@@ -0,0 +1,3 @@
+EXPERIMENTAL {
+	local: *;
+};
diff --git a/drivers/compress/octeontx/zip_pmd.c b/drivers/compress/octeontx/zip_pmd.c
new file mode 100644
index 000000000..1181bed19
--- /dev/null
+++ b/drivers/compress/octeontx/zip_pmd.c
@@ -0,0 +1,129 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017-2018 Cavium Networks
+ */
+
+#include <string.h>
+#include <rte_common.h>
+#include <rte_malloc.h>
+#include <rte_cpuflags.h>
+#include <rte_byteorder.h>
+#include "zipvf.h"
+
+/* global structure to keep driver info */
+struct zip_pmd_private zip_pmd_priv;
+
+static int
+zip_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+	struct rte_pci_device *pci_dev)
+{
+	int ret = 0;
+	char compressdev_name[RTE_COMPRESSDEV_NAME_MAX_LEN];
+	struct rte_compressdev *compressdev;
+	struct rte_compressdev_pmd_init_params init_params = {
+		"",
+		rte_socket_id(),
+	};
+
+	ZIP_PMD_INFO("vendor_id=0x%x device_id=0x%x",
+			(unsigned int)pci_dev->id.vendor_id,
+			(unsigned int)pci_dev->id.device_id);
+
+	rte_pci_device_name(&pci_dev->addr, compressdev_name,
+			    sizeof(compressdev_name));
+
+	compressdev = rte_compressdev_pmd_create(compressdev_name,
+		&pci_dev->device, sizeof(struct zip_vf), &init_params);
+	if (compressdev == NULL) {
+		ZIP_PMD_ERR("driver %s: create failed", init_params.name);
+		return -ENODEV;
+	}
+
+	/*
+	 * create only if proc_type is primary.
+	 */
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+		/*  create vf dev with given pmd dev id */
+		ret = zipvf_create(compressdev, zip_pmd_priv.num_zipvfs);
+		if (ret < 0) {
+			ZIP_PMD_ERR("Device creation failed");
+			rte_compressdev_pmd_destroy(compressdev);
+			return ret;
+		}
+	}
+
+	/* TBD: check if driver global structure to be shared
+	 * too among processes. if yes, then zip_pmd_priv
+	 * had to be allocated from shared memzone. Currently
+	 * it is in global data segment
+	 */
+	zip_pmd_priv.zipvf_table[zip_pmd_priv.num_zipvfs] =
+		compressdev->data->dev_private;
+	zip_pmd_priv.num_zipvfs++;
+
+	compressdev->dev_ops = &octtx_zip_pmd_ops;
+	/* register rx/tx burst functions for data path */
+	compressdev->dequeue_burst = zip_pmd_dequeue_burst_sync;
+	compressdev->enqueue_burst = zip_pmd_enqueue_burst_sync;
+	compressdev->feature_flags = RTE_COMPDEV_FF_HW_ACCELERATED;
+	return ret;
+}
+
+static int
+zip_pci_remove(struct rte_pci_device *pci_dev)
+{
+	struct rte_compressdev *compressdev;
+	char compressdev_name[RTE_COMPRESSDEV_NAME_MAX_LEN];
+
+	if (pci_dev == NULL) {
+		ZIP_PMD_ERR(" Invalid PCI Device\n");
+		return -EINVAL;
+	}
+	rte_pci_device_name(&pci_dev->addr, compressdev_name,
+			sizeof(compressdev_name));
+
+	compressdev = rte_compressdev_pmd_get_named_dev(compressdev_name);
+	if (compressdev == NULL)
+		return -ENODEV;
+
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+		if (zipvf_destroy(compressdev) < 0)
+			return -ENODEV;
+	}
+	return rte_compressdev_pmd_destroy(compressdev);
+}
+
+
+
+static struct rte_pci_id pci_id_octtx_zipvf_table[] = {
+	{
+		RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM,
+			PCI_DEVICE_ID_OCTEONTX_ZIPVF),
+	},
+	{
+		.device_id = 0
+	},
+};
+
+/**
+ * Structure that represents a PCI driver
+ */
+static struct rte_pci_driver octtx_zip_pmd = {
+	.id_table    = pci_id_octtx_zipvf_table,
+	.drv_flags   = RTE_PCI_DRV_NEED_MAPPING,
+	.probe       = zip_pci_probe,
+	.remove      = zip_pci_remove,
+};
+
+RTE_PMD_REGISTER_PCI(COMPRESSDEV_NAME_ZIP_PMD, octtx_zip_pmd);
+RTE_PMD_REGISTER_PCI_TABLE(COMPRESSDEV_NAME_ZIP_PMD, pci_id_octtx_zipvf_table);
+
+RTE_INIT(octtx_zip_init_log);
+
+static void
+octtx_zip_init_log(void)
+{
+	octtx_zip_logtype_driver = rte_log_register("comp_octeontx_zip");
+	if (octtx_zip_logtype_driver >= 0)
+		rte_log_set_level(octtx_zip_logtype_driver, RTE_LOG_INFO);
+}
+
diff --git a/drivers/compress/octeontx/zipvf.c b/drivers/compress/octeontx/zipvf.c
new file mode 100644
index 000000000..e082c2849
--- /dev/null
+++ b/drivers/compress/octeontx/zipvf.c
@@ -0,0 +1,48 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017-2018 Cavium Networks
+ */
+
+#include "zipvf.h"
+
+int zipvf_create(struct rte_compressdev *compressdev, int vfid)
+{
+	struct   rte_pci_device *pdev = RTE_DEV_TO_PCI(compressdev->device);
+	struct   zip_vf *zipvf = NULL;
+	char     *dev_name = compressdev->data->name;
+	void     *vbar0;
+	uint64_t reg;
+
+	if (pdev->mem_resource[0].phys_addr == 0ULL)
+		return -EIO;
+
+	vbar0 = pdev->mem_resource[0].addr;
+	if (!vbar0) {
+		ZIP_PMD_ERR("Failed to map BAR0 of %s", dev_name);
+		return -ENODEV;
+	}
+
+	zipvf = (struct zip_vf *)(compressdev->data->dev_private);
+
+	if (!zipvf)
+		return -ENOMEM;
+
+	zipvf->vbar0 = vbar0;
+	reg = zip_reg_read64(zipvf->vbar0, ZIP_VF_PF_MBOXX(0));
+	/* Storing domain in local to ZIP VF */
+	zipvf->dom_sdom = reg;
+	zipvf->pdev = pdev;
+	zipvf->max_nb_queue_pairs = ZIP_MAX_VF_QUEUE;
+	zipvf->vfid = vfid;
+	return 0;
+}
+
+int zipvf_destroy(struct rte_compressdev *compressdev)
+{
+	struct zip_vf *vf = (struct zip_vf *)(compressdev->data->dev_private);
+
+	/* Rewriting the domain_id in ZIP_VF_MBOX for app rerun */
+	zip_reg_write64(vf->vbar0, ZIP_VF_PF_MBOXX(0), vf->dom_sdom);
+
+	return 0;
+}
+
diff --git a/drivers/compress/octeontx/zipvf.h b/drivers/compress/octeontx/zipvf.h
new file mode 100644
index 000000000..dcaaf4e46
--- /dev/null
+++ b/drivers/compress/octeontx/zipvf.h
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017-2018 Cavium Networks
+ */
+#ifndef _RTE_OCTEONTX_ZIP_VF_H_
+#define _RTE_OCTEONTX_ZIP_VF_H_
+
+#include <rte_comp.h>
+#include <rte_compressdev.h>
+#include <rte_compressdev_pmd.h>
+#include <unistd.h>
+
+int octtx_zip_logtype_driver;
+
+
+#define ZIP_PMD_LOG(level, fmt, args...) \
+	rte_log(RTE_LOG_ ## level, \
+	octtx_zip_logtype_driver, "%s(): "fmt "\n", \
+	__func__, ##args)
+
+#define ZIP_PMD_INFO(fmt, args...) \
+	ZIP_PMD_LOG(INFO, fmt, ## args)
+#define ZIP_PMD_ERR(fmt, args...) \
+	ZIP_PMD_LOG(ERR, fmt, ## args)
+#define ZIP_PMD_WARN(fmt, args...) \
+	ZIP_PMD_LOG(WARNING, fmt, ## args)
+
+/**
+ * ZIP VF device structure.
+ */
+struct zip_vf {
+	int vfid;
+	/* vf index */
+	struct rte_pci_device *pdev;
+	/* pci device */
+	void *vbar0;
+	/* CSR base address for underlying BAR0 VF.*/
+	uint64_t dom_sdom;
+	/* Storing mbox domain and subdomain id for app rerun*/
+	uint32_t  max_nb_queue_pairs;
+	/* pointer to device qps */
+	struct rte_mempool *zip_mp;
+	/* pointer to pools */
+} __rte_cache_aligned;
+
+int zipvf_create(struct rte_compressdev *compressdev, int vfid);
+
+#endif /* _RTE_ZIP_VF_H_ */
diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index d0c420906..1d48a6cba 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -24,6 +24,8 @@
               'SVendor': None, 'SDevice': None}
 cavium_tim = {'Class': '08', 'Vendor': '177d', 'Device': 'a051',
               'SVendor': None, 'SDevice': None}
+cavium_zip = {'Class': '12', 'Vendor': '177d', 'Device': 'a037',
+              'SVendor': None, 'SDevice': None}
 avp_vnic = {'Class': '05', 'Vendor': '1af4', 'Device': '1110',
               'SVendor': None, 'SDevice': None}
 
@@ -31,6 +33,7 @@
 crypto_devices = [encryption_class, intel_processor_class]
 eventdev_devices = [cavium_sso, cavium_tim]
 mempool_devices = [cavium_fpa]
+compress_devices = [cavium_zip]
 
 # global dict ethernet devices present. Dictionary indexed by PCI address.
 # Each device within this is itself a dictionary of device properties
@@ -569,6 +572,10 @@ def show_status():
     if status_dev == "mempool" or status_dev == "all":
         show_device_status(mempool_devices, "Mempool")
 
+    if status_dev == "compress" or status_dev == "all":
+        show_device_status(compress_devices , "Compress")
+
+
 def parse_args():
     '''Parses the command-line arguments given by the user and takes the
     appropriate action for each'''
@@ -642,6 +649,7 @@ def do_arg_actions():
             get_device_details(crypto_devices)
             get_device_details(eventdev_devices)
             get_device_details(mempool_devices)
+            get_device_details(compress_devices)
         show_status()
 
 
@@ -654,6 +662,7 @@ def main():
     get_device_details(crypto_devices)
     get_device_details(eventdev_devices)
     get_device_details(mempool_devices)
+    get_device_details(compress_devices)
     do_arg_actions()
 
 if __name__ == "__main__":
-- 
2.14.3

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-dev] [PATCH v1 2/7] compress/octeontx: add device setup PMD ops
  2018-06-05 10:35 [dpdk-dev] [PATCH v1 0/7] compress: add Octeontx ZIP compression PMD Shally Verma
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 1/7] compress/octeontx: add octeontx zip PMD support Shally Verma
@ 2018-06-05 10:35 ` Shally Verma
  2018-06-19 22:15   ` De Lara Guarch, Pablo
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 3/7] compress/octeontx: add xform and stream create support Shally Verma
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 25+ messages in thread
From: Shally Verma @ 2018-06-05 10:35 UTC (permalink / raw)
  To: pablo.de.lara.guarch
  Cc: fiona.trahe, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu

implement device configure and PMD ops.
setup stream resource memory pool
setup and enable hardware queue

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
---
 drivers/compress/octeontx/include/zip_regs.h | 721 +++++++++++++++++++++++++++
 drivers/compress/octeontx/zip_pmd.c          | 269 ++++++++++
 drivers/compress/octeontx/zipvf.c            |  81 +++
 drivers/compress/octeontx/zipvf.h            | 103 ++++
 4 files changed, 1174 insertions(+)

diff --git a/drivers/compress/octeontx/include/zip_regs.h b/drivers/compress/octeontx/include/zip_regs.h
new file mode 100644
index 000000000..1326dc030
--- /dev/null
+++ b/drivers/compress/octeontx/include/zip_regs.h
@@ -0,0 +1,721 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017-2018 Cavium Networks
+ */
+
+#ifndef _RTE_OCTEONTX_ZIP_REGS_H_
+#define _RTE_OCTEONTX_ZIP_REGS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <stdint.h>
+
+/**
+ * Enumeration zip_cc
+ *
+ * ZIP compression coding Enumeration
+ * Enumerates ZIP_INST_S[CC].
+ */
+enum {
+	ZIP_CC_DEFAULT = 0,
+	ZIP_CC_DYN_HUFF,
+	ZIP_CC_FIXED_HUFF,
+	ZIP_CC_LZS
+} zip_cc;
+
+/**
+ * Register (NCB) zip_vq#_ena
+ *
+ * ZIP VF Queue Enable Register
+ * If a queue is disabled, ZIP CTL stops fetching instructions from the queue.
+ */
+typedef union {
+	uint64_t u;
+	struct zip_vqx_ena_s {
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
+		uint64_t reserved_1_63         : 63;
+		uint64_t ena                   : 1;
+#else /* Word 0 - Little Endian */
+		uint64_t ena                   : 1;
+		uint64_t reserved_1_63         : 63;
+#endif /* Word 0 - End */
+	} s;
+	/* struct zip_vqx_ena_s cn; */
+} zip_vqx_ena_t;
+
+/**
+ * Register (NCB) zip_vq#_sbuf_addr
+ *
+ * ZIP VF Queue Starting Buffer Address Registers
+ * These registers set the buffer parameters for the instruction queues.
+ * When quiescent (i.e.
+ * outstanding doorbell count is 0), it is safe to rewrite this register
+ * to effectively reset the
+ * command buffer state machine.
+ * These registers must be programmed after software programs the
+ * corresponding ZIP_QUE()_SBUF_CTL.
+ */
+typedef union {
+	uint64_t u;
+	struct zip_vqx_sbuf_addr_s {
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
+		uint64_t reserved_49_63        : 15;
+		uint64_t ptr                   : 42;
+		uint64_t off                   : 7;
+#else /* Word 0 - Little Endian */
+		uint64_t off                   : 7;
+		uint64_t ptr                   : 42;
+		uint64_t reserved_49_63        : 15;
+#endif /* Word 0 - End */
+	} s;
+	/* struct zip_vqx_sbuf_addr_s cn; */
+} zip_vqx_sbuf_addr_t;
+
+/**
+ * Register (NCB) zip_que#_doorbell
+ *
+ * ZIP Queue Doorbell Registers
+ * Doorbells for the ZIP instruction queues.
+ */
+typedef union {
+	uint64_t u;
+	struct zip_quex_doorbell_s {
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
+		uint64_t reserved_20_63        : 44;
+		uint64_t dbell_cnt             : 20;
+#else /* Word 0 - Little Endian */
+		uint64_t dbell_cnt             : 20;
+		uint64_t reserved_20_63        : 44;
+#endif /* Word 0 - End */
+	} s;
+	/* struct zip_quex_doorbell_s cn; */
+} zip_quex_doorbell_t;
+
+/**
+ * Structure zip_nptr_s
+ *
+ * ZIP Instruction Next-Chunk-Buffer Pointer (NPTR) Structure
+ * This structure is used to chain all the ZIP instruction buffers
+ * together. ZIP instruction buffers are managed
+ * (allocated and released) by software.
+ */
+union zip_nptr_s {
+	uint64_t u;
+	struct zip_nptr_s_s {
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
+		uint64_t addr                  : 64;
+#else /* Word 0 - Little Endian */
+		uint64_t addr                  : 64;
+#endif /* Word 0 - End */
+	} s;
+	/* struct zip_nptr_s_s cn83xx; */
+};
+
+/**
+ * generic ptr address
+ */
+union zip_zptr_addr_s {
+	/** This field can be used to set/clear all bits, or do bitwise
+	 * operations over the entire structure.
+	 */
+	uint64_t u;
+	/** generic ptr address */
+	struct {
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
+		uint64_t addr : 64;
+#else /* Word 0 - Little Endian */
+		uint64_t addr : 64;
+#endif /* Word 0 - End */
+	} s;
+};
+
+/**
+ * generic ptr ctl
+ */
+union zip_zptr_ctl_s {
+	/** This field can be used to set/clear all bits, or do bitwise
+	 * operations over the entire structure.
+	 */
+	uint64_t u;
+	/** generic ptr ctl */
+	struct {
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */
+		uint64_t reserved_112_127      : 16;
+		uint64_t length                : 16;
+		uint64_t reserved_67_95        : 29;
+		uint64_t fw                    : 1;
+		uint64_t nc                    : 1;
+		uint64_t data_be               : 1;
+#else /* Word 1 - Little Endian */
+		uint64_t data_be               : 1;
+		uint64_t nc                    : 1;
+		uint64_t fw                    : 1;
+		uint64_t reserved_67_95        : 29;
+		uint64_t length                : 16;
+		uint64_t reserved_112_127      : 16;
+#endif /* Word 1 - End */
+	} s;
+
+};
+
+/**
+ * Structure zip_inst_s
+ *
+ * ZIP Instruction Structure
+ * Each ZIP instruction has 16 words (they are called IWORD0 to IWORD15
+ * within the structure).
+ */
+union zip_inst_s {
+	/** This field can be used to set/clear all bits, or do bitwise
+	 * operations over the entire structure.
+	 */
+	uint64_t u[16];
+	/** ZIP Instruction Structure */
+	struct zip_inst_s_s {
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
+		/** Done interrupt */
+		uint64_t doneint               : 1;
+		/** reserved */
+		uint64_t reserved_56_62        : 7;
+		/**  Total output length */
+		uint64_t totaloutputlength     : 24;
+		/** reserved */
+		uint64_t reserved_27_31        : 5;
+		/** EXNUM */
+		uint64_t exn                   : 3;
+		/**  HASH IV */
+		uint64_t iv                    : 1;
+		/** EXBITS */
+		uint64_t exbits                : 7;
+		/** Hash more-in-file */
+		uint64_t hmif                  : 1;
+		/** Hash Algorithm and enable */
+		uint64_t halg                  : 3;
+		/** Sync flush*/
+		uint64_t sf                    : 1;
+		/** Compression speed/storage */
+		uint64_t ss                    : 2;
+		/** Compression coding */
+		uint64_t cc                    : 2;
+		/** End of input data */
+		uint64_t ef                    : 1;
+		/** Beginning of file */
+		uint64_t bf                    : 1;
+		// uint64_t reserved_3_4          : 2;
+		/** Comp/decomp operation */
+		uint64_t op                    : 2;
+		/** Data sactter */
+		uint64_t ds                    : 1;
+		/** Data gather */
+		uint64_t dg                    : 1;
+		/** History gather */
+		uint64_t hg                    : 1;
+#else /* Word 0 - Little Endian */
+		uint64_t hg                    : 1;
+		uint64_t dg                    : 1;
+		uint64_t ds                    : 1;
+		//uint64_t reserved_3_4          : 2;
+		uint64_t op                    : 2;
+		uint64_t bf                    : 1;
+		uint64_t ef                    : 1;
+		uint64_t cc                    : 2;
+		uint64_t ss                    : 2;
+		uint64_t sf                    : 1;
+		uint64_t halg                  : 3;
+		uint64_t hmif                  : 1;
+		uint64_t exbits                : 7;
+		uint64_t iv                    : 1;
+		uint64_t exn                   : 3;
+		uint64_t reserved_27_31        : 5;
+		uint64_t totaloutputlength     : 24;
+		uint64_t reserved_56_62        : 7;
+		uint64_t doneint               : 1;
+
+#endif /* Word 0 - End */
+
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */
+		/** History length */
+		uint64_t historylength         : 16;
+		/** reserved */
+		uint64_t reserved_96_111       : 16;
+		/** adler/crc32 checksum*/
+		uint64_t adlercrc32            : 32;
+#else /* Word 1 - Little Endian */
+		uint64_t adlercrc32            : 32;
+		uint64_t reserved_96_111       : 16;
+		uint64_t historylength         : 16;
+#endif /* Word 1 - End */
+
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 2 - Big Endian */
+		/** Decompression Context Pointer Address */
+		union zip_zptr_addr_s  ctx_ptr_addr;
+#else /* Word 2 - Little Endian */
+		union zip_zptr_addr_s  ctx_ptr_addr;
+#endif /* Word 2 - End */
+
+#if defined(__BIG_ENDIAN_BITFIELD)
+		/** Decompression Context Pointer Control */
+		union zip_zptr_ctl_s   ctx_ptr_ctl;
+#else /* Word 3 - Little Endian */
+		union zip_zptr_ctl_s   ctx_ptr_ctl;
+#endif /* Word 3 - End */
+
+#if defined(__BIG_ENDIAN_BITFIELD)
+		/** Decompression history pointer address */
+		union zip_zptr_addr_s  his_ptr_addr;
+#else /* Word 4 - Little Endian */
+		union zip_zptr_addr_s  his_ptr_addr;
+#endif /* Word 4 - End */
+
+#if defined(__BIG_ENDIAN_BITFIELD)
+		/** Decompression history pointer control */
+		union zip_zptr_ctl_s   his_ptr_ctl;
+#else /* Word 5 - Little Endian */
+		union zip_zptr_ctl_s   his_ptr_ctl;
+#endif /* Word 5 - End */
+
+#if defined(__BIG_ENDIAN_BITFIELD)
+		/** Input and compression history pointer address */
+		union zip_zptr_addr_s  inp_ptr_addr;
+#else /* Word 6 - Little Endian */
+		union zip_zptr_addr_s  inp_ptr_addr;
+#endif /* Word 6 - End */
+
+#if defined(__BIG_ENDIAN_BITFIELD)
+		/** Input and compression history pointer control */
+		union zip_zptr_ctl_s   inp_ptr_ctl;
+#else /* Word 7 - Little Endian */
+		union zip_zptr_ctl_s   inp_ptr_ctl;
+#endif /* Word 7 - End */
+
+#if defined(__BIG_ENDIAN_BITFIELD)
+		/** Output pointer address */
+		union zip_zptr_addr_s  out_ptr_addr;
+#else /* Word 8 - Little Endian */
+		union zip_zptr_addr_s  out_ptr_addr;
+#endif /* Word 8 - End */
+
+#if defined(__BIG_ENDIAN_BITFIELD)
+		/** Output pointer control */
+		union zip_zptr_ctl_s   out_ptr_ctl;
+#else /* Word 9 - Little Endian */
+		union zip_zptr_ctl_s   out_ptr_ctl;
+#endif /* Word 9 - End */
+
+#if defined(__BIG_ENDIAN_BITFIELD)
+		/** Result pointer address */
+		union zip_zptr_addr_s  res_ptr_addr;
+#else /* Word 10 - Little Endian */
+		union zip_zptr_addr_s  res_ptr_addr;
+#endif /* Word 10 - End */
+
+#if defined(__BIG_ENDIAN_BITFIELD)
+		/** Result pointer control */
+		union zip_zptr_ctl_s   res_ptr_ctl;
+#else /* Word 11 - Little Endian */
+		union zip_zptr_ctl_s   res_ptr_ctl;
+#endif /* Word 11 - End */
+
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 12 - Big Endian */
+		/** reserved */
+		uint64_t reserved_812_831      : 20;
+		/** SSO guest group */
+		uint64_t ggrp                  : 10;
+		/** SSO tag type */
+		uint64_t tt                    : 2;
+		/** SSO tag */
+		uint64_t tag                   : 32;
+#else /* Word 12 - Little Endian */
+		uint64_t tag                   : 32;
+		uint64_t tt                    : 2;
+		uint64_t ggrp                  : 10;
+		uint64_t reserved_812_831      : 20;
+#endif /* Word 12 - End */
+
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 13 - Big Endian */
+		/** Work queue entry pointer */
+		uint64_t wq_ptr                : 64;
+#else /* Word 13 - Little Endian */
+		uint64_t wq_ptr                : 64;
+#endif /* Word 13 - End */
+
+#if defined(__BIG_ENDIAN_BITFIELD)
+		/** reserved */
+		uint64_t reserved_896_959      : 64;
+#else /* Word 14 - Little Endian */
+		uint64_t reserved_896_959      : 64;
+#endif /* Word 14 - End */
+#if defined(__BIG_ENDIAN_BITFIELD)
+		/** Hash structure pointer */
+		uint64_t hash_ptr              : 64;
+#else /* Word 15 - Little Endian */
+		uint64_t hash_ptr              : 64;
+#endif /* Word 15 - End */
+	} /** ZIP 88xx Instruction Structure */zip88xx;
+
+	/** ZIP Instruction Structure */
+	struct zip_inst_s_cn83xx {
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
+		/** Done interrupt */
+		uint64_t doneint               : 1;
+		/** reserved */
+		uint64_t reserved_56_62        : 7;
+		/**  Total output length */
+		uint64_t totaloutputlength     : 24;
+		/** reserved */
+		uint64_t reserved_27_31        : 5;
+		/** EXNUM */
+		uint64_t exn                   : 3;
+		/**  HASH IV */
+		uint64_t iv                    : 1;
+		/** EXBITS */
+		uint64_t exbits                : 7;
+		/** Hash more-in-file */
+		uint64_t hmif                  : 1;
+		/** Hash Algorithm and enable */
+		uint64_t halg                  : 3;
+		/** Sync flush*/
+		uint64_t sf                    : 1;
+		/** Compression speed/storage */
+		uint64_t ss                    : 2;
+		/** Compression coding */
+		uint64_t cc                    : 2;
+		/** End of input data */
+		uint64_t ef                    : 1;
+		/** Beginning of file */
+		uint64_t bf                    : 1;
+		/** Comp/decomp operation */
+		uint64_t op                    : 2;
+		/** Data sactter */
+		uint64_t ds                    : 1;
+		/** Data gather */
+		uint64_t dg                    : 1;
+		/** History gather */
+		uint64_t hg                    : 1;
+#else /* Word 0 - Little Endian */
+		uint64_t hg                    : 1;
+		uint64_t dg                    : 1;
+		uint64_t ds                    : 1;
+		uint64_t op                    : 2;
+		uint64_t bf                    : 1;
+		uint64_t ef                    : 1;
+		uint64_t cc                    : 2;
+		uint64_t ss                    : 2;
+		uint64_t sf                    : 1;
+		uint64_t halg                  : 3;
+		uint64_t hmif                  : 1;
+		uint64_t exbits                : 7;
+		uint64_t iv                    : 1;
+		uint64_t exn                   : 3;
+		uint64_t reserved_27_31        : 5;
+		uint64_t totaloutputlength     : 24;
+		uint64_t reserved_56_62        : 7;
+		uint64_t doneint               : 1;
+#endif /* Word 0 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */
+		/** History length */
+		uint64_t historylength         : 16;
+		/** reserved */
+		uint64_t reserved_96_111       : 16;
+		/** adler/crc32 checksum*/
+		uint64_t adlercrc32            : 32;
+#else /* Word 1 - Little Endian */
+		uint64_t adlercrc32            : 32;
+		uint64_t reserved_96_111       : 16;
+		uint64_t historylength         : 16;
+#endif /* Word 1 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 2 - Big Endian */
+		/** Decompression Context Pointer Address */
+		union zip_zptr_addr_s  ctx_ptr_addr;
+#else /* Word 2 - Little Endian */
+		union zip_zptr_addr_s  ctx_ptr_addr;
+#endif /* Word 2 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 3 - Big Endian */
+		/** Decompression Context Pointer Control */
+		union zip_zptr_ctl_s   ctx_ptr_ctl;
+#else /* Word 3 - Little Endian */
+		union zip_zptr_ctl_s   ctx_ptr_ctl;
+#endif /* Word 3 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 4 - Big Endian */
+		/** Decompression history pointer address */
+		union zip_zptr_addr_s  his_ptr_addr;
+#else /* Word 4 - Little Endian */
+		union zip_zptr_addr_s  his_ptr_addr;
+#endif /* Word 4 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 5 - Big Endian */
+		/** Decompression history pointer control */
+		union zip_zptr_ctl_s   his_ptr_ctl;
+#else /* Word 5 - Little Endian */
+		union zip_zptr_ctl_s   his_ptr_ctl;
+#endif /* Word 5 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 6 - Big Endian */
+		/** Input and compression history pointer address */
+		union zip_zptr_addr_s  inp_ptr_addr;
+#else /* Word 6 - Little Endian */
+		union zip_zptr_addr_s  inp_ptr_addr;
+#endif /* Word 6 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 7 - Big Endian */
+		/** Input and compression history pointer control */
+		union zip_zptr_ctl_s   inp_ptr_ctl;
+#else /* Word 7 - Little Endian */
+		union zip_zptr_ctl_s   inp_ptr_ctl;
+#endif /* Word 7 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 8 - Big Endian */
+		/** Output pointer address */
+		union zip_zptr_addr_s  out_ptr_addr;
+#else /* Word 8 - Little Endian */
+		union zip_zptr_addr_s  out_ptr_addr;
+#endif /* Word 8 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 9 - Big Endian */
+		/** Output pointer control */
+		union zip_zptr_ctl_s   out_ptr_ctl;
+#else /* Word 9 - Little Endian */
+		union zip_zptr_ctl_s   out_ptr_ctl;
+#endif /* Word 9 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 10 - Big Endian */
+		/** Result pointer address */
+		union zip_zptr_addr_s  res_ptr_addr;
+#else /* Word 10 - Little Endian */
+		union zip_zptr_addr_s  res_ptr_addr;
+#endif /* Word 10 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 11 - Big Endian */
+		/** Result pointer control */
+		union zip_zptr_ctl_s   res_ptr_ctl;
+#else /* Word 11 - Little Endian */
+		union zip_zptr_ctl_s   res_ptr_ctl;
+#endif /* Word 11 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 12 - Big Endian */
+		/** reserved */
+		uint64_t reserved_812_831      : 20;
+		/** SSO guest group */
+		uint64_t ggrp                  : 10;
+		/** SSO tag type */
+		uint64_t tt                    : 2;
+		/** SSO tag */
+		uint64_t tag                   : 32;
+#else /* Word 12 - Little Endian */
+		uint64_t tag                   : 32;
+		uint64_t tt                    : 2;
+		uint64_t ggrp                  : 10;
+		uint64_t reserved_812_831      : 20;
+#endif /* Word 12 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 13 - Big Endian */
+		/** Work queue entry pointer */
+		uint64_t wq_ptr                : 64;
+#else /* Word 13 - Little Endian */
+		uint64_t wq_ptr                : 64;
+#endif /* Word 13 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 14 - Big Endian */
+		/** reserved */
+		uint64_t reserved_896_959      : 64;
+#else /* Word 14 - Little Endian */
+		uint64_t reserved_896_959      : 64;
+#endif /* Word 14 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 15 - Big Endian */
+		/** Hash structure pointer */
+		uint64_t hash_ptr              : 64;
+#else /* Word 15 - Little Endian */
+		uint64_t hash_ptr              : 64;
+#endif /* Word 15 - End */
+	} /** ZIP 83xx Instruction Structure */s;
+};
+
+/**
+ * Structure zip_zres_s
+ *
+ * ZIP Result Structure
+ * The ZIP coprocessor writes the result structure after it completes the
+ * invocation. The result structure is exactly 24 bytes, and each invocation
+ * of the ZIP coprocessor produces exactly one result structure.
+ */
+union zip_zres_s {
+	/** This field can be used to set/clear all bits, or do bitwise
+	 * operations over the entire structure.
+	 */
+	uint64_t u[8];
+	/** ZIP Result Structure */
+	struct zip_zres_s_s {
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
+		/** crc32 checksum of uncompressed stream */
+		uint64_t crc32                 : 32;
+		/** adler32 checksum of uncompressed stream*/
+		uint64_t adler32               : 32;
+#else /* Word 0 - Little Endian */
+		uint64_t adler32               : 32;
+		uint64_t crc32                 : 32;
+#endif /* Word 0 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */
+		/** Total numer of Bytes produced in output stream */
+		uint64_t totalbyteswritten     : 32;
+		/** Total number of bytes processed from the input stream */
+		uint64_t totalbytesread        : 32;
+#else /* Word 1 - Little Endian */
+		uint64_t totalbytesread        : 32;
+		uint64_t totalbyteswritten     : 32;
+#endif /* Word 1 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 2 - Big Endian */
+		/** Total number of compressed input bits
+		 * consumed to decompress all blocks in the file
+		 */
+		uint64_t totalbitsprocessed    : 32;
+		/** Done interrupt*/
+		uint64_t doneint               : 1;
+		/** reserved */
+		uint64_t reserved_155_158      : 4;
+		/** EXNUM */
+		uint64_t exn                   : 3;
+		/** reserved */
+		uint64_t reserved_151          : 1;
+		/** EXBITS */
+		uint64_t exbits                : 7;
+		/** reserved */
+		uint64_t reserved_137_143      : 7;
+		/** End of file */
+		uint64_t ef                    : 1;
+		/** Completion/error code */
+		uint64_t compcode              : 8;
+#else /* Word 2 - Little Endian */
+		uint64_t compcode              : 8;
+		uint64_t ef                    : 1;
+		uint64_t reserved_137_143      : 7;
+		uint64_t exbits                : 7;
+		uint64_t reserved_151          : 1;
+		uint64_t exn                   : 3;
+		uint64_t reserved_155_158      : 4;
+		uint64_t doneint               : 1;
+		uint64_t totalbitsprocessed    : 32;
+#endif /* Word 2 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 3 - Big Endian */
+		/** reserved */
+		uint64_t reserved_253_255      : 3;
+		/** Hash length in bytes */
+		uint64_t hshlen                : 61;
+#else /* Word 3 - Little Endian */
+		uint64_t hshlen                : 61;
+		uint64_t reserved_253_255      : 3;
+#endif /* Word 3 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 4 - Big Endian */
+		/** Double-word 0 of computed hash */
+		uint64_t hash0                 : 64;
+#else /* Word 4 - Little Endian */
+		uint64_t hash0                 : 64;
+#endif /* Word 4 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 5 - Big Endian */
+		/** Double-word 1 of computed hash */
+		uint64_t hash1                 : 64;
+#else /* Word 5 - Little Endian */
+		uint64_t hash1                 : 64;
+#endif /* Word 5 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 6 - Big Endian */
+		/** Double-word 2 of computed hash */
+		uint64_t hash2                 : 64;
+#else /* Word 6 - Little Endian */
+		uint64_t hash2                 : 64;
+#endif /* Word 6 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 7 - Big Endian */
+		/** Double-word 3 of computed hash */
+		uint64_t hash3                 : 64;
+#else /* Word 7 - Little Endian */
+		uint64_t hash3                 : 64;
+#endif /* Word 7 - End */
+	} /** ZIP Result Structure */s;
+
+	/* struct zip_zres_s_s cn83xx; */
+};
+
+/**
+ * Structure zip_zptr_s
+ *
+ * ZIP Generic Pointer Structure
+ * This structure is the generic format of pointers in ZIP_INST_S.
+ */
+union zip_zptr_s {
+	/** This field can be used to set/clear all bits, or do bitwise
+	 * operations over the entire structure.
+	 */
+	uint64_t u[2];
+	/** ZIP Generic Pointer Structure */
+	struct zip_zptr_s_s {
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 0 - Big Endian */
+		/** Pointer to Data or scatter-gather list */
+		uint64_t addr                  : 64;
+#else /* Word 0 - Little Endian */
+		uint64_t addr                  : 64;
+#endif /* Word 0 - End */
+#if defined(__BIG_ENDIAN_BITFIELD) /* Word 1 - Big Endian */
+		/** reserved */
+		uint64_t reserved_112_127      : 16;
+		/** Length of Data or scatter-gather list*/
+		uint64_t length                : 16;
+		/** reserved */
+		uint64_t reserved_67_95        : 29;
+		/** Full-block write */
+		uint64_t fw                    : 1;
+		/** No cache allocation */
+		uint64_t nc                    : 1;
+		/** reserved */
+		uint64_t data_be               : 1;
+#else /* Word 1 - Little Endian */
+		uint64_t data_be               : 1;
+		uint64_t nc                    : 1;
+		uint64_t fw                    : 1;
+		uint64_t reserved_67_95        : 29;
+		uint64_t length                : 16;
+		uint64_t reserved_112_127      : 16;
+#endif /* Word 1 - End */
+	} /** ZIP Generic Pointer Structure */s;
+};
+
+/**
+ * Enumeration zip_comp_e
+ *
+ * ZIP Completion Enumeration
+ * Enumerates the values of ZIP_ZRES_S[COMPCODE].
+ */
+#define ZIP_COMP_E_NOTDONE       (0)
+#define ZIP_COMP_E_SUCCESS       (1)
+#define ZIP_COMP_E_DTRUNC        (2)
+#define ZIP_COMP_E_DSTOP         (3)
+#define ZIP_COMP_E_ITRUNC        (4)
+#define ZIP_COMP_E_RBLOCK        (5)
+#define ZIP_COMP_E_NLEN          (6)
+#define ZIP_COMP_E_BADCODE       (7)
+#define ZIP_COMP_E_BADCODE2      (8)
+#define ZIP_COMP_E_ZERO_LEN      (9)
+#define ZIP_COMP_E_PARITY        (0xa)
+#define ZIP_COMP_E_FATAL         (0xb)
+#define ZIP_COMP_E_TIMEOUT       (0xc)
+#define ZIP_COMP_E_INSTR_ERR     (0xd)
+#define ZIP_COMP_E_HCTX_ERR      (0xe)
+#define ZIP_COMP_E_STOP          (3)
+
+/**
+ * Enumeration zip_op_e
+ *
+ * ZIP Operation Enumeration
+ * Enumerates ZIP_INST_S[OP].
+ * Internal:
+ */
+#define ZIP_OP_E_DECOMP   (0)
+#define ZIP_OP_E_NOCOMP   (1)
+#define ZIP_OP_E_COMP     (2)
+
+/**
+ * Enumeration zip compression levels
+ *
+ * ZIP Compression Level Enumeration
+ * Enumerates ZIP_INST_S[SS].
+ * Internal:
+ */
+#define ZIP_COMP_E_LEVEL_MAX  (0)
+#define ZIP_COMP_E_LEVEL_MED  (1)
+#define ZIP_COMP_E_LEVEL_LOW  (2)
+#define ZIP_COMP_E_LEVEL_MIN  (3)
+
+#ifdef __cplusplus
+}
+#endif
+#endif	/* _RTE_ZIP_REGS_H_ */
+
diff --git a/drivers/compress/octeontx/zip_pmd.c b/drivers/compress/octeontx/zip_pmd.c
index 1181bed19..3bb7f6896 100644
--- a/drivers/compress/octeontx/zip_pmd.c
+++ b/drivers/compress/octeontx/zip_pmd.c
@@ -12,6 +12,275 @@
 /* global structure to keep driver info */
 struct zip_pmd_private zip_pmd_priv;
 
+static const struct rte_compressdev_capabilities
+				octtx_zip_pmd_capabilities[] = {
+	{       /* Deflate */
+		.algo = RTE_COMP_ALGO_DEFLATE,
+		/* Non sharable Priv XFORM and Stateless */
+		.comp_feature_flags = (RTE_COMP_FF_MBUF_SCATTER_GATHER |
+				      RTE_COMP_FF_ADLER32_CHECKSUM |
+				      RTE_COMP_FF_CRC32_CHECKSUM),
+		.window_size = {
+				/* size supported 2^1 to 2^14 */
+				.min = 1,
+				.max = 14,
+				.increment = 1
+		},
+	},
+	RTE_COMP_END_OF_CAPABILITIES_LIST()
+};
+
+/** Configure device */
+static int
+zip_pmd_config(struct rte_compressdev *dev,
+		struct rte_compressdev_config *config)
+{
+	int nb_streams;
+	char res_pool[RTE_MEMZONE_NAMESIZE];
+	struct zip_vf *vf;
+	struct rte_mempool *zip_buf_mp;
+
+	if (!config || !dev)
+		return -EIO;
+
+	vf = (struct zip_vf *)(dev->data->dev_private);
+
+	/* create pool with maximum numbers of resources
+	 * required by streams
+	 */
+
+	/* use common pool for non-shareable priv_xform and stream */
+	nb_streams = config->max_nb_priv_xforms + config->max_nb_streams;
+
+	snprintf(res_pool, RTE_MEMZONE_NAMESIZE, "octtx_zip_res_pool%u",
+		 dev->data->dev_id);
+
+	/** TBD Should we use the per core object cache for stream resources */
+	zip_buf_mp = rte_mempool_create(
+			res_pool,
+			nb_streams * MAX_BUFS_PER_STREAM,
+			ZIP_BUF_SIZE,
+			0,
+			0,
+			NULL,
+			NULL,
+			NULL,
+			NULL,
+			SOCKET_ID_ANY,
+			0);
+
+	if (zip_buf_mp == NULL) {
+		ZIP_PMD_ERR(
+			"Failed to create buf mempool octtx_zip_res_pool%u",
+			dev->data->dev_id);
+		return -1;
+	}
+
+	vf->zip_mp = zip_buf_mp;
+
+	return 0;
+}
+
+/** Start device */
+static int
+zip_pmd_start(struct rte_compressdev *dev)
+{
+	if (dev == NULL)
+		return -1;
+	return 0;
+}
+
+/** Stop device */
+static void
+zip_pmd_stop(__rte_unused struct rte_compressdev *dev)
+{
+
+}
+
+/** Close device */
+static int
+zip_pmd_close(struct rte_compressdev *dev)
+{
+	if (dev == NULL)
+		return -1;
+
+	struct zip_vf *vf = (struct zip_vf *)dev->data->dev_private;
+
+	for (int i = 0; dev->data->nb_queue_pairs; i++) {
+		if (dev->data->queue_pairs[i] != NULL)
+		/* qp not released, return error */
+		return -1;
+	}
+
+	rte_mempool_free(vf->zip_mp);
+	return 0;
+}
+
+/** Get device statistics */
+static void
+zip_pmd_stats_get(struct rte_compressdev *dev,
+		struct rte_compressdev_stats *stats)
+{
+	int qp_id;
+
+	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
+		struct zipvf_qp *qp = dev->data->queue_pairs[qp_id];
+
+		stats->enqueued_count += qp->qp_stats.enqueued_count;
+		stats->dequeued_count += qp->qp_stats.dequeued_count;
+
+		stats->enqueue_err_count += qp->qp_stats.enqueue_err_count;
+		stats->dequeue_err_count += qp->qp_stats.dequeue_err_count;
+	}
+}
+
+/** Reset device statistics */
+static void
+zip_pmd_stats_reset(struct rte_compressdev *dev)
+{
+	int qp_id;
+
+	for (qp_id = 0; qp_id < dev->data->nb_queue_pairs; qp_id++) {
+		struct zipvf_qp *qp = dev->data->queue_pairs[qp_id];
+		memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+	}
+}
+
+/** Get device info */
+static void
+zip_pmd_info_get(struct rte_compressdev *dev,
+		struct rte_compressdev_info *dev_info)
+{
+	struct zip_vf *vf = (struct zip_vf *)dev->data->dev_private;
+
+	if (dev_info != NULL) {
+		dev_info->driver_name = dev->device->driver->name;
+		dev_info->feature_flags = dev->feature_flags;
+		dev_info->capabilities = octtx_zip_pmd_capabilities;
+		dev_info->max_nb_queue_pairs = vf->max_nb_queue_pairs;
+	}
+}
+
+/** Release queue pair */
+static int
+zip_pmd_qp_release(struct rte_compressdev *dev, uint16_t qp_id)
+{
+	struct zipvf_qp *qp = dev->data->queue_pairs[qp_id];
+	struct rte_ring *r = NULL;
+
+	if (qp != NULL) {
+		zipvf_q_term(qp);
+		r = rte_ring_lookup(qp->name);
+		if (r)
+			rte_ring_free(r);
+		rte_free(qp);
+		dev->data->queue_pairs[qp_id] = NULL;
+	}
+	return 0;
+}
+
+/** Create a ring to place process packets on */
+static struct rte_ring *
+zip_pmd_qp_create_processed_pkts_ring(struct zipvf_qp *qp,
+		unsigned int ring_size, int socket_id)
+{
+	struct rte_ring *r;
+
+	r = rte_ring_lookup(qp->name);
+	if (r) {
+		if (rte_ring_get_size(r) >= ring_size) {
+			ZIP_PMD_INFO("Reusing existing ring %s for processed"
+					" packets", qp->name);
+			return r;
+		}
+
+		ZIP_PMD_ERR("Unable to reuse existing ring %s for processed"
+				" packets", qp->name);
+		return NULL;
+	}
+
+	return rte_ring_create(qp->name, ring_size, socket_id,
+						RING_F_EXACT_SZ);
+}
+
+/** Setup a queue pair */
+static int
+zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
+		uint32_t max_inflight_ops, int socket_id)
+{
+	struct zipvf_qp *qp = NULL;
+	struct zip_vf *vf = (struct zip_vf *) (dev->data->dev_private);
+	int ret;
+
+	if (!dev)
+		return -1;
+
+	/* Free memory prior to re-allocation if needed. */
+	if (dev->data->queue_pairs[qp_id] != NULL) {
+		ZIP_PMD_INFO("Using existing queue pair %d ", qp_id);
+		return 0;
+	}
+
+	/* Allocate the queue pair data structure. */
+	qp = rte_zmalloc_socket("ZIP PMD Queue Pair", sizeof(*qp),
+				RTE_CACHE_LINE_SIZE, socket_id);
+	if (qp == NULL)
+		return (-ENOMEM);
+
+	snprintf(qp->name, sizeof(qp->name),
+		 "zip_pmd_%u_qp_%u",
+		 dev->data->dev_id, qp_id);
+
+	/* Create completion queue upto max_inflight_ops */
+	qp->processed_pkts = zip_pmd_qp_create_processed_pkts_ring(qp,
+						max_inflight_ops, socket_id);
+	if (qp->processed_pkts == NULL)
+		goto qp_setup_cleanup;
+
+	qp->id = qp_id;
+	qp->vf = vf;
+
+	ret = zipvf_q_init(qp);
+	if (ret < 0)
+		goto qp_setup_cleanup;
+
+	dev->data->queue_pairs[qp_id] = qp;
+
+	memset(&qp->qp_stats, 0, sizeof(qp->qp_stats));
+	return 0;
+
+qp_setup_cleanup:
+	if (qp->processed_pkts) {
+		rte_ring_free(qp->processed_pkts);
+		qp->processed_pkts = NULL;
+	}
+	if (qp) {
+		rte_free(qp);
+		qp = NULL;
+	}
+	return -1;
+}
+
+struct rte_compressdev_ops octtx_zip_pmd_ops = {
+		.dev_configure		= zip_pmd_config,
+		.dev_start		= zip_pmd_start,
+		.dev_stop		= zip_pmd_stop,
+		.dev_close		= zip_pmd_close,
+
+		.stats_get		= zip_pmd_stats_get,
+		.stats_reset		= zip_pmd_stats_reset,
+
+		.dev_infos_get		= zip_pmd_info_get,
+
+		.queue_pair_setup	= zip_pmd_qp_setup,
+		.queue_pair_release	= zip_pmd_qp_release,
+
+		.private_xform_create	= zip_pmd_stream_create,
+		.private_xform_free	= zip_pmd_stream_free,
+		.stream_create		= zip_pmd_stream_create,
+		.stream_free		= zip_pmd_stream_free
+};
+
 static int
 zip_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	struct rte_pci_device *pci_dev)
diff --git a/drivers/compress/octeontx/zipvf.c b/drivers/compress/octeontx/zipvf.c
index e082c2849..436e80b78 100644
--- a/drivers/compress/octeontx/zipvf.c
+++ b/drivers/compress/octeontx/zipvf.c
@@ -4,6 +4,87 @@
 
 #include "zipvf.h"
 
+uint64_t zip_reg_read64(uint8_t *hw_addr, uint64_t offset)
+{
+	uint8_t *base = hw_addr;
+	return *(volatile uint64_t *)(base + offset);
+}
+
+void zip_reg_write64(uint8_t *hw_addr, uint64_t offset, uint64_t val)
+{
+	uint8_t *base = hw_addr;
+	*(uint64_t *)(base + offset) = val;
+}
+
+static void zip_q_enable(struct zipvf_qp *qp)
+{
+	zip_vqx_ena_t que_ena;
+
+	/*ZIP VFx command queue init*/
+	que_ena.u = 0ull;
+	que_ena.s.ena = 1;
+
+	zip_reg_write64(qp->vf->vbar0, ZIP_VQ_ENA, que_ena.u);
+	rte_wmb();
+}
+
+/* initialize given qp on zip device */
+int zipvf_q_init(struct zipvf_qp *qp)
+{
+	zip_vqx_sbuf_addr_t que_sbuf_addr;
+
+	uint64_t size;
+	void *cmdq_addr;
+	uint64_t iova;
+	struct zipvf_cmdq *cmdq = &qp->cmdq;
+	struct zip_vf *vf = qp->vf;
+
+	/* allocate and setup instruction queue */
+	size = ZIP_MAX_CMDQ_SIZE;
+	size = ZIP_ALIGN_ROUNDUP(size, ZIP_CMDQ_ALIGN);
+
+	cmdq_addr = rte_zmalloc(qp->name, size, ZIP_CMDQ_ALIGN);
+	if (cmdq_addr == NULL)
+		return -1;
+
+	cmdq->sw_head = (uint64_t *)cmdq_addr;
+	cmdq->va = (uint8_t *)cmdq_addr;
+	iova = rte_mem_virt2iova(cmdq_addr);
+
+	/* Check for 128 byte alignment, if not align it*/
+	iova = (uint64_t)ZIP_ALIGN_ROUNDUP(iova, 128);
+	cmdq->iova = iova;
+
+	que_sbuf_addr.u = 0ull;
+	que_sbuf_addr.s.ptr = (cmdq->iova >> 7);
+	zip_reg_write64(vf->vbar0, ZIP_VQ_SBUF_ADDR, que_sbuf_addr.u);
+
+	zip_q_enable(qp);
+
+	memset(cmdq->va, 0, ZIP_MAX_CMDQ_SIZE);
+	rte_spinlock_init(&cmdq->qlock);
+
+	return 0;
+}
+
+int zipvf_q_term(struct zipvf_qp *qp)
+{
+	struct zipvf_cmdq *cmdq = &qp->cmdq;
+	zip_vqx_ena_t que_ena;
+	struct zip_vf *vf = qp->vf;
+
+	if (cmdq->va != NULL) {
+		memset(cmdq->va, 0, ZIP_MAX_CMDQ_SIZE);
+		rte_free(cmdq->va);
+	}
+
+	/*Disabling the ZIP queue*/
+	que_ena.u = 0ull;
+	zip_reg_write64(vf->vbar0, ZIP_VQ_ENA, que_ena.u);
+
+	return 0;
+}
+
 int zipvf_create(struct rte_compressdev *compressdev, int vfid)
 {
 	struct   rte_pci_device *pdev = RTE_DEV_TO_PCI(compressdev->device);
diff --git a/drivers/compress/octeontx/zipvf.h b/drivers/compress/octeontx/zipvf.h
index dcaaf4e46..9582d6119 100644
--- a/drivers/compress/octeontx/zipvf.h
+++ b/drivers/compress/octeontx/zipvf.h
@@ -4,13 +4,66 @@
 #ifndef _RTE_OCTEONTX_ZIP_VF_H_
 #define _RTE_OCTEONTX_ZIP_VF_H_
 
+#include <rte_bus_pci.h>
+#include <rte_spinlock.h>
+#include <rte_memory.h>
+#include <rte_malloc.h>
 #include <rte_comp.h>
 #include <rte_compressdev.h>
 #include <rte_compressdev_pmd.h>
+#include <zip_regs.h>
 #include <unistd.h>
 
 int octtx_zip_logtype_driver;
 
+/* ZIP VF Control/Status registers (CSRs): */
+/* VF_BAR0: */
+#define ZIP_VQ_ENA              (0x10)
+#define ZIP_VQ_SBUF_ADDR        (0x20)
+#define ZIP_VF_PF_MBOXX(x)      (0x400 | (x)<<3)
+#define ZIP_VQ_DOORBELL         (0x1000)
+
+/**< Vendor ID */
+#define PCI_VENDOR_ID_CAVIUM	0x177D
+/**< PCI device id of ZIP VF */
+#define PCI_DEVICE_ID_OCTEONTX_ZIPVF	0xA037
+
+/* maxmum number of zip vf devices */
+#define ZIP_MAX_VFS 8
+
+/* max size of one chunk */
+#define ZIP_MAX_CHUNK_SIZE	8192
+
+/* each instruction is fixed 128 bytes */
+#define ZIP_CMD_SIZE		128
+
+#define ZIP_CMD_SIZE_WORDS	(ZIP_CMD_SIZE >> 3) /* 16 64_bit words */
+
+/* size of next chunk buffer pointer */
+#define ZIP_MAX_NCBP_SIZE	8
+
+/* size of instruction queue in units of instruction size */
+#define ZIP_MAX_NUM_CMDS	((ZIP_MAX_CHUNK_SIZE - ZIP_MAX_NCBP_SIZE) / \
+				ZIP_CMD_SIZE) /* 63 */
+
+/* size of instruct queue in bytes */
+#define ZIP_MAX_CMDQ_SIZE	((ZIP_MAX_NUM_CMDS * ZIP_CMD_SIZE) + \
+				ZIP_MAX_NCBP_SIZE)/* ~8072ull */
+
+#define ZIP_BUF_SIZE	256
+
+#define ZIP_SGPTR_ALIGN	16
+#define ZIP_CMDQ_ALIGN	128
+#define MAX_SG_LEN	((ZIP_BUF_SIZE - ZIP_SGPTR_ALIGN) / sizeof(void *))
+
+/**< ZIP PMD specified queue pairs */
+#define ZIP_MAX_VF_QUEUE	1
+
+#define ZIP_ALIGN_ROUNDUP(x, _align) \
+	((_align) * (((x) + (_align) - 1) / (_align)))
+
+/**< ZIP PMD device name */
+#define COMPRESSDEV_NAME_ZIP_PMD	compress_octtx_zipvf
 
 #define ZIP_PMD_LOG(level, fmt, args...) \
 	rte_log(RTE_LOG_ ## level, \
@@ -24,6 +77,44 @@ int octtx_zip_logtype_driver;
 #define ZIP_PMD_WARN(fmt, args...) \
 	ZIP_PMD_LOG(WARNING, fmt, ## args)
 
+struct zip_pmd_private {
+	struct zip_vf *zipvf_table[ZIP_MAX_VFS];
+	/**< ZIP Devices List */
+	uint8_t num_zipvfs;
+	/**< Number of ZIP VFs attached to a Guest */
+};
+
+/**
+ * ZIP instruction Queue
+ */
+struct zipvf_cmdq {
+	rte_spinlock_t qlock;
+	/* queue lock */
+	uint64_t *sw_head;
+	/* 64-bit word pointer to queue head */
+	uint8_t *va;
+	/* pointer to iq virual address */
+	rte_iova_t iova;
+	/* iova addr of cmdq head*/
+};
+
+/**
+ * ZIP device queue structure
+ */
+struct zipvf_qp {
+	struct zipvf_cmdq cmdq;
+	/** Hardware queue handle */
+	struct rte_ring *processed_pkts;
+	/**< Ring for placing process packets */
+	struct rte_compressdev_stats qp_stats;
+	/**< Queue pair statistics */
+	uint16_t id;
+	/**< Queue Pair Identifier */
+	char name[RTE_COMPRESSDEV_NAME_MAX_LEN];
+	/**< Unique Queue Pair Name */
+	struct zip_vf *vf;
+} __rte_cache_aligned;
+
 /**
  * ZIP VF device structure.
  */
@@ -43,5 +134,17 @@ struct zip_vf {
 } __rte_cache_aligned;
 
 int zipvf_create(struct rte_compressdev *compressdev, int vfid);
+int zipvf_destroy(struct rte_compressdev *compressdev);
+int zipvf_q_init(struct zipvf_qp *qp);
+int zipvf_q_term(struct zipvf_qp *qp);
+int zip_set_stream_parameters(struct rte_compressdev *dev,
+				const struct rte_comp_xform *xform,
+				struct zip_stream *z_stream);
+int zip_process_op(struct rte_comp_op *op,
+				struct zipvf_qp *qp,
+				struct zip_stream *zstrm);
+
+uint64_t zip_reg_read64(uint8_t *hw_addr, uint64_t offset);
+void zip_reg_write64(uint8_t *hw_addr, uint64_t offset, uint64_t val);
 
 #endif /* _RTE_ZIP_VF_H_ */
-- 
2.14.3

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-dev] [PATCH v1 3/7] compress/octeontx: add xform and stream create support
  2018-06-05 10:35 [dpdk-dev] [PATCH v1 0/7] compress: add Octeontx ZIP compression PMD Shally Verma
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 1/7] compress/octeontx: add octeontx zip PMD support Shally Verma
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 2/7] compress/octeontx: add device setup PMD ops Shally Verma
@ 2018-06-05 10:35 ` Shally Verma
  2018-06-19 22:13   ` De Lara Guarch, Pablo
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 4/7] compress/octeontx: add ops enq deq apis Shally Verma
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 25+ messages in thread
From: Shally Verma @ 2018-06-05 10:35 UTC (permalink / raw)
  To: pablo.de.lara.guarch
  Cc: fiona.trahe, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu

implement private xform and stream create ops

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
---
 drivers/compress/octeontx/zip_pmd.c | 138 ++++++++++++++++++++++++++++++++++++
 drivers/compress/octeontx/zipvf.h   |  29 ++++++++
 2 files changed, 167 insertions(+)

diff --git a/drivers/compress/octeontx/zip_pmd.c b/drivers/compress/octeontx/zip_pmd.c
index 3bb7f6896..349114626 100644
--- a/drivers/compress/octeontx/zip_pmd.c
+++ b/drivers/compress/octeontx/zip_pmd.c
@@ -30,6 +30,104 @@ static const struct rte_compressdev_capabilities
 	RTE_COMP_END_OF_CAPABILITIES_LIST()
 };
 
+/** Parse xform parameters and setup a stream */
+int
+zip_set_stream_parameters(struct rte_compressdev *dev,
+			const struct rte_comp_xform *xform,
+			struct zip_stream *z_stream)
+{
+	int ret;
+	union zip_inst_s *inst;
+	struct zip_vf *vf = (struct zip_vf *)dev->data->dev_private;
+	void *res;
+
+	ret = rte_mempool_get_bulk(vf->zip_mp,
+			z_stream->bufs, MAX_BUFS_PER_STREAM);
+	if (ret < 0)
+		return -1;
+
+	inst = (union zip_inst_s *)z_stream->bufs[CMD_BUF];
+	res = z_stream->bufs[RES_BUF];
+
+	/* get one command buffer from pool and set up */
+
+	memset(inst->u, 0, sizeof(inst->u));
+
+	/* set bf for only first ops of stream */
+	inst->s.bf = 1;
+
+	if (xform->type == RTE_COMP_COMPRESS) {
+		inst->s.op = ZIP_OP_E_COMP;
+
+		switch (xform->compress.deflate.huffman) {
+		case RTE_COMP_HUFFMAN_DEFAULT:
+			inst->s.cc = ZIP_CC_DEFAULT;
+			break;
+		case RTE_COMP_HUFFMAN_FIXED:
+			inst->s.cc = ZIP_CC_FIXED_HUFF;
+			break;
+		case RTE_COMP_HUFFMAN_DYNAMIC:
+			inst->s.cc = ZIP_CC_DYN_HUFF;
+			break;
+		default:
+			ret = -1;
+			goto err;
+		}
+
+		switch (xform->compress.level) {
+		case RTE_COMP_LEVEL_MIN:
+			inst->s.ss = ZIP_COMP_E_LEVEL_MIN;
+			break;
+		case RTE_COMP_LEVEL_MAX:
+			inst->s.ss = ZIP_COMP_E_LEVEL_MAX;
+			break;
+		case RTE_COMP_LEVEL_NONE:
+			ZIP_PMD_ERR("Compression level not supported");
+			ret = -1;
+			goto err;
+		default:
+			/* for any value between min and max , choose
+			 * PMD default.
+			 */
+			inst->s.ss = ZIP_COMP_E_LEVEL_MED; /** PMD default **/
+			break;
+		}
+	} else if (xform->type == RTE_COMP_DECOMPRESS) {
+		inst->s.op = ZIP_OP_E_DECOMP;
+		/* from HRM,
+		 * For DEFLATE decompression, [CC] must be 0x0.
+		 * For decompression, [SS] must be 0x0
+		 */
+		inst->s.cc = 0;
+		/* Speed bit should not be set for decompression */
+		inst->s.ss = 0;
+		/* decompression context is supported only for STATEFUL
+		 * operations. Currently we support STATELESS ONLY so
+		 * skip setting of ctx pointer
+		 */
+
+	} else {
+		ZIP_PMD_ERR("\nxform type not supported");
+		ret = -1;
+		goto err;
+	}
+
+	inst->s.res_ptr_addr.s.addr = rte_mempool_virt2iova(res);
+	inst->s.res_ptr_ctl.s.length = 0;
+
+	z_stream->inst = inst;
+	z_stream->func = zip_process_op;
+
+	return 0;
+
+err:
+	rte_mempool_put_bulk(vf->zip_mp,
+			     (void *)&(z_stream->bufs[0]),
+			     MAX_BUFS_PER_STREAM);
+
+	return ret;
+}
+
 /** Configure device */
 static int
 zip_pmd_config(struct rte_compressdev *dev,
@@ -261,6 +359,46 @@ zip_pmd_qp_setup(struct rte_compressdev *dev, uint16_t qp_id,
 	return -1;
 }
 
+static int
+zip_pmd_stream_create(struct rte_compressdev *dev,
+		const struct rte_comp_xform *xform, void **stream)
+{
+	int ret;
+	struct zip_stream *strm;
+
+	strm = rte_malloc(NULL,
+			sizeof(struct zip_stream), 0);
+	ret = zip_set_stream_parameters(dev, xform, strm);
+	if (ret < 0) {
+		ZIP_PMD_ERR("failed configure xform parameters");
+		rte_free(strm);
+		return ret;
+	}
+	*stream = strm;
+	return 0;
+}
+
+static int
+zip_pmd_stream_free(struct rte_compressdev *dev, void *stream)
+{
+	struct zip_vf *vf = (struct zip_vf *) (dev->data->dev_private);
+	struct zip_stream *z_stream;
+
+	if (stream == NULL)
+		return -1;
+
+	z_stream = (struct zip_stream *)stream;
+	rte_mempool_put_bulk(vf->zip_mp,
+			     (void *)&(z_stream->bufs[0]),
+			     MAX_BUFS_PER_STREAM);
+
+	/* Zero out the whole structure */
+	memset(stream, 0, sizeof(struct zip_stream));
+	rte_free(stream);
+
+	return 0;
+}
+
 struct rte_compressdev_ops octtx_zip_pmd_ops = {
 		.dev_configure		= zip_pmd_config,
 		.dev_start		= zip_pmd_start,
diff --git a/drivers/compress/octeontx/zipvf.h b/drivers/compress/octeontx/zipvf.h
index 9582d6119..2388e2947 100644
--- a/drivers/compress/octeontx/zipvf.h
+++ b/drivers/compress/octeontx/zipvf.h
@@ -77,6 +77,25 @@ int octtx_zip_logtype_driver;
 #define ZIP_PMD_WARN(fmt, args...) \
 	ZIP_PMD_LOG(WARNING, fmt, ## args)
 
+/* resources required to process stream */
+enum {
+	RES_BUF = 0,
+	CMD_BUF,
+	HASH_CTX_BUF,
+	DECOMP_CTX_BUF,
+	IN_DATA_BUF,
+	OUT_DATA_BUF,
+	HISTORY_DATA_BUF,
+	MAX_BUFS_PER_STREAM
+} NUM_BUFS_PER_STREAM;
+
+struct zip_stream;
+struct zipvf_qp;
+
+/* Algorithm handler function prototype */
+typedef int (*comp_func_t)(struct rte_comp_op *op,
+			   struct zipvf_qp *qp, struct zip_stream *zstrm);
+
 struct zip_pmd_private {
 	struct zip_vf *zipvf_table[ZIP_MAX_VFS];
 	/**< ZIP Devices List */
@@ -84,6 +103,16 @@ struct zip_pmd_private {
 	/**< Number of ZIP VFs attached to a Guest */
 };
 
+/** ZIP private stream structure */
+struct zip_stream {
+	union zip_inst_s *inst;
+	/**< zip instruction pointer */
+	comp_func_t func;
+	/**< function to process comp operation */
+	void *bufs[MAX_BUFS_PER_STREAM];
+} _rte_cache_aligned;
+
+
 /**
  * ZIP instruction Queue
  */
-- 
2.14.3

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-dev] [PATCH v1 4/7] compress/octeontx: add ops enq deq apis
  2018-06-05 10:35 [dpdk-dev] [PATCH v1 0/7] compress: add Octeontx ZIP compression PMD Shally Verma
                   ` (2 preceding siblings ...)
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 3/7] compress/octeontx: add xform and stream create support Shally Verma
@ 2018-06-05 10:35 ` Shally Verma
  2018-06-19 22:18   ` De Lara Guarch, Pablo
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 5/7] test: add octeontx zip PMD for compressdev tests Shally Verma
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 25+ messages in thread
From: Shally Verma @ 2018-06-05 10:35 UTC (permalink / raw)
  To: pablo.de.lara.guarch
  Cc: fiona.trahe, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu

implement enqueue and dequeue apis

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
---
 drivers/compress/octeontx/zip_pmd.c | 111 ++++++++++++++++++++++++
 drivers/compress/octeontx/zipvf.c   |  49 +++++++++++
 drivers/compress/octeontx/zipvf.h   | 164 ++++++++++++++++++++++++++++++++++++
 3 files changed, 324 insertions(+)

diff --git a/drivers/compress/octeontx/zip_pmd.c b/drivers/compress/octeontx/zip_pmd.c
index 349114626..9e629fd17 100644
--- a/drivers/compress/octeontx/zip_pmd.c
+++ b/drivers/compress/octeontx/zip_pmd.c
@@ -30,6 +30,67 @@ static const struct rte_compressdev_capabilities
 	RTE_COMP_END_OF_CAPABILITIES_LIST()
 };
 
+/*
+ * Reset session to default state for next set of stateless operation
+ */
+static inline void reset_stream(struct zip_stream *z_stream)
+{
+	union zip_inst_s *inst = (union zip_inst_s *)(z_stream->inst);
+
+	inst->s.bf = 1;
+	inst->s.ef = 0;
+}
+
+int
+zip_process_op(struct rte_comp_op *op,
+		struct zipvf_qp *qp,
+		struct zip_stream *zstrm)
+{
+	int ret;
+	union zip_inst_s *inst = zstrm->inst;
+	volatile union zip_zres_s *zresult = NULL;
+
+	if (op->op_type == RTE_COMP_OP_STATELESS)
+		zipvf_prepare_cmd_stateless(op, zstrm);
+
+	zresult = (union zip_zres_s *)zstrm->bufs[RES_BUF];
+	zresult->s.compcode = 0;
+
+#ifdef ZIP_DBG
+	zip_dump_instruction(inst);
+#endif
+
+	/* Submit zip command */
+	ret = zipvf_push_command(qp, (void *)inst);
+
+	/* Check and Process results in sync mode */
+	do {
+	} while (!zresult->s.compcode);
+
+	if (zresult->s.compcode == ZIP_COMP_E_SUCCESS) {
+		op->status = RTE_COMP_OP_STATUS_SUCCESS;
+	} else {
+		/* FATAL error cannot do anything */
+		ZIP_PMD_ERR("operation failed with error code:%d\n",
+			zresult->s.compcode);
+		if (zresult->s.compcode == ZIP_COMP_E_DSTOP)
+			op->status = RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED;
+		else
+			op->status = RTE_COMP_OP_STATUS_ERROR;
+	}
+
+	ZIP_PMD_INFO("ret %d,written %d\n", ret, zresult->s.totalbyteswritten);
+
+	op->produced = zresult->s.totalbyteswritten;
+	op->consumed = zresult->s.totalbytesread;
+
+	if (zresult->s.ef == 1)
+		reset_stream(zstrm);
+
+	zresult->s.compcode = 0;
+	return ret;
+}
+
 /** Parse xform parameters and setup a stream */
 int
 zip_set_stream_parameters(struct rte_compressdev *dev,
@@ -399,6 +460,56 @@ zip_pmd_stream_free(struct rte_compressdev *dev, void *stream)
 	return 0;
 }
 
+static uint16_t
+zip_pmd_enqueue_burst_sync(void *queue_pair,
+		struct rte_comp_op **ops, uint16_t nb_ops)
+{
+	struct zipvf_qp *qp = queue_pair;
+	struct rte_comp_op *op;
+	struct zip_stream *zstrm;
+	int ret, i;
+	uint16_t enqd = 0;
+
+	for (i = 0; i < nb_ops; i++) {
+		op = ops[i];
+		if (op->op_type == RTE_COMP_OP_STATEFUL)
+			op->status = RTE_COMP_OP_STATUS_INVALID_ARGS;
+		else {
+			/* process stateless ops */
+			zstrm = (struct zip_stream *)op->private_xform;
+			ret = zstrm->func(op, qp, zstrm);
+		}
+
+		/* Whatever is out of op, put it into completion queue with
+		 * its status
+		 */
+		ret = rte_ring_enqueue(qp->processed_pkts, (void *)op);
+		if (unlikely(ret < 0)) {
+			/* increment count if failed to enqueue op*/
+			qp->qp_stats.enqueue_err_count++;
+		} else {
+			qp->qp_stats.enqueued_count++;
+			enqd++;
+		}
+	}
+	return enqd;
+}
+
+static uint16_t
+zip_pmd_dequeue_burst_sync(void *queue_pair,
+		struct rte_comp_op **ops, uint16_t nb_ops)
+{
+	struct zipvf_qp *qp = queue_pair;
+
+	unsigned int nb_dequeued = 0;
+
+	nb_dequeued = rte_ring_dequeue_burst(qp->processed_pkts,
+			(void **)ops, nb_ops, NULL);
+	qp->qp_stats.dequeued_count += nb_dequeued;
+
+	return nb_dequeued;
+}
+
 struct rte_compressdev_ops octtx_zip_pmd_ops = {
 		.dev_configure		= zip_pmd_config,
 		.dev_start		= zip_pmd_start,
diff --git a/drivers/compress/octeontx/zipvf.c b/drivers/compress/octeontx/zipvf.c
index 436e80b78..d50f36d64 100644
--- a/drivers/compress/octeontx/zipvf.c
+++ b/drivers/compress/octeontx/zipvf.c
@@ -85,6 +85,55 @@ int zipvf_q_term(struct zipvf_qp *qp)
 	return 0;
 }
 
+
+int zipvf_push_command(struct zipvf_qp *qp, union zip_inst_s *cmd)
+{
+	zip_quex_doorbell_t dbell;
+	union zip_nptr_s ncp;
+	uint64_t *ncb_ptr;
+	struct zipvf_cmdq *cmdq = &qp->cmdq;
+	void *reg_base = qp->vf->vbar0;
+
+	/*Held queue lock*/
+	rte_spinlock_lock(&(cmdq->qlock));
+
+	/* Check space availability in zip cmd queue */
+	if ((((cmdq->sw_head - (uint64_t *)cmdq->va) * sizeof(uint64_t *)) +
+		ZIP_CMD_SIZE) == (ZIP_MAX_CMDQ_SIZE - 8)) {
+		/*Last buffer of the command queue*/
+		memcpy((uint8_t *)cmdq->sw_head,
+			(uint8_t *)cmd,
+			sizeof(union zip_inst_s));
+		/* move pointer to next loc in unit of 64-bit word */
+		cmdq->sw_head += ZIP_CMD_SIZE_WORDS;
+
+		/* now, point the "Next-Chunk Buffer Ptr" to sw_head */
+		ncb_ptr = cmdq->sw_head;
+		/* Pointing head again to cmdqueue base*/
+		cmdq->sw_head = (uint64_t *)cmdq->va;
+
+		ncp.u = 0ull;
+		ncp.s.addr = cmdq->iova;
+		*ncb_ptr = ncp.u;
+	} else {
+		/*Enough buffers available in the command queue*/
+		memcpy((uint8_t *)cmdq->sw_head,
+			(uint8_t *)cmd,
+			sizeof(union zip_inst_s));
+		cmdq->sw_head += ZIP_CMD_SIZE_WORDS;
+	}
+
+	rte_wmb();
+
+	/* Ringing ZIP VF doorbell */
+	dbell.u = 0ull;
+	dbell.s.dbell_cnt = 1;
+	zip_reg_write64(reg_base, ZIP_VQ_DOORBELL, dbell.u);
+
+	rte_spinlock_unlock(&(cmdq->qlock));
+	return 0;
+}
+
 int zipvf_create(struct rte_compressdev *compressdev, int vfid)
 {
 	struct   rte_pci_device *pdev = RTE_DEV_TO_PCI(compressdev->device);
diff --git a/drivers/compress/octeontx/zipvf.h b/drivers/compress/octeontx/zipvf.h
index 2388e2947..849094fc6 100644
--- a/drivers/compress/octeontx/zipvf.h
+++ b/drivers/compress/octeontx/zipvf.h
@@ -162,10 +162,174 @@ struct zip_vf {
 	/* pointer to pools */
 } __rte_cache_aligned;
 
+
+static inline int
+zipvf_prepare_in_buf(struct zip_stream *zstrm, struct rte_comp_op *op)
+{
+	uint32_t offset, inlen;
+	union zip_zptr_s *sg_list = NULL;
+	struct rte_mbuf *m_src;
+	union zip_inst_s *inst = zstrm->inst;
+	rte_iova_t iova;
+
+	inlen = op->src.length;
+	offset = op->src.offset;
+	m_src = op->m_src;
+
+	if (m_src->nb_segs == 1) {
+		/* Prepare direct input data pointer */
+		inst->s.dg = 0;
+		inst->s.inp_ptr_addr.s.addr =
+			rte_pktmbuf_iova_offset(m_src, offset);
+		inst->s.inp_ptr_ctl.s.length = inlen;
+		return 0;
+	}
+
+	ZIP_PMD_ERR("Input packet is segmented\n");
+
+	/* Packet is segmented, create gather buffer */
+	inst->s.dg = 1;
+	iova = rte_mempool_virt2iova(zstrm->bufs[IN_DATA_BUF]);
+	if (iova & 0xF) {
+		/* Align it to 16 Byte address */
+		iova = ZIP_ALIGN_ROUNDUP(iova, ZIP_SGPTR_ALIGN);
+	}
+
+	inst->s.inp_ptr_addr.s.addr = iova;
+	inst->s.inp_ptr_ctl.s.length = (m_src->nb_segs < MAX_SG_LEN) ?
+					(m_src->nb_segs) : MAX_SG_LEN;
+
+	sg_list = (union zip_zptr_s *)iova;
+
+	int i = 0;
+	rte_iova_t addr;
+	uint16_t len;
+
+	while (i < inst->s.inp_ptr_ctl.s.length) {
+		addr = rte_pktmbuf_iova_offset(m_src, offset);
+		len = rte_pktmbuf_data_len(m_src);
+		if (len > inlen)
+			len = inlen;
+		sg_list[i].s.addr = addr;
+		sg_list[i].s.length = len;
+		i++;
+		inlen -= len;
+		m_src = m_src->next;//try offset += len instead
+		offset = 0;
+	}
+	return 0;
+}
+
+static inline int
+zipvf_prepare_out_buf(struct zip_stream *zstrm, struct rte_comp_op *op)
+{
+	uint32_t offset;
+	union zip_zptr_s *sg_list = NULL;
+	struct rte_mbuf *m_dst;
+	union zip_inst_s *inst = zstrm->inst;
+	rte_iova_t iova;
+
+	offset = op->src.offset;
+	m_dst = op->m_dst;
+
+	if (m_dst->nb_segs == 1) {
+		/* Prepare direct input data pointer */
+		inst->s.ds = 0;
+		inst->s.out_ptr_addr.s.addr =
+			rte_pktmbuf_iova_offset(m_dst, offset);
+		inst->s.totaloutputlength = rte_pktmbuf_data_len(m_dst) -
+					    op->dst.offset;
+		inst->s.out_ptr_ctl.s.length = inst->s.totaloutputlength;
+		return 0;
+	}
+
+	ZIP_PMD_ERR("output packet is segmented\n");
+
+	/* Packet is segmented, create gather buffer */
+	inst->s.ds = 1;
+	iova = rte_mempool_virt2iova(zstrm->bufs[OUT_DATA_BUF]);
+	if (iova & 0xF) {
+		/* Align it to 16 Byte address */
+		iova = ZIP_ALIGN_ROUNDUP(iova, ZIP_SGPTR_ALIGN);
+	}
+
+	inst->s.out_ptr_addr.s.addr = iova;
+	inst->s.inp_ptr_ctl.s.length = (m_dst->nb_segs < MAX_SG_LEN) ?
+					(m_dst->nb_segs) : MAX_SG_LEN;
+
+	sg_list = (union zip_zptr_s *)iova;
+
+	int i = 0;
+
+	while (i < inst->s.inp_ptr_ctl.s.length) {
+		sg_list[i].s.addr = rte_pktmbuf_iova_offset(m_dst, offset);
+		sg_list[i].s.length = rte_pktmbuf_data_len(m_dst);
+		inst->s.totaloutputlength += sg_list[i].s.length;
+		m_dst = m_dst->next;//try offset += len instead
+		offset = 0;
+		i++;
+	}
+
+	return 0;
+}
+
+static inline int
+zipvf_prepare_cmd_stateless(struct rte_comp_op *op, struct zip_stream *zstrm)
+{
+	union zip_inst_s *inst = zstrm->inst;
+
+	/* set flush flag to always 1*/
+	inst->s.ef = 1;
+
+	if (inst->s.op == ZIP_OP_E_DECOMP)
+		inst->s.sf = 1;
+	else
+		inst->s.sf = 0;
+
+	/* Set input checksum */
+	inst->s.adlercrc32 = op->input_chksum;
+
+	/* Prepare gather buffers if input packet is segmented */
+	zipvf_prepare_in_buf(zstrm, op);
+	zipvf_prepare_out_buf(zstrm, op);
+
+	return 0;
+}
+
+#ifdef ZIP_DBG
+static inline void zip_dump_instruction(void *inst)
+{
+	union zip_inst_s *cmd83 = (union zip_inst_s *)inst;
+	printf("####### START ########\n");
+	printf("doneint:%d totaloutputlength:%d\n", cmd83->s.doneint,
+		cmd83->s.totaloutputlength);
+	printf("exnum:%d iv:%d exbits:%d hmif:%d halg:%d\n", cmd83->s.exn,
+		cmd83->s.iv, cmd83->s.exbits, cmd83->s.hmif, cmd83->s.halg);
+	printf("flush:%d speed:%d cc:%d\n", cmd83->s.sf,
+		cmd83->s.ss, cmd83->s.cc);
+	printf("eof:%d bof:%d op:%d dscatter:%d dgather:%d hgather:%d\n",
+		cmd83->s.ef, cmd83->s.bf, cmd83->s.op, cmd83->s.ds,
+		cmd83->s.dg, cmd83->s.hg);
+	printf("historylength:%d adler32:%d\n", cmd83->s.historylength,
+		cmd83->s.adlercrc32);
+	printf("ctx_ptr.addr:0x%lx\n", cmd83->s.ctx_ptr_addr.s.addr);
+	printf("ctx_ptr.len:%d\n", cmd83->s.ctx_ptr_ctl.s.length);
+	printf("history_ptr.addr:0x%lx\n", cmd83->s.his_ptr_addr.s.addr);
+	printf("history_ptr.len:%d\n", cmd83->s.his_ptr_ctl.s.length);
+	printf("inp_ptr.addr:0x%lx\n", cmd83->s.inp_ptr_addr.s.addr);
+	printf("inp_ptr.len:%d\n", cmd83->s.inp_ptr_ctl.s.length);
+	printf("out_ptr.addr:0x%lx\n", cmd83->s.out_ptr_addr.s.addr);
+	printf("out_ptr.len:%d\n", cmd83->s.out_ptr_ctl.s.length);
+	printf("result_ptr.len:%d\n", cmd83->s.res_ptr_ctl.s.length);
+	printf("####### END ########\n");
+}
+#endif
+
 int zipvf_create(struct rte_compressdev *compressdev, int vfid);
 int zipvf_destroy(struct rte_compressdev *compressdev);
 int zipvf_q_init(struct zipvf_qp *qp);
 int zipvf_q_term(struct zipvf_qp *qp);
+int zipvf_push_command(struct zipvf_qp *qp, union zip_inst_s *zcmd);
 int zip_set_stream_parameters(struct rte_compressdev *dev,
 				const struct rte_comp_xform *xform,
 				struct zip_stream *z_stream);
-- 
2.14.3

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-dev] [PATCH v1 5/7] test: add octeontx zip PMD for compressdev tests
  2018-06-05 10:35 [dpdk-dev] [PATCH v1 0/7] compress: add Octeontx ZIP compression PMD Shally Verma
                   ` (3 preceding siblings ...)
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 4/7] compress/octeontx: add ops enq deq apis Shally Verma
@ 2018-06-05 10:35 ` Shally Verma
  2018-06-19 22:18   ` De Lara Guarch, Pablo
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 6/7] doc: add octeontx zip PMD documentation Shally Verma
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 7/7] drivers/compress: add meson.build support Shally Verma
  6 siblings, 1 reply; 25+ messages in thread
From: Shally Verma @ 2018-06-05 10:35 UTC (permalink / raw)
  To: pablo.de.lara.guarch
  Cc: fiona.trahe, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu

link zlib pmd library in app.mk

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
---
 mk/rte.app.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 438f99d87..b367a552b 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -239,6 +239,7 @@ _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_OCTEONTX_ZIPVF) += -lrte_pmd_octeontx_zip
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ISAL) += -lrte_pmd_isal_comp
 _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_ISAL) += -lisal
 endif # CONFIG_RTE_LIBRTE_COMPRESSDEV
-- 
2.14.3

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-dev] [PATCH v1 6/7] doc: add octeontx zip PMD documentation
  2018-06-05 10:35 [dpdk-dev] [PATCH v1 0/7] compress: add Octeontx ZIP compression PMD Shally Verma
                   ` (4 preceding siblings ...)
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 5/7] test: add octeontx zip PMD for compressdev tests Shally Verma
@ 2018-06-05 10:35 ` Shally Verma
  2018-06-14 11:22   ` Kovacevic, Marko
  2018-06-19 22:22   ` De Lara Guarch, Pablo
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 7/7] drivers/compress: add meson.build support Shally Verma
  6 siblings, 2 replies; 25+ messages in thread
From: Shally Verma @ 2018-06-05 10:35 UTC (permalink / raw)
  To: pablo.de.lara.guarch
  Cc: fiona.trahe, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu

add zip pmd feature specification and overview documentation

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
---
 doc/guides/compressdevs/features/octeontx.ini |  22 +++++
 doc/guides/compressdevs/index.rst             |   1 +
 doc/guides/compressdevs/octeontx.rst          | 116 ++++++++++++++++++++++++++
 3 files changed, 139 insertions(+)

diff --git a/doc/guides/compressdevs/features/octeontx.ini b/doc/guides/compressdevs/features/octeontx.ini
new file mode 100644
index 000000000..224bcb8bb
--- /dev/null
+++ b/doc/guides/compressdevs/features/octeontx.ini
@@ -0,0 +1,22 @@
+;
+; Refer to default.ini for the full list of available PMD features.
+;
+; Supported features of 'OCTEONTX ZIP' compression driver.
+;
+[Features]
+HW Accelerated = Y
+CPU SSE        =
+CPU AVX        =
+CPU AVX2       =
+CPU AVX512     =
+CPU NEON       =
+Stateful       =
+By-Pass        =
+Chained mbufs  =
+Deflate        = Y
+LZS            =
+Adler32        =
+Crc32          =
+Adler32&Crc32  =
+Fixed          = Y
+Dynamic        = Y
diff --git a/doc/guides/compressdevs/index.rst b/doc/guides/compressdevs/index.rst
index bc59ce810..cb467ab90 100644
--- a/doc/guides/compressdevs/index.rst
+++ b/doc/guides/compressdevs/index.rst
@@ -11,3 +11,4 @@ Compression Device Drivers
 
     overview
     isal
+    octeontx
diff --git a/doc/guides/compressdevs/octeontx.rst b/doc/guides/compressdevs/octeontx.rst
new file mode 100644
index 000000000..6ad5e31ce
--- /dev/null
+++ b/doc/guides/compressdevs/octeontx.rst
@@ -0,0 +1,116 @@
+..  SPDX-License-Identifier: BSD-3-Clause
+    Copyright(c) 2018 Cavium Networks.
+
+Octeontx ZIP Compression Poll Mode Driver
+=========================================
+
+The Octeontx ZIP PMD (**librte_pmd_octeontx_zip**) provides poll mode
+compression & decompression driver for ZIP HW offload device, found in
+**Cavium OCTEONTX** SoC family.
+
+More information can be found at `Cavium, Inc Official Website
+<http://www.cavium.com/OCTEON-TX_ARM_Processors.html>`_.
+
+Features
+--------
+
+Octeontx ZIP PMD has support for:
+
+Compression/Decompression algorithm:
+
+* DEFLATE
+
+Huffman code type:
+
+* FIXED
+* DYNAMIC
+
+Window size support:
+
+* 32K
+
+Limitations
+-----------
+
+* Chained mbufs are not supported.
+
+Supported OCTEONTX SoCs
+-----------------------
+
+- CN83xx
+
+Steps To Setup Platform
+-----------------------
+
+   Octeontx SDK includes kernel image which provides Octeontx ZIP PF
+   driver to manage the Physical Function of Octeontx ZIP device.
+   Required version of SDK is "OCTEONTX-SDK-6.2.0-build35" or above.
+
+   SDK can be install by using below command.
+   #rpm -ivh CTEONTX-SDK-6.2.0-build35.x86_64.rpm --force --nodeps
+   It will install OCTEONTX-SDK at following default location
+   /usr/local/Cavium_Networks/OCTEONTX-SDK/
+
+   For more information on building and booting linux kernel on OCTEONTX
+   please refer /usr/local/Cavium_Networks/OCTEONTX-SDK/docs/OcteonTX-SDK-UG_6.2.0.pdf.
+
+   SDK and related information can be obtained from: `Cavium support site <https://support.cavium.com/>`_.
+
+Installation
+------------
+
+Config File Options
+~~~~~~~~~~~~~~~~~~~
+
+The following options can be modified in the ``config`` file.
+
+- ``CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF`` (default ``y``)
+
+  Toggle compilation of the ``librte_pmd_octeontx_zip`` driver.
+
+Driver Compilation
+~~~~~~~~~~~~~~~~~~
+
+To compile the OCTEONTX ZIP PMD for Linux arm64 gcc target, run the
+following ``make`` command:
+
+.. code-block:: console
+
+   cd <DPDK-source-directory>
+   make config T=arm64-thunderx-linuxapp-gcc install
+
+
+Initialization
+--------------
+
+The octeontx zip is exposed as pci device which consists of a set of
+PCIe VF devices. On EAL initialization, ZIP PCIe VF devices will be
+probed. To use the PMD in an application, user must:
+
+* run dev_bind script to bind eight ZIP PCIe VFs to the ``vfio-pci`` driver:
+
+   .. code-block:: console
+
+      ./usertools/dpdk-devbind.py -b vfio-pci 0001:04:00.1
+      ./usertools/dpdk-devbind.py -b vfio-pci 0001:04:00.2
+      ./usertools/dpdk-devbind.py -b vfio-pci 0001:04:00.3
+      ./usertools/dpdk-devbind.py -b vfio-pci 0001:04:00.4
+      ./usertools/dpdk-devbind.py -b vfio-pci 0001:04:00.5
+      ./usertools/dpdk-devbind.py -b vfio-pci 0001:04:00.6
+      ./usertools/dpdk-devbind.py -b vfio-pci 0001:04:00.7
+      ./usertools/dpdk-devbind.py -b vfio-pci 0001:04:01.0
+
+The unit test cases can be tested as below:
+
+.. code-block:: console
+
+    reserve enough huge pages
+    cd to the top-level DPDK directory
+    export RTE_TARGET=arm64-thunderx-linuxapp-gcc
+    export RTE_SDK=`pwd`
+    cd to test/test
+    type the command "make" to compile
+    run the tests with "./test"
+    type the command "compressdev_autotest" to test
+
+
-- 
2.14.3

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [dpdk-dev] [PATCH v1 7/7] drivers/compress: add meson.build support
  2018-06-05 10:35 [dpdk-dev] [PATCH v1 0/7] compress: add Octeontx ZIP compression PMD Shally Verma
                   ` (5 preceding siblings ...)
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 6/7] doc: add octeontx zip PMD documentation Shally Verma
@ 2018-06-05 10:35 ` Shally Verma
  2018-06-19 22:30   ` De Lara Guarch, Pablo
  6 siblings, 1 reply; 25+ messages in thread
From: Shally Verma @ 2018-06-05 10:35 UTC (permalink / raw)
  To: pablo.de.lara.guarch
  Cc: fiona.trahe, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu

Add octeontx in drivers/compress/meson.build.

Also change the config and drv format flags to append _compress
to use compression specific format for global filenames. This also
require change in compression PMDs to rename their version.map files
as rte_pmd_<pmd name>_compress.map ex. Isal should rename as
rte_pmd_isal_compress_version.map.

Currently the drivers/compress/meson.build use the generic
config names with no compress specific specifier. This breaks
meson build when vendor uses same name for different PMDs,
where all belongs to same platform.
Ex. drivers/net/octeontx, drivers/event/octeontx, drivers/compress/octeontx
where, net, event and compress carry PMD for eth, event and compression
devices for Octeontx platform. Thus, differentiate globally used files
using module specific specifier ex. rte_pmd_octeontx_compress_version.map
and rte_pmd_octeontx_event_version.map

Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
---
 .../{rte_pmd_isal_version.map => rte_pmd_isal_compress_version.map} | 0
 drivers/compress/meson.build                                        | 6 +++---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/compress/isal/rte_pmd_isal_version.map b/drivers/compress/isal/rte_pmd_isal_compress_version.map
similarity index 100%
rename from drivers/compress/isal/rte_pmd_isal_version.map
rename to drivers/compress/isal/rte_pmd_isal_compress_version.map
diff --git a/drivers/compress/meson.build b/drivers/compress/meson.build
index fb136e1b2..62e11d781 100644
--- a/drivers/compress/meson.build
+++ b/drivers/compress/meson.build
@@ -1,8 +1,8 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Intel Corporation
 
-drivers = ['isal']
+drivers = ['isal', 'octeontx']
 
 std_deps = ['compressdev'] # compressdev pulls in all other needed deps
-config_flag_fmt = 'RTE_LIBRTE_@0@_PMD'
-driver_name_fmt = 'rte_pmd_@0@'
+config_flag_fmt = 'RTE_LIBRTE_@0@_COMPRESS_PMD'
+driver_name_fmt = 'rte_pmd_@0@_compress'
-- 
2.14.3

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/7] compress/octeontx: add octeontx zip PMD support
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 1/7] compress/octeontx: add octeontx zip PMD support Shally Verma
@ 2018-06-10 10:38   ` Jerin Jacob
  2018-06-20  6:32     ` Verma, Shally
  2018-06-19 22:15   ` De Lara Guarch, Pablo
  1 sibling, 1 reply; 25+ messages in thread
From: Jerin Jacob @ 2018-06-10 10:38 UTC (permalink / raw)
  To: Shally Verma
  Cc: pablo.de.lara.guarch, fiona.trahe, dev, pathreya, mchalla,
	Ashish Gupta, Sunila Sahu

-----Original Message-----
> Date: Tue,  5 Jun 2018 16:05:07 +0530
> From: Shally Verma <shally.verma@caviumnetworks.com>
> To: pablo.de.lara.guarch@intel.com
> CC: fiona.trahe@intel.com, dev@dpdk.org, pathreya@caviumnetworks.com,
>  mchalla@caviumnetworks.com, Ashish Gupta
>  <ashish.gupta@caviumnetworks.com>, Sunila Sahu
>  <sunila.sahu@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v1 1/7] compress/octeontx: add octeontx zip PMD
>  support
> X-Mailer: git-send-email 1.9.1
> 
> Add octeontx zip pmd support in compressdev driver.
> Add device probe and remove support.
> Update makefile to build octeontx zip pmd
> 
> Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
> Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
> ---
>  config/common_base                                 |   6 +
>  drivers/compress/Makefile                          |   2 +-
>  drivers/compress/octeontx/Makefile                 |  33 ++++++
>  drivers/compress/octeontx/meson.build              |  10 ++
>  .../octeontx/rte_pmd_octeontx_compress_version.map |   3 +
>  drivers/compress/octeontx/zip_pmd.c                | 129 +++++++++++++++++++++
>  drivers/compress/octeontx/zipvf.c                  |  48 ++++++++
>  drivers/compress/octeontx/zipvf.h                  |  47 ++++++++
>  usertools/dpdk-devbind.py                          |   9 ++
>  9 files changed, 286 insertions(+), 1 deletion(-)
> 
> diff --git a/config/common_base b/config/common_base
> index 6b0d1cbbb..e56d14b7f 100644
> --- a/config/common_base
> +++ b/config/common_base
> @@ -584,6 +584,12 @@ CONFIG_RTE_COMPRESS_MAX_DEVS=64
>  #
>  CONFIG_RTE_COMPRESSDEV_TEST=n
>  
> +#
> +# Compile PMD for Octeontx ZIPVF compression device
> +#
> +CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF=n

Please enable this option  by default, If there are arm64 specific 
usage then please stub it out so that it can compile on 
all architectures. It will help to verify the API changes
across the architecture by author.(i.e author should not depend arm64
box to verify the compilation changes)

> +CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF_DEBUG=n

This config option is not required when we are using
dynamic debugging.

> +
>  #
>  # Compile PMD for ISA-L compression device
>  #
> diff --git a/drivers/compress/Makefile b/drivers/compress/Makefile
> index 592497f51..62b4e5abe 100644
> --- a/drivers/compress/Makefile
> +++ b/drivers/compress/Makefile
> @@ -4,5 +4,5 @@
>  include $(RTE_SDK)/mk/rte.vars.mk
>  
>  DIRS-$(CONFIG_RTE_LIBRTE_PMD_ISAL) += isal
> -
> +DIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF) += octeontx
>  include $(RTE_SDK)/mk/rte.subdir.mk
> diff --git a/drivers/compress/octeontx/Makefile b/drivers/compress/octeontx/Makefile
> new file mode 100644
> index 000000000..89078f085
> --- /dev/null
> +++ b/drivers/compress/octeontx/Makefile
> @@ -0,0 +1,33 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2017-2018 Cavium Network

We are using the following copyright header across DPDK,
Please use the same schematics new.

example:
Copyright(c) 2017 Cavium, Inc


> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +# library name
> +LIB = librte_pmd_octeontx_zip.a
> +
> +# library version
> +LIBABIVER := 1
> +
> +# build flags
> +CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -O3
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
> +CFLAGS += -I$(RTE_SDK)/drivers/compress/octeontx/include
> +
> +# external library include paths
> +LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
> +LDLIBS += -lrte_compressdev
> +LDLIBS += -lrte_pci -lrte_bus_pci
> +
> +# library source files
> +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF) += zip_pmd.c
> +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF) += zipvf.c
> +
> +# export include files
> +SYMLINK-y-include +=
> +
> +# versioning export map
> +EXPORT_MAP := rte_pmd_octeontx_compress_version.map
> +
> +include $(RTE_SDK)/mk/rte.lib.mk
> diff --git a/drivers/compress/octeontx/meson.build b/drivers/compress/octeontx/meson.build
> new file mode 100644
> index 000000000..cce404337
> --- /dev/null
> +++ b/drivers/compress/octeontx/meson.build
> @@ -0,0 +1,10 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2018 Cavium Networks
> +
> +sources = files('zipvf.c', 'zip_pmd.c')
> +allow_experimental_apis = true
> +includes += include_directories('include')
> +deps += ['mempool_octeontx', 'bus_pci']
> +ext_deps += dep
> +
> +
> diff --git a/drivers/compress/octeontx/rte_pmd_octeontx_compress_version.map b/drivers/compress/octeontx/rte_pmd_octeontx_compress_version.map
> new file mode 100644
> index 000000000..33c1b976f
> --- /dev/null
> +++ b/drivers/compress/octeontx/rte_pmd_octeontx_compress_version.map
> @@ -0,0 +1,3 @@
> +EXPERIMENTAL {
> +	local: *;
> +};
> diff --git a/drivers/compress/octeontx/zip_pmd.c b/drivers/compress/octeontx/zip_pmd.c
> new file mode 100644
> index 000000000..1181bed19
> --- /dev/null
> +++ b/drivers/compress/octeontx/zip_pmd.c
> @@ -0,0 +1,129 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2017-2018 Cavium Networks
> + */
> +
> +#include <string.h>
> +#include <rte_common.h>
> +#include <rte_malloc.h>
> +#include <rte_cpuflags.h>
> +#include <rte_byteorder.h>

Use alphabetical order.

> +#include "zipvf.h"
> +
> +/* global structure to keep driver info */
> +struct zip_pmd_private zip_pmd_priv;

Remove global memory. Use name based memzone infrastructure to
allocate the memory.

> +
> +static int
> +zip_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
> +	struct rte_pci_device *pci_dev)
> +{
> +	int ret = 0;
> +	char compressdev_name[RTE_COMPRESSDEV_NAME_MAX_LEN];
> +	struct rte_compressdev *compressdev;
> +	struct rte_compressdev_pmd_init_params init_params = {
> +		"",
> +		rte_socket_id(),
> +	};
> +
> +	ZIP_PMD_INFO("vendor_id=0x%x device_id=0x%x",
> +			(unsigned int)pci_dev->id.vendor_id,
> +			(unsigned int)pci_dev->id.device_id);
> +
> +	rte_pci_device_name(&pci_dev->addr, compressdev_name,
> +			    sizeof(compressdev_name));
> +
> +	compressdev = rte_compressdev_pmd_create(compressdev_name,
> +		&pci_dev->device, sizeof(struct zip_vf), &init_params);
> +	if (compressdev == NULL) {
> +		ZIP_PMD_ERR("driver %s: create failed", init_params.name);
> +		return -ENODEV;
> +	}
> +
> +	/*
> +	 * create only if proc_type is primary.
> +	 */
> +	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
> +		/*  create vf dev with given pmd dev id */
> +		ret = zipvf_create(compressdev, zip_pmd_priv.num_zipvfs);
> +		if (ret < 0) {
> +			ZIP_PMD_ERR("Device creation failed");
> +			rte_compressdev_pmd_destroy(compressdev);
> +			return ret;
> +		}
> +	}
> +
> +	/* TBD: check if driver global structure to be shared
> +	 * too among processes. if yes, then zip_pmd_priv
> +	 * had to be allocated from shared memzone. Currently
> +	 * it is in global data segment
> +	 */
> +	zip_pmd_priv.zipvf_table[zip_pmd_priv.num_zipvfs] =
> +		compressdev->data->dev_private;
> +	zip_pmd_priv.num_zipvfs++;
> +
> +	compressdev->dev_ops = &octtx_zip_pmd_ops;
> +	/* register rx/tx burst functions for data path */
> +	compressdev->dequeue_burst = zip_pmd_dequeue_burst_sync;
> +	compressdev->enqueue_burst = zip_pmd_enqueue_burst_sync;
> +	compressdev->feature_flags = RTE_COMPDEV_FF_HW_ACCELERATED;
> +	return ret;
> +}
> +
> +static int
> +zip_pci_remove(struct rte_pci_device *pci_dev)
> +{
> +	struct rte_compressdev *compressdev;
> +	char compressdev_name[RTE_COMPRESSDEV_NAME_MAX_LEN];
> +
> +	if (pci_dev == NULL) {
> +		ZIP_PMD_ERR(" Invalid PCI Device\n");
> +		return -EINVAL;
> +	}
> +	rte_pci_device_name(&pci_dev->addr, compressdev_name,
> +			sizeof(compressdev_name));
> +
> +	compressdev = rte_compressdev_pmd_get_named_dev(compressdev_name);
> +	if (compressdev == NULL)
> +		return -ENODEV;
> +
> +	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
> +		if (zipvf_destroy(compressdev) < 0)
> +			return -ENODEV;
> +	}
> +	return rte_compressdev_pmd_destroy(compressdev);
> +}
> +
> +
> +
> +static struct rte_pci_id pci_id_octtx_zipvf_table[] = {
> +	{
> +		RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM,
> +			PCI_DEVICE_ID_OCTEONTX_ZIPVF),
> +	},
> +	{
> +		.device_id = 0
> +	},
> +};
> +
> +/**
> + * Structure that represents a PCI driver
> + */
> +static struct rte_pci_driver octtx_zip_pmd = {
> +	.id_table    = pci_id_octtx_zipvf_table,
> +	.drv_flags   = RTE_PCI_DRV_NEED_MAPPING,
> +	.probe       = zip_pci_probe,
> +	.remove      = zip_pci_remove,
> +};
> +
> +RTE_PMD_REGISTER_PCI(COMPRESSDEV_NAME_ZIP_PMD, octtx_zip_pmd);
> +RTE_PMD_REGISTER_PCI_TABLE(COMPRESSDEV_NAME_ZIP_PMD, pci_id_octtx_zipvf_table);
> +
> +RTE_INIT(octtx_zip_init_log);
> +
> +static void
> +octtx_zip_init_log(void)
> +{
> +	octtx_zip_logtype_driver = rte_log_register("comp_octeontx_zip");
> +	if (octtx_zip_logtype_driver >= 0)
> +		rte_log_set_level(octtx_zip_logtype_driver, RTE_LOG_INFO);
> +}
> +
> +
> +#endif /* _RTE_ZIP_VF_H_ */
> diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py

Addition to usertools/dpdk-devbind.py, please send it as separate patch as
it is an common code change

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 6/7] doc: add octeontx zip PMD documentation
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 6/7] doc: add octeontx zip PMD documentation Shally Verma
@ 2018-06-14 11:22   ` Kovacevic, Marko
  2018-06-19 22:22   ` De Lara Guarch, Pablo
  1 sibling, 0 replies; 25+ messages in thread
From: Kovacevic, Marko @ 2018-06-14 11:22 UTC (permalink / raw)
  To: Shally Verma, De Lara Guarch, Pablo
  Cc: Trahe, Fiona, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu

Acked-by: Marko Kovacevic <marko.kovacevic@intel.com>

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 3/7] compress/octeontx: add xform and stream create support
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 3/7] compress/octeontx: add xform and stream create support Shally Verma
@ 2018-06-19 22:13   ` De Lara Guarch, Pablo
  2018-06-20  6:12     ` Verma, Shally
  0 siblings, 1 reply; 25+ messages in thread
From: De Lara Guarch, Pablo @ 2018-06-19 22:13 UTC (permalink / raw)
  To: Shally Verma
  Cc: Trahe, Fiona, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu



> -----Original Message-----
> From: Shally Verma [mailto:shally.verma@caviumnetworks.com]
> Sent: Tuesday, June 5, 2018 11:35 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org;
> pathreya@caviumnetworks.com; mchalla@caviumnetworks.com; Ashish Gupta
> <ashish.gupta@caviumnetworks.com>; Sunila Sahu
> <sunila.sahu@caviumnetworks.com>
> Subject: [PATCH v1 3/7] compress/octeontx: add xform and stream create
> support
> 
> implement private xform and stream create ops
> 
> Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
> Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
> ---
>  drivers/compress/octeontx/zip_pmd.c | 138
> ++++++++++++++++++++++++++++++++++++
>  drivers/compress/octeontx/zipvf.h   |  29 ++++++++
>  2 files changed, 167 insertions(+)
> 
> diff --git a/drivers/compress/octeontx/zip_pmd.c
> b/drivers/compress/octeontx/zip_pmd.c
> index 3bb7f6896..349114626 100644
> --- a/drivers/compress/octeontx/zip_pmd.c
> +++ b/drivers/compress/octeontx/zip_pmd.c

...

> +static int
> +zip_pmd_stream_create(struct rte_compressdev *dev,
> +		const struct rte_comp_xform *xform, void **stream) {
> +	int ret;
> +	struct zip_stream *strm;
> +
> +	strm = rte_malloc(NULL,
> +			sizeof(struct zip_stream), 0);

Should not this come from a mempool, as there is an option
in the configuration for max number of sessions.


> +	ret = zip_set_stream_parameters(dev, xform, strm);
> +	if (ret < 0) {
> +		ZIP_PMD_ERR("failed configure xform parameters");
> +		rte_free(strm);
> +		return ret;
> +	}
> +	*stream = strm;		
> +	return 0;
> +}
> +
> +static int
> +zip_pmd_stream_free(struct rte_compressdev *dev, void *stream) {
> +	struct zip_vf *vf = (struct zip_vf *) (dev->data->dev_private);
> +	struct zip_stream *z_stream;
> +
> +	if (stream == NULL)
> +		return -1;
> +
> +	z_stream = (struct zip_stream *)stream;
> +	rte_mempool_put_bulk(vf->zip_mp,
> +			     (void *)&(z_stream->bufs[0]),
> +			     MAX_BUFS_PER_STREAM);
> +
> +	/* Zero out the whole structure */
> +	memset(stream, 0, sizeof(struct zip_stream));
> +	rte_free(stream);

I was expecting this stream to be put back into a mempool,
but anyway, there is no need to reset this structure if you are freeing the memory then.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/7] compress/octeontx: add octeontx zip PMD support
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 1/7] compress/octeontx: add octeontx zip PMD support Shally Verma
  2018-06-10 10:38   ` Jerin Jacob
@ 2018-06-19 22:15   ` De Lara Guarch, Pablo
  1 sibling, 0 replies; 25+ messages in thread
From: De Lara Guarch, Pablo @ 2018-06-19 22:15 UTC (permalink / raw)
  To: Shally Verma
  Cc: Trahe, Fiona, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu



> -----Original Message-----
> From: Shally Verma [mailto:shally.verma@caviumnetworks.com]
> Sent: Tuesday, June 5, 2018 11:35 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org;
> pathreya@caviumnetworks.com; mchalla@caviumnetworks.com; Ashish Gupta
> <ashish.gupta@caviumnetworks.com>; Sunila Sahu
> <sunila.sahu@caviumnetworks.com>
> Subject: [PATCH v1 1/7] compress/octeontx: add octeontx zip PMD support
> 
> Add octeontx zip pmd support in compressdev driver.
> Add device probe and remove support.
> Update makefile to build octeontx zip pmd

Don't forget to update the MAINTAINERS file.
Also, there are some compilation errors in the the next patches,
when enabling the PMD since the beginning. This should be fixed.

> 
> Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
> Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
> ---
>  config/common_base                                 |   6 +
>  drivers/compress/Makefile                          |   2 +-
>  drivers/compress/octeontx/Makefile                 |  33 ++++++
>  drivers/compress/octeontx/meson.build              |  10 ++
>  .../octeontx/rte_pmd_octeontx_compress_version.map |   3 +
>  drivers/compress/octeontx/zip_pmd.c                | 129 +++++++++++++++++++++
>  drivers/compress/octeontx/zipvf.c                  |  48 ++++++++
>  drivers/compress/octeontx/zipvf.h                  |  47 ++++++++
>  usertools/dpdk-devbind.py                          |   9 ++
>  9 files changed, 286 insertions(+), 1 deletion(-)
> 
> diff --git a/config/common_base b/config/common_base index
> 6b0d1cbbb..e56d14b7f 100644
> --- a/config/common_base
> +++ b/config/common_base
> @@ -584,6 +584,12 @@ CONFIG_RTE_COMPRESS_MAX_DEVS=64  #
> CONFIG_RTE_COMPRESSDEV_TEST=n
> 
> +#
> +# Compile PMD for Octeontx ZIPVF compression device #
> +CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF=n
> +CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF_DEBUG=n

As Jerin said, the PMD can be enabled by default, right?
As far as I know, this PMD has no external dependencies.
Also, the DEBUG flag can be removed.

> +
>  #
>  # Compile PMD for ISA-L compression device  # diff --git
> a/drivers/compress/Makefile b/drivers/compress/Makefile index
> 592497f51..62b4e5abe 100644
> --- a/drivers/compress/Makefile
> +++ b/drivers/compress/Makefile
> @@ -4,5 +4,5 @@
>  include $(RTE_SDK)/mk/rte.vars.mk
> 
>  DIRS-$(CONFIG_RTE_LIBRTE_PMD_ISAL) += isal
> -
> +DIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF) += octeontx

Add this without removing the blank line.

>  include $(RTE_SDK)/mk/rte.subdir.mk
> diff --git a/drivers/compress/octeontx/Makefile
> b/drivers/compress/octeontx/Makefile
> new file mode 100644
> index 000000000..89078f085
> --- /dev/null
> +++ b/drivers/compress/octeontx/Makefile
> @@ -0,0 +1,33 @@
> +# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2017-2018 Cavium
> +Networks
> +
> +include $(RTE_SDK)/mk/rte.vars.mk
> +
> +# library name
> +LIB = librte_pmd_octeontx_zip.a
> +
> +# library version
> +LIBABIVER := 1
> +
> +# build flags
> +CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -O3
> +CFLAGS += -DALLOW_EXPERIMENTAL_API
> +CFLAGS += -I$(RTE_SDK)/drivers/compress/octeontx/include

Is this include necessary?
Also, there is not /include in this patch.

> +
> +# external library include paths
> +LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS +=
> +-lrte_compressdev LDLIBS += -lrte_pci -lrte_bus_pci
> +
> +# library source files
> +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF) += zip_pmd.c
> +SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF) += zipvf.c
> +
> +# export include files
> +SYMLINK-y-include +=
> +
> +# versioning export map
> +EXPORT_MAP := rte_pmd_octeontx_compress_version.map
> +
> +include $(RTE_SDK)/mk/rte.lib.mk
> diff --git a/drivers/compress/octeontx/meson.build
> b/drivers/compress/octeontx/meson.build
> new file mode 100644
> index 000000000..cce404337
> --- /dev/null
> +++ b/drivers/compress/octeontx/meson.build
> @@ -0,0 +1,10 @@
> +# SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Cavium
> +Networks
> +
> +sources = files('zipvf.c', 'zip_pmd.c') allow_experimental_apis = true
> +includes += include_directories('include') deps += ['mempool_octeontx',
> +'bus_pci'] ext_deps += dep
> +
> +
> diff --git
> a/drivers/compress/octeontx/rte_pmd_octeontx_compress_version.map
> b/drivers/compress/octeontx/rte_pmd_octeontx_compress_version.map
> new file mode 100644
> index 000000000..33c1b976f
> --- /dev/null
> +++ b/drivers/compress/octeontx/rte_pmd_octeontx_compress_version.map
> @@ -0,0 +1,3 @@
> +EXPERIMENTAL {
> +	local: *;
> +};

I think this can be 18.08, as there is no API, so we won't need to
modify this once the compression API turns stable.

> diff --git a/drivers/compress/octeontx/zip_pmd.c
> b/drivers/compress/octeontx/zip_pmd.c
> new file mode 100644
> index 000000000..1181bed19
> --- /dev/null
> +++ b/drivers/compress/octeontx/zip_pmd.c

...

> +++ b/drivers/compress/octeontx/zipvf.c
> @@ -0,0 +1,48 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright(c) 2017-2018 Cavium Networks  */
> +
> +#include "zipvf.h"
> +
> +int zipvf_create(struct rte_compressdev *compressdev, int vfid) {

Return type should be in the line before the function name.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 2/7] compress/octeontx: add device setup PMD ops
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 2/7] compress/octeontx: add device setup PMD ops Shally Verma
@ 2018-06-19 22:15   ` De Lara Guarch, Pablo
  2018-06-20  6:04     ` Verma, Shally
  0 siblings, 1 reply; 25+ messages in thread
From: De Lara Guarch, Pablo @ 2018-06-19 22:15 UTC (permalink / raw)
  To: Shally Verma
  Cc: Trahe, Fiona, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu



> -----Original Message-----
> From: Shally Verma [mailto:shally.verma@caviumnetworks.com]
> Sent: Tuesday, June 5, 2018 11:35 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org;
> pathreya@caviumnetworks.com; mchalla@caviumnetworks.com; Ashish Gupta
> <ashish.gupta@caviumnetworks.com>; Sunila Sahu
> <sunila.sahu@caviumnetworks.com>
> Subject: [PATCH v1 2/7] compress/octeontx: add device setup PMD ops
> 
> implement device configure and PMD ops.
> setup stream resource memory pool
> setup and enable hardware queue
> 
> Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
> Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
> ---
>  drivers/compress/octeontx/include/zip_regs.h | 721
> +++++++++++++++++++++++++++
>  drivers/compress/octeontx/zip_pmd.c          | 269 ++++++++++
>  drivers/compress/octeontx/zipvf.c            |  81 +++
>  drivers/compress/octeontx/zipvf.h            | 103 ++++
>  4 files changed, 1174 insertions(+)

..

> diff --git a/drivers/compress/octeontx/zip_pmd.c
> b/drivers/compress/octeontx/zip_pmd.c
> index 1181bed19..3bb7f6896 100644
> --- a/drivers/compress/octeontx/zip_pmd.c
> +++ b/drivers/compress/octeontx/zip_pmd.c
...

> +
> +/** Start device */
> +static int
> +zip_pmd_start(struct rte_compressdev *dev) {
> +	if (dev == NULL)
> +		return -1;
> +	return 0;
> +}

Dev cannot be NULL at this stage, so no need to have this check.

> +
> +/** Stop device */
> +static void
> +zip_pmd_stop(__rte_unused struct rte_compressdev *dev) {
> +
> +}
> +
> +/** Close device */
> +static int
> +zip_pmd_close(struct rte_compressdev *dev) {
> +	if (dev == NULL)
> +		return -1;

Same as above.

> +
> +	struct zip_vf *vf = (struct zip_vf *)dev->data->dev_private;
> +
> +	for (int i = 0; dev->data->nb_queue_pairs; i++) {
> +		if (dev->data->queue_pairs[i] != NULL)
> +		/* qp not released, return error */
> +		return -1;

All queue pairs should be released at this point, so not sure this check is required.
If it is, don't forget the indentation.

> +	}
> +
> +	rte_mempool_free(vf->zip_mp);
> +	return 0;
> +}
> +
> 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 4/7] compress/octeontx: add ops enq deq apis
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 4/7] compress/octeontx: add ops enq deq apis Shally Verma
@ 2018-06-19 22:18   ` De Lara Guarch, Pablo
  2018-06-29  7:42     ` Verma, Shally
  0 siblings, 1 reply; 25+ messages in thread
From: De Lara Guarch, Pablo @ 2018-06-19 22:18 UTC (permalink / raw)
  To: Shally Verma
  Cc: Trahe, Fiona, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu



> -----Original Message-----
> From: Shally Verma [mailto:shally.verma@caviumnetworks.com]
> Sent: Tuesday, June 5, 2018 11:35 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org;
> pathreya@caviumnetworks.com; mchalla@caviumnetworks.com; Ashish Gupta
> <ashish.gupta@caviumnetworks.com>; Sunila Sahu
> <sunila.sahu@caviumnetworks.com>
> Subject: [PATCH v1 4/7] compress/octeontx: add ops enq deq apis
> 
> implement enqueue and dequeue apis
> 
> Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
> Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>

...

> --- a/drivers/compress/octeontx/zipvf.h
> +++ b/drivers/compress/octeontx/zipvf.h

...

> +static inline int
> +zipvf_prepare_out_buf(struct zip_stream *zstrm, struct rte_comp_op *op)
> +{
> +	uint32_t offset;
> +	union zip_zptr_s *sg_list = NULL;
> +	struct rte_mbuf *m_dst;
> +	union zip_inst_s *inst = zstrm->inst;
> +	rte_iova_t iova;
> +
> +	offset = op->src.offset;
> +	m_dst = op->m_dst;
> +
> +	if (m_dst->nb_segs == 1) {
> +		/* Prepare direct input data pointer */
> +		inst->s.ds = 0;
> +		inst->s.out_ptr_addr.s.addr =
> +			rte_pktmbuf_iova_offset(m_dst, offset);
> +		inst->s.totaloutputlength = rte_pktmbuf_data_len(m_dst) -
> +					    op->dst.offset;
> +		inst->s.out_ptr_ctl.s.length = inst->s.totaloutputlength;
> +		return 0;
> +	}
> +
> +	ZIP_PMD_ERR("output packet is segmented\n");
> +
> +	/* Packet is segmented, create gather buffer */
> +	inst->s.ds = 1;
> +	iova = rte_mempool_virt2iova(zstrm->bufs[OUT_DATA_BUF]);
> +	if (iova & 0xF) {
> +		/* Align it to 16 Byte address */
> +		iova = ZIP_ALIGN_ROUNDUP(iova, ZIP_SGPTR_ALIGN);
> +	}
> +
> +	inst->s.out_ptr_addr.s.addr = iova;
> +	inst->s.inp_ptr_ctl.s.length = (m_dst->nb_segs < MAX_SG_LEN) ?
> +					(m_dst->nb_segs) : MAX_SG_LEN;
> +
> +	sg_list = (union zip_zptr_s *)iova;

There is a compilation issue on gcc 32 bits:

drivers/compress/octeontx/zipvf.h:260:12: error:
cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  sg_list = (union zip_zptr_s *)iova;

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 5/7] test: add octeontx zip PMD for compressdev tests
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 5/7] test: add octeontx zip PMD for compressdev tests Shally Verma
@ 2018-06-19 22:18   ` De Lara Guarch, Pablo
  2018-06-20  6:03     ` Verma, Shally
  0 siblings, 1 reply; 25+ messages in thread
From: De Lara Guarch, Pablo @ 2018-06-19 22:18 UTC (permalink / raw)
  To: Shally Verma
  Cc: Trahe, Fiona, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu



> -----Original Message-----
> From: Shally Verma [mailto:shally.verma@caviumnetworks.com]
> Sent: Tuesday, June 5, 2018 11:35 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org;
> pathreya@caviumnetworks.com; mchalla@caviumnetworks.com; Ashish Gupta
> <ashish.gupta@caviumnetworks.com>; Sunila Sahu
> <sunila.sahu@caviumnetworks.com>
> Subject: [PATCH v1 5/7] test: add octeontx zip PMD for compressdev tests
> 
> link zlib pmd library in app.mk
> 
> Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
> Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>

You can add this directly in the first patch.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 6/7] doc: add octeontx zip PMD documentation
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 6/7] doc: add octeontx zip PMD documentation Shally Verma
  2018-06-14 11:22   ` Kovacevic, Marko
@ 2018-06-19 22:22   ` De Lara Guarch, Pablo
  1 sibling, 0 replies; 25+ messages in thread
From: De Lara Guarch, Pablo @ 2018-06-19 22:22 UTC (permalink / raw)
  To: Shally Verma
  Cc: Trahe, Fiona, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu



> -----Original Message-----
> From: Shally Verma [mailto:shally.verma@caviumnetworks.com]
> Sent: Tuesday, June 5, 2018 11:35 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org;
> pathreya@caviumnetworks.com; mchalla@caviumnetworks.com; Ashish Gupta
> <ashish.gupta@caviumnetworks.com>; Sunila Sahu
> <sunila.sahu@caviumnetworks.com>
> Subject: [PATCH v1 6/7] doc: add octeontx zip PMD documentation

You can retitle this to doc: add Octeonx zip guide

> 
> add zip pmd feature specification and overview documentation
> 
> Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
> Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
> ---
>  doc/guides/compressdevs/features/octeontx.ini |  22 +++++
>  doc/guides/compressdevs/index.rst             |   1 +
>  doc/guides/compressdevs/octeontx.rst          | 116
> ++++++++++++++++++++++++++
>  3 files changed, 139 insertions(+)
> 
> diff --git a/doc/guides/compressdevs/features/octeontx.ini
> b/doc/guides/compressdevs/features/octeontx.ini
> new file mode 100644
> index 000000000..224bcb8bb
> --- /dev/null
> +++ b/doc/guides/compressdevs/features/octeontx.ini
> @@ -0,0 +1,22 @@
> +;
> +; Refer to default.ini for the full list of available PMD features.
> +;
> +; Supported features of 'OCTEONTX ZIP' compression driver.
> +;
> +[Features]
> +HW Accelerated = Y
> +CPU SSE        =
> +CPU AVX        =
> +CPU AVX2       =
> +CPU AVX512     =
> +CPU NEON       =
> +Stateful       =
> +By-Pass        =
> +Chained mbufs  =

In the capabilities structure, sgl and checksum are supported, so there is an incompatibility here.

> +Deflate        = Y
> +LZS            =
> +Adler32        =
> +Crc32          =
> +Adler32&Crc32  =
> +Fixed          = Y
> +Dynamic        = Y
> diff --git a/doc/guides/compressdevs/index.rst
> b/doc/guides/compressdevs/index.rst
> index bc59ce810..cb467ab90 100644
> --- a/doc/guides/compressdevs/index.rst
> +++ b/doc/guides/compressdevs/index.rst
> @@ -11,3 +11,4 @@ Compression Device Drivers
> 
>      overview
>      isal
> +    octeontx
> diff --git a/doc/guides/compressdevs/octeontx.rst
> b/doc/guides/compressdevs/octeontx.rst
> new file mode 100644
> index 000000000..6ad5e31ce
> --- /dev/null
> +++ b/doc/guides/compressdevs/octeontx.rst

...

> +
> +Limitations
> +-----------
> +
> +* Chained mbufs are not supported.

Inconsistent with capabilities.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 7/7] drivers/compress: add meson.build support
  2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 7/7] drivers/compress: add meson.build support Shally Verma
@ 2018-06-19 22:30   ` De Lara Guarch, Pablo
  2018-06-20  6:02     ` Verma, Shally
  0 siblings, 1 reply; 25+ messages in thread
From: De Lara Guarch, Pablo @ 2018-06-19 22:30 UTC (permalink / raw)
  To: Shally Verma
  Cc: Trahe, Fiona, dev, pathreya, mchalla, Ashish Gupta, Sunila Sahu



> -----Original Message-----
> From: Shally Verma [mailto:shally.verma@caviumnetworks.com]
> Sent: Tuesday, June 5, 2018 11:35 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org;
> pathreya@caviumnetworks.com; mchalla@caviumnetworks.com; Ashish Gupta
> <ashish.gupta@caviumnetworks.com>; Sunila Sahu
> <sunila.sahu@caviumnetworks.com>
> Subject: [PATCH v1 7/7] drivers/compress: add meson.build support
> 
> Add octeontx in drivers/compress/meson.build.

This should be added in patch 1.

> 
> Also change the config and drv format flags to append _compress to use
> compression specific format for global filenames. This also require change in
> compression PMDs to rename their version.map files as rte_pmd_<pmd
> name>_compress.map ex. Isal should rename as
> rte_pmd_isal_compress_version.map.
> 
> Currently the drivers/compress/meson.build use the generic config names with
> no compress specific specifier. This breaks meson build when vendor uses same
> name for different PMDs, where all belongs to same platform.
> Ex. drivers/net/octeontx, drivers/event/octeontx, drivers/compress/octeontx
> where, net, event and compress carry PMD for eth, event and compression
> devices for Octeontx platform. Thus, differentiate globally used files using
> module specific specifier ex. rte_pmd_octeontx_compress_version.map
> and rte_pmd_octeontx_event_version.map

I think instead of forcing all the PMDs to use that suffix, if there are drivers with the same PMD,
they can add the "compres" suffix, without imposing it to others.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 7/7] drivers/compress: add meson.build support
  2018-06-19 22:30   ` De Lara Guarch, Pablo
@ 2018-06-20  6:02     ` Verma, Shally
  2018-06-20  7:25       ` De Lara Guarch, Pablo
  0 siblings, 1 reply; 25+ messages in thread
From: Verma, Shally @ 2018-06-20  6:02 UTC (permalink / raw)
  To: De Lara Guarch, Pablo
  Cc: Trahe, Fiona, dev, Athreya, Narayana Prasad, Challa, Mahipal,
	Gupta, Ashish, Sahu, Sunila



>-----Original Message-----
>From: De Lara Guarch, Pablo [mailto:pablo.de.lara.guarch@intel.com]
>Sent: 20 June 2018 04:00
>To: Verma, Shally <Shally.Verma@cavium.com>
>Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org; Athreya, Narayana Prasad <NarayanaPrasad.Athreya@cavium.com>;
>Challa, Mahipal <Mahipal.Challa@cavium.com>; Gupta, Ashish <Ashish.Gupta@cavium.com>; Sahu, Sunila
><Sunila.Sahu@cavium.com>
>Subject: RE: [PATCH v1 7/7] drivers/compress: add meson.build support
>
>External Email
>
>> -----Original Message-----
>> From: Shally Verma [mailto:shally.verma@caviumnetworks.com]
>> Sent: Tuesday, June 5, 2018 11:35 AM
>> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
>> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org;
>> pathreya@caviumnetworks.com; mchalla@caviumnetworks.com; Ashish Gupta
>> <ashish.gupta@caviumnetworks.com>; Sunila Sahu
>> <sunila.sahu@caviumnetworks.com>
>> Subject: [PATCH v1 7/7] drivers/compress: add meson.build support
>>
>> Add octeontx in drivers/compress/meson.build.
>
>This should be added in patch 1.
>
>>
>> Also change the config and drv format flags to append _compress to use
>> compression specific format for global filenames. This also require change in
>> compression PMDs to rename their version.map files as rte_pmd_<pmd
>> name>_compress.map ex. Isal should rename as
>> rte_pmd_isal_compress_version.map.
>>
>> Currently the drivers/compress/meson.build use the generic config names with
>> no compress specific specifier. This breaks meson build when vendor uses same
>> name for different PMDs, where all belongs to same platform.
>> Ex. drivers/net/octeontx, drivers/event/octeontx, drivers/compress/octeontx
>> where, net, event and compress carry PMD for eth, event and compression
>> devices for Octeontx platform. Thus, differentiate globally used files using
>> module specific specifier ex. rte_pmd_octeontx_compress_version.map
>> and rte_pmd_octeontx_event_version.map
>
>I think instead of forcing all the PMDs to use that suffix, if there are drivers with the same PMD,
>they can add the "compres" suffix, without imposing it to others.
>
[Shally] Meson build force us to use then directory name as octeontx_compress where as we want to keep it as compress/octeontx (on the similar lines of net/octeontx, event/octeontx). Also its already under compress, so having it as compress/octeontx_compress looks unnecessary,

Thanks
Shally

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 5/7] test: add octeontx zip PMD for compressdev tests
  2018-06-19 22:18   ` De Lara Guarch, Pablo
@ 2018-06-20  6:03     ` Verma, Shally
  0 siblings, 0 replies; 25+ messages in thread
From: Verma, Shally @ 2018-06-20  6:03 UTC (permalink / raw)
  To: De Lara Guarch, Pablo
  Cc: Trahe, Fiona, dev, Athreya, Narayana Prasad, Challa, Mahipal,
	Gupta, Ashish, Sahu, Sunila



>-----Original Message-----
>From: De Lara Guarch, Pablo [mailto:pablo.de.lara.guarch@intel.com]
>Sent: 20 June 2018 03:49
>To: Verma, Shally <Shally.Verma@cavium.com>
>Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org; Athreya, Narayana Prasad <NarayanaPrasad.Athreya@cavium.com>;
>Challa, Mahipal <Mahipal.Challa@cavium.com>; Gupta, Ashish <Ashish.Gupta@cavium.com>; Sahu, Sunila
><Sunila.Sahu@cavium.com>
>Subject: RE: [PATCH v1 5/7] test: add octeontx zip PMD for compressdev tests
>
>External Email
>
>> -----Original Message-----
>> From: Shally Verma [mailto:shally.verma@caviumnetworks.com]
>> Sent: Tuesday, June 5, 2018 11:35 AM
>> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
>> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org;
>> pathreya@caviumnetworks.com; mchalla@caviumnetworks.com; Ashish Gupta
>> <ashish.gupta@caviumnetworks.com>; Sunila Sahu
>> <sunila.sahu@caviumnetworks.com>
>> Subject: [PATCH v1 5/7] test: add octeontx zip PMD for compressdev tests
>>
>> link zlib pmd library in app.mk
>>
>> Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
>> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
>> Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
>
>You can add this directly in the first patch.
Acked.

Shally

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 2/7] compress/octeontx: add device setup PMD ops
  2018-06-19 22:15   ` De Lara Guarch, Pablo
@ 2018-06-20  6:04     ` Verma, Shally
  0 siblings, 0 replies; 25+ messages in thread
From: Verma, Shally @ 2018-06-20  6:04 UTC (permalink / raw)
  To: De Lara Guarch, Pablo
  Cc: Trahe, Fiona, dev, Athreya, Narayana Prasad, Challa, Mahipal,
	Gupta, Ashish, Sahu, Sunila



>-----Original Message-----
>From: De Lara Guarch, Pablo [mailto:pablo.de.lara.guarch@intel.com]
>Sent: 20 June 2018 03:45
>To: Verma, Shally <Shally.Verma@cavium.com>
>Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org; Athreya, Narayana Prasad <NarayanaPrasad.Athreya@cavium.com>;
>Challa, Mahipal <Mahipal.Challa@cavium.com>; Gupta, Ashish <Ashish.Gupta@cavium.com>; Sahu, Sunila
><Sunila.Sahu@cavium.com>
>Subject: RE: [PATCH v1 2/7] compress/octeontx: add device setup PMD ops
>
>External Email
>
>> -----Original Message-----
>> From: Shally Verma [mailto:shally.verma@caviumnetworks.com]
>> Sent: Tuesday, June 5, 2018 11:35 AM
>> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
>> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org;
>> pathreya@caviumnetworks.com; mchalla@caviumnetworks.com; Ashish Gupta
>> <ashish.gupta@caviumnetworks.com>; Sunila Sahu
>> <sunila.sahu@caviumnetworks.com>
>> Subject: [PATCH v1 2/7] compress/octeontx: add device setup PMD ops
>>
>> implement device configure and PMD ops.
>> setup stream resource memory pool
>> setup and enable hardware queue
>>
>> Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
>> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
>> Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
>> ---
>>  drivers/compress/octeontx/include/zip_regs.h | 721
>> +++++++++++++++++++++++++++
>>  drivers/compress/octeontx/zip_pmd.c          | 269 ++++++++++
>>  drivers/compress/octeontx/zipvf.c            |  81 +++
>>  drivers/compress/octeontx/zipvf.h            | 103 ++++
>>  4 files changed, 1174 insertions(+)
>
>..
>
>> diff --git a/drivers/compress/octeontx/zip_pmd.c
>> b/drivers/compress/octeontx/zip_pmd.c
>> index 1181bed19..3bb7f6896 100644
>> --- a/drivers/compress/octeontx/zip_pmd.c
>> +++ b/drivers/compress/octeontx/zip_pmd.c
>...
>
>> +
>> +/** Start device */
>> +static int
>> +zip_pmd_start(struct rte_compressdev *dev) {
>> +     if (dev == NULL)
>> +             return -1;
>> +     return 0;
>> +}
>
>Dev cannot be NULL at this stage, so no need to have this check.
>
>> +
>> +/** Stop device */
>> +static void
>> +zip_pmd_stop(__rte_unused struct rte_compressdev *dev) {
>> +
>> +}
>> +
>> +/** Close device */
>> +static int
>> +zip_pmd_close(struct rte_compressdev *dev) {
>> +     if (dev == NULL)
>> +             return -1;
>
>Same as above.
>
>> +
>> +     struct zip_vf *vf = (struct zip_vf *)dev->data->dev_private;
>> +
>> +     for (int i = 0; dev->data->nb_queue_pairs; i++) {
>> +             if (dev->data->queue_pairs[i] != NULL)
>> +             /* qp not released, return error */
>> +             return -1;
>
>All queue pairs should be released at this point, so not sure this check is required.
>If it is, don't forget the indentation.
>
[Shally] Ack to all. 

Thanks for review.
Shally
>> +     }
>> +
>> +     rte_mempool_free(vf->zip_mp);
>> +     return 0;
>> +}
>> +
>>

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 3/7] compress/octeontx: add xform and stream create support
  2018-06-19 22:13   ` De Lara Guarch, Pablo
@ 2018-06-20  6:12     ` Verma, Shally
  0 siblings, 0 replies; 25+ messages in thread
From: Verma, Shally @ 2018-06-20  6:12 UTC (permalink / raw)
  To: De Lara Guarch, Pablo
  Cc: Trahe, Fiona, dev, Athreya, Narayana Prasad, Challa, Mahipal,
	Gupta, Ashish, Sahu, Sunila



>-----Original Message-----
>From: De Lara Guarch, Pablo [mailto:pablo.de.lara.guarch@intel.com]
>Sent: 20 June 2018 03:43
>To: Verma, Shally <Shally.Verma@cavium.com>
>Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org; Athreya, Narayana Prasad <NarayanaPrasad.Athreya@cavium.com>;
>Challa, Mahipal <Mahipal.Challa@cavium.com>; Gupta, Ashish <Ashish.Gupta@cavium.com>; Sahu, Sunila
><Sunila.Sahu@cavium.com>
>Subject: RE: [PATCH v1 3/7] compress/octeontx: add xform and stream create support
>
>External Email
>
>> -----Original Message-----
>> From: Shally Verma [mailto:shally.verma@caviumnetworks.com]
>> Sent: Tuesday, June 5, 2018 11:35 AM
>> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
>> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org;
>> pathreya@caviumnetworks.com; mchalla@caviumnetworks.com; Ashish Gupta
>> <ashish.gupta@caviumnetworks.com>; Sunila Sahu
>> <sunila.sahu@caviumnetworks.com>
>> Subject: [PATCH v1 3/7] compress/octeontx: add xform and stream create
>> support
>>
>> implement private xform and stream create ops
>>
>> Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
>> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
>> Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
>> ---
>>  drivers/compress/octeontx/zip_pmd.c | 138
>> ++++++++++++++++++++++++++++++++++++
>>  drivers/compress/octeontx/zipvf.h   |  29 ++++++++
>>  2 files changed, 167 insertions(+)
>>
>> diff --git a/drivers/compress/octeontx/zip_pmd.c
>> b/drivers/compress/octeontx/zip_pmd.c
>> index 3bb7f6896..349114626 100644
>> --- a/drivers/compress/octeontx/zip_pmd.c
>> +++ b/drivers/compress/octeontx/zip_pmd.c
>
>...
>
>> +static int
>> +zip_pmd_stream_create(struct rte_compressdev *dev,
>> +             const struct rte_comp_xform *xform, void **stream) {
>> +     int ret;
>> +     struct zip_stream *strm;
>> +
>> +     strm = rte_malloc(NULL,
>> +                     sizeof(struct zip_stream), 0);
>
>Should not this come from a mempool, as there is an option
>in the configuration for max number of sessions.
>
[Shally] We're using mempool for per-stream resources but not specifically for stream struct itself.
We, though, had thought about approach too but it turns out to be more feasible to keep it this way for now.
>
>> +     ret = zip_set_stream_parameters(dev, xform, strm);
>> +     if (ret < 0) {
>> +             ZIP_PMD_ERR("failed configure xform parameters");
>> +             rte_free(strm);
>> +             return ret;
>> +     }
>> +     *stream = strm;
>> +     return 0;
>> +}
>> +
>> +static int
>> +zip_pmd_stream_free(struct rte_compressdev *dev, void *stream) {
>> +     struct zip_vf *vf = (struct zip_vf *) (dev->data->dev_private);
>> +     struct zip_stream *z_stream;
>> +
>> +     if (stream == NULL)
>> +             return -1;
>> +
>> +     z_stream = (struct zip_stream *)stream;
>> +     rte_mempool_put_bulk(vf->zip_mp,
>> +                          (void *)&(z_stream->bufs[0]),
>> +                          MAX_BUFS_PER_STREAM);
>> +
>> +     /* Zero out the whole structure */
>> +     memset(stream, 0, sizeof(struct zip_stream));
>> +     rte_free(stream);
>
>I was expecting this stream to be put back into a mempool,
>but anyway, there is no need to reset this structure if you are freeing the memory then.
>
Thanks for review.
Shally

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/7] compress/octeontx: add octeontx zip PMD support
  2018-06-10 10:38   ` Jerin Jacob
@ 2018-06-20  6:32     ` Verma, Shally
  0 siblings, 0 replies; 25+ messages in thread
From: Verma, Shally @ 2018-06-20  6:32 UTC (permalink / raw)
  To: Jacob,  Jerin
  Cc: pablo.de.lara.guarch, fiona.trahe, dev, Athreya, Narayana Prasad,
	Challa, Mahipal, Gupta, Ashish, Sahu, Sunila

Hi Jerin

>-----Original Message-----
>From: Jacob, Jerin
>Sent: 10 June 2018 16:09
>To: Verma, Shally <Shally.Verma@cavium.com>
>Cc: pablo.de.lara.guarch@intel.com; fiona.trahe@intel.com; dev@dpdk.org; Athreya, Narayana Prasad
><NarayanaPrasad.Athreya@cavium.com>; Challa, Mahipal <Mahipal.Challa@cavium.com>; Gupta, Ashish
><Ashish.Gupta@cavium.com>; Sahu, Sunila <Sunila.Sahu@cavium.com>
>Subject: Re: [dpdk-dev] [PATCH v1 1/7] compress/octeontx: add octeontx zip PMD support
>
>-----Original Message-----
>> Date: Tue,  5 Jun 2018 16:05:07 +0530
>> From: Shally Verma <shally.verma@caviumnetworks.com>
>> To: pablo.de.lara.guarch@intel.com
>> CC: fiona.trahe@intel.com, dev@dpdk.org, pathreya@caviumnetworks.com,
>>  mchalla@caviumnetworks.com, Ashish Gupta
>>  <ashish.gupta@caviumnetworks.com>, Sunila Sahu
>>  <sunila.sahu@caviumnetworks.com>
>> Subject: [dpdk-dev] [PATCH v1 1/7] compress/octeontx: add octeontx zip PMD
>>  support
>> X-Mailer: git-send-email 1.9.1
>>
>> Add octeontx zip pmd support in compressdev driver.
>> Add device probe and remove support.
>> Update makefile to build octeontx zip pmd
>>
>> Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
>> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
>> Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
>> ---
>>  config/common_base                                 |   6 +
>>  drivers/compress/Makefile                          |   2 +-
>>  drivers/compress/octeontx/Makefile                 |  33 ++++++
>>  drivers/compress/octeontx/meson.build              |  10 ++
>>  .../octeontx/rte_pmd_octeontx_compress_version.map |   3 +
>>  drivers/compress/octeontx/zip_pmd.c                | 129 +++++++++++++++++++++
>>  drivers/compress/octeontx/zipvf.c                  |  48 ++++++++
>>  drivers/compress/octeontx/zipvf.h                  |  47 ++++++++
>>  usertools/dpdk-devbind.py                          |   9 ++
>>  9 files changed, 286 insertions(+), 1 deletion(-)
>>
>> diff --git a/config/common_base b/config/common_base
>> index 6b0d1cbbb..e56d14b7f 100644
>> --- a/config/common_base
>> +++ b/config/common_base
>> @@ -584,6 +584,12 @@ CONFIG_RTE_COMPRESS_MAX_DEVS=64
>>  #
>>  CONFIG_RTE_COMPRESSDEV_TEST=n
>>
>> +#
>> +# Compile PMD for Octeontx ZIPVF compression device
>> +#
>> +CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF=n
>
>Please enable this option  by default, If there are arm64 specific
>usage then please stub it out so that it can compile on
>all architectures. It will help to verify the API changes
>across the architecture by author.(i.e author should not depend arm64
>box to verify the compilation changes)
>
[Shally] Ok. Will propose this change in next patch

>> +CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF_DEBUG=n
>
>This config option is not required when we are using
>dynamic debugging.

[Shally] Ack

>
>> +
>>  #
>>  # Compile PMD for ISA-L compression device
>>  #
>> diff --git a/drivers/compress/Makefile b/drivers/compress/Makefile
>> index 592497f51..62b4e5abe 100644
>> --- a/drivers/compress/Makefile
>> +++ b/drivers/compress/Makefile
>> @@ -4,5 +4,5 @@
>>  include $(RTE_SDK)/mk/rte.vars.mk
>>
>>  DIRS-$(CONFIG_RTE_LIBRTE_PMD_ISAL) += isal
>> -
>> +DIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_ZIPVF) += octeontx
>>  include $(RTE_SDK)/mk/rte.subdir.mk
>> diff --git a/drivers/compress/octeontx/Makefile b/drivers/compress/octeontx/Makefile
>> new file mode 100644
>> index 000000000..89078f085
>> --- /dev/null
>> +++ b/drivers/compress/octeontx/Makefile
>> @@ -0,0 +1,33 @@
>> +# SPDX-License-Identifier: BSD-3-Clause
>> +# Copyright(c) 2017-2018 Cavium Network
>
>We are using the following copyright header across DPDK,
>Please use the same schematics new.
>
>example:
>Copyright(c) 2017 Cavium, Inc
>
>

//snip

>
>Use alphabetical order.
>
>> +#include "zipvf.h"
>> +
>> +/* global structure to keep driver info */
>> +struct zip_pmd_private zip_pmd_priv;
>
>Remove global memory. Use name based memzone infrastructure to
>allocate the memory.

[Shally] Ok. Will look into this.

>
//snip

>> +
>> +
>> +#endif /* _RTE_ZIP_VF_H_ */
>> diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
>
>Addition to usertools/dpdk-devbind.py, please send it as separate patch as
>it is an common code change

[Shally] Ok.

Thanks for review.
Shally

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 7/7] drivers/compress: add meson.build support
  2018-06-20  6:02     ` Verma, Shally
@ 2018-06-20  7:25       ` De Lara Guarch, Pablo
  2018-06-20  7:36         ` Verma, Shally
  0 siblings, 1 reply; 25+ messages in thread
From: De Lara Guarch, Pablo @ 2018-06-20  7:25 UTC (permalink / raw)
  To: Verma, Shally
  Cc: Trahe, Fiona, dev, Athreya, Narayana Prasad, Challa, Mahipal,
	Gupta, Ashish, Sahu, Sunila

Hi Shally,

> -----Original Message-----
> From: Verma, Shally [mailto:Shally.Verma@cavium.com]
> Sent: Wednesday, June 20, 2018 7:02 AM
> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org; Athreya, Narayana
> Prasad <NarayanaPrasad.Athreya@cavium.com>; Challa, Mahipal
> <Mahipal.Challa@cavium.com>; Gupta, Ashish <Ashish.Gupta@cavium.com>;
> Sahu, Sunila <Sunila.Sahu@cavium.com>
> Subject: RE: [PATCH v1 7/7] drivers/compress: add meson.build support
> 
> 
> 
> >-----Original Message-----
> >From: De Lara Guarch, Pablo [mailto:pablo.de.lara.guarch@intel.com]
> >Sent: 20 June 2018 04:00
> >To: Verma, Shally <Shally.Verma@cavium.com>
> >Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org; Athreya,
> >Narayana Prasad <NarayanaPrasad.Athreya@cavium.com>;
> >Challa, Mahipal <Mahipal.Challa@cavium.com>; Gupta, Ashish
> ><Ashish.Gupta@cavium.com>; Sahu, Sunila <Sunila.Sahu@cavium.com>
> >Subject: RE: [PATCH v1 7/7] drivers/compress: add meson.build support
> >
> >External Email
> >
> >> -----Original Message-----
> >> From: Shally Verma [mailto:shally.verma@caviumnetworks.com]
> >> Sent: Tuesday, June 5, 2018 11:35 AM
> >> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> >> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org;
> >> pathreya@caviumnetworks.com; mchalla@caviumnetworks.com; Ashish
> Gupta
> >> <ashish.gupta@caviumnetworks.com>; Sunila Sahu
> >> <sunila.sahu@caviumnetworks.com>
> >> Subject: [PATCH v1 7/7] drivers/compress: add meson.build support
> >>
> >> Add octeontx in drivers/compress/meson.build.
> >
> >This should be added in patch 1.
> >
> >>
> >> Also change the config and drv format flags to append _compress to
> >> use compression specific format for global filenames. This also
> >> require change in compression PMDs to rename their version.map files
> >> as rte_pmd_<pmd
> >> name>_compress.map ex. Isal should rename as
> >> rte_pmd_isal_compress_version.map.
> >>
> >> Currently the drivers/compress/meson.build use the generic config
> >> names with no compress specific specifier. This breaks meson build
> >> when vendor uses same name for different PMDs, where all belongs to same
> platform.
> >> Ex. drivers/net/octeontx, drivers/event/octeontx,
> >> drivers/compress/octeontx where, net, event and compress carry PMD
> >> for eth, event and compression devices for Octeontx platform. Thus,
> >> differentiate globally used files using module specific specifier ex.
> >> rte_pmd_octeontx_compress_version.map
> >> and rte_pmd_octeontx_event_version.map
> >
> >I think instead of forcing all the PMDs to use that suffix, if there
> >are drivers with the same PMD, they can add the "compres" suffix, without
> imposing it to others.
> >
> [Shally] Meson build force us to use then directory name as octeontx_compress
> where as we want to keep it as compress/octeontx (on the similar lines of
> net/octeontx, event/octeontx). Also its already under compress, so having it as
> compress/octeontx_compress looks unnecessary,

For null crypto, the directory is called crypto/null and it is built with meson (and there is also a net/null).
Maybe doing something like that will work?

If it doesn't, then you can add this, but make sure that you fix
the isal export map name in the Makefile too.

Thanks,
Pablo

> 
> Thanks
> Shally

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 7/7] drivers/compress: add meson.build support
  2018-06-20  7:25       ` De Lara Guarch, Pablo
@ 2018-06-20  7:36         ` Verma, Shally
  0 siblings, 0 replies; 25+ messages in thread
From: Verma, Shally @ 2018-06-20  7:36 UTC (permalink / raw)
  To: De Lara Guarch, Pablo
  Cc: Trahe, Fiona, dev, Athreya, Narayana Prasad, Challa, Mahipal,
	Gupta, Ashish, Sahu, Sunila



>-----Original Message-----
>From: De Lara Guarch, Pablo [mailto:pablo.de.lara.guarch@intel.com]
>Sent: 20 June 2018 12:56
>To: Verma, Shally <Shally.Verma@cavium.com>
>Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org; Athreya, Narayana Prasad <NarayanaPrasad.Athreya@cavium.com>;
>Challa, Mahipal <Mahipal.Challa@cavium.com>; Gupta, Ashish <Ashish.Gupta@cavium.com>; Sahu, Sunila
><Sunila.Sahu@cavium.com>
>Subject: RE: [PATCH v1 7/7] drivers/compress: add meson.build support
>
>External Email
>
>Hi Shally,
>
>> -----Original Message-----
>> From: Verma, Shally [mailto:Shally.Verma@cavium.com]
>> Sent: Wednesday, June 20, 2018 7:02 AM
>> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
>> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org; Athreya, Narayana
>> Prasad <NarayanaPrasad.Athreya@cavium.com>; Challa, Mahipal
>> <Mahipal.Challa@cavium.com>; Gupta, Ashish <Ashish.Gupta@cavium.com>;
>> Sahu, Sunila <Sunila.Sahu@cavium.com>
>> Subject: RE: [PATCH v1 7/7] drivers/compress: add meson.build support
>>
>>
>>

// snip

>> >> Also change the config and drv format flags to append _compress to
>> >> use compression specific format for global filenames. This also
>> >> require change in compression PMDs to rename their version.map files
>> >> as rte_pmd_<pmd
>> >> name>_compress.map ex. Isal should rename as
>> >> rte_pmd_isal_compress_version.map.
>> >>
>> >> Currently the drivers/compress/meson.build use the generic config
>> >> names with no compress specific specifier. This breaks meson build
>> >> when vendor uses same name for different PMDs, where all belongs to same
>> platform.
>> >> Ex. drivers/net/octeontx, drivers/event/octeontx,
>> >> drivers/compress/octeontx where, net, event and compress carry PMD
>> >> for eth, event and compression devices for Octeontx platform. Thus,
>> >> differentiate globally used files using module specific specifier ex.
>> >> rte_pmd_octeontx_compress_version.map
>> >> and rte_pmd_octeontx_event_version.map
>> >
>> >I think instead of forcing all the PMDs to use that suffix, if there
>> >are drivers with the same PMD, they can add the "compres" suffix, without
>> imposing it to others.
>> >
>> [Shally] Meson build force us to use then directory name as octeontx_compress
>> where as we want to keep it as compress/octeontx (on the similar lines of
>> net/octeontx, event/octeontx). Also its already under compress, so having it as
>> compress/octeontx_compress looks unnecessary,
>
>For null crypto, the directory is called crypto/null and it is built with meson (and there is also a net/null).
>Maybe doing something like that will work?
>
>If it doesn't, then you can add this, but make sure that you fix
>the isal export map name in the Makefile too.
>
[Shally] fine. I will check for this and if required, will send patch for ISAL as well.

>Thanks,
>Pablo
>
>>
>> Thanks
>> Shally

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [dpdk-dev] [PATCH v1 4/7] compress/octeontx: add ops enq deq apis
  2018-06-19 22:18   ` De Lara Guarch, Pablo
@ 2018-06-29  7:42     ` Verma, Shally
  0 siblings, 0 replies; 25+ messages in thread
From: Verma, Shally @ 2018-06-29  7:42 UTC (permalink / raw)
  To: De Lara Guarch, Pablo
  Cc: Trahe, Fiona, dev, Athreya, Narayana Prasad, Challa, Mahipal,
	Gupta, Ashish, Sahu, Sunila

HI Pablo

>-----Original Message-----
>From: De Lara Guarch, Pablo [mailto:pablo.de.lara.guarch@intel.com]
>Sent: 20 June 2018 03:48
>To: Verma, Shally <Shally.Verma@cavium.com>
>Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org; Athreya, Narayana Prasad <NarayanaPrasad.Athreya@cavium.com>;
>Challa, Mahipal <Mahipal.Challa@cavium.com>; Gupta, Ashish <Ashish.Gupta@cavium.com>; Sahu, Sunila
><Sunila.Sahu@cavium.com>
>Subject: RE: [PATCH v1 4/7] compress/octeontx: add ops enq deq apis
>
>External Email
>
>> -----Original Message-----
>> From: Shally Verma [mailto:shally.verma@caviumnetworks.com]
>> Sent: Tuesday, June 5, 2018 11:35 AM
>> To: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
>> Cc: Trahe, Fiona <fiona.trahe@intel.com>; dev@dpdk.org;
>> pathreya@caviumnetworks.com; mchalla@caviumnetworks.com; Ashish Gupta
>> <ashish.gupta@caviumnetworks.com>; Sunila Sahu
>> <sunila.sahu@caviumnetworks.com>
>> Subject: [PATCH v1 4/7] compress/octeontx: add ops enq deq apis
>>
>> implement enqueue and dequeue apis
>>
>> Signed-off-by: Ashish Gupta <ashish.gupta@caviumnetworks.com>
>> Signed-off-by: Shally Verma <shally.verma@caviumnetworks.com>
>> Signed-off-by: Sunila Sahu <sunila.sahu@caviumnetworks.com>
>
>...
>
>> --- a/drivers/compress/octeontx/zipvf.h
>> +++ b/drivers/compress/octeontx/zipvf.h
>
>...
>
>> +static inline int
>> +zipvf_prepare_out_buf(struct zip_stream *zstrm, struct rte_comp_op *op)
>> +{
>> +     uint32_t offset;
>> +     union zip_zptr_s *sg_list = NULL;
>> +     struct rte_mbuf *m_dst;
>> +     union zip_inst_s *inst = zstrm->inst;
>> +     rte_iova_t iova;
>> +
>> +     offset = op->src.offset;
>> +     m_dst = op->m_dst;
>> +
>> +     if (m_dst->nb_segs == 1) {
>> +             /* Prepare direct input data pointer */
>> +             inst->s.ds = 0;
>> +             inst->s.out_ptr_addr.s.addr =
>> +                     rte_pktmbuf_iova_offset(m_dst, offset);
>> +             inst->s.totaloutputlength = rte_pktmbuf_data_len(m_dst) -
>> +                                         op->dst.offset;
>> +             inst->s.out_ptr_ctl.s.length = inst->s.totaloutputlength;
>> +             return 0;
>> +     }
>> +
>> +     ZIP_PMD_ERR("output packet is segmented\n");
>> +
>> +     /* Packet is segmented, create gather buffer */
>> +     inst->s.ds = 1;
>> +     iova = rte_mempool_virt2iova(zstrm->bufs[OUT_DATA_BUF]);
>> +     if (iova & 0xF) {
>> +             /* Align it to 16 Byte address */
>> +             iova = ZIP_ALIGN_ROUNDUP(iova, ZIP_SGPTR_ALIGN);
>> +     }
>> +
>> +     inst->s.out_ptr_addr.s.addr = iova;
>> +     inst->s.inp_ptr_ctl.s.length = (m_dst->nb_segs < MAX_SG_LEN) ?
>> +                                     (m_dst->nb_segs) : MAX_SG_LEN;
>> +
>> +     sg_list = (union zip_zptr_s *)iova;
>
>There is a compilation issue on gcc 32 bits:
>
>drivers/compress/octeontx/zipvf.h:260:12: error:
>cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>  sg_list = (union zip_zptr_s *)iova;
>
[Shally] Shouldn't rte_iova_t should be defined to 32-bit size for 32-bit machine?

Thanks
Shally

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2018-06-29  7:42 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-05 10:35 [dpdk-dev] [PATCH v1 0/7] compress: add Octeontx ZIP compression PMD Shally Verma
2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 1/7] compress/octeontx: add octeontx zip PMD support Shally Verma
2018-06-10 10:38   ` Jerin Jacob
2018-06-20  6:32     ` Verma, Shally
2018-06-19 22:15   ` De Lara Guarch, Pablo
2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 2/7] compress/octeontx: add device setup PMD ops Shally Verma
2018-06-19 22:15   ` De Lara Guarch, Pablo
2018-06-20  6:04     ` Verma, Shally
2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 3/7] compress/octeontx: add xform and stream create support Shally Verma
2018-06-19 22:13   ` De Lara Guarch, Pablo
2018-06-20  6:12     ` Verma, Shally
2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 4/7] compress/octeontx: add ops enq deq apis Shally Verma
2018-06-19 22:18   ` De Lara Guarch, Pablo
2018-06-29  7:42     ` Verma, Shally
2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 5/7] test: add octeontx zip PMD for compressdev tests Shally Verma
2018-06-19 22:18   ` De Lara Guarch, Pablo
2018-06-20  6:03     ` Verma, Shally
2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 6/7] doc: add octeontx zip PMD documentation Shally Verma
2018-06-14 11:22   ` Kovacevic, Marko
2018-06-19 22:22   ` De Lara Guarch, Pablo
2018-06-05 10:35 ` [dpdk-dev] [PATCH v1 7/7] drivers/compress: add meson.build support Shally Verma
2018-06-19 22:30   ` De Lara Guarch, Pablo
2018-06-20  6:02     ` Verma, Shally
2018-06-20  7:25       ` De Lara Guarch, Pablo
2018-06-20  7:36         ` Verma, Shally

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).