get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/63766/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 63766,
    "url": "http://patches.dpdk.org/api/patches/63766/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191211155000.26610-1-arturx.trybula@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20191211155000.26610-1-arturx.trybula@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191211155000.26610-1-arturx.trybula@intel.com",
    "date": "2019-12-11T15:50:00",
    "name": "test/compress: add cycle-count mode to the perf tool",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "9cbc06d1fba4129a9c3bd2a4e4c81fb679269b94",
    "submitter": {
        "id": 1327,
        "url": "http://patches.dpdk.org/api/people/1327/?format=api",
        "name": "Artur Trybula",
        "email": "arturx.trybula@intel.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191211155000.26610-1-arturx.trybula@intel.com/mbox/",
    "series": [
        {
            "id": 7797,
            "url": "http://patches.dpdk.org/api/series/7797/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7797",
            "date": "2019-12-11T15:50:00",
            "name": "test/compress: add cycle-count mode to the perf tool",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/7797/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/63766/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/63766/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id E4DD1A04F6;\n\tWed, 11 Dec 2019 16:51:56 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id B25052C6A;\n\tWed, 11 Dec 2019 16:51:56 +0100 (CET)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id EFA4D1D9E\n for <dev@dpdk.org>; Wed, 11 Dec 2019 16:51:53 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 11 Dec 2019 07:51:42 -0800",
            "from atrybulx-mobl.ger.corp.intel.com (HELO\n build-VirtualBox.isw.intel.com) ([10.103.104.115])\n by fmsmga001.fm.intel.com with ESMTP; 11 Dec 2019 07:51:40 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.69,301,1571727600\"; d=\"scan'208\";a=\"220487724\"",
        "From": "Artur Trybula <arturx.trybula@intel.com>",
        "To": "dev@dpdk.org, fiona.trahe@intel.com, shallyv@marvell.com,\n adamx.dybkowski@intel.com, marcinx.danilewicz@intel.com,\n arturx.trybula@intel.com, akhil.goyal@nxp.com",
        "Date": "Wed, 11 Dec 2019 16:50:00 +0100",
        "Message-Id": "<20191211155000.26610-1-arturx.trybula@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "Subject": "[dpdk-dev] [PATCH] test/compress: add cycle-count mode to the perf\n\ttool",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This commit adds cycle-count mode to the compression perf tool.\nThe new mode enhances the compression performance tool to allow\ncycle-count measurement of both hardware and softwate PMDs.\n\nSigned-off-by: Artur Trybula <arturx.trybula@intel.com>\n---\n app/test-compress-perf/Makefile               |   3 +-\n app/test-compress-perf/comp_perf.h            |   6 +-\n app/test-compress-perf/comp_perf_options.h    |   7 +-\n .../comp_perf_options_parse.c                 |  35 +-\n .../comp_perf_test_common.c                   |  23 +-\n .../comp_perf_test_common.h                   |   2 +-\n .../comp_perf_test_cyclecount.c               | 614 ++++++++++++++++++\n .../comp_perf_test_cyclecount.h               |  24 +\n ...enchmark.c => comp_perf_test_throughput.c} |  10 +-\n ...enchmark.h => comp_perf_test_throughput.h} |   6 +-\n .../comp_perf_test_verify.c                   |   4 +-\n app/test-compress-perf/main.c                 |  65 +-\n app/test-compress-perf/meson.build            |   3 +-\n 13 files changed, 755 insertions(+), 47 deletions(-)\n create mode 100644 app/test-compress-perf/comp_perf_test_cyclecount.c\n create mode 100644 app/test-compress-perf/comp_perf_test_cyclecount.h\n rename app/test-compress-perf/{comp_perf_test_benchmark.c => comp_perf_test_throughput.c} (97%)\n rename app/test-compress-perf/{comp_perf_test_benchmark.h => comp_perf_test_throughput.h} (80%)",
    "diff": "diff --git a/app/test-compress-perf/Makefile b/app/test-compress-perf/Makefile\nindex d1a6820e6..ad3b91d0a 100644\n--- a/app/test-compress-perf/Makefile\n+++ b/app/test-compress-perf/Makefile\n@@ -13,7 +13,8 @@ CFLAGS += -O3\n SRCS-y := main.c\n SRCS-y += comp_perf_options_parse.c\n SRCS-y += comp_perf_test_verify.c\n-SRCS-y += comp_perf_test_benchmark.c\n+SRCS-y += comp_perf_test_throughput.c\n+SRCS-y += comp_perf_test_cyclecount.c\n SRCS-y += comp_perf_test_common.c\n \n include $(RTE_SDK)/mk/rte.app.mk\ndiff --git a/app/test-compress-perf/comp_perf.h b/app/test-compress-perf/comp_perf.h\nindex 57289b07a..997d46b59 100644\n--- a/app/test-compress-perf/comp_perf.h\n+++ b/app/test-compress-perf/comp_perf.h\n@@ -26,15 +26,15 @@ struct cperf_test {\n /* Needed for weak functions*/\n \n void *\n-cperf_benchmark_test_constructor(uint8_t dev_id __rte_unused,\n+cperf_throughput_test_constructor(uint8_t dev_id __rte_unused,\n \t\t\t\t uint16_t qp_id __rte_unused,\n \t\t\t\t struct comp_test_data *options __rte_unused);\n \n void\n-cperf_benchmark_test_destructor(void *arg __rte_unused);\n+cperf_throughput_test_destructor(void *arg __rte_unused);\n \n int\n-cperf_benchmark_test_runner(void *test_ctx __rte_unused);\n+cperf_throughput_test_runner(void *test_ctx __rte_unused);\n \n void *\n cperf_verify_test_constructor(uint8_t dev_id __rte_unused,\ndiff --git a/app/test-compress-perf/comp_perf_options.h b/app/test-compress-perf/comp_perf_options.h\nindex 2c26511ef..0b777521c 100644\n--- a/app/test-compress-perf/comp_perf_options.h\n+++ b/app/test-compress-perf/comp_perf_options.h\n@@ -24,8 +24,9 @@ enum cleanup_st {\n };\n \n enum cperf_test_type {\n-\tCPERF_TEST_TYPE_BENCHMARK,\n-\tCPERF_TEST_TYPE_VERIFY\n+\tCPERF_TEST_TYPE_THROUGHPUT,\n+\tCPERF_TEST_TYPE_VERIFY,\n+\tCPERF_TEST_TYPE_PMDCC\n };\n \n enum comp_operation {\n@@ -68,6 +69,8 @@ struct comp_test_data {\n \tdouble ratio;\n \tenum cleanup_st cleanup;\n \tint perf_comp_force_stop;\n+\n+\tuint32_t cyclecount_delay;\n };\n \n int\ndiff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-compress-perf/comp_perf_options_parse.c\nindex 12d0a6caf..04a8d2fbe 100644\n--- a/app/test-compress-perf/comp_perf_options_parse.c\n+++ b/app/test-compress-perf/comp_perf_options_parse.c\n@@ -30,6 +30,9 @@\n #define CPERF_WINDOW_SIZE\t(\"window-sz\")\n #define CPERF_EXTERNAL_MBUFS\t(\"external-mbufs\")\n \n+/* cyclecount-specific options */\n+#define CPERF_CYCLECOUNT_DELAY_US (\"cc-delay-us\")\n+\n struct name_id_map {\n \tconst char *name;\n \tuint32_t id;\n@@ -39,7 +42,7 @@ static void\n usage(char *progname)\n {\n \tprintf(\"%s [EAL options] --\\n\"\n-\t\t\" --ptest benchmark / verify :\"\n+\t\t\" --ptest throughput / verify / pmd-cyclecount\\n\"\n \t\t\" --driver-name NAME: compress driver to use\\n\"\n \t\t\" --input-file NAME: file to compress and decompress\\n\"\n \t\t\" --extended-input-sz N: extend file data up to this size (default: no extension)\\n\"\n@@ -61,6 +64,8 @@ usage(char *progname)\n \t\t\"\t\t(e.g.: 15 => 32k, default: max supported by PMD)\\n\"\n \t\t\" --external-mbufs: use memzones as external buffers instead of\\n\"\n \t\t\"\t\tkeeping the data directly in mbuf area\\n\"\n+\t\t\" --cc-delay-us N: delay between enqueue and dequeue operations in microseconds\\n\"\n+\t\t\"\t\tvalid only for cyclecount perf test (default: 500 us)\\n\"\n \t\t\" -h: prints this help\\n\",\n \t\tprogname);\n }\n@@ -85,12 +90,16 @@ parse_cperf_test_type(struct comp_test_data *test_data, const char *arg)\n {\n \tstruct name_id_map cperftest_namemap[] = {\n \t\t{\n-\t\t\tcomp_perf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],\n-\t\t\tCPERF_TEST_TYPE_BENCHMARK\n+\t\t\tcomp_perf_test_type_strs[CPERF_TEST_TYPE_THROUGHPUT],\n+\t\t\tCPERF_TEST_TYPE_THROUGHPUT\n \t\t},\n \t\t{\n \t\t\tcomp_perf_test_type_strs[CPERF_TEST_TYPE_VERIFY],\n \t\t\tCPERF_TEST_TYPE_VERIFY\n+\t\t},\n+\t\t{\n+\t\t\tcomp_perf_test_type_strs[CPERF_TEST_TYPE_PMDCC],\n+\t\t\tCPERF_TEST_TYPE_PMDCC\n \t\t}\n \t};\n \n@@ -531,17 +540,28 @@ parse_external_mbufs(struct comp_test_data *test_data,\n \treturn 0;\n }\n \n+static int\n+parse_cyclecount_delay_us(struct comp_test_data *test_data,\n+\t\t\tconst char *arg)\n+{\n+\tint ret = parse_uint32_t(&(test_data->cyclecount_delay), arg);\n+\n+\tif (ret) {\n+\t\tRTE_LOG(ERR, USER1, \"Failed to parse cyclecount delay\\n\");\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+\n typedef int (*option_parser_t)(struct comp_test_data *test_data,\n \t\tconst char *arg);\n \n struct long_opt_parser {\n \tconst char *lgopt_name;\n \toption_parser_t parser_fn;\n-\n };\n \n static struct option lgopts[] = {\n-\n \t{ CPERF_PTEST_TYPE, required_argument, 0, 0 },\n \t{ CPERF_DRIVER_NAME, required_argument, 0, 0 },\n \t{ CPERF_TEST_FILE, required_argument, 0, 0 },\n@@ -556,6 +576,7 @@ static struct option lgopts[] = {\n \t{ CPERF_LEVEL, required_argument, 0, 0 },\n \t{ CPERF_WINDOW_SIZE, required_argument, 0, 0 },\n \t{ CPERF_EXTERNAL_MBUFS, 0, 0, 0 },\n+\t{ CPERF_CYCLECOUNT_DELAY_US, required_argument, 0, 0 },\n \t{ NULL, 0, 0, 0 }\n };\n \n@@ -577,6 +598,7 @@ comp_perf_opts_parse_long(int opt_idx, struct comp_test_data *test_data)\n \t\t{ CPERF_LEVEL,\t\tparse_level },\n \t\t{ CPERF_WINDOW_SIZE,\tparse_window_sz },\n \t\t{ CPERF_EXTERNAL_MBUFS,\tparse_external_mbufs },\n+\t\t{ CPERF_CYCLECOUNT_DELAY_US,\tparse_cyclecount_delay_us },\n \t};\n \tunsigned int i;\n \n@@ -631,8 +653,9 @@ comp_perf_options_default(struct comp_test_data *test_data)\n \ttest_data->level_lst.min = RTE_COMP_LEVEL_MIN;\n \ttest_data->level_lst.max = RTE_COMP_LEVEL_MAX;\n \ttest_data->level_lst.inc = 1;\n-\ttest_data->test = CPERF_TEST_TYPE_BENCHMARK;\n+\ttest_data->test = CPERF_TEST_TYPE_THROUGHPUT;\n \ttest_data->use_external_mbufs = 0;\n+\ttest_data->cyclecount_delay = 500;\n }\n \n int\ndiff --git a/app/test-compress-perf/comp_perf_test_common.c b/app/test-compress-perf/comp_perf_test_common.c\nindex 1b8985b43..b402a0d83 100644\n--- a/app/test-compress-perf/comp_perf_test_common.c\n+++ b/app/test-compress-perf/comp_perf_test_common.c\n@@ -9,7 +9,8 @@\n \n #include \"comp_perf.h\"\n #include \"comp_perf_options.h\"\n-#include \"comp_perf_test_benchmark.h\"\n+#include \"comp_perf_test_throughput.h\"\n+#include \"comp_perf_test_cyclecount.h\"\n #include \"comp_perf_test_common.h\"\n #include \"comp_perf_test_verify.h\"\n \n@@ -276,9 +277,11 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,\n \n \tsnprintf(pool_name, sizeof(pool_name), \"op_pool_%u_qp_%u\",\n \t\t\tmem->dev_id, mem->qp_id);\n+\n+\t/* one mempool for both src and dst mbufs */\n \tmem->op_pool = rte_comp_op_pool_create(pool_name,\n-\t\t\t\t  mem->total_bufs,\n-\t\t\t\t  0, 0, rte_socket_id());\n+\t\t\t\tmem->total_bufs * 2,\n+\t\t\t\t0, 0, rte_socket_id());\n \tif (mem->op_pool == NULL) {\n \t\tRTE_LOG(ERR, USER1, \"Comp op mempool could not be created\\n\");\n \t\treturn -1;\n@@ -495,20 +498,24 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)\n }\n \n void\n-print_test_dynamics(void)\n+print_test_dynamics(const struct comp_test_data *test_data)\n {\n \tuint32_t opt_total_segs = DIV_CEIL(buffer_info.input_data_sz,\n \t\t\tMAX_SEG_SIZE);\n \n \tif (buffer_info.total_buffs > 1) {\n-\t\tprintf(\"\\nWarning: for the current input parameters, number\"\n+\t\tif (test_data->test == CPERF_TEST_TYPE_THROUGHPUT) {\n+\t\t\tprintf(\"\\nWarning: for the current input parameters, number\"\n \t\t\t\t\" of ops is higher than one, which may result\"\n \t\t\t\t\" in sub-optimal performance.\\n\");\n-\t\tprintf(\"To improve the performance (for the current\"\n+\t\t\tprintf(\"To improve the performance (for the current\"\n \t\t\t\t\" input data) following parameters are\"\n \t\t\t\t\" suggested:\\n\");\n-\t\tprintf(\"\t* Segment size: %d\\n\", MAX_SEG_SIZE);\n-\t\tprintf(\"\t* Number of segments: %u\\n\", opt_total_segs);\n+\t\t\tprintf(\"\t* Segment size: %d\\n\",\n+\t\t\t       MAX_SEG_SIZE);\n+\t\t\tprintf(\"\t* Number of segments: %u\\n\",\n+\t\t\t       opt_total_segs);\n+\t\t}\n \t} else if (buffer_info.total_buffs == 1) {\n \t\tprintf(\"\\nInfo: there is only one op with %u segments -\"\n \t\t\t\t\" the compression ratio is the best.\\n\",\ndiff --git a/app/test-compress-perf/comp_perf_test_common.h b/app/test-compress-perf/comp_perf_test_common.h\nindex 920642888..72705c6a2 100644\n--- a/app/test-compress-perf/comp_perf_test_common.h\n+++ b/app/test-compress-perf/comp_perf_test_common.h\n@@ -49,6 +49,6 @@ int\n prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem);\n \n void\n-print_test_dynamics(void);\n+print_test_dynamics(const struct comp_test_data *test_data);\n \n #endif /* _COMP_PERF_TEST_COMMON_H_ */\ndiff --git a/app/test-compress-perf/comp_perf_test_cyclecount.c b/app/test-compress-perf/comp_perf_test_cyclecount.c\nnew file mode 100644\nindex 000000000..55559a7d5\n--- /dev/null\n+++ b/app/test-compress-perf/comp_perf_test_cyclecount.c\n@@ -0,0 +1,614 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2019 Intel Corporation\n+ */\n+\n+#include <rte_malloc.h>\n+#include <rte_eal.h>\n+#include <rte_log.h>\n+#include <rte_cycles.h>\n+#include \"rte_spinlock.h\"\n+#include <rte_compressdev.h>\n+\n+#include \"comp_perf_test_cyclecount.h\"\n+\n+struct cperf_cyclecount_ctx {\n+\tstruct cperf_verify_ctx ver;\n+\n+\tuint32_t ops_enq_retries;\n+\tuint32_t ops_deq_retries;\n+\n+\tuint64_t duration_op;\n+\tuint64_t duration_enq;\n+\tuint64_t duration_deq;\n+};\n+\n+void\n+cperf_cyclecount_test_destructor(void *arg)\n+{\n+\tstruct cperf_cyclecount_ctx *ctx = arg;\n+\n+\tif (arg) {\n+\t\tcomp_perf_free_memory(ctx->ver.options, &ctx->ver.mem);\n+\t\trte_free(arg);\n+\t}\n+}\n+\n+void *\n+cperf_cyclecount_test_constructor(uint8_t dev_id, uint16_t qp_id,\n+\t\tstruct comp_test_data *options)\n+{\n+\tstruct cperf_cyclecount_ctx *ctx = NULL;\n+\n+\tctx = rte_malloc(NULL, sizeof(struct cperf_cyclecount_ctx), 0);\n+\n+\tif (ctx == NULL)\n+\t\treturn NULL;\n+\n+\tctx->ver.mem.dev_id = dev_id;\n+\tctx->ver.mem.qp_id = qp_id;\n+\tctx->ver.options = options;\n+\tctx->ver.silent = 1; /* ver. part will be silent */\n+\n+\tif (!comp_perf_allocate_memory(ctx->ver.options, &ctx->ver.mem)\n+\t\t\t&& !prepare_bufs(ctx->ver.options, &ctx->ver.mem))\n+\t\treturn ctx;\n+\n+\tcperf_cyclecount_test_destructor(ctx);\n+\treturn NULL;\n+}\n+\n+static int\n+cperf_cyclecount_op_setup(struct rte_comp_op **ops,\n+\t\t\t\t struct cperf_cyclecount_ctx *ctx,\n+\t\t\t\t struct rte_mbuf **input_bufs,\n+\t\t\t\t struct rte_mbuf **output_bufs,\n+\t\t\t\t void *priv_xform,\n+\t\t\t\t uint32_t out_seg_sz)\n+{\n+\tstruct comp_test_data *test_data = ctx->ver.options;\n+\tstruct cperf_mem_resources *mem = &ctx->ver.mem;\n+\n+\tuint32_t i, iter, num_iter;\n+\tint res = 0;\n+\tuint16_t ops_needed;\n+\n+\tnum_iter = test_data->num_iter;\n+\n+\tfor (iter = 0; iter < num_iter; iter++) {\n+\t\tuint32_t remaining_ops = mem->total_bufs;\n+\t\tuint32_t total_deq_ops = 0;\n+\t\tuint32_t total_enq_ops = 0;\n+\t\tuint16_t num_enq = 0;\n+\t\tuint16_t num_deq = 0;\n+\n+\t\twhile (remaining_ops > 0) {\n+\t\t\tuint16_t num_ops = RTE_MIN(remaining_ops,\n+\t\t\t\t\t\t   test_data->burst_sz);\n+\t\t\tops_needed = num_ops;\n+\n+\t\t\t/* Allocate compression operations */\n+\t\t\tif (ops_needed && rte_mempool_get_bulk(\n+\t\t\t\t\t\tmem->op_pool,\n+\t\t\t\t\t\t(void **)ops,\n+\t\t\t\t\t\tops_needed) != 0) {\n+\t\t\t\tRTE_LOG(ERR, USER1,\n+\t\t\t\t      \"Cyclecount: could not allocate enough operations\\n\");\n+\t\t\t\tres = -1;\n+\t\t\t\tgoto end;\n+\t\t\t}\n+\n+\t\t\tfor (i = 0; i < ops_needed; i++) {\n+\n+\t\t\t\t/* Calculate next buffer to attach */\n+\t\t\t\t/* to operation */\n+\t\t\t\tuint32_t buf_id = total_enq_ops + i;\n+\t\t\t\tuint16_t op_id = i;\n+\n+\t\t\t\t/* Reset all data in output buffers */\n+\t\t\t\tstruct rte_mbuf *m = output_bufs[buf_id];\n+\n+\t\t\t\tm->pkt_len = out_seg_sz * m->nb_segs;\n+\t\t\t\twhile (m) {\n+\t\t\t\t\tm->data_len = m->buf_len - m->data_off;\n+\t\t\t\t\tm = m->next;\n+\t\t\t\t}\n+\t\t\t\tops[op_id]->m_src = input_bufs[buf_id];\n+\t\t\t\tops[op_id]->m_dst = output_bufs[buf_id];\n+\t\t\t\tops[op_id]->src.offset = 0;\n+\t\t\t\tops[op_id]->src.length =\n+\t\t\t\t\trte_pktmbuf_pkt_len(input_bufs[buf_id]);\n+\t\t\t\tops[op_id]->dst.offset = 0;\n+\t\t\t\tops[op_id]->flush_flag = RTE_COMP_FLUSH_FINAL;\n+\t\t\t\tops[op_id]->input_chksum = buf_id;\n+\t\t\t\tops[op_id]->private_xform = priv_xform;\n+\t\t\t}\n+\n+\t\t\t/* E N Q U E U I N G */\n+\t\t\t/* assuming that all ops are enqueued */\n+\t\t\t/* instead of the real enqueue operation */\n+\t\t\tnum_enq = num_ops;\n+\n+\t\t\tremaining_ops -= num_enq;\n+\t\t\ttotal_enq_ops += num_enq;\n+\n+\t\t\t/* D E Q U E U I N G */\n+\t\t\t/* assuming that all ops dequeued */\n+\t\t\t/* instead of the real dequeue operation */\n+\t\t\tnum_deq = num_ops;\n+\n+\t\t\ttotal_deq_ops += num_deq;\n+\t\t\trte_mempool_put_bulk(mem->op_pool,\n+\t\t\t\t\t     (void **)ops, num_deq);\n+\t\t}\n+\t}\n+\treturn res;\n+end:\n+\trte_mempool_put_bulk(mem->op_pool, (void **)ops, ops_needed);\n+\trte_free(ops);\n+\n+\treturn res;\n+}\n+\n+static int\n+main_loop(struct cperf_cyclecount_ctx *ctx, enum rte_comp_xform_type type)\n+{\n+\tstruct comp_test_data *test_data = ctx->ver.options;\n+\tstruct cperf_mem_resources *mem = &ctx->ver.mem;\n+\tuint8_t dev_id = mem->dev_id;\n+\tuint32_t i, iter, num_iter;\n+\tstruct rte_comp_op **ops, **deq_ops;\n+\tvoid *priv_xform = NULL;\n+\tstruct rte_comp_xform xform;\n+\tstruct rte_mbuf **input_bufs, **output_bufs;\n+\tint ret, res = 0;\n+\tint allocated = 0;\n+\tuint32_t out_seg_sz;\n+\n+\tuint64_t tsc_start, tsc_end, tsc_duration;\n+\n+\tif (test_data == NULL || !test_data->burst_sz) {\n+\t\tRTE_LOG(ERR, USER1, \"Unknown burst size\\n\");\n+\t\treturn -1;\n+\t}\n+\tctx->duration_enq = 0;\n+\tctx->duration_deq = 0;\n+\tctx->ops_enq_retries = 0;\n+\tctx->ops_deq_retries = 0;\n+\n+\t/* one array for both enqueue and dequeue */\n+\tops = rte_zmalloc_socket(NULL,\n+\t\t2 * mem->total_bufs * sizeof(struct rte_comp_op *),\n+\t\t0, rte_socket_id());\n+\n+\tif (ops == NULL) {\n+\t\tRTE_LOG(ERR, USER1,\n+\t\t\t\"Can't allocate memory for ops strucures\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\tdeq_ops = &ops[mem->total_bufs];\n+\n+\tif (type == RTE_COMP_COMPRESS) {\n+\t\txform = (struct rte_comp_xform) {\n+\t\t\t.type = RTE_COMP_COMPRESS,\n+\t\t\t.compress = {\n+\t\t\t\t.algo = RTE_COMP_ALGO_DEFLATE,\n+\t\t\t\t.deflate.huffman = test_data->huffman_enc,\n+\t\t\t\t.level = test_data->level,\n+\t\t\t\t.window_size = test_data->window_sz,\n+\t\t\t\t.chksum = RTE_COMP_CHECKSUM_NONE,\n+\t\t\t\t.hash_algo = RTE_COMP_HASH_ALGO_NONE\n+\t\t\t}\n+\t\t};\n+\t\tinput_bufs = mem->decomp_bufs;\n+\t\toutput_bufs = mem->comp_bufs;\n+\t\tout_seg_sz = test_data->out_seg_sz;\n+\t} else {\n+\t\txform = (struct rte_comp_xform) {\n+\t\t\t.type = RTE_COMP_DECOMPRESS,\n+\t\t\t.decompress = {\n+\t\t\t\t.algo = RTE_COMP_ALGO_DEFLATE,\n+\t\t\t\t.chksum = RTE_COMP_CHECKSUM_NONE,\n+\t\t\t\t.window_size = test_data->window_sz,\n+\t\t\t\t.hash_algo = RTE_COMP_HASH_ALGO_NONE\n+\t\t\t}\n+\t\t};\n+\t\tinput_bufs = mem->comp_bufs;\n+\t\toutput_bufs = mem->decomp_bufs;\n+\t\tout_seg_sz = test_data->seg_sz;\n+\t}\n+\n+\t/* Create private xform */\n+\tif (rte_compressdev_private_xform_create(dev_id, &xform,\n+\t\t\t\t\t\t&priv_xform) < 0) {\n+\t\tRTE_LOG(ERR, USER1, \"Private xform could not be created\\n\");\n+\t\tres = -1;\n+\t\tgoto end;\n+\t}\n+\n+\ttsc_start = rte_rdtsc_precise();\n+\tret = cperf_cyclecount_op_setup(ops,\n+\t\t\t\tctx,\n+\t\t\t\tinput_bufs,\n+\t\t\t\toutput_bufs,\n+\t\t\t\tpriv_xform,\n+\t\t\t\tout_seg_sz);\n+\n+\ttsc_end = rte_rdtsc_precise();\n+\n+\t/* ret value check postponed a bit to cancel extra 'if' bias */\n+\tif (ret < 0) {\n+\t\tRTE_LOG(ERR, USER1, \"Setup function failed\\n\");\n+\t\tres = -1;\n+\t\tgoto end;\n+\t}\n+\n+\ttsc_duration = tsc_end - tsc_start;\n+\tctx->duration_op = tsc_duration;\n+\n+\tnum_iter = test_data->num_iter;\n+\tfor (iter = 0; iter < num_iter; iter++) {\n+\t\tuint32_t total_ops = mem->total_bufs;\n+\t\tuint32_t remaining_ops = mem->total_bufs;\n+\t\tuint32_t total_deq_ops = 0;\n+\t\tuint32_t total_enq_ops = 0;\n+\t\tuint16_t ops_unused = 0;\n+\t\tuint16_t num_enq = 0;\n+\t\tuint16_t num_deq = 0;\n+\n+\t\twhile (remaining_ops > 0) {\n+\t\t\tuint16_t num_ops = RTE_MIN(remaining_ops,\n+\t\t\t\t\t\t   test_data->burst_sz);\n+\t\t\tuint16_t ops_needed = num_ops - ops_unused;\n+\n+\t\t\t/*\n+\t\t\t * Move the unused operations from the previous\n+\t\t\t * enqueue_burst call to the front, to maintain order\n+\t\t\t */\n+\t\t\tif ((ops_unused > 0) && (num_enq > 0)) {\n+\t\t\t\tsize_t nb_b_to_mov =\n+\t\t\t\t      ops_unused * sizeof(struct rte_comp_op *);\n+\n+\t\t\t\tmemmove(ops, &ops[num_enq], nb_b_to_mov);\n+\t\t\t}\n+\n+\t\t\t/* Allocate compression operations */\n+\t\t\tif (ops_needed && rte_mempool_get_bulk(\n+\t\t\t\t\t\tmem->op_pool,\n+\t\t\t\t\t\t(void **)ops,\n+\t\t\t\t\t\tops_needed) != 0) {\n+\t\t\t\tRTE_LOG(ERR, USER1,\n+\t\t\t\t      \"Could not allocate enough operations\\n\");\n+\t\t\t\tres = -1;\n+\t\t\t\tgoto end;\n+\t\t\t}\n+\t\t\tallocated += ops_needed;\n+\n+\t\t\tfor (i = 0; i < ops_needed; i++) {\n+\t\t\t\t/*\n+\t\t\t\t * Calculate next buffer to attach to operation\n+\t\t\t\t */\n+\t\t\t\tuint32_t buf_id = total_enq_ops + i +\n+\t\t\t\t\t\tops_unused;\n+\t\t\t\tuint16_t op_id = ops_unused + i;\n+\t\t\t\t/* Reset all data in output buffers */\n+\t\t\t\tstruct rte_mbuf *m = output_bufs[buf_id];\n+\n+\t\t\t\tm->pkt_len = out_seg_sz * m->nb_segs;\n+\t\t\t\twhile (m) {\n+\t\t\t\t\tm->data_len = m->buf_len - m->data_off;\n+\t\t\t\t\tm = m->next;\n+\t\t\t\t}\n+\t\t\t\tops[op_id]->m_src = input_bufs[buf_id];\n+\t\t\t\tops[op_id]->m_dst = output_bufs[buf_id];\n+\t\t\t\tops[op_id]->src.offset = 0;\n+\t\t\t\tops[op_id]->src.length =\n+\t\t\t\t\trte_pktmbuf_pkt_len(input_bufs[buf_id]);\n+\t\t\t\tops[op_id]->dst.offset = 0;\n+\t\t\t\tops[op_id]->flush_flag = RTE_COMP_FLUSH_FINAL;\n+\t\t\t\tops[op_id]->input_chksum = buf_id;\n+\t\t\t\tops[op_id]->private_xform = priv_xform;\n+\t\t\t}\n+\n+\t\t\tif (unlikely(test_data->perf_comp_force_stop))\n+\t\t\t\tgoto end;\n+\n+\t\t\ttsc_start = rte_rdtsc_precise();\n+\t\t\tnum_enq = rte_compressdev_enqueue_burst(dev_id,\n+\t\t\t\t\t\t\t\tmem->qp_id, ops,\n+\t\t\t\t\t\t\t\tnum_ops);\n+\t\t\ttsc_end = rte_rdtsc_precise();\n+\t\t\ttsc_duration = tsc_end - tsc_start;\n+\t\t\tctx->duration_enq += tsc_duration;\n+\n+\t\t\tif (num_enq < num_ops)\n+\t\t\t\tctx->ops_enq_retries++;\n+\n+\t\t\tif (test_data->cyclecount_delay)\n+\t\t\t\trte_delay_us_block(test_data->cyclecount_delay);\n+\n+\t\t\tif (num_enq == 0) {\n+\t\t\t\tstruct rte_compressdev_stats stats;\n+\n+\t\t\t\trte_compressdev_stats_get(dev_id, &stats);\n+\t\t\t\tif (stats.enqueue_err_count) {\n+\t\t\t\t\tres = -1;\n+\t\t\t\t\tgoto end;\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\tops_unused = num_ops - num_enq;\n+\t\t\tremaining_ops -= num_enq;\n+\t\t\ttotal_enq_ops += num_enq;\n+\n+\t\t\ttsc_start = rte_rdtsc_precise();\n+\t\t\tnum_deq = rte_compressdev_dequeue_burst(dev_id,\n+\t\t\t\t\t\t\t   mem->qp_id,\n+\t\t\t\t\t\t\t   deq_ops,\n+\t\t\t\t\t\t\t   allocated);\n+\t\t\ttsc_end = rte_rdtsc_precise();\n+\t\t\ttsc_duration = tsc_end - tsc_start;\n+\t\t\tctx->duration_deq += tsc_duration;\n+\n+\t\t\tif (num_deq < allocated)\n+\t\t\t\tctx->ops_deq_retries++;\n+\n+\t\t\ttotal_deq_ops += num_deq;\n+\n+\t\t\tif (iter == num_iter - 1) {\n+\t\t\t\tfor (i = 0; i < num_deq; i++) {\n+\t\t\t\t\tstruct rte_comp_op *op = deq_ops[i];\n+\n+\t\t\t\t\tif (op->status !=\n+\t\t\t\t\t\tRTE_COMP_OP_STATUS_SUCCESS) {\n+\t\t\t\t\t\tRTE_LOG(ERR, USER1, \"Some operations were not successful\\n\");\n+\t\t\t\t\t\tgoto end;\n+\t\t\t\t\t}\n+\n+\t\t\t\t\tstruct rte_mbuf *m = op->m_dst;\n+\n+\t\t\t\t\tm->pkt_len = op->produced;\n+\t\t\t\t\tuint32_t remaining_data = op->produced;\n+\t\t\t\t\tuint16_t data_to_append;\n+\n+\t\t\t\t\twhile (remaining_data > 0) {\n+\t\t\t\t\t\tdata_to_append =\n+\t\t\t\t\t\t\tRTE_MIN(remaining_data,\n+\t\t\t\t\t\t\t     out_seg_sz);\n+\t\t\t\t\t\tm->data_len = data_to_append;\n+\t\t\t\t\t\tremaining_data -=\n+\t\t\t\t\t\t\t\tdata_to_append;\n+\t\t\t\t\t\tm = m->next;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\trte_mempool_put_bulk(mem->op_pool,\n+\t\t\t\t\t     (void **)deq_ops, num_deq);\n+\t\t\tallocated -= num_deq;\n+\t\t}\n+\n+\t\t/* Dequeue the last operations */\n+\t\twhile (total_deq_ops < total_ops) {\n+\t\t\tif (unlikely(test_data->perf_comp_force_stop))\n+\t\t\t\tgoto end;\n+\n+\t\t\ttsc_start = rte_rdtsc_precise();\n+\t\t\tnum_deq = rte_compressdev_dequeue_burst(dev_id,\n+\t\t\t\t\t\tmem->qp_id,\n+\t\t\t\t\t\tdeq_ops,\n+\t\t\t\t\t\ttest_data->burst_sz);\n+\t\t\ttsc_end = rte_rdtsc_precise();\n+\t\t\ttsc_duration = tsc_end - tsc_start;\n+\t\t\tctx->duration_deq += tsc_duration;\n+\t\t\tctx->ops_deq_retries++;\n+\n+\t\t\tif (num_deq == 0) {\n+\t\t\t\tstruct rte_compressdev_stats stats;\n+\n+\t\t\t\trte_compressdev_stats_get(dev_id, &stats);\n+\t\t\t\tif (stats.dequeue_err_count) {\n+\t\t\t\t\tres = -1;\n+\t\t\t\t\tgoto end;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\ttotal_deq_ops += num_deq;\n+\n+\t\t\tif (iter == num_iter - 1) {\n+\t\t\t\tfor (i = 0; i < num_deq; i++) {\n+\t\t\t\t\tstruct rte_comp_op *op = deq_ops[i];\n+\n+\t\t\t\t\tif (op->status !=\n+\t\t\t\t\t\tRTE_COMP_OP_STATUS_SUCCESS) {\n+\t\t\t\t\t\tRTE_LOG(ERR, USER1, \"Some operations were not successful\\n\");\n+\t\t\t\t\t\tgoto end;\n+\t\t\t\t\t}\n+\n+\t\t\t\t\tstruct rte_mbuf *m = op->m_dst;\n+\n+\t\t\t\t\tm->pkt_len = op->produced;\n+\t\t\t\t\tuint32_t remaining_data = op->produced;\n+\t\t\t\t\tuint16_t data_to_append;\n+\n+\t\t\t\t\twhile (remaining_data > 0) {\n+\t\t\t\t\t\tdata_to_append =\n+\t\t\t\t\t\tRTE_MIN(remaining_data,\n+\t\t\t\t\t\t\tout_seg_sz);\n+\t\t\t\t\t\tm->data_len = data_to_append;\n+\t\t\t\t\t\tremaining_data -=\n+\t\t\t\t\t\t\t\tdata_to_append;\n+\t\t\t\t\t\tm = m->next;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\trte_mempool_put_bulk(mem->op_pool,\n+\t\t\t\t\t     (void **)deq_ops, num_deq);\n+\t\t\tallocated -= num_deq;\n+\t\t}\n+\t}\n+\tallocated = 0;\n+\n+end:\n+\tif (allocated)\n+\t\trte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);\n+\trte_compressdev_private_xform_free(dev_id, priv_xform);\n+\trte_free(ops);\n+\n+\tif (test_data->perf_comp_force_stop) {\n+\t\tRTE_LOG(ERR, USER1,\n+\t\t      \"lcore: %d Perf. test has been aborted by user\\n\",\n+\t\t\tmem->lcore_id);\n+\t\tres = -1;\n+\t}\n+\treturn res;\n+}\n+\n+int\n+cperf_cyclecount_test_runner(void *test_ctx)\n+{\n+\tstruct cperf_cyclecount_ctx *ctx = test_ctx;\n+\tstruct comp_test_data *test_data = ctx->ver.options;\n+\tuint32_t lcore = rte_lcore_id();\n+\tstatic rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);\n+\tstatic rte_spinlock_t print_spinlock;\n+\tint i;\n+\n+\tuint32_t ops_enq_retries_comp;\n+\tuint32_t ops_deq_retries_comp;\n+\n+\tuint32_t ops_enq_retries_decomp;\n+\tuint32_t ops_deq_retries_decomp;\n+\n+\tuint32_t duration_setup_per_op;\n+\n+\tuint32_t duration_enq_per_op_comp;\n+\tuint32_t duration_deq_per_op_comp;\n+\n+\tuint32_t duration_enq_per_op_decomp;\n+\tuint32_t duration_deq_per_op_decomp;\n+\n+\tctx->ver.mem.lcore_id = lcore;\n+\n+\t/*\n+\t * printing information about current compression thread\n+\t */\n+\tif (rte_atomic16_test_and_set(&ctx->ver.mem.print_info_once))\n+\t\tprintf(\"    lcore: %u,\"\n+\t\t\t\t\" driver name: %s,\"\n+\t\t\t\t\" device name: %s,\"\n+\t\t\t\t\" device id: %u,\"\n+\t\t\t\t\" socket id: %u,\"\n+\t\t\t\t\" queue pair id: %u\\n\",\n+\t\t\tlcore,\n+\t\t\tctx->ver.options->driver_name,\n+\t\t\trte_compressdev_name_get(ctx->ver.mem.dev_id),\n+\t\t\tctx->ver.mem.dev_id,\n+\t\t\trte_compressdev_socket_id(ctx->ver.mem.dev_id),\n+\t\t\tctx->ver.mem.qp_id);\n+\n+\t/*\n+\t * First the verification part is needed\n+\t */\n+\tif (cperf_verify_test_runner(&ctx->ver))\n+\t\treturn EXIT_FAILURE;\n+\n+\t/*\n+\t * Run the tests twice, discarding the first performance\n+\t * results, before the cache is warmed up\n+\t */\n+\n+\t/* C O M P R E S S */\n+\tfor (i = 0; i < 2; i++) {\n+\t\tif (main_loop(ctx, RTE_COMP_COMPRESS) < 0)\n+\t\t\treturn EXIT_FAILURE;\n+\t}\n+\n+\tops_enq_retries_comp = ctx->ops_enq_retries;\n+\tops_deq_retries_comp = ctx->ops_deq_retries;\n+\n+\tduration_enq_per_op_comp = ctx->duration_enq /\n+\t\t\t(ctx->ver.mem.total_bufs * test_data->num_iter);\n+\tduration_deq_per_op_comp = ctx->duration_deq /\n+\t\t\t(ctx->ver.mem.total_bufs * test_data->num_iter);\n+\n+\t/* D E C O M P R E S S */\n+\tfor (i = 0; i < 2; i++) {\n+\t\tif (main_loop(ctx, RTE_COMP_DECOMPRESS) < 0)\n+\t\t\treturn EXIT_FAILURE;\n+\t}\n+\n+\tops_enq_retries_decomp = ctx->ops_enq_retries;\n+\tops_deq_retries_decomp = ctx->ops_deq_retries;\n+\n+\tduration_enq_per_op_decomp = ctx->duration_enq /\n+\t\t\t(ctx->ver.mem.total_bufs * test_data->num_iter);\n+\tduration_deq_per_op_decomp = ctx->duration_deq /\n+\t\t\t(ctx->ver.mem.total_bufs * test_data->num_iter);\n+\n+\tduration_setup_per_op = ctx->duration_op /\n+\t\t\t(ctx->ver.mem.total_bufs * test_data->num_iter);\n+\n+\t/* R E P O R T processing */\n+\tif (rte_atomic16_test_and_set(&display_once)) {\n+\n+\t\trte_spinlock_lock(&print_spinlock);\n+\n+\t\tprintf(\"\\nLegend for the table\\n\"\n+\t\t\"  - Retries section: number of retries for the following operations:\\n\"\n+\t\t\"    [C-e] - compression enqueue\\n\"\n+\t\t\"    [C-d] - compression dequeue\\n\"\n+\t\t\"    [D-e] - decompression enqueue\\n\"\n+\t\t\"    [D-d] - decompression dequeue\\n\"\n+\t\t\"  - Cycles section: number of cycles per 'op' for the following operations:\\n\"\n+\t\t\"    setup/op - memory allocation, op configuration and memory dealocation\\n\"\n+\t\t\"    [C-e] - compression enqueue\\n\"\n+\t\t\"    [C-d] - compression dequeue\\n\"\n+\t\t\"    [D-e] - decompression enqueue\\n\"\n+\t\t\"    [D-d] - decompression dequeue\\n\\n\");\n+\n+\t\tprintf(\"\\n%12s%6s%12s%17s\",\n+\t\t\t\"lcore id\", \"Level\", \"Comp size\", \"Comp ratio [%]\");\n+\n+\t\tprintf(\"  |%10s %6s %8s %6s %8s\",\n+\t\t\t\" Retries:\",\n+\t\t\t\"[C-e]\", \"[C-d]\",\n+\t\t\t\"[D-e]\", \"[D-d]\");\n+\n+\t\tprintf(\"  |%9s %9s %9s %9s %9s %9s\\n\",\n+\t\t\t\" Cycles:\",\n+\t\t\t\"setup/op\",\n+\t\t\t\"[C-e]\", \"[C-d]\",\n+\t\t\t\"[D-e]\", \"[D-d]\");\n+\n+\t\trte_spinlock_unlock(&print_spinlock);\n+\t}\n+\n+\trte_spinlock_lock(&print_spinlock);\n+\n+\tprintf(\"%12u\"\n+\t       \"%6u\"\n+\t       \"%12zu\"\n+\t       \"%17.2f\",\n+\t\tctx->ver.mem.lcore_id,\n+\t\ttest_data->level,\n+\t\tctx->ver.comp_data_sz,\n+\t\tctx->ver.ratio);\n+\n+\tprintf(\"  |%10s %6u %8u %6u %8u\",\n+\t       \" \",\n+\t\tops_enq_retries_comp,\n+\t\tops_deq_retries_comp,\n+\t\tops_enq_retries_decomp,\n+\t\tops_deq_retries_decomp);\n+\n+\tprintf(\"  |%9s %9u %9u %9u %9u %9u\\n\",\n+\t       \" \",\n+\t\tduration_setup_per_op,\n+\t\tduration_enq_per_op_comp,\n+\t\tduration_deq_per_op_comp,\n+\t\tduration_enq_per_op_decomp,\n+\t\tduration_deq_per_op_decomp);\n+\n+\trte_spinlock_unlock(&print_spinlock);\n+\n+\treturn EXIT_SUCCESS;\n+}\ndiff --git a/app/test-compress-perf/comp_perf_test_cyclecount.h b/app/test-compress-perf/comp_perf_test_cyclecount.h\nnew file mode 100644\nindex 000000000..8e1b4d9e9\n--- /dev/null\n+++ b/app/test-compress-perf/comp_perf_test_cyclecount.h\n@@ -0,0 +1,24 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2019 Intel Corporation\n+ */\n+\n+#ifndef _COMP_PERF_TEST_CYCLECOUNT_\n+#define _COMP_PERF_TEST_CYCLECOUNT_\n+\n+#include <stdint.h>\n+\n+#include \"comp_perf_options.h\"\n+#include \"comp_perf_test_common.h\"\n+#include \"comp_perf_test_verify.h\"\n+\n+void\n+cperf_cyclecount_test_destructor(void *arg);\n+\n+int\n+cperf_cyclecount_test_runner(void *test_ctx);\n+\n+void *\n+cperf_cyclecount_test_constructor(uint8_t dev_id, uint16_t qp_id,\n+\t\tstruct comp_test_data *options);\n+\n+#endif\ndiff --git a/app/test-compress-perf/comp_perf_test_benchmark.c b/app/test-compress-perf/comp_perf_test_throughput.c\nsimilarity index 97%\nrename from app/test-compress-perf/comp_perf_test_benchmark.c\nrename to app/test-compress-perf/comp_perf_test_throughput.c\nindex 0c6bb9b45..13922b658 100644\n--- a/app/test-compress-perf/comp_perf_test_benchmark.c\n+++ b/app/test-compress-perf/comp_perf_test_throughput.c\n@@ -8,10 +8,10 @@\n #include <rte_cycles.h>\n #include <rte_compressdev.h>\n \n-#include \"comp_perf_test_benchmark.h\"\n+#include \"comp_perf_test_throughput.h\"\n \n void\n-cperf_benchmark_test_destructor(void *arg)\n+cperf_throughput_test_destructor(void *arg)\n {\n \tif (arg) {\n \t\tcomp_perf_free_memory(\n@@ -22,7 +22,7 @@ cperf_benchmark_test_destructor(void *arg)\n }\n \n void *\n-cperf_benchmark_test_constructor(uint8_t dev_id, uint16_t qp_id,\n+cperf_throughput_test_constructor(uint8_t dev_id, uint16_t qp_id,\n \t\tstruct comp_test_data *options)\n {\n \tstruct cperf_benchmark_ctx *ctx = NULL;\n@@ -41,7 +41,7 @@ cperf_benchmark_test_constructor(uint8_t dev_id, uint16_t qp_id,\n \t\t\t&& !prepare_bufs(ctx->ver.options, &ctx->ver.mem))\n \t\treturn ctx;\n \n-\tcperf_benchmark_test_destructor(ctx);\n+\tcperf_throughput_test_destructor(ctx);\n \treturn NULL;\n }\n \n@@ -324,7 +324,7 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)\n }\n \n int\n-cperf_benchmark_test_runner(void *test_ctx)\n+cperf_throughput_test_runner(void *test_ctx)\n {\n \tstruct cperf_benchmark_ctx *ctx = test_ctx;\n \tstruct comp_test_data *test_data = ctx->ver.options;\ndiff --git a/app/test-compress-perf/comp_perf_test_benchmark.h b/app/test-compress-perf/comp_perf_test_throughput.h\nsimilarity index 80%\nrename from app/test-compress-perf/comp_perf_test_benchmark.h\nrename to app/test-compress-perf/comp_perf_test_throughput.h\nindex d9b2694b8..467e3aa78 100644\n--- a/app/test-compress-perf/comp_perf_test_benchmark.h\n+++ b/app/test-compress-perf/comp_perf_test_throughput.h\n@@ -24,13 +24,13 @@ struct cperf_benchmark_ctx {\n };\n \n void\n-cperf_benchmark_test_destructor(void *arg);\n+cperf_throughput_test_destructor(void *arg);\n \n int\n-cperf_benchmark_test_runner(void *test_ctx);\n+cperf_throughput_test_runner(void *test_ctx);\n \n void *\n-cperf_benchmark_test_constructor(uint8_t dev_id, uint16_t qp_id,\n+cperf_throughput_test_constructor(uint8_t dev_id, uint16_t qp_id,\n \t\tstruct comp_test_data *options);\n \n #endif\ndiff --git a/app/test-compress-perf/comp_perf_test_verify.c b/app/test-compress-perf/comp_perf_test_verify.c\nindex 758a22ff5..5e13257b7 100644\n--- a/app/test-compress-perf/comp_perf_test_verify.c\n+++ b/app/test-compress-perf/comp_perf_test_verify.c\n@@ -48,8 +48,8 @@ static int\n main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)\n {\n \tstruct comp_test_data *test_data = ctx->options;\n-\tuint8_t *output_data_ptr;\n-\tsize_t *output_data_sz;\n+\tuint8_t *output_data_ptr = NULL;\n+\tsize_t *output_data_sz = NULL;\n \tstruct cperf_mem_resources *mem = &ctx->mem;\n \n \tuint8_t dev_id = mem->dev_id;\ndiff --git a/app/test-compress-perf/main.c b/app/test-compress-perf/main.c\nindex 6b56dd680..ed21605d8 100644\n--- a/app/test-compress-perf/main.c\n+++ b/app/test-compress-perf/main.c\n@@ -11,32 +11,41 @@\n #include <rte_log.h>\n #include <rte_compressdev.h>\n \n-#include \"comp_perf_options.h\"\n-#include \"comp_perf_test_verify.h\"\n-#include \"comp_perf_test_benchmark.h\"\n #include \"comp_perf.h\"\n+#include \"comp_perf_options.h\"\n #include \"comp_perf_test_common.h\"\n+#include \"comp_perf_test_cyclecount.h\"\n+#include \"comp_perf_test_throughput.h\"\n+#include \"comp_perf_test_verify.h\"\n \n #define NUM_MAX_XFORMS 16\n #define NUM_MAX_INFLIGHT_OPS 512\n \n __extension__\n const char *comp_perf_test_type_strs[] = {\n-\t[CPERF_TEST_TYPE_BENCHMARK] = \"benchmark\",\n-\t[CPERF_TEST_TYPE_VERIFY] = \"verify\"\n+\t[CPERF_TEST_TYPE_THROUGHPUT] = \"throughput\",\n+\t[CPERF_TEST_TYPE_VERIFY] = \"verify\",\n+\t[CPERF_TEST_TYPE_PMDCC] = \"pmd-cyclecount\"\n };\n \n __extension__\n static const struct cperf_test cperf_testmap[] = {\n-\t[CPERF_TEST_TYPE_BENCHMARK] = {\n-\t\t\tcperf_benchmark_test_constructor,\n-\t\t\tcperf_benchmark_test_runner,\n-\t\t\tcperf_benchmark_test_destructor\n+\t[CPERF_TEST_TYPE_THROUGHPUT] = {\n+\t\t\tcperf_throughput_test_constructor,\n+\t\t\tcperf_throughput_test_runner,\n+\t\t\tcperf_throughput_test_destructor\n+\n \t},\n \t[CPERF_TEST_TYPE_VERIFY] = {\n \t\t\tcperf_verify_test_constructor,\n \t\t\tcperf_verify_test_runner,\n \t\t\tcperf_verify_test_destructor\n+\t},\n+\n+\t[CPERF_TEST_TYPE_PMDCC] = {\n+\t\t\tcperf_cyclecount_test_constructor,\n+\t\t\tcperf_cyclecount_test_runner,\n+\t\t\tcperf_cyclecount_test_destructor\n \t}\n };\n \n@@ -116,7 +125,8 @@ comp_perf_initialize_compressdev(struct comp_test_data *test_data,\n \tenabled_cdev_count = rte_compressdev_devices_get(test_data->driver_name,\n \t\t\tenabled_cdevs, RTE_COMPRESS_MAX_DEVS);\n \tif (enabled_cdev_count == 0) {\n-\t\tRTE_LOG(ERR, USER1, \"No compress devices type %s available\\n\",\n+\t\tRTE_LOG(ERR, USER1, \"No compress devices type %s available,\"\n+\t\t\t\t    \" please check the list of specified devices in EAL section\\n\",\n \t\t\t\ttest_data->driver_name);\n \t\treturn -EINVAL;\n \t}\n@@ -270,6 +280,7 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)\n \t\tdata += data_to_read;\n \t}\n \n+\tprintf(\"\\n\");\n \tif (test_data->input_data_sz > actual_file_sz)\n \t\tRTE_LOG(INFO, USER1,\n \t\t  \"%zu bytes read from file %s, extending the file %.2f times\\n\",\n@@ -365,9 +376,12 @@ main(int argc, char **argv)\n \telse\n \t\ttest_data->level = test_data->level_lst.list[0];\n \n-\tprintf(\"App uses socket: %u\\n\", rte_socket_id());\n+\tprintf(\"\\nApp uses socket: %u\\n\", rte_socket_id());\n \tprintf(\"Burst size = %u\\n\", test_data->burst_sz);\n \tprintf(\"Input data size = %zu\\n\", test_data->input_data_sz);\n+\tif (test_data->test == CPERF_TEST_TYPE_PMDCC)\n+\t\tprintf(\"Cycle-count delay = %u [us]\\n\",\n+\t\t       test_data->cyclecount_delay);\n \n \ttest_data->cleanup = ST_DURING_TEST;\n \ttotal_nb_qps = nb_compressdevs * test_data->nb_qps;\n@@ -394,7 +408,7 @@ main(int argc, char **argv)\n \t\ti++;\n \t}\n \n-\tprint_test_dynamics(); /* constructors must be executed first */\n+\tprint_test_dynamics(test_data);\n \n \twhile (test_data->level <= test_data->level_lst.max) {\n \n@@ -472,7 +486,28 @@ main(int argc, char **argv)\n }\n \n __rte_weak void *\n-cperf_benchmark_test_constructor(uint8_t dev_id __rte_unused,\n+cperf_cyclecount_test_constructor(uint8_t dev_id __rte_unused,\n+\t\t\t\t uint16_t qp_id __rte_unused,\n+\t\t\t\t struct comp_test_data *options __rte_unused)\n+{\n+\tRTE_LOG(INFO, USER1, \"Cycle count test is not supported yet\\n\");\n+\treturn NULL;\n+}\n+\n+__rte_weak void\n+cperf_cyclecount_test_destructor(void *arg __rte_unused)\n+{\n+\tRTE_LOG(INFO, USER1, \"Something wrong happened!!!\\n\");\n+}\n+\n+__rte_weak int\n+cperf_cyclecount_test_runner(void *test_ctx __rte_unused)\n+{\n+\treturn 0;\n+}\n+\n+__rte_weak void *\n+cperf_throughput_test_constructor(uint8_t dev_id __rte_unused,\n \t\t\t\t uint16_t qp_id __rte_unused,\n \t\t\t\t struct comp_test_data *options __rte_unused)\n {\n@@ -481,13 +516,13 @@ cperf_benchmark_test_constructor(uint8_t dev_id __rte_unused,\n }\n \n __rte_weak void\n-cperf_benchmark_test_destructor(void *arg __rte_unused)\n+cperf_throughput_test_destructor(void *arg __rte_unused)\n {\n \n }\n \n __rte_weak int\n-cperf_benchmark_test_runner(void *test_ctx __rte_unused)\n+cperf_throughput_test_runner(void *test_ctx __rte_unused)\n {\n \treturn 0;\n }\ndiff --git a/app/test-compress-perf/meson.build b/app/test-compress-perf/meson.build\nindex 1136f04bc..1fe26cc14 100644\n--- a/app/test-compress-perf/meson.build\n+++ b/app/test-compress-perf/meson.build\n@@ -5,6 +5,7 @@ allow_experimental_apis = true\n sources = files('comp_perf_options_parse.c',\n \t\t'main.c',\n \t\t'comp_perf_test_verify.c',\n-\t\t'comp_perf_test_benchmark.c',\n+\t\t'comp_perf_test_throughput.c',\n+\t\t'comp_perf_test_cyclecount.c',\n \t\t'comp_perf_test_common.c')\n deps = ['compressdev']\n",
    "prefixes": []
}