Skip to contentSkip to conversation

add multiple cores feature to test-compress-perf

PATCH In review Tomasz Jozwiak 7 participants 87 messages May 30, 2019 – Jul 15, 2019 1 message not in the archive Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover add multiple cores feature to test-compress-perf

This patchset adds multiple cores feature to compression perf tool. All structures have been aligned and are consistent
with crypto perf tool. All test cases have constructor, runner and destructor and can use more cores and compression devices at the same time.

Tomasz Jozwiak (7):
app/test-compress-perf: add weak functions for multi-cores test app/test-compress-perf: add ptest command line option app/test-compress-perf: add verification test case app/test-compress-perf: add benchmark test case
doc: update dpdk-test-compress-perf description app/test-compress-perf: add force process termination
doc: update release notes for 19.08

 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf.h                |  61 +++
 app/test-compress-perf/comp_perf_options.h        |  46 +-
 app/test-compress-perf/comp_perf_options_parse.c  |  58 +-
 app/test-compress-perf/comp_perf_test_benchmark.c | 152 ++++--
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +-
 app/test-compress-perf/comp_perf_test_common.c    | 285 ++++++++++
 app/test-compress-perf/comp_perf_test_common.h    |  41 ++
 app/test-compress-perf/comp_perf_test_verify.c    | 136 +++--
 app/test-compress-perf/comp_perf_test_verify.h    |  24 +-
 app/test-compress-perf/main.c                     | 630 ++++++++++------------
 app/test-compress-perf/meson.build                |   3 +-
 doc/guides/rel_notes/release_19_08.rst            |   3 +
 doc/guides/tools/comp_perf.rst                    |  34 +-
 14 files changed, 1033 insertions(+), 466 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/7 app/test-compress-perf: add weak functions for multi-cores test

This patch adds a template functions for multi-cores performance version of compress-perf-tool.

---
 app/test-compress-perf/Makefile                  |   3 +-
 app/test-compress-perf/comp_perf.h               |  61 +++
 app/test-compress-perf/comp_perf_options.h       |  45 +-
 app/test-compress-perf/comp_perf_options_parse.c |  24 +-
 app/test-compress-perf/comp_perf_test_common.c   | 285 +++++++++++
 app/test-compress-perf/comp_perf_test_common.h   |  41 ++
 app/test-compress-perf/main.c                    | 624 ++++++++++-------------
 app/test-compress-perf/meson.build               |   3 +-
 8 files changed, 685 insertions(+), 401 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
app/test-compress-perf/Makefile +1 -2
index d20e17e..de74129 100644
@@ -12,7 +12,6 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
-SRCS-y += comp_perf_test_verify.c
-SRCS-y += comp_perf_test_benchmark.c
+SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf.h new file +61 -0

61 lines not on this page · raw message

app/test-compress-perf/comp_perf_options.h +26 -19

69 lines not on this page · raw message

app/test-compress-perf/comp_perf_options_parse.c +12 -12
index 2fb6fb4..bc4b98a 100644
@@ -466,19 +466,20 @@ parse_level(struct comp_test_data *test_data, const char *arg)
 	 * Try parsing the argument as a range, if it fails,
 	 * arse it as a list
 	 */
-	if (parse_range(arg, &test_data->level.min, &test_data->level.max,
-			&test_data->level.inc) < 0) {
-		ret = parse_list(arg, test_data->level.list,
-					&test_data->level.min,
-					&test_data->level.max);
+	if (parse_range(arg, &test_data->level_lst.min,
+			&test_data->level_lst.max,
+			&test_data->level_lst.inc) < 0) {
+		ret = parse_list(arg, test_data->level_lst.list,
+					&test_data->level_lst.min,
+					&test_data->level_lst.max);
 		if (ret < 0) {
 			RTE_LOG(ERR, USER1,
 				"Failed to parse compression level/s\n");
 			return -1;
 		}
-		test_data->level.count = ret;
+		test_data->level_lst.count = ret;
 
-		if (test_data->level.max > RTE_COMP_LEVEL_MAX) {
+		if (test_data->level_lst.max > RTE_COMP_LEVEL_MAX) {
 			RTE_LOG(ERR, USER1, "Level cannot be higher than %u\n",
 					RTE_COMP_LEVEL_MAX);
 			return -1;
@@ -498,7 +499,6 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
-
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -572,7 +572,6 @@ comp_perf_options_parse(struct comp_test_data *test_data, int argc, char **argv)
 void
 comp_perf_options_default(struct comp_test_data *test_data)
 {
-	test_data->cdev_id = -1;
 	test_data->seg_sz = 2048;
 	test_data->burst_sz = 32;
 	test_data->pool_sz = 8192;
@@ -581,9 +580,10 @@ comp_perf_options_default(struct comp_test_data *test_data)
 	test_data->huffman_enc = RTE_COMP_HUFFMAN_DYNAMIC;
 	test_data->test_op = COMPRESS_DECOMPRESS;
 	test_data->window_sz = -1;
-	test_data->level.min = 1;
-	test_data->level.max = 9;
-	test_data->level.inc = 1;
+	test_data->level_lst.min = 1;
+	test_data->level_lst.max = 9;
+	test_data->level_lst.inc = 1;
+	test_data->test = CPERF_TEST_TYPE_BENCHMARK;
 }
 
 int
app/test-compress-perf/comp_perf_test_common.c new file +285 -0

285 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_common.h new file +41 -0

41 lines not on this page · raw message

app/test-compress-perf/main.c +258 -366

731 lines not on this page · raw message

app/test-compress-perf/meson.build +1 -2
index ec73e5e..00413c6 100644
@@ -4,6 +4,5 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
-		'comp_perf_test_verify.c',
-		'comp_perf_test_benchmark.c')
+		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/7 app/test-compress-perf: add ptest command line option

In reply to Tomasz Jozwiak

This patch adds --ptest option to make possible a choose of test case from command line.

---
 app/test-compress-perf/comp_perf_options_parse.c | 36 ++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
app/test-compress-perf/comp_perf_options_parse.c +36 -0
index bc4b98a..07672b2 100644
@@ -15,6 +15,7 @@
 
 #include "comp_perf_options.h"
 
+#define CPERF_PTEST_TYPE	("ptest")
 #define CPERF_DRIVER_NAME	("driver-name")
 #define CPERF_TEST_FILE		("input-file")
 #define CPERF_SEG_SIZE		("seg-sz")
@@ -37,6 +38,7 @@ static void
 usage(char *progname)
 {
 	printf("%s [EAL options] --\n"
+		" --ptest benchmark / verify :"
 		" --driver-name NAME: compress driver to use\n"
 		" --input-file NAME: file to compress and decompress\n"
 		" --extended-input-sz N: extend file data up to this size (default: no extension)\n"
@@ -76,6 +78,37 @@ get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len,
 }
 
 static int
+parse_cperf_test_type(struct comp_test_data *test_data, const char *arg)
+{
+	struct name_id_map cperftest_namemap[] = {
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
+			CPERF_TEST_TYPE_BENCHMARK
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
+			CPERF_TEST_TYPE_VERIFY
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_PMDCC],
+			CPERF_TEST_TYPE_PMDCC
+		}
+	};
+
+	int id = get_str_key_id_mapping(
+			(struct name_id_map *)cperftest_namemap,
+			RTE_DIM(cperftest_namemap), arg);
+	if (id < 0) {
+		RTE_LOG(ERR, USER1, "failed to parse test type");
+		return -1;
+	}
+
+	test_data->test = (enum cperf_perf_test_type)id;
+
+	return 0;
+}
+
+static int
 parse_uint32_t(uint32_t *value, const char *arg)
 {
 	char *end = NULL;
@@ -499,6 +532,8 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
+
+	{ CPERF_PTEST_TYPE, required_argument, 0, 0 },
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -517,6 +552,7 @@ static int
 comp_perf_opts_parse_long(int opt_idx, struct comp_test_data *test_data)
 {
 	struct long_opt_parser parsermap[] = {
+		{ CPERF_PTEST_TYPE,	parse_cperf_test_type },
 		{ CPERF_DRIVER_NAME,	parse_driver_name },
 		{ CPERF_TEST_FILE,	parse_test_file },
 		{ CPERF_SEG_SIZE,	parse_seg_sz },
Signature · 1 line
2.7.4
#3 lore raw

Re: [dpdk-dev] [EXT] [PATCH v1 2/7] app/test-compress-perf: add ptest command line option

Quoted 28 lines

-----Original Message-----
From: Tomasz Jozwiak <[email protected]>
Sent: Thursday, May 30, 2019 1:36 PM
To: [email protected]; [email protected]; tjozwiakgm.gmail.com@mx0a- 0016f401.pphosted.com; Shally Verma <[email protected]>
Subject: [EXT] [PATCH v1 2/7] app/test-compress-perf: add ptest command line option

External Email

----------------------------------------------------------------------
This patch adds --ptest option to make possible a choose of test case from command line.

---
 app/test-compress-perf/comp_perf_options_parse.c | 36
++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
app/test- renamed from app/test-compress-perf/comp_perf_options_parse.c +0 -0

compress-perf/comp_perf_options_parse.c
index bc4b98a..07672b2 100644

app/test-compress-perf/comp_perf_options_parse.c line 18

Quoted 4 lines
app/test-compress-perf/comp_perf_options_parse.c +1 -0
@@ -15,6 +15,7 @@
 
 #include "comp_perf_options.h"
 
+#define CPERF_PTEST_TYPE	("ptest")

Why name cant be just CPERF_TEST_TYPE instead of PTEST_TYPE?

..

Quoted 1 line

2.7.4

#4 lore raw

PATCH 3/7 app/test-compress-perf: add verification test case

In reply to Tomasz Jozwiak

This patch adds a verification part to compression-perf-tool as a separate test case, which can be executed multi-threaded.

---
 app/test-compress-perf/Makefile                |   1 +
 app/test-compress-perf/comp_perf_test_verify.c | 122 ++++++++++++++++++-------
 app/test-compress-perf/comp_perf_test_verify.h |  24 ++++-
 app/test-compress-perf/main.c                  |   1 +
 app/test-compress-perf/meson.build             |   1 +
 5 files changed, 112 insertions(+), 37 deletions(-)
app/test-compress-perf/Makefile +1 -0
index de74129..f54d9a4 100644
@@ -12,6 +12,7 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
+SRCS-y += comp_perf_test_verify.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_verify.c +87 -35

242 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_verify.h +22 -2
index 67c6b49..ae8b742 100644
@@ -1,13 +1,33 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018-2019 Intel Corporation
  */
 
 #ifndef _COMP_PERF_TEST_VERIFY_
 #define _COMP_PERF_TEST_VERIFY_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+
+struct cperf_verify_ctx {
+	struct cperf_mem_resources mem;
+	struct comp_test_data *options;
+
+	int silent;
+	size_t comp_data_sz;
+	size_t decomp_data_sz;
+	double ratio;
+};
+
+void
+cperf_verify_test_destructor(void *arg);
 
 int
-cperf_verification(struct comp_test_data *test_data, uint8_t level);
+cperf_verify_test_runner(void *test_ctx);
+
+void *
+cperf_verify_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index f393c1b..813b205 100644
@@ -8,6 +8,7 @@
 #include <rte_compressdev.h>
 
 #include "comp_perf_options.h"
+#include "comp_perf_test_verify.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index 00413c6..c6246e5 100644
@@ -4,5 +4,6 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
+		'comp_perf_test_verify.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.7.4
#5 lore raw

PATCH 4/7 app/test-compress-perf: add benchmark test case

In reply to Tomasz Jozwiak

This patch adds a benchmark part to compression-perf-tool as a separate test case, which can be executed multi-threaded.

---
 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf_test_benchmark.c | 139 ++++++++++++++++------
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +++-
 app/test-compress-perf/main.c                     |   1 +
 app/test-compress-perf/meson.build                |   1 +
 5 files changed, 129 insertions(+), 38 deletions(-)
app/test-compress-perf/Makefile +1 -0
index f54d9a4..d1a6820 100644
@@ -13,6 +13,7 @@ CFLAGS += -O3
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
 SRCS-y += comp_perf_test_verify.c
+SRCS-y += comp_perf_test_benchmark.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_benchmark.c +102 -37

277 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_benchmark.h +24 -1
index b193445..d9b2694 100644
@@ -5,9 +5,32 @@
 #ifndef _COMP_PERF_TEST_BENCHMARK_
 #define _COMP_PERF_TEST_BENCHMARK_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+#include "comp_perf_test_verify.h"
+
+struct cperf_benchmark_ctx {
+	struct cperf_verify_ctx ver;
+
+	/* Store TSC duration for all levels (including level 0) */
+	uint64_t comp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	uint64_t decomp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	double comp_gbps;
+	double decomp_gbps;
+	double comp_tsc_byte;
+	double decomp_tsc_byte;
+};
+
+void
+cperf_benchmark_test_destructor(void *arg);
 
 int
-cperf_benchmark(struct comp_test_data *test_data, uint8_t level);
+cperf_benchmark_test_runner(void *test_ctx);
+
+void *
+cperf_benchmark_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index 813b205..c8be84e 100644
@@ -9,6 +9,7 @@
 
 #include "comp_perf_options.h"
 #include "comp_perf_test_verify.h"
+#include "comp_perf_test_benchmark.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index c6246e5..1136f04 100644
@@ -5,5 +5,6 @@ allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
 		'comp_perf_test_verify.c',
+		'comp_perf_test_benchmark.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.7.4
#6 lore raw

PATCH 5/7 doc: update dpdk-test-compress-perf description

In reply to Tomasz Jozwiak

This patch updates a dpdk-test-compress-perf documentation.

---
 doc/guides/tools/comp_perf.rst | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)
doc/guides/tools/comp_perf.rst +31 -3
index 52869c1..71eef18 100644
@@ -6,7 +6,9 @@ dpdk-test-compress-perf Tool
 
 The ``dpdk-test-compress-perf`` tool is a Data Plane Development Kit (DPDK)
 utility that allows measuring performance parameters of PMDs available in the
-compress tree. The tool reads the data from a file (--input-file),
+compress tree. User can use multiple cores to run tests on but only
+one type of compression PMD can be measured during single application
+execution. The tool reads the data from a file (--input-file),
 dumps all the file into a buffer and fills out the data of input mbufs,
 which are passed to compress device with compression operations.
 Then, the output buffers are fed into the decompression stage, and the resulting
@@ -26,9 +28,35 @@ Limitations
 
 * Stateful operation is not supported in this version.
 
+EAL Options
+~~~~~~~~~~~
+
+The following are the EAL command-line options that can be used in conjunction
+with the ``dpdk-test-compress-perf`` application.
+See the DPDK Getting Started Guides for more information on these options.
+
+*   ``-c <COREMASK>`` or ``-l <CORELIST>``
+
+	Set the hexadecimal bitmask of the cores to run on. The corelist is a
+	list cores to use.
+
+.. Note::
+
+	One lcore is needed for process admin, tests are run on all other cores.
+	To run tests on two lcores, three lcores must be passed to the tool.
+
+*   ``-w <PCI>``
+
+	Add a PCI device in white list.
+
+*   ``--vdev <driver><id>``
+
+	Add a virtual device.
+
+Appication Options
+~~~~~~~~~~~~~~~~~~
 
-Command line options
---------------------
+ ``--ptest [benchmark/verify]``: set test type (default: benchmark)
 
  ``--driver-name NAME``: compress driver to use
 
Signature · 1 line
2.7.4
#7 lore raw

PATCH 6/7 app/test-compress-perf: add force process termination

In reply to Tomasz Jozwiak

This patch adds a possibility to force controlled process termination as a result of two signals: SIGTERM and SIGINT

---
 app/test-compress-perf/comp_perf_options.h        |  1 +
 app/test-compress-perf/comp_perf_test_benchmark.c | 13 ++++++++++++
 app/test-compress-perf/comp_perf_test_verify.c    | 14 ++++++++++++
 app/test-compress-perf/main.c                     | 26 +++++++++++++++++++++--
 4 files changed, 52 insertions(+), 2 deletions(-)
app/test-compress-perf/comp_perf_options.h +1 -0
index 79e63d5..534212d 100644
@@ -68,6 +68,7 @@ struct comp_test_data {
 
 	double ratio;
 	enum cleanup_st cleanup;
+	int perf_comp_force_stop;
 };
 
 int
app/test-compress-perf/comp_perf_test_benchmark.c +13 -0
index 9b0b146..b38b33c 100644
@@ -183,6 +183,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -241,6 +244,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							   mem->qp_id,
 							   deq_ops,
@@ -305,6 +311,13 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
 	return res;
 }
 
app/test-compress-perf/comp_perf_test_verify.c +14 -0
index c2aab70..b2cd7a0 100644
@@ -187,6 +187,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -267,6 +270,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							mem->qp_id,
 							deq_ops,
@@ -345,6 +351,14 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
+
 	return res;
 }
 
app/test-compress-perf/main.c +24 -2
index c8be84e..98acd02 100644
@@ -2,6 +2,10 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
+#include <signal.h>
+#include <sys/types.h>
+#include <unistd.h>
+
 #include <rte_malloc.h>
 #include <rte_eal.h>
 #include <rte_log.h>
@@ -42,6 +46,8 @@ static const struct cperf_test cperf_testmap[] = {
 	}
 };
 
+static struct comp_test_data *test_data;
+
 static int
 comp_perf_check_capabilities(struct comp_test_data *test_data, uint8_t cdev_id)
 {
@@ -280,12 +286,24 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)
 	return ret;
 }
 
+static void
+comp_perf_cleanup_on_signal(int signalNumber __rte_unused)
+{
+	test_data->perf_comp_force_stop = 1;
+}
+
+static void
+comp_perf_register_cleanup_on_signal(void)
+{
+	signal(SIGTERM, comp_perf_cleanup_on_signal);
+	signal(SIGINT, comp_perf_cleanup_on_signal);
+}
+
 int
 main(int argc, char **argv)
 {
 	uint8_t level_idx = 0;
 	int ret, i;
-	struct comp_test_data *test_data;
 	void *ctx[RTE_MAX_LCORE] = {};
 	uint8_t enabled_cdevs[RTE_COMPRESS_MAX_DEVS];
 	int nb_compressdevs = 0;
@@ -307,6 +325,8 @@ main(int argc, char **argv)
 		rte_exit(EXIT_FAILURE, "Cannot reserve memory in socket %d\n",
 				rte_socket_id());
 
+	comp_perf_register_cleanup_on_signal();
+
 	ret = EXIT_SUCCESS;
 	test_data->cleanup = ST_TEST_DATA;
 	comp_perf_options_default(test_data);
@@ -426,8 +446,10 @@ main(int argc, char **argv)
 		/* fallthrough */
 	case ST_COMPDEV:
 		for (i = 0; i < nb_compressdevs &&
-				i < RTE_COMPRESS_MAX_DEVS; i++)
+		     i < RTE_COMPRESS_MAX_DEVS; i++) {
 			rte_compressdev_stop(enabled_cdevs[i]);
+			rte_compressdev_close(enabled_cdevs[i]);
+		}
 		/* fallthrough */
 	case ST_TEST_DATA:
 		rte_free(test_data);
Signature · 1 line
2.7.4
#8 lore raw

PATCH 7/7 doc: update release notes for 19.08

In reply to Tomasz Jozwiak

Added release note entry for test-compress-perf application

---
 doc/guides/rel_notes/release_19_08.rst | 3 +++
 1 file changed, 3 insertions(+)
doc/guides/rel_notes/release_19_08.rst +3 -0
index b9510f9..543e7d3 100644
@@ -54,6 +54,9 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Updated test-compress-perf tool application.**
+
+  Added multiple cores feature to compression perf tool application.
 
 Removed Items
 -------------
Signature · 1 line
2.7.4
#9 lore raw

v2 cover add multiple cores feature to test-compress-perf

In reply to Tomasz Jozwiak

This patchset adds multiple cores feature to compression perf tool. All structures have been aligned and are consistent
with crypto perf tool. All test cases have constructor, runner and destructor and can use more cores and compression devices at the same time.

v2 changes:

- fixed checkpatch warning
- fixed max_nb_queue_pairs detection. Based on compression API if max_nb_queue_pairs = 0 that means there is no limit in maximum number of queue pairs
- fixed qp setup on the last device

Tomasz Jozwiak (7):
app/test-compress-perf: add weak functions for multi-cores test app/test-compress-perf: add ptest command line option app/test-compress-perf: add verification test case app/test-compress-perf: add benchmark test case
doc: update dpdk-test-compress-perf description app/test-compress-perf: add force process termination
doc: update release notes for 19.08

 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf.h                |  61 +++
 app/test-compress-perf/comp_perf_options.h        |  46 +-
 app/test-compress-perf/comp_perf_options_parse.c  |  58 +-
 app/test-compress-perf/comp_perf_test_benchmark.c | 152 ++++--
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +-
 app/test-compress-perf/comp_perf_test_common.c    | 285 ++++++++++
 app/test-compress-perf/comp_perf_test_common.h    |  41 ++
 app/test-compress-perf/comp_perf_test_verify.c    | 136 +++--
 app/test-compress-perf/comp_perf_test_verify.h    |  24 +-
 app/test-compress-perf/main.c                     | 633 ++++++++++------------
 app/test-compress-perf/meson.build                |   3 +-
 doc/guides/rel_notes/release_19_08.rst            |   3 +
 doc/guides/tools/comp_perf.rst                    |  34 +-
 14 files changed, 1036 insertions(+), 466 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
Signature · 1 line
2.7.4
#10 lore raw

PATCH v2 1/7 app/test-compress-perf: add weak functions for multi-cores test

From: Tomasz Jozwiak <[email protected]>

This patch adds a template functions for multi-cores performance version of compress-perf-tool.

---
 app/test-compress-perf/Makefile                  |   3 +-
 app/test-compress-perf/comp_perf.h               |  61 +++
 app/test-compress-perf/comp_perf_options.h       |  45 +-
 app/test-compress-perf/comp_perf_options_parse.c |  24 +-
 app/test-compress-perf/comp_perf_test_common.c   | 285 +++++++++++
 app/test-compress-perf/comp_perf_test_common.h   |  41 ++
 app/test-compress-perf/main.c                    | 627 ++++++++++-------------
 app/test-compress-perf/meson.build               |   3 +-
 8 files changed, 688 insertions(+), 401 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
app/test-compress-perf/Makefile +1 -2
index d20e17e..de74129 100644
@@ -12,7 +12,6 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
-SRCS-y += comp_perf_test_verify.c
-SRCS-y += comp_perf_test_benchmark.c
+SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf.h new file +61 -0

61 lines not on this page · raw message

app/test-compress-perf/comp_perf_options.h +26 -19

69 lines not on this page · raw message

app/test-compress-perf/comp_perf_options_parse.c +12 -12
index 2fb6fb4..bc4b98a 100644
@@ -466,19 +466,20 @@ parse_level(struct comp_test_data *test_data, const char *arg)
 	 * Try parsing the argument as a range, if it fails,
 	 * arse it as a list
 	 */
-	if (parse_range(arg, &test_data->level.min, &test_data->level.max,
-			&test_data->level.inc) < 0) {
-		ret = parse_list(arg, test_data->level.list,
-					&test_data->level.min,
-					&test_data->level.max);
+	if (parse_range(arg, &test_data->level_lst.min,
+			&test_data->level_lst.max,
+			&test_data->level_lst.inc) < 0) {
+		ret = parse_list(arg, test_data->level_lst.list,
+					&test_data->level_lst.min,
+					&test_data->level_lst.max);
 		if (ret < 0) {
 			RTE_LOG(ERR, USER1,
 				"Failed to parse compression level/s\n");
 			return -1;
 		}
-		test_data->level.count = ret;
+		test_data->level_lst.count = ret;
 
-		if (test_data->level.max > RTE_COMP_LEVEL_MAX) {
+		if (test_data->level_lst.max > RTE_COMP_LEVEL_MAX) {
 			RTE_LOG(ERR, USER1, "Level cannot be higher than %u\n",
 					RTE_COMP_LEVEL_MAX);
 			return -1;
@@ -498,7 +499,6 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
-
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -572,7 +572,6 @@ comp_perf_options_parse(struct comp_test_data *test_data, int argc, char **argv)
 void
 comp_perf_options_default(struct comp_test_data *test_data)
 {
-	test_data->cdev_id = -1;
 	test_data->seg_sz = 2048;
 	test_data->burst_sz = 32;
 	test_data->pool_sz = 8192;
@@ -581,9 +580,10 @@ comp_perf_options_default(struct comp_test_data *test_data)
 	test_data->huffman_enc = RTE_COMP_HUFFMAN_DYNAMIC;
 	test_data->test_op = COMPRESS_DECOMPRESS;
 	test_data->window_sz = -1;
-	test_data->level.min = 1;
-	test_data->level.max = 9;
-	test_data->level.inc = 1;
+	test_data->level_lst.min = 1;
+	test_data->level_lst.max = 9;
+	test_data->level_lst.inc = 1;
+	test_data->test = CPERF_TEST_TYPE_BENCHMARK;
 }
 
 int
app/test-compress-perf/comp_perf_test_common.c new file +285 -0

285 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_common.h new file +41 -0

41 lines not on this page · raw message

app/test-compress-perf/main.c +261 -366

734 lines not on this page · raw message

app/test-compress-perf/meson.build +1 -2
index ec73e5e..00413c6 100644
@@ -4,6 +4,5 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
-		'comp_perf_test_verify.c',
-		'comp_perf_test_benchmark.c')
+		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.7.4
#11 lore raw

PATCH v2 2/7 app/test-compress-perf: add ptest command line option

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds --ptest option to make possible a choose of test case from command line.

---
 app/test-compress-perf/comp_perf_options_parse.c | 36 ++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
app/test-compress-perf/comp_perf_options_parse.c +36 -0
index bc4b98a..07672b2 100644
@@ -15,6 +15,7 @@
 
 #include "comp_perf_options.h"
 
+#define CPERF_PTEST_TYPE	("ptest")
 #define CPERF_DRIVER_NAME	("driver-name")
 #define CPERF_TEST_FILE		("input-file")
 #define CPERF_SEG_SIZE		("seg-sz")
@@ -37,6 +38,7 @@ static void
 usage(char *progname)
 {
 	printf("%s [EAL options] --\n"
+		" --ptest benchmark / verify :"
 		" --driver-name NAME: compress driver to use\n"
 		" --input-file NAME: file to compress and decompress\n"
 		" --extended-input-sz N: extend file data up to this size (default: no extension)\n"
@@ -76,6 +78,37 @@ get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len,
 }
 
 static int
+parse_cperf_test_type(struct comp_test_data *test_data, const char *arg)
+{
+	struct name_id_map cperftest_namemap[] = {
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
+			CPERF_TEST_TYPE_BENCHMARK
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
+			CPERF_TEST_TYPE_VERIFY
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_PMDCC],
+			CPERF_TEST_TYPE_PMDCC
+		}
+	};
+
+	int id = get_str_key_id_mapping(
+			(struct name_id_map *)cperftest_namemap,
+			RTE_DIM(cperftest_namemap), arg);
+	if (id < 0) {
+		RTE_LOG(ERR, USER1, "failed to parse test type");
+		return -1;
+	}
+
+	test_data->test = (enum cperf_perf_test_type)id;
+
+	return 0;
+}
+
+static int
 parse_uint32_t(uint32_t *value, const char *arg)
 {
 	char *end = NULL;
@@ -499,6 +532,8 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
+
+	{ CPERF_PTEST_TYPE, required_argument, 0, 0 },
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -517,6 +552,7 @@ static int
 comp_perf_opts_parse_long(int opt_idx, struct comp_test_data *test_data)
 {
 	struct long_opt_parser parsermap[] = {
+		{ CPERF_PTEST_TYPE,	parse_cperf_test_type },
 		{ CPERF_DRIVER_NAME,	parse_driver_name },
 		{ CPERF_TEST_FILE,	parse_test_file },
 		{ CPERF_SEG_SIZE,	parse_seg_sz },
Signature · 1 line
2.7.4
#12 lore raw

PATCH v2 3/7 app/test-compress-perf: add verification test case

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds a verification part to compression-perf-tool as a separate test case, which can be executed multi-threaded.

---
 app/test-compress-perf/Makefile                |   1 +
 app/test-compress-perf/comp_perf_test_verify.c | 122 ++++++++++++++++++-------
 app/test-compress-perf/comp_perf_test_verify.h |  24 ++++-
 app/test-compress-perf/main.c                  |   1 +
 app/test-compress-perf/meson.build             |   1 +
 5 files changed, 112 insertions(+), 37 deletions(-)
app/test-compress-perf/Makefile +1 -0
index de74129..f54d9a4 100644
@@ -12,6 +12,7 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
+SRCS-y += comp_perf_test_verify.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_verify.c +87 -35

242 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_verify.h +22 -2
index 67c6b49..ae8b742 100644
@@ -1,13 +1,33 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018-2019 Intel Corporation
  */
 
 #ifndef _COMP_PERF_TEST_VERIFY_
 #define _COMP_PERF_TEST_VERIFY_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+
+struct cperf_verify_ctx {
+	struct cperf_mem_resources mem;
+	struct comp_test_data *options;
+
+	int silent;
+	size_t comp_data_sz;
+	size_t decomp_data_sz;
+	double ratio;
+};
+
+void
+cperf_verify_test_destructor(void *arg);
 
 int
-cperf_verification(struct comp_test_data *test_data, uint8_t level);
+cperf_verify_test_runner(void *test_ctx);
+
+void *
+cperf_verify_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index c65d609..42ffb0d 100644
@@ -8,6 +8,7 @@
 #include <rte_compressdev.h>
 
 #include "comp_perf_options.h"
+#include "comp_perf_test_verify.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index 00413c6..c6246e5 100644
@@ -4,5 +4,6 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
+		'comp_perf_test_verify.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.7.4
#13 lore raw

PATCH v2 4/7 app/test-compress-perf: add benchmark test case

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds a benchmark part to compression-perf-tool as a separate test case, which can be executed multi-threaded.

---
 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf_test_benchmark.c | 139 ++++++++++++++++------
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +++-
 app/test-compress-perf/main.c                     |   1 +
 app/test-compress-perf/meson.build                |   1 +
 5 files changed, 129 insertions(+), 38 deletions(-)
app/test-compress-perf/Makefile +1 -0
index f54d9a4..d1a6820 100644
@@ -13,6 +13,7 @@ CFLAGS += -O3
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
 SRCS-y += comp_perf_test_verify.c
+SRCS-y += comp_perf_test_benchmark.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_benchmark.c +102 -37

277 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_benchmark.h +24 -1
index b193445..d9b2694 100644
@@ -5,9 +5,32 @@
 #ifndef _COMP_PERF_TEST_BENCHMARK_
 #define _COMP_PERF_TEST_BENCHMARK_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+#include "comp_perf_test_verify.h"
+
+struct cperf_benchmark_ctx {
+	struct cperf_verify_ctx ver;
+
+	/* Store TSC duration for all levels (including level 0) */
+	uint64_t comp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	uint64_t decomp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	double comp_gbps;
+	double decomp_gbps;
+	double comp_tsc_byte;
+	double decomp_tsc_byte;
+};
+
+void
+cperf_benchmark_test_destructor(void *arg);
 
 int
-cperf_benchmark(struct comp_test_data *test_data, uint8_t level);
+cperf_benchmark_test_runner(void *test_ctx);
+
+void *
+cperf_benchmark_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index 42ffb0d..f8e5f15 100644
@@ -9,6 +9,7 @@
 
 #include "comp_perf_options.h"
 #include "comp_perf_test_verify.h"
+#include "comp_perf_test_benchmark.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index c6246e5..1136f04 100644
@@ -5,5 +5,6 @@ allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
 		'comp_perf_test_verify.c',
+		'comp_perf_test_benchmark.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.7.4
#14 lore raw

PATCH v2 5/7 doc: update dpdk-test-compress-perf description

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch updates a dpdk-test-compress-perf documentation.

---
 doc/guides/tools/comp_perf.rst | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)
doc/guides/tools/comp_perf.rst +31 -3
index 52869c1..71eef18 100644
@@ -6,7 +6,9 @@ dpdk-test-compress-perf Tool
 
 The ``dpdk-test-compress-perf`` tool is a Data Plane Development Kit (DPDK)
 utility that allows measuring performance parameters of PMDs available in the
-compress tree. The tool reads the data from a file (--input-file),
+compress tree. User can use multiple cores to run tests on but only
+one type of compression PMD can be measured during single application
+execution. The tool reads the data from a file (--input-file),
 dumps all the file into a buffer and fills out the data of input mbufs,
 which are passed to compress device with compression operations.
 Then, the output buffers are fed into the decompression stage, and the resulting
@@ -26,9 +28,35 @@ Limitations
 
 * Stateful operation is not supported in this version.
 
+EAL Options
+~~~~~~~~~~~
+
+The following are the EAL command-line options that can be used in conjunction
+with the ``dpdk-test-compress-perf`` application.
+See the DPDK Getting Started Guides for more information on these options.
+
+*   ``-c <COREMASK>`` or ``-l <CORELIST>``
+
+	Set the hexadecimal bitmask of the cores to run on. The corelist is a
+	list cores to use.
+
+.. Note::
+
+	One lcore is needed for process admin, tests are run on all other cores.
+	To run tests on two lcores, three lcores must be passed to the tool.
+
+*   ``-w <PCI>``
+
+	Add a PCI device in white list.
+
+*   ``--vdev <driver><id>``
+
+	Add a virtual device.
+
+Appication Options
+~~~~~~~~~~~~~~~~~~
 
-Command line options
---------------------
+ ``--ptest [benchmark/verify]``: set test type (default: benchmark)
 
  ``--driver-name NAME``: compress driver to use
 
Signature · 1 line
2.7.4
#15 lore raw

PATCH v2 6/7 app/test-compress-perf: add force process termination

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds a possibility to force controlled process termination as a result of two signals: SIGTERM and SIGINT

---
 app/test-compress-perf/comp_perf_options.h        |  1 +
 app/test-compress-perf/comp_perf_test_benchmark.c | 13 ++++++++++++
 app/test-compress-perf/comp_perf_test_verify.c    | 14 ++++++++++++
 app/test-compress-perf/main.c                     | 26 +++++++++++++++++++++--
 4 files changed, 52 insertions(+), 2 deletions(-)
app/test-compress-perf/comp_perf_options.h +1 -0
index 79e63d5..534212d 100644
@@ -68,6 +68,7 @@ struct comp_test_data {
 
 	double ratio;
 	enum cleanup_st cleanup;
+	int perf_comp_force_stop;
 };
 
 int
app/test-compress-perf/comp_perf_test_benchmark.c +13 -0
index 9b0b146..b38b33c 100644
@@ -183,6 +183,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -241,6 +244,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							   mem->qp_id,
 							   deq_ops,
@@ -305,6 +311,13 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
 	return res;
 }
 
app/test-compress-perf/comp_perf_test_verify.c +14 -0
index c2aab70..b2cd7a0 100644
@@ -187,6 +187,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -267,6 +270,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							mem->qp_id,
 							deq_ops,
@@ -345,6 +351,14 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
+
 	return res;
 }
 
app/test-compress-perf/main.c +24 -2
index f8e5f15..a9022f6 100644
@@ -2,6 +2,10 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
+#include <signal.h>
+#include <sys/types.h>
+#include <unistd.h>
+
 #include <rte_malloc.h>
 #include <rte_eal.h>
 #include <rte_log.h>
@@ -42,6 +46,8 @@ static const struct cperf_test cperf_testmap[] = {
 	}
 };
 
+static struct comp_test_data *test_data;
+
 static int
 comp_perf_check_capabilities(struct comp_test_data *test_data, uint8_t cdev_id)
 {
@@ -283,12 +289,24 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)
 	return ret;
 }
 
+static void
+comp_perf_cleanup_on_signal(int signalNumber __rte_unused)
+{
+	test_data->perf_comp_force_stop = 1;
+}
+
+static void
+comp_perf_register_cleanup_on_signal(void)
+{
+	signal(SIGTERM, comp_perf_cleanup_on_signal);
+	signal(SIGINT, comp_perf_cleanup_on_signal);
+}
+
 int
 main(int argc, char **argv)
 {
 	uint8_t level_idx = 0;
 	int ret, i;
-	struct comp_test_data *test_data;
 	void *ctx[RTE_MAX_LCORE] = {};
 	uint8_t enabled_cdevs[RTE_COMPRESS_MAX_DEVS];
 	int nb_compressdevs = 0;
@@ -310,6 +328,8 @@ main(int argc, char **argv)
 		rte_exit(EXIT_FAILURE, "Cannot reserve memory in socket %d\n",
 				rte_socket_id());
 
+	comp_perf_register_cleanup_on_signal();
+
 	ret = EXIT_SUCCESS;
 	test_data->cleanup = ST_TEST_DATA;
 	comp_perf_options_default(test_data);
@@ -429,8 +449,10 @@ main(int argc, char **argv)
 		/* fallthrough */
 	case ST_COMPDEV:
 		for (i = 0; i < nb_compressdevs &&
-				i < RTE_COMPRESS_MAX_DEVS; i++)
+		     i < RTE_COMPRESS_MAX_DEVS; i++) {
 			rte_compressdev_stop(enabled_cdevs[i]);
+			rte_compressdev_close(enabled_cdevs[i]);
+		}
 		/* fallthrough */
 	case ST_TEST_DATA:
 		rte_free(test_data);
Signature · 1 line
2.7.4
#16 lore raw

PATCH v2 7/7 doc: update release notes for 19.08

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

Added release note entry for test-compress-perf application

---
 doc/guides/rel_notes/release_19_08.rst | 3 +++
 1 file changed, 3 insertions(+)
doc/guides/rel_notes/release_19_08.rst +3 -0
index b9510f9..543e7d3 100644
@@ -54,6 +54,9 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Updated test-compress-perf tool application.**
+
+  Added multiple cores feature to compression perf tool application.
 
 Removed Items
 -------------
Signature · 1 line
2.7.4
#17 lore raw

v3 cover add multiple cores feature to test-compress-perf

In reply to Tomasz Jozwiak

This patchset adds multiple cores feature to compression perf tool. All structures have been aligned and are consistent
with crypto perf tool. All test cases have constructor, runner and destructor and can use more cores and compression devices at the same time.

v2 changes:

- fixed checkpatch warning
- fixed max_nb_queue_pairs detection. Based on compression API if max_nb_queue_pairs = 0 that means there is no limit in maximum number of queue pairs
- fixed qp setup on the last device

v3 changes:

- merged with commit 767350e7ede791932cc050bf2a192f6527b70c15 app/compress-perf: add prints for socket id

- fixed wrong compression/decompression throughput calculation

Tomasz Jozwiak (7):
app/test-compress-perf: add weak functions for multi-cores test app/test-compress-perf: add ptest command line option app/test-compress-perf: add verification test case app/test-compress-perf: add benchmark test case
doc: update dpdk-test-compress-perf description app/test-compress-perf: add force process termination
doc: update release notes for 19.08

 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf.h                |  61 +++
 app/test-compress-perf/comp_perf_options.h        |  46 +-
 app/test-compress-perf/comp_perf_options_parse.c  |  58 +-
 app/test-compress-perf/comp_perf_test_benchmark.c | 152 ++++--
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +-
 app/test-compress-perf/comp_perf_test_common.c    | 285 ++++++++++
 app/test-compress-perf/comp_perf_test_common.h    |  41 ++
 app/test-compress-perf/comp_perf_test_verify.c    | 136 +++--
 app/test-compress-perf/comp_perf_test_verify.h    |  24 +-
 app/test-compress-perf/main.c                     | 632 ++++++++++------------
 app/test-compress-perf/meson.build                |   3 +-
 doc/guides/rel_notes/release_19_08.rst            |   3 +
 doc/guides/tools/comp_perf.rst                    |  34 +-
 14 files changed, 1034 insertions(+), 467 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
Signature · 1 line
2.7.4
#18 lore raw

PATCH v3 1/7 app/test-compress-perf: add weak functions for multi-cores test

From: Tomasz Jozwiak <[email protected]>

This patch adds a template functions for multi-cores performance version of compress-perf-tool.

---
 app/test-compress-perf/Makefile                  |   3 +-
 app/test-compress-perf/comp_perf.h               |  61 +++
 app/test-compress-perf/comp_perf_options.h       |  45 +-
 app/test-compress-perf/comp_perf_options_parse.c |  24 +-
 app/test-compress-perf/comp_perf_test_common.c   | 285 +++++++++++
 app/test-compress-perf/comp_perf_test_common.h   |  41 ++
 app/test-compress-perf/main.c                    | 626 ++++++++++-------------
 app/test-compress-perf/meson.build               |   3 +-
 8 files changed, 686 insertions(+), 402 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
app/test-compress-perf/Makefile +1 -2
index d20e17e..de74129 100644
@@ -12,7 +12,6 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
-SRCS-y += comp_perf_test_verify.c
-SRCS-y += comp_perf_test_benchmark.c
+SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf.h new file +61 -0

61 lines not on this page · raw message

app/test-compress-perf/comp_perf_options.h +26 -19

69 lines not on this page · raw message

app/test-compress-perf/comp_perf_options_parse.c +12 -12
index 2fb6fb4..bc4b98a 100644
@@ -466,19 +466,20 @@ parse_level(struct comp_test_data *test_data, const char *arg)
 	 * Try parsing the argument as a range, if it fails,
 	 * arse it as a list
 	 */
-	if (parse_range(arg, &test_data->level.min, &test_data->level.max,
-			&test_data->level.inc) < 0) {
-		ret = parse_list(arg, test_data->level.list,
-					&test_data->level.min,
-					&test_data->level.max);
+	if (parse_range(arg, &test_data->level_lst.min,
+			&test_data->level_lst.max,
+			&test_data->level_lst.inc) < 0) {
+		ret = parse_list(arg, test_data->level_lst.list,
+					&test_data->level_lst.min,
+					&test_data->level_lst.max);
 		if (ret < 0) {
 			RTE_LOG(ERR, USER1,
 				"Failed to parse compression level/s\n");
 			return -1;
 		}
-		test_data->level.count = ret;
+		test_data->level_lst.count = ret;
 
-		if (test_data->level.max > RTE_COMP_LEVEL_MAX) {
+		if (test_data->level_lst.max > RTE_COMP_LEVEL_MAX) {
 			RTE_LOG(ERR, USER1, "Level cannot be higher than %u\n",
 					RTE_COMP_LEVEL_MAX);
 			return -1;
@@ -498,7 +499,6 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
-
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -572,7 +572,6 @@ comp_perf_options_parse(struct comp_test_data *test_data, int argc, char **argv)
 void
 comp_perf_options_default(struct comp_test_data *test_data)
 {
-	test_data->cdev_id = -1;
 	test_data->seg_sz = 2048;
 	test_data->burst_sz = 32;
 	test_data->pool_sz = 8192;
@@ -581,9 +580,10 @@ comp_perf_options_default(struct comp_test_data *test_data)
 	test_data->huffman_enc = RTE_COMP_HUFFMAN_DYNAMIC;
 	test_data->test_op = COMPRESS_DECOMPRESS;
 	test_data->window_sz = -1;
-	test_data->level.min = 1;
-	test_data->level.max = 9;
-	test_data->level.inc = 1;
+	test_data->level_lst.min = 1;
+	test_data->level_lst.max = 9;
+	test_data->level_lst.inc = 1;
+	test_data->test = CPERF_TEST_TYPE_BENCHMARK;
 }
 
 int
app/test-compress-perf/comp_perf_test_common.c new file +285 -0

285 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_common.h new file +41 -0

41 lines not on this page · raw message

app/test-compress-perf/main.c +259 -367

728 lines not on this page · raw message

app/test-compress-perf/meson.build +1 -2
index ec73e5e..00413c6 100644
@@ -4,6 +4,5 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
-		'comp_perf_test_verify.c',
-		'comp_perf_test_benchmark.c')
+		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.7.4
#19 lore raw

PATCH v3 2/7 app/test-compress-perf: add ptest command line option

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds --ptest option to make possible a choose of test case from command line.

---
 app/test-compress-perf/comp_perf_options_parse.c | 36 ++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
app/test-compress-perf/comp_perf_options_parse.c +36 -0
index bc4b98a..07672b2 100644
@@ -15,6 +15,7 @@
 
 #include "comp_perf_options.h"
 
+#define CPERF_PTEST_TYPE	("ptest")
 #define CPERF_DRIVER_NAME	("driver-name")
 #define CPERF_TEST_FILE		("input-file")
 #define CPERF_SEG_SIZE		("seg-sz")
@@ -37,6 +38,7 @@ static void
 usage(char *progname)
 {
 	printf("%s [EAL options] --\n"
+		" --ptest benchmark / verify :"
 		" --driver-name NAME: compress driver to use\n"
 		" --input-file NAME: file to compress and decompress\n"
 		" --extended-input-sz N: extend file data up to this size (default: no extension)\n"
@@ -76,6 +78,37 @@ get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len,
 }
 
 static int
+parse_cperf_test_type(struct comp_test_data *test_data, const char *arg)
+{
+	struct name_id_map cperftest_namemap[] = {
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
+			CPERF_TEST_TYPE_BENCHMARK
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
+			CPERF_TEST_TYPE_VERIFY
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_PMDCC],
+			CPERF_TEST_TYPE_PMDCC
+		}
+	};
+
+	int id = get_str_key_id_mapping(
+			(struct name_id_map *)cperftest_namemap,
+			RTE_DIM(cperftest_namemap), arg);
+	if (id < 0) {
+		RTE_LOG(ERR, USER1, "failed to parse test type");
+		return -1;
+	}
+
+	test_data->test = (enum cperf_perf_test_type)id;
+
+	return 0;
+}
+
+static int
 parse_uint32_t(uint32_t *value, const char *arg)
 {
 	char *end = NULL;
@@ -499,6 +532,8 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
+
+	{ CPERF_PTEST_TYPE, required_argument, 0, 0 },
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -517,6 +552,7 @@ static int
 comp_perf_opts_parse_long(int opt_idx, struct comp_test_data *test_data)
 {
 	struct long_opt_parser parsermap[] = {
+		{ CPERF_PTEST_TYPE,	parse_cperf_test_type },
 		{ CPERF_DRIVER_NAME,	parse_driver_name },
 		{ CPERF_TEST_FILE,	parse_test_file },
 		{ CPERF_SEG_SIZE,	parse_seg_sz },
Signature · 1 line
2.7.4
#20 lore raw

Re: [dpdk-dev] [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest command line option

Quoted 55 lines

-----Original Message-----
From: Tomasz Jozwiak <[email protected]>
Sent: Wednesday, June 26, 2019 10:00 PM
To: [email protected]; [email protected]; [email protected]; Shally Verma <[email protected]>; [email protected]
Subject: [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest command line option

External Email

----------------------------------------------------------------------
From: Tomasz Jozwiak <[email protected]>

This patch adds --ptest option to make possible a choose of test case from command line.

---
 app/test-compress-perf/comp_perf_options_parse.c | 36
++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
app/test- renamed from app/test-compress-perf/comp_perf_options_parse.c +0 -0

compress-perf/comp_perf_options_parse.c
index bc4b98a..07672b2 100644

app/test-compress-perf/comp_perf_options_parse.c +2 -0
@@ -15,6 +15,7 @@
 
 #include "comp_perf_options.h"
 
+#define CPERF_PTEST_TYPE	("ptest")
 #define CPERF_DRIVER_NAME	("driver-name")
 #define CPERF_TEST_FILE		("input-file")
 #define CPERF_SEG_SIZE		("seg-sz")
@@ -37,6 +38,7 @@ static void
 usage(char *progname)
 {
 	printf("%s [EAL options] --\n"
+		" --ptest benchmark / verify :"
 		" --driver-name NAME: compress driver to use\n"
 		" --input-file NAME: file to compress and decompress\n"
 		" --extended-input-sz N: extend file data up to this size

(default: no extension)\n"

app/test-compress-perf/comp_perf_options_parse.c +5 -0
@@ -76,6 +78,37 @@ get_str_key_id_mapping(struct name_id_map *map,
 unsigned int map_len,  }
 
 static int
+parse_cperf_test_type(struct comp_test_data *test_data, const char
+*arg) {
+	struct name_id_map cperftest_namemap[] = {
+		{
+

app/test-compress-perf/comp_perf_options_parse.c get_str_key_id_mapping(struct name_id_map *map, · line 95

Quoted 10 lines
app/test-compress-perf/comp_perf_options_parse.c +9 -0
 	cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
+			CPERF_TEST_TYPE_BENCHMARK
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
+			CPERF_TEST_TYPE_VERIFY
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_PMDCC],
+			CPERF_TEST_TYPE_PMDCC

What is PMDCC here? What kind of test type?

Quoted 36 lines
app/test-compress-perf/comp_perf_options_parse.c +19 -0
+		}
+	};
+
+	int id = get_str_key_id_mapping(
+			(struct name_id_map *)cperftest_namemap,
+			RTE_DIM(cperftest_namemap), arg);
+	if (id < 0) {
+		RTE_LOG(ERR, USER1, "failed to parse test type");
+		return -1;
+	}
+
+	test_data->test = (enum cperf_perf_test_type)id;
+
+	return 0;
+}
+
+static int
 parse_uint32_t(uint32_t *value, const char *arg)  {
 	char *end = NULL;
@@ -499,6 +532,8 @@ struct long_opt_parser {  };
 
 static struct option lgopts[] = {
+
+	{ CPERF_PTEST_TYPE, required_argument, 0, 0 },
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 }, @@ -517,6 +552,7 @@

static int comp_perf_opts_parse_long(int opt_idx, struct comp_test_data *test_data) {

app/test-compress-perf/comp_perf_options_parse.c +1 -1
 	struct long_opt_parser parsermap[] = {
+		{ CPERF_PTEST_TYPE,	parse_cperf_test_type },
 		{ CPERF_DRIVER_NAME,	parse_driver_name },
 		{ CPERF_TEST_FILE,	parse_test_file },
 		{ CPERF_SEG_SIZE,	parse_seg_sz },
--

2.7.4

#21 lore raw

Re: [dpdk-dev] [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest command line option

Hi Shally,

Quoted 56 lines
Quoted 56 lines

-----Original Message-----
From: Tomasz Jozwiak <[email protected]>
Sent: Wednesday, June 26, 2019 10:00 PM
To: [email protected]; [email protected]; [email protected]; Shally Verma <[email protected]>; [email protected]
Subject: [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest command line option

External Email

----------------------------------------------------------------------
From: Tomasz Jozwiak <[email protected]>

This patch adds --ptest option to make possible a choose of test case from command line.

---
  app/test-compress-perf/comp_perf_options_parse.c | 36
++++++++++++++++++++++++
  1 file changed, 36 insertions(+)
app/test- renamed from app/test-compress-perf/comp_perf_options_parse.c +0 -0

compress-perf/comp_perf_options_parse.c
index bc4b98a..07672b2 100644

app/test-compress-perf/comp_perf_options_parse.c +2 -0
@@ -15,6 +15,7 @@
 
  #include "comp_perf_options.h"
 
+#define CPERF_PTEST_TYPE	("ptest")
  #define CPERF_DRIVER_NAME	("driver-name")
  #define CPERF_TEST_FILE		("input-file")
  #define CPERF_SEG_SIZE		("seg-sz")
@@ -37,6 +38,7 @@ static void
  usage(char *progname)
  {
  	printf("%s [EAL options] --\n"
+		" --ptest benchmark / verify :"
  		" --driver-name NAME: compress driver to use\n"
  		" --input-file NAME: file to compress and decompress\n"
  		" --extended-input-sz N: extend file data up to this size

(default: no extension)\n"

app/test-compress-perf/comp_perf_options_parse.c +7 -0
@@ -76,6 +78,37 @@ get_str_key_id_mapping(struct name_id_map *map,
 unsigned int map_len,  }
 
  static int
+parse_cperf_test_type(struct comp_test_data *test_data, const char
+*arg) {
+	struct name_id_map cperftest_namemap[] = {
+		{
+
 	cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
+			CPERF_TEST_TYPE_BENCHMARK
+		},
Quoted 8 lines

app/test-compress-perf/comp_perf_options_parse.c get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len, · line 94

Quoted 7 lines
app/test-compress-perf/comp_perf_options_parse.c +7 -0
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
+			CPERF_TEST_TYPE_VERIFY
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_PMDCC],
+			CPERF_TEST_TYPE_PMDCC

What is PMDCC here? What kind of test type?

[Tomek] This's for 'pmd_cyclecount_test'. Actually compression_perf tool

doesn't support that test, but we added a sort of 'template' for that, cause there's a plan to add

this test in the future.

Thx

--

Tomek

#22 lore raw

Re: [dpdk-dev] [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest command line option

Quoted 81 lines

-----Original Message-----
From: Tomasz Jozwiak <[email protected]>
Sent: Wednesday, June 26, 2019 11:05 PM
To: Shally Verma <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest command line option

Hi Shally,

Quoted 4 lines
Quoted 4 lines

-----Original Message-----
From: Tomasz Jozwiak <[email protected]>
Sent: Wednesday, June 26, 2019 10:00 PM
To: [email protected]; [email protected]; [email protected];

Shally

Quoted 28 lines
Quoted 28 lines

Verma <[email protected]>; [email protected]
Subject: [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest command line option

External Email

---------------------------------------------------------------------
-
From: Tomasz Jozwiak <[email protected]>

This patch adds --ptest option to make possible a choose of test case from command line.

---
  app/test-compress-perf/comp_perf_options_parse.c | 36
++++++++++++++++++++++++
  1 file changed, 36 insertions(+)
(quoted diff) +0 -0

b/app/test- compress-perf/comp_perf_options_parse.c index bc4b98a..07672b2 100644

app/test-compress-perf/comp_perf_options_parse.c +0 -0
@@ -15,6 +15,7 @@
 
  #include "comp_perf_options.h"
 
Quoted 14 lines

app/test-compress-perf/comp_perf_options_parse.c get_str_key_id_mapping(struct name_id_map

Quoted 14 lines
app/test-compress-perf/comp_perf_options_parse.c +2 -0
+#define CPERF_PTEST_TYPE	("ptest")
  #define CPERF_DRIVER_NAME	("driver-name")
  #define CPERF_TEST_FILE		("input-file")
  #define CPERF_SEG_SIZE		("seg-sz")
@@ -37,6 +38,7 @@ static void
  usage(char *progname)
  {
  	printf("%s [EAL options] --\n"
+		" --ptest benchmark / verify :"
  		" --driver-name NAME: compress driver to use\n"
  		" --input-file NAME: file to compress and decompress\n"
  		" --extended-input-sz N: extend file data up to this size

(default: no extension)\n"

app/test-compress-perf/comp_perf_options_parse.c +0 -0
@@ -76,6 +78,37 @@ get_str_key_id_mapping(struct name_id_map

*map,

Quoted 11 lines
Quoted 11 lines
app/test-compress-perf/comp_perf_options_parse.c +7 -0
 unsigned int map_len,  }
 
  static int
+parse_cperf_test_type(struct comp_test_data *test_data, const char
+*arg) {
+	struct name_id_map cperftest_namemap[] = {
+		{
+
 	cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
+			CPERF_TEST_TYPE_BENCHMARK
+		},
Quoted 8 lines

app/test-compress-perf/comp_perf_options_parse.c get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len, · line 94

Quoted 7 lines
app/test-compress-perf/comp_perf_options_parse.c +7 -0
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
+			CPERF_TEST_TYPE_VERIFY
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_PMDCC],
+			CPERF_TEST_TYPE_PMDCC

What is PMDCC here? What kind of test type?

Quoted 6 lines

[Tomek] This's for 'pmd_cyclecount_test'. Actually compression_perf tool

doesn't support that test, but we added a sort of 'template' for that, cause there's a plan to add

this test in the future.

Isn’t it better we add this .. when we actually add feature?

Quoted 9 lines

Thx

--

Tomek

#23 lore raw

Re: [dpdk-dev] [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest command line option

Hi Shally,

Quoted 79 lines
Quoted 79 lines

-----Original Message-----
From: Tomasz Jozwiak <[email protected]>
Sent: Wednesday, June 26, 2019 11:05 PM
To: Shally Verma <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest command line option

Hi Shally,

Quoted 4 lines
Quoted 4 lines

-----Original Message-----
From: Tomasz Jozwiak <[email protected]>
Sent: Wednesday, June 26, 2019 10:00 PM
To: [email protected]; [email protected]; [email protected];

Shally

Quoted 28 lines
Quoted 28 lines

Verma <[email protected]>; [email protected]
Subject: [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest command line option

External Email

---------------------------------------------------------------------
-
From: Tomasz Jozwiak <[email protected]>

This patch adds --ptest option to make possible a choose of test case from command line.

---
   app/test-compress-perf/comp_perf_options_parse.c | 36
++++++++++++++++++++++++
   1 file changed, 36 insertions(+)
(quoted diff) +0 -0

b/app/test- compress-perf/comp_perf_options_parse.c index bc4b98a..07672b2 100644

app/test-compress-perf/comp_perf_options_parse.c +0 -0
@@ -15,6 +15,7 @@
 
   #include "comp_perf_options.h"
 
Quoted 14 lines

app/test-compress-perf/comp_perf_options_parse.c get_str_key_id_mapping(struct name_id_map

Quoted 14 lines
app/test-compress-perf/comp_perf_options_parse.c +2 -0
+#define CPERF_PTEST_TYPE	("ptest")
   #define CPERF_DRIVER_NAME	("driver-name")
   #define CPERF_TEST_FILE		("input-file")
   #define CPERF_SEG_SIZE		("seg-sz")
@@ -37,6 +38,7 @@ static void
   usage(char *progname)
   {
   	printf("%s [EAL options] --\n"
+		" --ptest benchmark / verify :"
   		" --driver-name NAME: compress driver to use\n"
   		" --input-file NAME: file to compress and decompress\n"
   		" --extended-input-sz N: extend file data up to this size

(default: no extension)\n"

app/test-compress-perf/comp_perf_options_parse.c +0 -0
@@ -76,6 +78,37 @@ get_str_key_id_mapping(struct name_id_map

*map,

Quoted 19 lines
Quoted 8 lines
app/test-compress-perf/comp_perf_options_parse.c +5 -0
 unsigned int map_len,  }
 
   static int
+parse_cperf_test_type(struct comp_test_data *test_data, const char
+*arg) {
+	struct name_id_map cperftest_namemap[] = {
+		{
+

app/test-compress-perf/comp_perf_options_parse.c get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len, · line 94

Quoted 10 lines
app/test-compress-perf/comp_perf_options_parse.c +9 -0
 	cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
+			CPERF_TEST_TYPE_BENCHMARK
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
+			CPERF_TEST_TYPE_VERIFY
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_PMDCC],
+			CPERF_TEST_TYPE_PMDCC

What is PMDCC here? What kind of test type?

Quoted 7 lines
Quoted 6 lines

[Tomek] This's for 'pmd_cyclecount_test'. Actually compression_perf tool

doesn't support that test, but we added a sort of 'template' for that, cause there's a plan to add

this test in the future.

Isn’t it better we add this .. when we actually add feature?

[Tomek] True , I'll remove this in V4.

Thx, Tomek

#24 lore raw

PATCH v3 3/7 app/test-compress-perf: add verification test case

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds a verification part to compression-perf-tool as a separate test case, which can be executed multi-threaded.

---
 app/test-compress-perf/Makefile                |   1 +
 app/test-compress-perf/comp_perf_test_verify.c | 122 ++++++++++++++++++-------
 app/test-compress-perf/comp_perf_test_verify.h |  24 ++++-
 app/test-compress-perf/main.c                  |   1 +
 app/test-compress-perf/meson.build             |   1 +
 5 files changed, 112 insertions(+), 37 deletions(-)
app/test-compress-perf/Makefile +1 -0
index de74129..f54d9a4 100644
@@ -12,6 +12,7 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
+SRCS-y += comp_perf_test_verify.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_verify.c +87 -35

242 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_verify.h +22 -2
index 67c6b49..ae8b742 100644
@@ -1,13 +1,33 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018-2019 Intel Corporation
  */
 
 #ifndef _COMP_PERF_TEST_VERIFY_
 #define _COMP_PERF_TEST_VERIFY_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+
+struct cperf_verify_ctx {
+	struct cperf_mem_resources mem;
+	struct comp_test_data *options;
+
+	int silent;
+	size_t comp_data_sz;
+	size_t decomp_data_sz;
+	double ratio;
+};
+
+void
+cperf_verify_test_destructor(void *arg);
 
 int
-cperf_verification(struct comp_test_data *test_data, uint8_t level);
+cperf_verify_test_runner(void *test_ctx);
+
+void *
+cperf_verify_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index d142b91..eba2795 100644
@@ -8,6 +8,7 @@
 #include <rte_compressdev.h>
 
 #include "comp_perf_options.h"
+#include "comp_perf_test_verify.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index 00413c6..c6246e5 100644
@@ -4,5 +4,6 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
+		'comp_perf_test_verify.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.7.4
#25 lore raw

PATCH v3 4/7 app/test-compress-perf: add benchmark test case

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds a benchmark part to compression-perf-tool as a separate test case, which can be executed multi-threaded.

---
 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf_test_benchmark.c | 139 ++++++++++++++++------
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +++-
 app/test-compress-perf/main.c                     |   1 +
 app/test-compress-perf/meson.build                |   1 +
 5 files changed, 129 insertions(+), 38 deletions(-)
app/test-compress-perf/Makefile +1 -0
index f54d9a4..d1a6820 100644
@@ -13,6 +13,7 @@ CFLAGS += -O3
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
 SRCS-y += comp_perf_test_verify.c
+SRCS-y += comp_perf_test_benchmark.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_benchmark.c +102 -37

277 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_benchmark.h +24 -1
index b193445..d9b2694 100644
@@ -5,9 +5,32 @@
 #ifndef _COMP_PERF_TEST_BENCHMARK_
 #define _COMP_PERF_TEST_BENCHMARK_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+#include "comp_perf_test_verify.h"
+
+struct cperf_benchmark_ctx {
+	struct cperf_verify_ctx ver;
+
+	/* Store TSC duration for all levels (including level 0) */
+	uint64_t comp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	uint64_t decomp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	double comp_gbps;
+	double decomp_gbps;
+	double comp_tsc_byte;
+	double decomp_tsc_byte;
+};
+
+void
+cperf_benchmark_test_destructor(void *arg);
 
 int
-cperf_benchmark(struct comp_test_data *test_data, uint8_t level);
+cperf_benchmark_test_runner(void *test_ctx);
+
+void *
+cperf_benchmark_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index eba2795..1044532 100644
@@ -9,6 +9,7 @@
 
 #include "comp_perf_options.h"
 #include "comp_perf_test_verify.h"
+#include "comp_perf_test_benchmark.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index c6246e5..1136f04 100644
@@ -5,5 +5,6 @@ allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
 		'comp_perf_test_verify.c',
+		'comp_perf_test_benchmark.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.7.4
#26 lore raw

PATCH v3 5/7 doc: update dpdk-test-compress-perf description

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch updates a dpdk-test-compress-perf documentation.

---
 doc/guides/tools/comp_perf.rst | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)
doc/guides/tools/comp_perf.rst +31 -3
index 52869c1..71eef18 100644
@@ -6,7 +6,9 @@ dpdk-test-compress-perf Tool
 
 The ``dpdk-test-compress-perf`` tool is a Data Plane Development Kit (DPDK)
 utility that allows measuring performance parameters of PMDs available in the
-compress tree. The tool reads the data from a file (--input-file),
+compress tree. User can use multiple cores to run tests on but only
+one type of compression PMD can be measured during single application
+execution. The tool reads the data from a file (--input-file),
 dumps all the file into a buffer and fills out the data of input mbufs,
 which are passed to compress device with compression operations.
 Then, the output buffers are fed into the decompression stage, and the resulting
@@ -26,9 +28,35 @@ Limitations
 
 * Stateful operation is not supported in this version.
 
+EAL Options
+~~~~~~~~~~~
+
+The following are the EAL command-line options that can be used in conjunction
+with the ``dpdk-test-compress-perf`` application.
+See the DPDK Getting Started Guides for more information on these options.
+
+*   ``-c <COREMASK>`` or ``-l <CORELIST>``
+
+	Set the hexadecimal bitmask of the cores to run on. The corelist is a
+	list cores to use.
+
+.. Note::
+
+	One lcore is needed for process admin, tests are run on all other cores.
+	To run tests on two lcores, three lcores must be passed to the tool.
+
+*   ``-w <PCI>``
+
+	Add a PCI device in white list.
+
+*   ``--vdev <driver><id>``
+
+	Add a virtual device.
+
+Appication Options
+~~~~~~~~~~~~~~~~~~
 
-Command line options
---------------------
+ ``--ptest [benchmark/verify]``: set test type (default: benchmark)
 
  ``--driver-name NAME``: compress driver to use
 
Signature · 1 line
2.7.4
#27 lore raw

PATCH v3 6/7 app/test-compress-perf: add force process termination

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds a possibility to force controlled process termination as a result of two signals: SIGTERM and SIGINT

---
 app/test-compress-perf/comp_perf_options.h        |  1 +
 app/test-compress-perf/comp_perf_test_benchmark.c | 13 ++++++++++++
 app/test-compress-perf/comp_perf_test_verify.c    | 14 ++++++++++++
 app/test-compress-perf/main.c                     | 26 +++++++++++++++++++++--
 4 files changed, 52 insertions(+), 2 deletions(-)
app/test-compress-perf/comp_perf_options.h +1 -0
index 79e63d5..534212d 100644
@@ -68,6 +68,7 @@ struct comp_test_data {
 
 	double ratio;
 	enum cleanup_st cleanup;
+	int perf_comp_force_stop;
 };
 
 int
app/test-compress-perf/comp_perf_test_benchmark.c +13 -0
index 5f27bae..9effccc 100644
@@ -183,6 +183,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -241,6 +244,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							   mem->qp_id,
 							   deq_ops,
@@ -305,6 +311,13 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
 	return res;
 }
 
app/test-compress-perf/comp_perf_test_verify.c +14 -0
index c2aab70..b2cd7a0 100644
@@ -187,6 +187,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -267,6 +270,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							mem->qp_id,
 							deq_ops,
@@ -345,6 +351,14 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
+
 	return res;
 }
 
app/test-compress-perf/main.c +24 -2
index 1044532..77b279b 100644
@@ -2,6 +2,10 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
+#include <signal.h>
+#include <sys/types.h>
+#include <unistd.h>
+
 #include <rte_malloc.h>
 #include <rte_eal.h>
 #include <rte_log.h>
@@ -42,6 +46,8 @@ static const struct cperf_test cperf_testmap[] = {
 	}
 };
 
+static struct comp_test_data *test_data;
+
 static int
 comp_perf_check_capabilities(struct comp_test_data *test_data, uint8_t cdev_id)
 {
@@ -283,12 +289,24 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)
 	return ret;
 }
 
+static void
+comp_perf_cleanup_on_signal(int signalNumber __rte_unused)
+{
+	test_data->perf_comp_force_stop = 1;
+}
+
+static void
+comp_perf_register_cleanup_on_signal(void)
+{
+	signal(SIGTERM, comp_perf_cleanup_on_signal);
+	signal(SIGINT, comp_perf_cleanup_on_signal);
+}
+
 int
 main(int argc, char **argv)
 {
 	uint8_t level_idx = 0;
 	int ret, i;
-	struct comp_test_data *test_data;
 	void *ctx[RTE_MAX_LCORE] = {};
 	uint8_t enabled_cdevs[RTE_COMPRESS_MAX_DEVS];
 	int nb_compressdevs = 0;
@@ -310,6 +328,8 @@ main(int argc, char **argv)
 		rte_exit(EXIT_FAILURE, "Cannot reserve memory in socket %d\n",
 				rte_socket_id());
 
+	comp_perf_register_cleanup_on_signal();
+
 	ret = EXIT_SUCCESS;
 	test_data->cleanup = ST_TEST_DATA;
 	comp_perf_options_default(test_data);
@@ -430,8 +450,10 @@ main(int argc, char **argv)
 		/* fallthrough */
 	case ST_COMPDEV:
 		for (i = 0; i < nb_compressdevs &&
-				i < RTE_COMPRESS_MAX_DEVS; i++)
+		     i < RTE_COMPRESS_MAX_DEVS; i++) {
 			rte_compressdev_stop(enabled_cdevs[i]);
+			rte_compressdev_close(enabled_cdevs[i]);
+		}
 		/* fallthrough */
 	case ST_TEST_DATA:
 		rte_free(test_data);
Signature · 1 line
2.7.4
#28 lore raw

PATCH v3 7/7 doc: update release notes for 19.08

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

Added release note entry for test-compress-perf application

---
 doc/guides/rel_notes/release_19_08.rst | 3 +++
 1 file changed, 3 insertions(+)
doc/guides/rel_notes/release_19_08.rst +3 -0
index 7c0435a..2b2e029 100644
@@ -99,6 +99,9 @@ New Features
   Updated ``librte_telemetry`` to fetch the global metrics from the
   ``librte_metrics`` library.
 
+* **Updated test-compress-perf tool application.**
+
+  Added multiple cores feature to compression perf tool application.
 
 Removed Items
 -------------
Signature · 1 line
2.7.4
#29 lore raw

Re: [dpdk-dev] [PATCH v3 7/7] doc: update release notes for 19.08

26/06/2019 18:30, Tomasz Jozwiak:

doc/guides/rel_notes/release_19_08.rst New Features · line 104

Quoted 5 lines
doc/guides/rel_notes/release_19_08.rst +3 -0
+* **Updated test-compress-perf tool application.**
+
+  Added multiple cores feature to compression perf tool application.

This should be in the patch adding this feature.

#30 lore raw

Re: [dpdk-dev] [PATCH v3 7/7] doc: update release notes for 19.08

Hi Thomas,

W dniu 26.06.2019 o 23:26, Thomas Monjalon pisze:

Quoted 7 lines

26/06/2019 18:30, Tomasz Jozwiak:

doc/guides/rel_notes/release_19_08.rst New Features · line 104

Quoted 5 lines
doc/guides/rel_notes/release_19_08.rst +3 -0
+* **Updated test-compress-perf tool application.**
+
+  Added multiple cores feature to compression perf tool application.

This should be in the patch adding this feature.

[Tomek] Ok, we'll move this to that patch.

Thx, Tomek

#31 lore raw

v4 cover add multiple cores feature to test-compress-perf

In reply to Tomasz Jozwiak

This patchset adds multiple cores feature to compression perf tool. All structures have been aligned and are consistent
with crypto perf tool. All test cases have constructor, runner and destructor and can use more cores and compression devices at the same time.

v2 changes:

- fixed checkpatch warning
- fixed max_nb_queue_pairs detection. Based on compression API if max_nb_queue_pairs = 0 that means there is no limit in maximum number of queue pairs
- fixed qp setup on the last device

v3 changes:

- merged with commit 767350e7ede791932cc050bf2a192f6527b70c15 app/compress-perf: add prints for socket id

- fixed wrong compression/decompression throughput calculation

v4 changes:

- moved release notes update to patch 1
- removed pmd cyclecount template

Tomasz Jozwiak (6):
app/test-compress-perf: add weak functions for multi-cores test app/test-compress-perf: add ptest command line option app/test-compress-perf: add verification test case app/test-compress-perf: add benchmark test case
doc: update dpdk-test-compress-perf description app/test-compress-perf: add force process termination

 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf.h                |  50 ++
 app/test-compress-perf/comp_perf_options.h        |  45 +-
 app/test-compress-perf/comp_perf_options_parse.c  |  54 +-
 app/test-compress-perf/comp_perf_test_benchmark.c | 152 ++++--
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +-
 app/test-compress-perf/comp_perf_test_common.c    | 285 ++++++++++
 app/test-compress-perf/comp_perf_test_common.h    |  41 ++
 app/test-compress-perf/comp_perf_test_verify.c    | 136 +++--
 app/test-compress-perf/comp_perf_test_verify.h    |  24 +-
 app/test-compress-perf/main.c                     | 606 +++++++++-------------
 app/test-compress-perf/meson.build                |   3 +-
 doc/guides/rel_notes/release_19_08.rst            |   3 +
 doc/guides/tools/comp_perf.rst                    |  34 +-
 14 files changed, 992 insertions(+), 467 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
Signature · 1 line
2.7.4
#32 lore raw

PATCH v4 1/6 app/test-compress-perf: add weak functions for multi-cores test

From: Tomasz Jozwiak <[email protected]>

This patch adds a template functions for multi-cores performance version of compress-perf-tool and updates release notes for 19.08

---
 app/test-compress-perf/Makefile                  |   3 +-
 app/test-compress-perf/comp_perf.h               |  50 ++
 app/test-compress-perf/comp_perf_options.h       |  44 +-
 app/test-compress-perf/comp_perf_options_parse.c |  24 +-
 app/test-compress-perf/comp_perf_test_common.c   | 285 +++++++++++
 app/test-compress-perf/comp_perf_test_common.h   |  41 ++
 app/test-compress-perf/main.c                    | 600 +++++++++--------------
 app/test-compress-perf/meson.build               |   3 +-
 doc/guides/rel_notes/release_19_08.rst           |   3 +
 9 files changed, 651 insertions(+), 402 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
app/test-compress-perf/Makefile +1 -2
index d20e17e..de74129 100644
@@ -12,7 +12,6 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
-SRCS-y += comp_perf_test_verify.c
-SRCS-y += comp_perf_test_benchmark.c
+SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf.h new file +50 -0

50 lines not on this page · raw message

app/test-compress-perf/comp_perf_options.h +25 -19

68 lines not on this page · raw message

app/test-compress-perf/comp_perf_options_parse.c +12 -12
index 2fb6fb4..bc4b98a 100644
@@ -466,19 +466,20 @@ parse_level(struct comp_test_data *test_data, const char *arg)
 	 * Try parsing the argument as a range, if it fails,
 	 * arse it as a list
 	 */
-	if (parse_range(arg, &test_data->level.min, &test_data->level.max,
-			&test_data->level.inc) < 0) {
-		ret = parse_list(arg, test_data->level.list,
-					&test_data->level.min,
-					&test_data->level.max);
+	if (parse_range(arg, &test_data->level_lst.min,
+			&test_data->level_lst.max,
+			&test_data->level_lst.inc) < 0) {
+		ret = parse_list(arg, test_data->level_lst.list,
+					&test_data->level_lst.min,
+					&test_data->level_lst.max);
 		if (ret < 0) {
 			RTE_LOG(ERR, USER1,
 				"Failed to parse compression level/s\n");
 			return -1;
 		}
-		test_data->level.count = ret;
+		test_data->level_lst.count = ret;
 
-		if (test_data->level.max > RTE_COMP_LEVEL_MAX) {
+		if (test_data->level_lst.max > RTE_COMP_LEVEL_MAX) {
 			RTE_LOG(ERR, USER1, "Level cannot be higher than %u\n",
 					RTE_COMP_LEVEL_MAX);
 			return -1;
@@ -498,7 +499,6 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
-
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -572,7 +572,6 @@ comp_perf_options_parse(struct comp_test_data *test_data, int argc, char **argv)
 void
 comp_perf_options_default(struct comp_test_data *test_data)
 {
-	test_data->cdev_id = -1;
 	test_data->seg_sz = 2048;
 	test_data->burst_sz = 32;
 	test_data->pool_sz = 8192;
@@ -581,9 +580,10 @@ comp_perf_options_default(struct comp_test_data *test_data)
 	test_data->huffman_enc = RTE_COMP_HUFFMAN_DYNAMIC;
 	test_data->test_op = COMPRESS_DECOMPRESS;
 	test_data->window_sz = -1;
-	test_data->level.min = 1;
-	test_data->level.max = 9;
-	test_data->level.inc = 1;
+	test_data->level_lst.min = 1;
+	test_data->level_lst.max = 9;
+	test_data->level_lst.inc = 1;
+	test_data->test = CPERF_TEST_TYPE_BENCHMARK;
 }
 
 int
app/test-compress-perf/comp_perf_test_common.c new file +285 -0

285 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_common.h new file +41 -0

41 lines not on this page · raw message

app/test-compress-perf/main.c +233 -367

702 lines not on this page · raw message

app/test-compress-perf/meson.build +1 -2
index ec73e5e..00413c6 100644
@@ -4,6 +4,5 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
-		'comp_perf_test_verify.c',
-		'comp_perf_test_benchmark.c')
+		'comp_perf_test_common.c')
 deps = ['compressdev']
doc/guides/rel_notes/release_19_08.rst +3 -0
index 7c0435a..2b2e029 100644
@@ -99,6 +99,9 @@ New Features
   Updated ``librte_telemetry`` to fetch the global metrics from the
   ``librte_metrics`` library.
 
+* **Updated test-compress-perf tool application.**
+
+  Added multiple cores feature to compression perf tool application.
 
 Removed Items
 -------------
Signature · 1 line
2.7.4
#33 lore raw

PATCH v4 2/6 app/test-compress-perf: add ptest command line option

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds --ptest option to make possible a choose of test case from command line.

---
 app/test-compress-perf/comp_perf_options_parse.c | 32 ++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
app/test-compress-perf/comp_perf_options_parse.c +32 -0
index bc4b98a..7888ab6 100644
@@ -15,6 +15,7 @@
 
 #include "comp_perf_options.h"
 
+#define CPERF_PTEST_TYPE	("ptest")
 #define CPERF_DRIVER_NAME	("driver-name")
 #define CPERF_TEST_FILE		("input-file")
 #define CPERF_SEG_SIZE		("seg-sz")
@@ -37,6 +38,7 @@ static void
 usage(char *progname)
 {
 	printf("%s [EAL options] --\n"
+		" --ptest benchmark / verify :"
 		" --driver-name NAME: compress driver to use\n"
 		" --input-file NAME: file to compress and decompress\n"
 		" --extended-input-sz N: extend file data up to this size (default: no extension)\n"
@@ -76,6 +78,33 @@ get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len,
 }
 
 static int
+parse_cperf_test_type(struct comp_test_data *test_data, const char *arg)
+{
+	struct name_id_map cperftest_namemap[] = {
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
+			CPERF_TEST_TYPE_BENCHMARK
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
+			CPERF_TEST_TYPE_VERIFY
+		}
+	};
+
+	int id = get_str_key_id_mapping(
+			(struct name_id_map *)cperftest_namemap,
+			RTE_DIM(cperftest_namemap), arg);
+	if (id < 0) {
+		RTE_LOG(ERR, USER1, "failed to parse test type");
+		return -1;
+	}
+
+	test_data->test = (enum cperf_perf_test_type)id;
+
+	return 0;
+}
+
+static int
 parse_uint32_t(uint32_t *value, const char *arg)
 {
 	char *end = NULL;
@@ -499,6 +528,8 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
+
+	{ CPERF_PTEST_TYPE, required_argument, 0, 0 },
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -517,6 +548,7 @@ static int
 comp_perf_opts_parse_long(int opt_idx, struct comp_test_data *test_data)
 {
 	struct long_opt_parser parsermap[] = {
+		{ CPERF_PTEST_TYPE,	parse_cperf_test_type },
 		{ CPERF_DRIVER_NAME,	parse_driver_name },
 		{ CPERF_TEST_FILE,	parse_test_file },
 		{ CPERF_SEG_SIZE,	parse_seg_sz },
Signature · 1 line
2.7.4
Acked-by on v4 2/6
#34 lore raw

Re: [dpdk-dev] [EXT] [PATCH v4 2/6] app/test-compress-perf: add ptest command line option

Quoted 15 lines

-----Original Message-----
From: Tomasz Jozwiak <[email protected]>
Sent: Friday, June 28, 2019 3:56 AM
To: [email protected]; [email protected]; [email protected]; Shally Verma <[email protected]>; [email protected]
Subject: [EXT] [PATCH v4 2/6] app/test-compress-perf: add ptest command line option

External Email

----------------------------------------------------------------------
From: Tomasz Jozwiak <[email protected]>

Quoted 6 lines

This patch adds --ptest option to make possible a choose of test case from command line.

---

..

#35 lore raw

PATCH v4 3/6 app/test-compress-perf: add verification test case

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds a verification part to compression-perf-tool as a separate test case, which can be executed multi-threaded.

---
 app/test-compress-perf/Makefile                |   1 +
 app/test-compress-perf/comp_perf_test_verify.c | 122 ++++++++++++++++++-------
 app/test-compress-perf/comp_perf_test_verify.h |  24 ++++-
 app/test-compress-perf/main.c                  |   1 +
 app/test-compress-perf/meson.build             |   1 +
 5 files changed, 112 insertions(+), 37 deletions(-)
app/test-compress-perf/Makefile +1 -0
index de74129..f54d9a4 100644
@@ -12,6 +12,7 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
+SRCS-y += comp_perf_test_verify.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_verify.c +87 -35

242 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_verify.h +22 -2
index 67c6b49..ae8b742 100644
@@ -1,13 +1,33 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018-2019 Intel Corporation
  */
 
 #ifndef _COMP_PERF_TEST_VERIFY_
 #define _COMP_PERF_TEST_VERIFY_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+
+struct cperf_verify_ctx {
+	struct cperf_mem_resources mem;
+	struct comp_test_data *options;
+
+	int silent;
+	size_t comp_data_sz;
+	size_t decomp_data_sz;
+	double ratio;
+};
+
+void
+cperf_verify_test_destructor(void *arg);
 
 int
-cperf_verification(struct comp_test_data *test_data, uint8_t level);
+cperf_verify_test_runner(void *test_ctx);
+
+void *
+cperf_verify_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index 309dc98..e54378a 100644
@@ -8,6 +8,7 @@
 #include <rte_compressdev.h>
 
 #include "comp_perf_options.h"
+#include "comp_perf_test_verify.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index 00413c6..c6246e5 100644
@@ -4,5 +4,6 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
+		'comp_perf_test_verify.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.7.4
#36 lore raw

Re: [dpdk-dev] [EXT] [PATCH v4 3/6] app/test-compress-perf: add verification test case

Quoted 14 lines

-----Original Message-----
From: Tomasz Jozwiak <[email protected]>
Sent: Friday, June 28, 2019 3:56 AM
To: [email protected]; [email protected]; [email protected]; Shally Verma <[email protected]>; [email protected]
Subject: [EXT] [PATCH v4 3/6] app/test-compress-perf: add verification test case

External Email

----------------------------------------------------------------------
From: Tomasz Jozwiak <[email protected]>

...

Quoted 18 lines
app/test- renamed from app/test-compress-perf/comp_perf_test_verify.c +0 -0

compress-perf/comp_perf_test_verify.c
index 28a0fe8..c2aab70 100644

app/test-compress-perf/comp_perf_test_verify.c +8 -0
@@ -8,14 +8,48 @@
 #include <rte_compressdev.h>
 
 #include "comp_perf_test_verify.h"
+#include "comp_perf_test_common.h"
+
+void
+cperf_verify_test_destructor(void *arg) {
+	if (arg) {
+		comp_perf_free_memory(&((struct cperf_verify_ctx *)arg)-
 >mem);
+		rte_free(arg);
+	}

app/test-compress-perf/comp_perf_test_verify.c line 29

Quoted 10 lines
app/test-compress-perf/comp_perf_test_verify.c +10 -0
+}
+
+void *
+cperf_verify_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options)
+{
+	struct cperf_verify_ctx *ctx = NULL;
+
+	ctx = rte_malloc(NULL, sizeof(struct cperf_verify_ctx), 0);
+

Better just return from here

app/test-compress-perf/comp_perf_test_verify.c line 37

Quoted 9 lines
app/test-compress-perf/comp_perf_test_verify.c +6 -0
+	if (ctx != NULL) {
+		ctx->mem.dev_id = dev_id;
+		ctx->mem.qp_id = qp_id;
+		ctx->options = options;
+
+		if (!comp_perf_allocate_memory(ctx->options, &ctx->mem)

&&

app/test-compress-perf/comp_perf_test_verify.c +2 -0
+		    !prepare_bufs(ctx->options, &ctx->mem))
+			return ctx;

What if condition fails on comp_per_allocate_memory(), then it will go to verify_test_destructor(), so comp_perf_free_memory() check if mem != NULL before calling actual free?

Quoted 12 lines
app/test-compress-perf/comp_perf_test_verify.c +6 -4
+	}
+
+	cperf_verify_test_destructor(ctx);
+	return NULL;
+}
 
 static int
-main_loop(struct comp_test_data *test_data, uint8_t level,
-			enum rte_comp_xform_type type,
-			uint8_t *output_data_ptr,
-			size_t *output_data_sz)
+main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)

...

Quoted 2 lines

--
2.7.4

#37 lore raw

Re: [dpdk-dev] [EXT] [PATCH v4 3/6] app/test-compress-perf: add verification test case

Hi Shally,

Thx for the review.

My comments below:

Quoted 31 lines
Quoted 13 lines

-----Original Message-----
From: Tomasz Jozwiak <[email protected]>
Sent: Friday, June 28, 2019 3:56 AM
To: [email protected]; [email protected]; [email protected]; Shally Verma <[email protected]>; [email protected]
Subject: [EXT] [PATCH v4 3/6] app/test-compress-perf: add verification test case

External Email

----------------------------------------------------------------------
From: Tomasz Jozwiak <[email protected]>

...

Quoted 16 lines
app/test- renamed from app/test-compress-perf/comp_perf_test_verify.c +0 -0

compress-perf/comp_perf_test_verify.c
index 28a0fe8..c2aab70 100644

app/test-compress-perf/comp_perf_test_verify.c +6 -0
@@ -8,14 +8,48 @@
  #include <rte_compressdev.h>
 
  #include "comp_perf_test_verify.h"
+#include "comp_perf_test_common.h"
+
+void
+cperf_verify_test_destructor(void *arg) {
+	if (arg) {
+		comp_perf_free_memory(&((struct cperf_verify_ctx *)arg)-
 > mem);
Quoted 13 lines

app/test-compress-perf/comp_perf_test_verify.c line 29

Quoted 12 lines
app/test-compress-perf/comp_perf_test_verify.c +12 -0
+		rte_free(arg);
+	}
+}
+
+void *
+cperf_verify_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options)
+{
+	struct cperf_verify_ctx *ctx = NULL;
+
+	ctx = rte_malloc(NULL, sizeof(struct cperf_verify_ctx), 0);
+

Better just return from here

[Tomek]. Yes you right. we wasn't able to allocate 'cperf_verify_ctx struct',

so we don't need to call destructor here. I assume there's the same issue

in benchmark patch - will align both in V5. Thx.

Quoted 11 lines

app/test-compress-perf/comp_perf_test_verify.c line 37

Quoted 10 lines
app/test-compress-perf/comp_perf_test_verify.c +6 -0
+	if (ctx != NULL) {
+		ctx->mem.dev_id = dev_id;
+		ctx->mem.qp_id = qp_id;
+		ctx->options = options;
+
+		if (!comp_perf_allocate_memory(ctx->options, &ctx->mem)

&&

app/test-compress-perf/comp_perf_test_verify.c +2 -0
+		    !prepare_bufs(ctx->options, &ctx->mem))
+			return ctx;

What if condition fails on comp_per_allocate_memory(), then it will go to verify_test_destructor(), so comp_perf_free_memory() check if mem != NULL before calling actual free?

[Tomek] I mean it's ok. Please take in to account that we was able to allocate 'cperf_verify_ctx struct' - cause

ctx != NULL here. that means 'mem struct' inside 'cperf_verify_ctx struct' exists for sure:

struct cperf_verify_ctx {
*struct cperf_mem_resources mem;*
    struct comp_test_data *options;

    int silent;
    size_t comp_data_sz;
    size_t decomp_data_sz;
    double ratio;
};

and all fields inside 'struct cperf_mem_resources mem' are zeroed.

We don't need to check mem != NULL before free, because in this place mem != NULL for sure. Also it's ok to call 'rte_free',

'rte_mempool_free' and 'rte_pktmbuf_free' with NULL ptr.

as a argument because the check is inside all of these functions.

Thx for the comments.

--

Tomek

#38 lore raw

Re: [dpdk-dev] [EXT] [PATCH v4 3/6] app/test-compress-perf: add verification test case

From: Tomasz Jozwiak <[email protected]>
Sent: Monday, July 1, 2019 2:33 AM
To: Shally Verma <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: Re: [EXT] [PATCH v4 3/6] app/test-compress-perf: add verification test case

…

+ if (ctx != NULL) {

+ ctx->mem.dev_id = dev_id;

+ ctx->mem.qp_id = qp_id;

+ ctx->options = options;

+

+ if (!comp_perf_allocate_memory(ctx->options, &ctx->mem)

&&

+ !prepare_bufs(ctx->options, &ctx->mem))

+ return ctx;

What if condition fails on comp_per_allocate_memory(), then it will go to verify_test_destructor(), so comp_perf_free_memory() check if mem != NULL before calling actual free?

[Tomek] I mean it's ok. Please take in to account that we was able to allocate 'cperf_verify_ctx struct' - cause

ctx != NULL here. that means 'mem struct' inside 'cperf_verify_ctx struct' exists for sure:

struct cperf_verify_ctx {
    struct cperf_mem_resources mem;
    struct comp_test_data *options;

    int silent;
    size_t comp_data_sz;
    size_t decomp_data_sz;
    double ratio;
};

and all fields inside 'struct cperf_mem_resources mem' are zeroed.

We don't need to check mem != NULL before free, because in this place mem != NULL for sure. Also it's ok to call 'rte_free',

'rte_mempool_free' and 'rte_pktmbuf_free' with NULL ptr.

as a argument because the check is inside all of these functions.

[Shally] Okay.

Thx for the comments.

--

Tomek

#39 lore raw

PATCH v4 4/6 app/test-compress-perf: add benchmark test case

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds a benchmark part to compression-perf-tool as a separate test case, which can be executed multi-threaded.

---
 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf_test_benchmark.c | 139 ++++++++++++++++------
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +++-
 app/test-compress-perf/main.c                     |   1 +
 app/test-compress-perf/meson.build                |   1 +
 5 files changed, 129 insertions(+), 38 deletions(-)
app/test-compress-perf/Makefile +1 -0
index f54d9a4..d1a6820 100644
@@ -13,6 +13,7 @@ CFLAGS += -O3
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
 SRCS-y += comp_perf_test_verify.c
+SRCS-y += comp_perf_test_benchmark.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_benchmark.c +102 -37

277 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_benchmark.h +24 -1
index b193445..d9b2694 100644
@@ -5,9 +5,32 @@
 #ifndef _COMP_PERF_TEST_BENCHMARK_
 #define _COMP_PERF_TEST_BENCHMARK_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+#include "comp_perf_test_verify.h"
+
+struct cperf_benchmark_ctx {
+	struct cperf_verify_ctx ver;
+
+	/* Store TSC duration for all levels (including level 0) */
+	uint64_t comp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	uint64_t decomp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	double comp_gbps;
+	double decomp_gbps;
+	double comp_tsc_byte;
+	double decomp_tsc_byte;
+};
+
+void
+cperf_benchmark_test_destructor(void *arg);
 
 int
-cperf_benchmark(struct comp_test_data *test_data, uint8_t level);
+cperf_benchmark_test_runner(void *test_ctx);
+
+void *
+cperf_benchmark_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index e54378a..bc50e37 100644
@@ -9,6 +9,7 @@
 
 #include "comp_perf_options.h"
 #include "comp_perf_test_verify.h"
+#include "comp_perf_test_benchmark.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index c6246e5..1136f04 100644
@@ -5,5 +5,6 @@ allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
 		'comp_perf_test_verify.c',
+		'comp_perf_test_benchmark.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.7.4
#40 lore raw

PATCH v4 5/6 doc: update dpdk-test-compress-perf description

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch updates a dpdk-test-compress-perf documentation.

---
 doc/guides/tools/comp_perf.rst | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)
doc/guides/tools/comp_perf.rst +31 -3
index 52869c1..71eef18 100644
@@ -6,7 +6,9 @@ dpdk-test-compress-perf Tool
 
 The ``dpdk-test-compress-perf`` tool is a Data Plane Development Kit (DPDK)
 utility that allows measuring performance parameters of PMDs available in the
-compress tree. The tool reads the data from a file (--input-file),
+compress tree. User can use multiple cores to run tests on but only
+one type of compression PMD can be measured during single application
+execution. The tool reads the data from a file (--input-file),
 dumps all the file into a buffer and fills out the data of input mbufs,
 which are passed to compress device with compression operations.
 Then, the output buffers are fed into the decompression stage, and the resulting
@@ -26,9 +28,35 @@ Limitations
 
 * Stateful operation is not supported in this version.
 
+EAL Options
+~~~~~~~~~~~
+
+The following are the EAL command-line options that can be used in conjunction
+with the ``dpdk-test-compress-perf`` application.
+See the DPDK Getting Started Guides for more information on these options.
+
+*   ``-c <COREMASK>`` or ``-l <CORELIST>``
+
+	Set the hexadecimal bitmask of the cores to run on. The corelist is a
+	list cores to use.
+
+.. Note::
+
+	One lcore is needed for process admin, tests are run on all other cores.
+	To run tests on two lcores, three lcores must be passed to the tool.
+
+*   ``-w <PCI>``
+
+	Add a PCI device in white list.
+
+*   ``--vdev <driver><id>``
+
+	Add a virtual device.
+
+Appication Options
+~~~~~~~~~~~~~~~~~~
 
-Command line options
---------------------
+ ``--ptest [benchmark/verify]``: set test type (default: benchmark)
 
  ``--driver-name NAME``: compress driver to use
 
Signature · 1 line
2.7.4
Acked-by on v4 5/6
#41 lore raw

Re: [dpdk-dev] [EXT] [PATCH v4 5/6] doc: update dpdk-test-compress-perf description

Quoted 12 lines

-----Original Message-----
From: Tomasz Jozwiak <[email protected]>
Sent: Friday, June 28, 2019 3:56 AM
To: [email protected]; [email protected]; [email protected]; Shally Verma <[email protected]>; [email protected]
Subject: [EXT] [PATCH v4 5/6] doc: update dpdk-test-compress-perf description

External Email

Quoted 7 lines

----------------------------------------------------------------------
From: Tomasz Jozwiak <[email protected]>

This patch updates a dpdk-test-compress-perf documentation.

---

#42 lore raw

PATCH v4 6/6 app/test-compress-perf: add force process termination

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds a possibility to force controlled process termination as a result of two signals: SIGTERM and SIGINT

---
 app/test-compress-perf/comp_perf_options.h        |  1 +
 app/test-compress-perf/comp_perf_test_benchmark.c | 13 ++++++++++++
 app/test-compress-perf/comp_perf_test_verify.c    | 14 ++++++++++++
 app/test-compress-perf/main.c                     | 26 +++++++++++++++++++++--
 4 files changed, 52 insertions(+), 2 deletions(-)
app/test-compress-perf/comp_perf_options.h +1 -0
index 0aa29a5..532fb96 100644
@@ -67,6 +67,7 @@ struct comp_test_data {
 
 	double ratio;
 	enum cleanup_st cleanup;
+	int perf_comp_force_stop;
 };
 
 int
app/test-compress-perf/comp_perf_test_benchmark.c +13 -0
index 5f27bae..9effccc 100644
@@ -183,6 +183,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -241,6 +244,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							   mem->qp_id,
 							   deq_ops,
@@ -305,6 +311,13 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
 	return res;
 }
 
app/test-compress-perf/comp_perf_test_verify.c +14 -0
index c2aab70..b2cd7a0 100644
@@ -187,6 +187,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -267,6 +270,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							mem->qp_id,
 							deq_ops,
@@ -345,6 +351,14 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
+
 	return res;
 }
 
app/test-compress-perf/main.c +24 -2
index bc50e37..f31f663 100644
@@ -2,6 +2,10 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
+#include <signal.h>
+#include <sys/types.h>
+#include <unistd.h>
+
 #include <rte_malloc.h>
 #include <rte_eal.h>
 #include <rte_log.h>
@@ -36,6 +40,8 @@ static const struct cperf_test cperf_testmap[] = {
 	}
 };
 
+static struct comp_test_data *test_data;
+
 static int
 comp_perf_check_capabilities(struct comp_test_data *test_data, uint8_t cdev_id)
 {
@@ -277,12 +283,24 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)
 	return ret;
 }
 
+static void
+comp_perf_cleanup_on_signal(int signalNumber __rte_unused)
+{
+	test_data->perf_comp_force_stop = 1;
+}
+
+static void
+comp_perf_register_cleanup_on_signal(void)
+{
+	signal(SIGTERM, comp_perf_cleanup_on_signal);
+	signal(SIGINT, comp_perf_cleanup_on_signal);
+}
+
 int
 main(int argc, char **argv)
 {
 	uint8_t level_idx = 0;
 	int ret, i;
-	struct comp_test_data *test_data;
 	void *ctx[RTE_MAX_LCORE] = {};
 	uint8_t enabled_cdevs[RTE_COMPRESS_MAX_DEVS];
 	int nb_compressdevs = 0;
@@ -304,6 +322,8 @@ main(int argc, char **argv)
 		rte_exit(EXIT_FAILURE, "Cannot reserve memory in socket %d\n",
 				rte_socket_id());
 
+	comp_perf_register_cleanup_on_signal();
+
 	ret = EXIT_SUCCESS;
 	test_data->cleanup = ST_TEST_DATA;
 	comp_perf_options_default(test_data);
@@ -424,8 +444,10 @@ main(int argc, char **argv)
 		/* fallthrough */
 	case ST_COMPDEV:
 		for (i = 0; i < nb_compressdevs &&
-				i < RTE_COMPRESS_MAX_DEVS; i++)
+		     i < RTE_COMPRESS_MAX_DEVS; i++) {
 			rte_compressdev_stop(enabled_cdevs[i]);
+			rte_compressdev_close(enabled_cdevs[i]);
+		}
 		/* fallthrough */
 	case ST_TEST_DATA:
 		rte_free(test_data);
Signature · 1 line
2.7.4
Acked-by on v4 6/6
#43 lore raw

Re: [dpdk-dev] [EXT] [PATCH v4 6/6] app/test-compress-perf: add force process termination

Quoted 12 lines

-----Original Message-----
From: Tomasz Jozwiak <[email protected]>
Sent: Friday, June 28, 2019 3:56 AM
To: [email protected]; [email protected]; [email protected]; Shally Verma <[email protected]>; [email protected]
Subject: [EXT] [PATCH v4 6/6] app/test-compress-perf: add force process termination

External Email

Quoted 8 lines

----------------------------------------------------------------------
From: Tomasz Jozwiak <[email protected]>

This patch adds a possibility to force controlled process termination as a result of two signals: SIGTERM and SIGINT

---

#44 lore raw

v5 cover add multiple cores feature to test-compress-perf

In reply to Tomasz Jozwiak

This patchset adds multiple cores feature to compression perf tool. All structures have been aligned and are consistent
with crypto perf tool. All test cases have constructor, runner and destructor and can use more cores and compression devices at the same time.

v2 changes:

- fixed checkpatch warning
- fixed max_nb_queue_pairs detection. Based on compression API if max_nb_queue_pairs = 0 that means there is no limit in maximum number of queue pairs
- fixed qp setup on the last device

v3 changes:

- merged with commit 767350e7ede791932cc050bf2a192f6527b70c15 app/compress-perf: add prints for socket id

- fixed wrong compression/decompression throughput calculation

v4 changes:

- moved release notes update to patch 1
- removed pmd cyclecount template

v5 changes:

- changed ctx null ptr detection inside constructors

Tomasz Jozwiak (6):
app/test-compress-perf: add weak functions for multi-cores test app/test-compress-perf: add ptest command line option app/test-compress-perf: add verification test case app/test-compress-perf: add benchmark test case
doc: update dpdk-test-compress-perf description app/test-compress-perf: add force process termination

 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf.h                |  50 ++
 app/test-compress-perf/comp_perf_options.h        |  45 +-
 app/test-compress-perf/comp_perf_options_parse.c  |  54 +-
 app/test-compress-perf/comp_perf_test_benchmark.c | 153 ++++--
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +-
 app/test-compress-perf/comp_perf_test_common.c    | 284 ++++++++++
 app/test-compress-perf/comp_perf_test_common.h    |  41 ++
 app/test-compress-perf/comp_perf_test_verify.c    | 137 +++--
 app/test-compress-perf/comp_perf_test_verify.h    |  24 +-
 app/test-compress-perf/main.c                     | 605 +++++++++-------------
 app/test-compress-perf/meson.build                |   3 +-
 doc/guides/rel_notes/release_19_08.rst            |   3 +
 doc/guides/tools/comp_perf.rst                    |  34 +-
 14 files changed, 992 insertions(+), 467 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
Signature · 1 line
2.7.4
#45 lore raw

PATCH v5 1/6 app/test-compress-perf: add weak functions for multi-cores test

From: Tomasz Jozwiak <[email protected]>

This patch adds a template functions for multi-cores performance version of compress-perf-tool and updates release notes for 19.08

---
 app/test-compress-perf/Makefile                  |   3 +-
 app/test-compress-perf/comp_perf.h               |  50 ++
 app/test-compress-perf/comp_perf_options.h       |  44 +-
 app/test-compress-perf/comp_perf_options_parse.c |  24 +-
 app/test-compress-perf/comp_perf_test_common.c   | 284 +++++++++++
 app/test-compress-perf/comp_perf_test_common.h   |  41 ++
 app/test-compress-perf/main.c                    | 599 +++++++++--------------
 app/test-compress-perf/meson.build               |   3 +-
 doc/guides/rel_notes/release_19_08.rst           |   3 +
 9 files changed, 649 insertions(+), 402 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
app/test-compress-perf/Makefile +1 -2
index d20e17e..de74129 100644
@@ -12,7 +12,6 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
-SRCS-y += comp_perf_test_verify.c
-SRCS-y += comp_perf_test_benchmark.c
+SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf.h new file +50 -0

50 lines not on this page · raw message

app/test-compress-perf/comp_perf_options.h +25 -19

68 lines not on this page · raw message

app/test-compress-perf/comp_perf_options_parse.c +12 -12
index 2fb6fb4..bc4b98a 100644
@@ -466,19 +466,20 @@ parse_level(struct comp_test_data *test_data, const char *arg)
 	 * Try parsing the argument as a range, if it fails,
 	 * arse it as a list
 	 */
-	if (parse_range(arg, &test_data->level.min, &test_data->level.max,
-			&test_data->level.inc) < 0) {
-		ret = parse_list(arg, test_data->level.list,
-					&test_data->level.min,
-					&test_data->level.max);
+	if (parse_range(arg, &test_data->level_lst.min,
+			&test_data->level_lst.max,
+			&test_data->level_lst.inc) < 0) {
+		ret = parse_list(arg, test_data->level_lst.list,
+					&test_data->level_lst.min,
+					&test_data->level_lst.max);
 		if (ret < 0) {
 			RTE_LOG(ERR, USER1,
 				"Failed to parse compression level/s\n");
 			return -1;
 		}
-		test_data->level.count = ret;
+		test_data->level_lst.count = ret;
 
-		if (test_data->level.max > RTE_COMP_LEVEL_MAX) {
+		if (test_data->level_lst.max > RTE_COMP_LEVEL_MAX) {
 			RTE_LOG(ERR, USER1, "Level cannot be higher than %u\n",
 					RTE_COMP_LEVEL_MAX);
 			return -1;
@@ -498,7 +499,6 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
-
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -572,7 +572,6 @@ comp_perf_options_parse(struct comp_test_data *test_data, int argc, char **argv)
 void
 comp_perf_options_default(struct comp_test_data *test_data)
 {
-	test_data->cdev_id = -1;
 	test_data->seg_sz = 2048;
 	test_data->burst_sz = 32;
 	test_data->pool_sz = 8192;
@@ -581,9 +580,10 @@ comp_perf_options_default(struct comp_test_data *test_data)
 	test_data->huffman_enc = RTE_COMP_HUFFMAN_DYNAMIC;
 	test_data->test_op = COMPRESS_DECOMPRESS;
 	test_data->window_sz = -1;
-	test_data->level.min = 1;
-	test_data->level.max = 9;
-	test_data->level.inc = 1;
+	test_data->level_lst.min = 1;
+	test_data->level_lst.max = 9;
+	test_data->level_lst.inc = 1;
+	test_data->test = CPERF_TEST_TYPE_BENCHMARK;
 }
 
 int
app/test-compress-perf/comp_perf_test_common.c new file +284 -0

284 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_common.h new file +41 -0

41 lines not on this page · raw message

app/test-compress-perf/main.c +232 -367

701 lines not on this page · raw message

app/test-compress-perf/meson.build +1 -2
index ec73e5e..00413c6 100644
@@ -4,6 +4,5 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
-		'comp_perf_test_verify.c',
-		'comp_perf_test_benchmark.c')
+		'comp_perf_test_common.c')
 deps = ['compressdev']
doc/guides/rel_notes/release_19_08.rst +3 -0
index 7c0435a..2b2e029 100644
@@ -99,6 +99,9 @@ New Features
   Updated ``librte_telemetry`` to fetch the global metrics from the
   ``librte_metrics`` library.
 
+* **Updated test-compress-perf tool application.**
+
+  Added multiple cores feature to compression perf tool application.
 
 Removed Items
 -------------
Signature · 1 line
2.7.4
#47 lore raw

v6 cover add multiple cores feature to test-compress-perf

In reply to Tomasz Jozwiak

This patchset adds multiple cores feature to compression perf tool. All structures have been aligned and are consistent with crypto perf tool. All test cases have constructor, runner and destructor and can use more cores and compression devices at the same time.

v2 changes:

- fixed checkpatch warning
- fixed max_nb_queue_pairs detection. Based on compression API if max_nb_queue_pairs = 0 that means there is no limit in maximum number of queue pairs
- fixed qp setup on the last device

v3 changes:

- merged with commit 2f6527b70c15
app/compress-perf: add prints for socket id

- fixed wrong compression/decompression throughput calculation

v4 changes:

- moved release notes update to patch 1
- removed pmd cyclecount template

v5 changes:

- changed ctx null ptr detection inside constructors

v6 changes:

- rebase to the recent master (before applying)

    commit 82b9677cb23c

Tomasz Jozwiak (6):
app/test-compress-perf: add weak functions for multi-cores test app/test-compress-perf: add ptest command line option app/test-compress-perf: add verification test case app/test-compress-perf: add benchmark test case
doc: update dpdk-test-compress-perf description app/test-compress-perf: add force process termination

 app/test-compress-perf/Makefile               |   1 +
 app/test-compress-perf/comp_perf.h            |  50 ++
 app/test-compress-perf/comp_perf_options.h    |  45 +-
 .../comp_perf_options_parse.c                 |  54 +-
 .../comp_perf_test_benchmark.c                | 153 +++--
 .../comp_perf_test_benchmark.h                |  25 +-
 .../comp_perf_test_common.c                   | 284 ++++++++
 .../comp_perf_test_common.h                   |  41 ++
 .../comp_perf_test_verify.c                   | 137 +++-
 .../comp_perf_test_verify.h                   |  24 +-
 app/test-compress-perf/main.c                 | 605 +++++++-----------
 app/test-compress-perf/meson.build            |   3 +-
 doc/guides/rel_notes/release_19_08.rst        |   4 +
 doc/guides/tools/comp_perf.rst                |  34 +-
 14 files changed, 993 insertions(+), 467 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
Signature · 1 line
2.17.1
#48 lore raw

PATCH v6 1/6 app/test-compress-perf: add weak functions for multi-cores test

From: Tomasz Jozwiak <[email protected]>

This patch adds a template functions for multi-cores performance version of compress-perf-tool and updates release notes for 19.08

---
 app/test-compress-perf/Makefile               |   3 +-
 app/test-compress-perf/comp_perf.h            |  50 ++
 app/test-compress-perf/comp_perf_options.h    |  44 +-
 .../comp_perf_options_parse.c                 |  24 +-
 .../comp_perf_test_common.c                   | 284 +++++++++
 .../comp_perf_test_common.h                   |  41 ++
 app/test-compress-perf/main.c                 | 599 +++++++-----------
 app/test-compress-perf/meson.build            |   3 +-
 doc/guides/rel_notes/release_19_08.rst        |   4 +
 9 files changed, 650 insertions(+), 402 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
app/test-compress-perf/Makefile +1 -2
index d20e17e47..de7412961 100644
@@ -12,7 +12,6 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
-SRCS-y += comp_perf_test_verify.c
-SRCS-y += comp_perf_test_benchmark.c
+SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf.h new file +50 -0

50 lines not on this page · raw message

app/test-compress-perf/comp_perf_options.h +25 -19

68 lines not on this page · raw message

app/test-compress-perf/comp_perf_options_parse.c +12 -12
index a7a8c1f9e..74ea81d09 100644
@@ -468,19 +468,20 @@ parse_level(struct comp_test_data *test_data, const char *arg)
 	 * Try parsing the argument as a range, if it fails,
 	 * arse it as a list
 	 */
-	if (parse_range(arg, &test_data->level.min, &test_data->level.max,
-			&test_data->level.inc) < 0) {
-		ret = parse_list(arg, test_data->level.list,
-					&test_data->level.min,
-					&test_data->level.max);
+	if (parse_range(arg, &test_data->level_lst.min,
+			&test_data->level_lst.max,
+			&test_data->level_lst.inc) < 0) {
+		ret = parse_list(arg, test_data->level_lst.list,
+					&test_data->level_lst.min,
+					&test_data->level_lst.max);
 		if (ret < 0) {
 			RTE_LOG(ERR, USER1,
 				"Failed to parse compression level/s\n");
 			return -1;
 		}
-		test_data->level.count = ret;
+		test_data->level_lst.count = ret;
 
-		if (test_data->level.max > RTE_COMP_LEVEL_MAX) {
+		if (test_data->level_lst.max > RTE_COMP_LEVEL_MAX) {
 			RTE_LOG(ERR, USER1, "Level cannot be higher than %u\n",
 					RTE_COMP_LEVEL_MAX);
 			return -1;
@@ -500,7 +501,6 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
-
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -574,7 +574,6 @@ comp_perf_options_parse(struct comp_test_data *test_data, int argc, char **argv)
 void
 comp_perf_options_default(struct comp_test_data *test_data)
 {
-	test_data->cdev_id = -1;
 	test_data->seg_sz = 2048;
 	test_data->burst_sz = 32;
 	test_data->pool_sz = 8192;
@@ -583,9 +582,10 @@ comp_perf_options_default(struct comp_test_data *test_data)
 	test_data->huffman_enc = RTE_COMP_HUFFMAN_DYNAMIC;
 	test_data->test_op = COMPRESS_DECOMPRESS;
 	test_data->window_sz = -1;
-	test_data->level.min = 1;
-	test_data->level.max = 9;
-	test_data->level.inc = 1;
+	test_data->level_lst.min = 1;
+	test_data->level_lst.max = 9;
+	test_data->level_lst.inc = 1;
+	test_data->test = CPERF_TEST_TYPE_BENCHMARK;
 }
 
 int
app/test-compress-perf/comp_perf_test_common.c new file +284 -0

284 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_common.h new file +41 -0

41 lines not on this page · raw message

app/test-compress-perf/main.c +232 -367

701 lines not on this page · raw message

app/test-compress-perf/meson.build +1 -2
index ec73e5e02..00413c6d0 100644
@@ -4,6 +4,5 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
-		'comp_perf_test_verify.c',
-		'comp_perf_test_benchmark.c')
+		'comp_perf_test_common.c')
 deps = ['compressdev']
doc/guides/rel_notes/release_19_08.rst +4 -0
index 644a74be8..3f779f336 100644
@@ -126,6 +126,10 @@ New Features
   Added telemetry mode to l3fwd-power application to report
   application level busyness, empty and full polls of rte_eth_rx_burst().
 
+* **Updated test-compress-perf tool application.**
+
+  Added multiple cores feature to compression perf tool application.
+
 
 Removed Items
 -------------
Signature · 1 line
2.17.1
#49 lore raw

PATCH v6 2/6 app/test-compress-perf: add ptest command line option

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch adds --ptest option to make possible a choose of test case from command line.

---
 .../comp_perf_options_parse.c                 | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
app/test-compress-perf/comp_perf_options_parse.c +32 -0
index 74ea81d09..3d820197a 100644
@@ -15,6 +15,7 @@
 
 #include "comp_perf_options.h"
 
+#define CPERF_PTEST_TYPE	("ptest")
 #define CPERF_DRIVER_NAME	("driver-name")
 #define CPERF_TEST_FILE		("input-file")
 #define CPERF_SEG_SIZE		("seg-sz")
@@ -37,6 +38,7 @@ static void
 usage(char *progname)
 {
 	printf("%s [EAL options] --\n"
+		" --ptest benchmark / verify :"
 		" --driver-name NAME: compress driver to use\n"
 		" --input-file NAME: file to compress and decompress\n"
 		" --extended-input-sz N: extend file data up to this size (default: no extension)\n"
@@ -75,6 +77,33 @@ get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len,
 	return -1;
 }
 
+static int
+parse_cperf_test_type(struct comp_test_data *test_data, const char *arg)
+{
+	struct name_id_map cperftest_namemap[] = {
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
+			CPERF_TEST_TYPE_BENCHMARK
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
+			CPERF_TEST_TYPE_VERIFY
+		}
+	};
+
+	int id = get_str_key_id_mapping(
+			(struct name_id_map *)cperftest_namemap,
+			RTE_DIM(cperftest_namemap), arg);
+	if (id < 0) {
+		RTE_LOG(ERR, USER1, "failed to parse test type");
+		return -1;
+	}
+
+	test_data->test = (enum cperf_perf_test_type)id;
+
+	return 0;
+}
+
 static int
 parse_uint32_t(uint32_t *value, const char *arg)
 {
@@ -501,6 +530,8 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
+
+	{ CPERF_PTEST_TYPE, required_argument, 0, 0 },
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -519,6 +550,7 @@ static int
 comp_perf_opts_parse_long(int opt_idx, struct comp_test_data *test_data)
 {
 	struct long_opt_parser parsermap[] = {
+		{ CPERF_PTEST_TYPE,	parse_cperf_test_type },
 		{ CPERF_DRIVER_NAME,	parse_driver_name },
 		{ CPERF_TEST_FILE,	parse_test_file },
 		{ CPERF_SEG_SIZE,	parse_seg_sz },
Signature · 1 line
2.17.1
#50 lore raw

PATCH v6 3/6 app/test-compress-perf: add verification test case

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch adds a verification part to compression-perf-tool as a separate test case, which can be executed multi-threaded.

---
 app/test-compress-perf/Makefile               |   1 +
 .../comp_perf_test_verify.c                   | 123 +++++++++++++-----
 .../comp_perf_test_verify.h                   |  24 +++-
 app/test-compress-perf/main.c                 |   1 +
 app/test-compress-perf/meson.build            |   1 +
 5 files changed, 113 insertions(+), 37 deletions(-)
app/test-compress-perf/Makefile +1 -0
index de7412961..f54d9a4dd 100644
@@ -12,6 +12,7 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
+SRCS-y += comp_perf_test_verify.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_verify.c +88 -35

243 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_verify.h +22 -2
index 67c6b4980..ae8b7429c 100644
@@ -1,13 +1,33 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018-2019 Intel Corporation
  */
 
 #ifndef _COMP_PERF_TEST_VERIFY_
 #define _COMP_PERF_TEST_VERIFY_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+
+struct cperf_verify_ctx {
+	struct cperf_mem_resources mem;
+	struct comp_test_data *options;
+
+	int silent;
+	size_t comp_data_sz;
+	size_t decomp_data_sz;
+	double ratio;
+};
+
+void
+cperf_verify_test_destructor(void *arg);
 
 int
-cperf_verification(struct comp_test_data *test_data, uint8_t level);
+cperf_verify_test_runner(void *test_ctx);
+
+void *
+cperf_verify_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index 3a3da4c90..51ca9f5b7 100644
@@ -8,6 +8,7 @@
 #include <rte_compressdev.h>
 
 #include "comp_perf_options.h"
+#include "comp_perf_test_verify.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index 00413c6d0..c6246e503 100644
@@ -4,5 +4,6 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
+		'comp_perf_test_verify.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.17.1
#51 lore raw

PATCH v6 4/6 app/test-compress-perf: add benchmark test case

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch adds a benchmark part to compression-perf-tool as a separate test case, which can be executed multi-threaded.

---
 app/test-compress-perf/Makefile               |   1 +
 .../comp_perf_test_benchmark.c                | 140 +++++++++++++-----
 .../comp_perf_test_benchmark.h                |  25 +++-
 app/test-compress-perf/main.c                 |   1 +
 app/test-compress-perf/meson.build            |   1 +
 5 files changed, 130 insertions(+), 38 deletions(-)
app/test-compress-perf/Makefile +1 -0
index f54d9a4dd..d1a6820e6 100644
@@ -13,6 +13,7 @@ CFLAGS += -O3
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
 SRCS-y += comp_perf_test_verify.c
+SRCS-y += comp_perf_test_benchmark.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_benchmark.c +103 -37

278 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_benchmark.h +24 -1
index b193445a3..d9b2694b8 100644
@@ -5,9 +5,32 @@
 #ifndef _COMP_PERF_TEST_BENCHMARK_
 #define _COMP_PERF_TEST_BENCHMARK_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+#include "comp_perf_test_verify.h"
+
+struct cperf_benchmark_ctx {
+	struct cperf_verify_ctx ver;
+
+	/* Store TSC duration for all levels (including level 0) */
+	uint64_t comp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	uint64_t decomp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	double comp_gbps;
+	double decomp_gbps;
+	double comp_tsc_byte;
+	double decomp_tsc_byte;
+};
+
+void
+cperf_benchmark_test_destructor(void *arg);
 
 int
-cperf_benchmark(struct comp_test_data *test_data, uint8_t level);
+cperf_benchmark_test_runner(void *test_ctx);
+
+void *
+cperf_benchmark_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index 51ca9f5b7..dd6ef9a6d 100644
@@ -9,6 +9,7 @@
 
 #include "comp_perf_options.h"
 #include "comp_perf_test_verify.h"
+#include "comp_perf_test_benchmark.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index c6246e503..1136f04bc 100644
@@ -5,5 +5,6 @@ allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
 		'comp_perf_test_verify.c',
+		'comp_perf_test_benchmark.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.17.1
#52 lore raw

PATCH v6 5/6 doc: update dpdk-test-compress-perf description

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch updates a dpdk-test-compress-perf documentation.

---
 doc/guides/tools/comp_perf.rst | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)
doc/guides/tools/comp_perf.rst +31 -3
index 52869c18c..71eef1821 100644
@@ -6,7 +6,9 @@ dpdk-test-compress-perf Tool
 
 The ``dpdk-test-compress-perf`` tool is a Data Plane Development Kit (DPDK)
 utility that allows measuring performance parameters of PMDs available in the
-compress tree. The tool reads the data from a file (--input-file),
+compress tree. User can use multiple cores to run tests on but only
+one type of compression PMD can be measured during single application
+execution. The tool reads the data from a file (--input-file),
 dumps all the file into a buffer and fills out the data of input mbufs,
 which are passed to compress device with compression operations.
 Then, the output buffers are fed into the decompression stage, and the resulting
@@ -26,9 +28,35 @@ Limitations
 
 * Stateful operation is not supported in this version.
 
+EAL Options
+~~~~~~~~~~~
+
+The following are the EAL command-line options that can be used in conjunction
+with the ``dpdk-test-compress-perf`` application.
+See the DPDK Getting Started Guides for more information on these options.
+
+*   ``-c <COREMASK>`` or ``-l <CORELIST>``
+
+	Set the hexadecimal bitmask of the cores to run on. The corelist is a
+	list cores to use.
+
+.. Note::
+
+	One lcore is needed for process admin, tests are run on all other cores.
+	To run tests on two lcores, three lcores must be passed to the tool.
+
+*   ``-w <PCI>``
+
+	Add a PCI device in white list.
+
+*   ``--vdev <driver><id>``
+
+	Add a virtual device.
+
+Appication Options
+~~~~~~~~~~~~~~~~~~
 
-Command line options
---------------------
+ ``--ptest [benchmark/verify]``: set test type (default: benchmark)
 
  ``--driver-name NAME``: compress driver to use
 
Signature · 1 line
2.17.1
#53 lore raw

PATCH v6 6/6 app/test-compress-perf: add force process termination

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch adds a possibility to force controlled process termination as a result of two signals: SIGTERM and SIGINT

---
 app/test-compress-perf/comp_perf_options.h    |  1 +
 .../comp_perf_test_benchmark.c                | 13 ++++++++++
 .../comp_perf_test_verify.c                   | 14 ++++++++++
 app/test-compress-perf/main.c                 | 26 +++++++++++++++++--
 4 files changed, 52 insertions(+), 2 deletions(-)
app/test-compress-perf/comp_perf_options.h +1 -0
index 0aa29a599..532fb964e 100644
@@ -67,6 +67,7 @@ struct comp_test_data {
 
 	double ratio;
 	enum cleanup_st cleanup;
+	int perf_comp_force_stop;
 };
 
 int
app/test-compress-perf/comp_perf_test_benchmark.c +13 -0
index e0f852bf0..aa1f8eea2 100644
@@ -184,6 +184,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -242,6 +245,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							   mem->qp_id,
 							   deq_ops,
@@ -306,6 +312,13 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
 	return res;
 }
 
app/test-compress-perf/comp_perf_test_verify.c +14 -0
index 7be30ee13..37ac38da6 100644
@@ -188,6 +188,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -268,6 +271,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							mem->qp_id,
 							deq_ops,
@@ -346,6 +352,14 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
+
 	return res;
 }
 
app/test-compress-perf/main.c +24 -2
index dd6ef9a6d..e746e4708 100644
@@ -2,6 +2,10 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
+#include <signal.h>
+#include <sys/types.h>
+#include <unistd.h>
+
 #include <rte_malloc.h>
 #include <rte_eal.h>
 #include <rte_log.h>
@@ -36,6 +40,8 @@ static const struct cperf_test cperf_testmap[] = {
 	}
 };
 
+static struct comp_test_data *test_data;
+
 static int
 comp_perf_check_capabilities(struct comp_test_data *test_data, uint8_t cdev_id)
 {
@@ -277,12 +283,24 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)
 	return ret;
 }
 
+static void
+comp_perf_cleanup_on_signal(int signalNumber __rte_unused)
+{
+	test_data->perf_comp_force_stop = 1;
+}
+
+static void
+comp_perf_register_cleanup_on_signal(void)
+{
+	signal(SIGTERM, comp_perf_cleanup_on_signal);
+	signal(SIGINT, comp_perf_cleanup_on_signal);
+}
+
 int
 main(int argc, char **argv)
 {
 	uint8_t level_idx = 0;
 	int ret, i;
-	struct comp_test_data *test_data;
 	void *ctx[RTE_MAX_LCORE] = {};
 	uint8_t enabled_cdevs[RTE_COMPRESS_MAX_DEVS];
 	int nb_compressdevs = 0;
@@ -304,6 +322,8 @@ main(int argc, char **argv)
 		rte_exit(EXIT_FAILURE, "Cannot reserve memory in socket %d\n",
 				rte_socket_id());
 
+	comp_perf_register_cleanup_on_signal();
+
 	ret = EXIT_SUCCESS;
 	test_data->cleanup = ST_TEST_DATA;
 	comp_perf_options_default(test_data);
@@ -424,8 +444,10 @@ main(int argc, char **argv)
 		/* fallthrough */
 	case ST_COMPDEV:
 		for (i = 0; i < nb_compressdevs &&
-				i < RTE_COMPRESS_MAX_DEVS; i++)
+		     i < RTE_COMPRESS_MAX_DEVS; i++) {
 			rte_compressdev_stop(enabled_cdevs[i]);
+			rte_compressdev_close(enabled_cdevs[i]);
+		}
 		/* fallthrough */
 	case ST_TEST_DATA:
 		rte_free(test_data);
Signature · 1 line
2.17.1
#54 lore raw
In reply to Artur Trybula
Quoted 72 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Artur Trybula
Sent: Wednesday, July 3, 2019 8:54 PM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [dpdk-dev] [PATCH v6 0/6] add multiple cores feature to test- compress-perf

This patchset adds multiple cores feature to compression perf tool. All structures have been aligned and are consistent with crypto perf tool. All test cases have constructor, runner and destructor and can use more cores and compression devices at the same time.

v2 changes:

- fixed checkpatch warning
- fixed max_nb_queue_pairs detection. Based on compression API if max_nb_queue_pairs = 0 that means there is no limit in maximum number of queue pairs
- fixed qp setup on the last device

v3 changes:

- merged with commit 2f6527b70c15
app/compress-perf: add prints for socket id

- fixed wrong compression/decompression throughput calculation

v4 changes:

- moved release notes update to patch 1
- removed pmd cyclecount template

v5 changes:

- changed ctx null ptr detection inside constructors

v6 changes:

- rebase to the recent master (before applying)

    commit 82b9677cb23c

Tomasz Jozwiak (6):
app/test-compress-perf: add weak functions for multi-cores test app/test-compress-perf: add ptest command line option app/test-compress-perf: add verification test case app/test-compress-perf: add benchmark test case
doc: update dpdk-test-compress-perf description app/test-compress-perf: add force process termination

 app/test-compress-perf/Makefile               |   1 +
 app/test-compress-perf/comp_perf.h            |  50 ++
 app/test-compress-perf/comp_perf_options.h    |  45 +-
 .../comp_perf_options_parse.c                 |  54 +-
 .../comp_perf_test_benchmark.c                | 153 +++--
 .../comp_perf_test_benchmark.h                |  25 +-
 .../comp_perf_test_common.c                   | 284 ++++++++
 .../comp_perf_test_common.h                   |  41 ++
 .../comp_perf_test_verify.c                   | 137 +++-
 .../comp_perf_test_verify.h                   |  24 +-
 app/test-compress-perf/main.c                 | 605 +++++++-----------
 app/test-compress-perf/meson.build            |   3 +-
 doc/guides/rel_notes/release_19_08.rst        |   4 +
 doc/guides/tools/comp_perf.rst                |  34 +-
 14 files changed, 993 insertions(+), 467 deletions(-)  create mode 100644
app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
Quoted 1 line

--

It will be nice if we could have version history in descending order. Other than that

Series Acked-by: Shally Verma <[email protected]>

Quoted 1 line

2.17.1

#55 lore raw

v7 cover add multiple cores feature to test-compress-perf

In reply to Artur Trybula

This patchset adds multiple cores feature to compression perf tool. All structures have been aligned and are consistent with crypto perf tool. All test cases have constructor, runner and destructor and can use more cores and compression devices at the same time.

v7 changes:
- rebase as patch failed to apply due to release note clash
- moved release note change to patch 4 as more appropriate

v6 changes:
- rebase to the recent master (before applying)

    commit 82b9677cb23c

v5 changes:
- changed ctx null ptr detection inside constructors

v4 changes:
- moved release notes update to patch 1
- removed pmd cyclecount template

v3 changes:
- merged with commit 2f6527b70c15
app/compress-perf: add prints for socket id
- fixed wrong compression/decompression throughput calculation

v2 changes:
- fixed max_nb_queue_pairs detection. Based on compression API if max_nb_queue_pairs = 0 that means there is no limit in maximum number of queue pairs
- fixed qp setup on the last device

Tomasz Jozwiak (6):
app/test-compress-perf: add weak functions for multi-cores test app/test-compress-perf: add ptest command line option app/test-compress-perf: add verification test case app/test-compress-perf: add benchmark test case
doc: update dpdk-test-compress-perf description app/test-compress-perf: add force process termination

 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf.h                |  50 ++
 app/test-compress-perf/comp_perf_options.h        |  45 +-
 app/test-compress-perf/comp_perf_options_parse.c  |  54 +-
 app/test-compress-perf/comp_perf_test_benchmark.c | 153 ++++--
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +-
 app/test-compress-perf/comp_perf_test_common.c    | 284 ++++++++++
 app/test-compress-perf/comp_perf_test_common.h    |  41 ++
 app/test-compress-perf/comp_perf_test_verify.c    | 137 +++--
 app/test-compress-perf/comp_perf_test_verify.h    |  24 +-
 app/test-compress-perf/main.c                     | 605 +++++++++-------------
 app/test-compress-perf/meson.build                |   3 +-
 doc/guides/rel_notes/release_19_08.rst            |   4 +
 doc/guides/tools/comp_perf.rst                    |  34 +-
 14 files changed, 993 insertions(+), 467 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
Signature · 1 line
2.13.6
#56 lore raw
Quoted 73 lines

-----Original Message-----
From: Fiona Trahe <[email protected]>
Sent: Friday, July 5, 2019 4:46 PM
To: [email protected]
Cc: [email protected]; Shally Verma <[email protected]>; [email protected]; [email protected]; [email protected]
Subject: [EXT] [PATCH v7 0/6] add multiple cores feature to test-compress- perf

External Email

----------------------------------------------------------------------
This patchset adds multiple cores feature to compression perf tool. All structures have been aligned and are consistent with crypto perf tool. All test cases have constructor, runner and destructor and can use more cores and compression devices at the same time.

v7 changes:
- rebase as patch failed to apply due to release note clash
- moved release note change to patch 4 as more appropriate

v6 changes:
- rebase to the recent master (before applying)

    commit 82b9677cb23c

v5 changes:
- changed ctx null ptr detection inside constructors

v4 changes:
- moved release notes update to patch 1
- removed pmd cyclecount template

v3 changes:
- merged with commit 2f6527b70c15
app/compress-perf: add prints for socket id
- fixed wrong compression/decompression throughput calculation

v2 changes:
- fixed max_nb_queue_pairs detection. Based on compression API if max_nb_queue_pairs = 0 that means there is no limit in maximum number of queue pairs
- fixed qp setup on the last device

Tomasz Jozwiak (6):
app/test-compress-perf: add weak functions for multi-cores test app/test-compress-perf: add ptest command line option app/test-compress-perf: add verification test case app/test-compress-perf: add benchmark test case
doc: update dpdk-test-compress-perf description app/test-compress-perf: add force process termination

 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf.h                |  50 ++
 app/test-compress-perf/comp_perf_options.h        |  45 +-
 app/test-compress-perf/comp_perf_options_parse.c  |  54 +-  app/test-
compress-perf/comp_perf_test_benchmark.c | 153 ++++--  app/test-
compress-perf/comp_perf_test_benchmark.h |  25 +-
 app/test-compress-perf/comp_perf_test_common.c    | 284 ++++++++++
 app/test-compress-perf/comp_perf_test_common.h    |  41 ++
 app/test-compress-perf/comp_perf_test_verify.c    | 137 +++--
 app/test-compress-perf/comp_perf_test_verify.h    |  24 +-
 app/test-compress-perf/main.c                     | 605 +++++++++-------------
 app/test-compress-perf/meson.build                |   3 +-
 doc/guides/rel_notes/release_19_08.rst            |   4 +
 doc/guides/tools/comp_perf.rst                    |  34 +-
 14 files changed, 993 insertions(+), 467 deletions(-)  create mode 100644
app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
Quoted 1 line

--

Other than few minor comments on another patch which can be addressed in next series,

Series acked-by: Shally Verma <[email protected]>

Quoted 1 line

2.13.6

#57 lore raw

PATCH v7 1/6 app/test-compress-perf: add weak functions for multi-cores test

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch adds template functions for multi-cores performance version of compress-perf-tool

---
 app/test-compress-perf/Makefile                  |   3 +-
 app/test-compress-perf/comp_perf.h               |  50 ++
 app/test-compress-perf/comp_perf_options.h       |  44 +-
 app/test-compress-perf/comp_perf_options_parse.c |  24 +-
 app/test-compress-perf/comp_perf_test_common.c   | 284 +++++++++++
 app/test-compress-perf/comp_perf_test_common.h   |  41 ++
 app/test-compress-perf/main.c                    | 599 +++++++++--------------
 app/test-compress-perf/meson.build               |   3 +-
 8 files changed, 646 insertions(+), 402 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
app/test-compress-perf/Makefile +1 -2
index d20e17e47..de7412961 100644
@@ -12,7 +12,6 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
-SRCS-y += comp_perf_test_verify.c
-SRCS-y += comp_perf_test_benchmark.c
+SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf.h new file +50 -0

50 lines not on this page · raw message

app/test-compress-perf/comp_perf_options.h +25 -19

68 lines not on this page · raw message

app/test-compress-perf/comp_perf_options_parse.c +12 -12
index a7a8c1f9e..74ea81d09 100644
@@ -468,19 +468,20 @@ parse_level(struct comp_test_data *test_data, const char *arg)
 	 * Try parsing the argument as a range, if it fails,
 	 * arse it as a list
 	 */
-	if (parse_range(arg, &test_data->level.min, &test_data->level.max,
-			&test_data->level.inc) < 0) {
-		ret = parse_list(arg, test_data->level.list,
-					&test_data->level.min,
-					&test_data->level.max);
+	if (parse_range(arg, &test_data->level_lst.min,
+			&test_data->level_lst.max,
+			&test_data->level_lst.inc) < 0) {
+		ret = parse_list(arg, test_data->level_lst.list,
+					&test_data->level_lst.min,
+					&test_data->level_lst.max);
 		if (ret < 0) {
 			RTE_LOG(ERR, USER1,
 				"Failed to parse compression level/s\n");
 			return -1;
 		}
-		test_data->level.count = ret;
+		test_data->level_lst.count = ret;
 
-		if (test_data->level.max > RTE_COMP_LEVEL_MAX) {
+		if (test_data->level_lst.max > RTE_COMP_LEVEL_MAX) {
 			RTE_LOG(ERR, USER1, "Level cannot be higher than %u\n",
 					RTE_COMP_LEVEL_MAX);
 			return -1;
@@ -500,7 +501,6 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
-
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -574,7 +574,6 @@ comp_perf_options_parse(struct comp_test_data *test_data, int argc, char **argv)
 void
 comp_perf_options_default(struct comp_test_data *test_data)
 {
-	test_data->cdev_id = -1;
 	test_data->seg_sz = 2048;
 	test_data->burst_sz = 32;
 	test_data->pool_sz = 8192;
@@ -583,9 +582,10 @@ comp_perf_options_default(struct comp_test_data *test_data)
 	test_data->huffman_enc = RTE_COMP_HUFFMAN_DYNAMIC;
 	test_data->test_op = COMPRESS_DECOMPRESS;
 	test_data->window_sz = -1;
-	test_data->level.min = 1;
-	test_data->level.max = 9;
-	test_data->level.inc = 1;
+	test_data->level_lst.min = 1;
+	test_data->level_lst.max = 9;
+	test_data->level_lst.inc = 1;
+	test_data->test = CPERF_TEST_TYPE_BENCHMARK;
 }
 
 int
app/test-compress-perf/comp_perf_test_common.c new file +284 -0

284 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_common.h new file +41 -0

41 lines not on this page · raw message

app/test-compress-perf/main.c +232 -367

701 lines not on this page · raw message

app/test-compress-perf/meson.build +1 -2
index ec73e5e02..00413c6d0 100644
@@ -4,6 +4,5 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
-		'comp_perf_test_verify.c',
-		'comp_perf_test_benchmark.c')
+		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.13.6
#58 lore raw

Re: [dpdk-dev] [EXT] [PATCH v7 1/6] app/test-compress-perf: add weak functions for multi-cores test

Quoted 15 lines

-----Original Message-----
From: Fiona Trahe <[email protected]>
Sent: Friday, July 5, 2019 4:46 PM
To: [email protected]
Cc: [email protected]; Shally Verma <[email protected]>; [email protected]; [email protected]; [email protected]; Tomasz Jozwiak <[email protected]>
Subject: [EXT] [PATCH v7 1/6] app/test-compress-perf: add weak functions for multi-cores test

External Email

----------------------------------------------------------------------

...

....

Quoted 1 line

+enum cperf_perf_test_type {

I think I had feedback here on enum name: it can be just cperf_test_type

Quoted 4 lines
app/test-compress-perf/comp_perf_options.h +4 -0
+	CPERF_TEST_TYPE_BENCHMARK,
+	CPERF_TEST_TYPE_VERIFY
+};
+

...

app/test-compress-perf/comp_perf_options.h struct range_list { · line 49

Quoted 3 lines

struct comp_test_data {

app/test-compress-perf/comp_perf_options.h +0 -0
 	char driver_name[64];
 	char input_file[64];

Rather than using magic number better use MACRO NAME? also where is limitation mentioned on name sizes?

Quoted 47 lines
app/test-compress-perf/comp_perf_options.h +8 -19
-	struct rte_mbuf **comp_bufs;
-	struct rte_mbuf **decomp_bufs;
-	uint32_t total_bufs;
+	enum cperf_perf_test_type test;
+
 	uint8_t *input_data;
 	size_t input_data_sz;
-	uint8_t *compressed_data;
-	uint8_t *decompressed_data;
-	struct rte_mempool *comp_buf_pool;
-	struct rte_mempool *decomp_buf_pool;
-	struct rte_mempool *op_pool;
-	int8_t cdev_id;
+	uint16_t nb_qps;
 	uint16_t seg_sz;
 	uint16_t out_seg_sz;
 	uint16_t burst_sz;
 	uint32_t pool_sz;
 	uint32_t num_iter;
 	uint16_t max_sgl_segs;
+
 	enum rte_comp_huffman huffman_enc;
 	enum comp_operation test_op;
 	int window_sz;
-	struct range_list level;
-	/* Store TSC duration for all levels (including level 0) */
-	uint64_t comp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
-	uint64_t decomp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
-	size_t comp_data_sz;
-	size_t decomp_data_sz;
+	struct range_list level_lst;
+	uint8_t level;
+
 	double ratio;
-	double comp_gbps;
-	double decomp_gbps;
-	double comp_tsc_byte;
-	double decomp_tsc_byte;
+	enum cleanup_st cleanup;
 };
 
 int
app/test- renamed from app/test-compress-perf/comp_perf_options_parse.c +0 -0

compress-perf/comp_perf_options_parse.c
index a7a8c1f9e..74ea81d09 100644

app/test-compress-perf/comp_perf_options_parse.c +0 -0

...

Quoted 4 lines
app/test-compress-perf/comp_perf_options_parse.c +0 -1
@@ -500,7 +501,6 @@ struct long_opt_parser {  };
 
 static struct option lgopts[] = {
-

...

app/test-compress-perf/comp_perf_options_parse.c comp_perf_options_default(struct comp_test_data *test_data) · line 587

Quoted 6 lines
app/test-compress-perf/comp_perf_options_parse.c +3 -3
-	test_data->level.min = 1;
-	test_data->level.max = 9;
-	test_data->level.inc = 1;
+	test_data->level_lst.min = 1;
+	test_data->level_lst.max = 9;
+	test_data->level_lst.inc = 1;

Replace by Macro?

Quoted 14 lines
app/test-compress-perf/comp_perf_options_parse.c +1 -0
+	test_data->test = CPERF_TEST_TYPE_BENCHMARK;
 }
 
 int
app/test- renamed from app/test-compress-perf/comp_perf_test_common.c +0 -0

compress-perf/comp_perf_test_common.c
new file mode 100644
index 000000000..dc9d0b0f4

app/test-compress-perf/comp_perf_test_common.c new file +3 -0
@@ -0,0 +1,284 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2019 Intel Corporation
+ */

app/test-compress-perf/comp_perf_test_common.c line 13

Quoted 10 lines
app/test-compress-perf/comp_perf_test_common.c new file +10 -0
+
+#include <rte_malloc.h>
+#include <rte_eal.h>
+#include <rte_log.h>
+#include <rte_compressdev.h>
+
+#include "comp_perf_options.h"
+#include "comp_perf_test_verify.h"
+#include "comp_perf_test_benchmark.h"
+#include "comp_perf.h"

Should this is before comp_perf_xx files to maintain alphabetical order?

Quoted 2 lines
app/test-compress-perf/comp_perf_test_common.c new file +2 -0
+#include "comp_perf_test_common.h"
+

...

app/test-compress-perf/comp_perf_test_common.c line 52

Quoted 11 lines
app/test-compress-perf/comp_perf_test_common.c new file +11 -0
+
+static uint32_t
+find_buf_size(uint32_t input_size)
+{
+	uint32_t i;
+
+	/* From performance point of view the buffer size should be a
+	 * power of 2 but also should be enough to store incompressible data
+	 */
+
+	/* We're looking for nearest power of 2 buffer size, which is greather

Typo: greater

Quoted 14 lines
app/test-compress-perf/comp_perf_test_common.c new file +4 -0
+	 * than input_size
+	 */
+	uint32_t size =
+		!input_size ? MIN_COMPRESSED_BUF_SIZE : (input_size <<

1);

app/test-compress-perf/comp_perf_test_common.c new file +9 -0
+
+	for (i = UINT16_MAX + 1; !(i & size); i >>= 1)
+		;
+
+	return i > ((UINT16_MAX + 1) >> 1)
+			? (uint32_t)((float)input_size * EXPANSE_RATIO)
+			: i;
+}
+

...

Quoted 2 lines

--
2.13.6

#59 lore raw

v8 cover add multiple cores feature to test-compress-perf

In reply to Fiona Trahe

This patchset adds multiple cores feature to compression perf tool. All structures have been aligned and are consistent with crypto perf tool. All test cases have constructor, runner and destructor and can use more cores and compression devices at the same time.

v8 changes:
- some minor fixes (e.g. 'magic numbers', spelling mistake, enum naming)

v7 changes:
- rebase as patch failed to apply due to release note clash
- moved release note change to patch 4 as more appropriate

v6 changes:
- rebase to the recent master (before applying)

    commit 82b9677cb23c

v5 changes:
- changed ctx null ptr detection inside constructors

v4 changes:
- moved release notes update to patch 1
- removed pmd cyclecount template

v3 changes:
- merged with commit 2f6527b70c15
app/compress-perf: add prints for socket id
- fixed wrong compression/decompression throughput calculation

v2 changes:
- fixed max_nb_queue_pairs detection. Based on compression API if max_nb_queue_pairs = 0 that means there is no limit in maximum number of queue pairs
- fixed qp setup on the last device

Artur Trybula (1):
app/test-compress-perf: 'magic numbers' removed

Tomasz Jozwiak (6):
app/test-compress-perf: add weak functions for multi-cores test app/test-compress-perf: add ptest command line option app/test-compress-perf: add verification test case app/test-compress-perf: add benchmark test case
doc: update dpdk-test-compress-perf description app/test-compress-perf: add force process termination

 app/test-compress-perf/Makefile               |   1 +
 app/test-compress-perf/comp_perf.h            |  50 ++
 app/test-compress-perf/comp_perf_options.h    |  51 +-
 .../comp_perf_options_parse.c                 |  54 +-
 .../comp_perf_test_benchmark.c                | 153 +++--
 .../comp_perf_test_benchmark.h                |  25 +-
 .../comp_perf_test_common.c                   | 285 +++++++++
 .../comp_perf_test_common.h                   |  41 ++
 .../comp_perf_test_verify.c                   | 137 +++-
 .../comp_perf_test_verify.h                   |  24 +-
 app/test-compress-perf/main.c                 | 605 +++++++-----------
 app/test-compress-perf/meson.build            |   3 +-
 doc/guides/rel_notes/release_19_08.rst        |  27 +
 doc/guides/tools/comp_perf.rst                |  34 +-
 14 files changed, 1019 insertions(+), 471 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h

Series acked-by: Shally Verma <[email protected]>

Signature · 1 line
2.17.1
#60 lore raw

PATCH v8 1/7 app/test-compress-perf: add weak functions for multi-cores test

From: Tomasz Jozwiak <[email protected]>

This patch adds template functions for multi-cores performance version of compress-perf-tool

---
 app/test-compress-perf/Makefile               |   3 +-
 app/test-compress-perf/comp_perf.h            |  50 ++
 app/test-compress-perf/comp_perf_options.h    |  44 +-
 .../comp_perf_options_parse.c                 |  24 +-
 .../comp_perf_test_common.c                   | 284 +++++++++
 .../comp_perf_test_common.h                   |  41 ++
 app/test-compress-perf/main.c                 | 599 +++++++-----------
 app/test-compress-perf/meson.build            |   3 +-
 8 files changed, 646 insertions(+), 402 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
app/test-compress-perf/Makefile +1 -2
index d20e17e47..de7412961 100644
@@ -12,7 +12,6 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
-SRCS-y += comp_perf_test_verify.c
-SRCS-y += comp_perf_test_benchmark.c
+SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf.h new file +50 -0

50 lines not on this page · raw message

app/test-compress-perf/comp_perf_options.h +25 -19

68 lines not on this page · raw message

app/test-compress-perf/comp_perf_options_parse.c +12 -12
index a7a8c1f9e..74ea81d09 100644
@@ -468,19 +468,20 @@ parse_level(struct comp_test_data *test_data, const char *arg)
 	 * Try parsing the argument as a range, if it fails,
 	 * arse it as a list
 	 */
-	if (parse_range(arg, &test_data->level.min, &test_data->level.max,
-			&test_data->level.inc) < 0) {
-		ret = parse_list(arg, test_data->level.list,
-					&test_data->level.min,
-					&test_data->level.max);
+	if (parse_range(arg, &test_data->level_lst.min,
+			&test_data->level_lst.max,
+			&test_data->level_lst.inc) < 0) {
+		ret = parse_list(arg, test_data->level_lst.list,
+					&test_data->level_lst.min,
+					&test_data->level_lst.max);
 		if (ret < 0) {
 			RTE_LOG(ERR, USER1,
 				"Failed to parse compression level/s\n");
 			return -1;
 		}
-		test_data->level.count = ret;
+		test_data->level_lst.count = ret;
 
-		if (test_data->level.max > RTE_COMP_LEVEL_MAX) {
+		if (test_data->level_lst.max > RTE_COMP_LEVEL_MAX) {
 			RTE_LOG(ERR, USER1, "Level cannot be higher than %u\n",
 					RTE_COMP_LEVEL_MAX);
 			return -1;
@@ -500,7 +501,6 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
-
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -574,7 +574,6 @@ comp_perf_options_parse(struct comp_test_data *test_data, int argc, char **argv)
 void
 comp_perf_options_default(struct comp_test_data *test_data)
 {
-	test_data->cdev_id = -1;
 	test_data->seg_sz = 2048;
 	test_data->burst_sz = 32;
 	test_data->pool_sz = 8192;
@@ -583,9 +582,10 @@ comp_perf_options_default(struct comp_test_data *test_data)
 	test_data->huffman_enc = RTE_COMP_HUFFMAN_DYNAMIC;
 	test_data->test_op = COMPRESS_DECOMPRESS;
 	test_data->window_sz = -1;
-	test_data->level.min = 1;
-	test_data->level.max = 9;
-	test_data->level.inc = 1;
+	test_data->level_lst.min = 1;
+	test_data->level_lst.max = 9;
+	test_data->level_lst.inc = 1;
+	test_data->test = CPERF_TEST_TYPE_BENCHMARK;
 }
 
 int
app/test-compress-perf/comp_perf_test_common.c new file +284 -0

284 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_common.h new file +41 -0

41 lines not on this page · raw message

app/test-compress-perf/main.c +232 -367

701 lines not on this page · raw message

app/test-compress-perf/meson.build +1 -2
index ec73e5e02..00413c6d0 100644
@@ -4,6 +4,5 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
-		'comp_perf_test_verify.c',
-		'comp_perf_test_benchmark.c')
+		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.17.1
#61 lore raw

PATCH v8 2/7 app/test-compress-perf: add ptest command line option

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch adds --ptest option to make possible to choose test case from command line.

---
 .../comp_perf_options_parse.c                 | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
app/test-compress-perf/comp_perf_options_parse.c +32 -0
index 74ea81d09..3d820197a 100644
@@ -15,6 +15,7 @@
 
 #include "comp_perf_options.h"
 
+#define CPERF_PTEST_TYPE	("ptest")
 #define CPERF_DRIVER_NAME	("driver-name")
 #define CPERF_TEST_FILE		("input-file")
 #define CPERF_SEG_SIZE		("seg-sz")
@@ -37,6 +38,7 @@ static void
 usage(char *progname)
 {
 	printf("%s [EAL options] --\n"
+		" --ptest benchmark / verify :"
 		" --driver-name NAME: compress driver to use\n"
 		" --input-file NAME: file to compress and decompress\n"
 		" --extended-input-sz N: extend file data up to this size (default: no extension)\n"
@@ -75,6 +77,33 @@ get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len,
 	return -1;
 }
 
+static int
+parse_cperf_test_type(struct comp_test_data *test_data, const char *arg)
+{
+	struct name_id_map cperftest_namemap[] = {
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
+			CPERF_TEST_TYPE_BENCHMARK
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
+			CPERF_TEST_TYPE_VERIFY
+		}
+	};
+
+	int id = get_str_key_id_mapping(
+			(struct name_id_map *)cperftest_namemap,
+			RTE_DIM(cperftest_namemap), arg);
+	if (id < 0) {
+		RTE_LOG(ERR, USER1, "failed to parse test type");
+		return -1;
+	}
+
+	test_data->test = (enum cperf_perf_test_type)id;
+
+	return 0;
+}
+
 static int
 parse_uint32_t(uint32_t *value, const char *arg)
 {
@@ -501,6 +530,8 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
+
+	{ CPERF_PTEST_TYPE, required_argument, 0, 0 },
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -519,6 +550,7 @@ static int
 comp_perf_opts_parse_long(int opt_idx, struct comp_test_data *test_data)
 {
 	struct long_opt_parser parsermap[] = {
+		{ CPERF_PTEST_TYPE,	parse_cperf_test_type },
 		{ CPERF_DRIVER_NAME,	parse_driver_name },
 		{ CPERF_TEST_FILE,	parse_test_file },
 		{ CPERF_SEG_SIZE,	parse_seg_sz },
Signature · 1 line
2.17.1
#62 lore raw

PATCH v8 3/7 app/test-compress-perf: add verification test case

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch adds a verification part to compression-perf-tool as a separate test case, which can be executed multi-threaded.

---
 app/test-compress-perf/Makefile               |   1 +
 .../comp_perf_test_verify.c                   | 123 +++++++++++++-----
 .../comp_perf_test_verify.h                   |  24 +++-
 app/test-compress-perf/main.c                 |   1 +
 app/test-compress-perf/meson.build            |   1 +
 5 files changed, 113 insertions(+), 37 deletions(-)
app/test-compress-perf/Makefile +1 -0
index de7412961..f54d9a4dd 100644
@@ -12,6 +12,7 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
+SRCS-y += comp_perf_test_verify.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_verify.c +88 -35

243 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_verify.h +22 -2
index 67c6b4980..ae8b7429c 100644
@@ -1,13 +1,33 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018-2019 Intel Corporation
  */
 
 #ifndef _COMP_PERF_TEST_VERIFY_
 #define _COMP_PERF_TEST_VERIFY_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+
+struct cperf_verify_ctx {
+	struct cperf_mem_resources mem;
+	struct comp_test_data *options;
+
+	int silent;
+	size_t comp_data_sz;
+	size_t decomp_data_sz;
+	double ratio;
+};
+
+void
+cperf_verify_test_destructor(void *arg);
 
 int
-cperf_verification(struct comp_test_data *test_data, uint8_t level);
+cperf_verify_test_runner(void *test_ctx);
+
+void *
+cperf_verify_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index 3a3da4c90..51ca9f5b7 100644
@@ -8,6 +8,7 @@
 #include <rte_compressdev.h>
 
 #include "comp_perf_options.h"
+#include "comp_perf_test_verify.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index 00413c6d0..c6246e503 100644
@@ -4,5 +4,6 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
+		'comp_perf_test_verify.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.17.1
#63 lore raw

PATCH v8 4/7 app/test-compress-perf: add benchmark test case

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch adds a benchmark part to compression-perf-tool as a separate test case, which can be executed multi-threaded.
Also updates release notes.

---
 app/test-compress-perf/Makefile               |   1 +
 .../comp_perf_test_benchmark.c                | 140 +++++++++++++-----
 .../comp_perf_test_benchmark.h                |  25 +++-
 app/test-compress-perf/main.c                 |   1 +
 app/test-compress-perf/meson.build            |   1 +
 doc/guides/rel_notes/release_19_08.rst        |  27 ++++
 6 files changed, 157 insertions(+), 38 deletions(-)
app/test-compress-perf/Makefile +1 -0
index f54d9a4dd..d1a6820e6 100644
@@ -13,6 +13,7 @@ CFLAGS += -O3
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
 SRCS-y += comp_perf_test_verify.c
+SRCS-y += comp_perf_test_benchmark.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_benchmark.c +103 -37

278 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_benchmark.h +24 -1
index b193445a3..d9b2694b8 100644
@@ -5,9 +5,32 @@
 #ifndef _COMP_PERF_TEST_BENCHMARK_
 #define _COMP_PERF_TEST_BENCHMARK_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+#include "comp_perf_test_verify.h"
+
+struct cperf_benchmark_ctx {
+	struct cperf_verify_ctx ver;
+
+	/* Store TSC duration for all levels (including level 0) */
+	uint64_t comp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	uint64_t decomp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	double comp_gbps;
+	double decomp_gbps;
+	double comp_tsc_byte;
+	double decomp_tsc_byte;
+};
+
+void
+cperf_benchmark_test_destructor(void *arg);
 
 int
-cperf_benchmark(struct comp_test_data *test_data, uint8_t level);
+cperf_benchmark_test_runner(void *test_ctx);
+
+void *
+cperf_benchmark_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index 51ca9f5b7..dd6ef9a6d 100644
@@ -9,6 +9,7 @@
 
 #include "comp_perf_options.h"
 #include "comp_perf_test_verify.h"
+#include "comp_perf_test_benchmark.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index c6246e503..1136f04bc 100644
@@ -5,5 +5,6 @@ allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
 		'comp_perf_test_verify.c',
+		'comp_perf_test_benchmark.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
doc/guides/rel_notes/release_19_08.rst +27 -0
index 8480112b9..ed7f6e250 100644
@@ -190,6 +190,29 @@ New Features
   Added telemetry mode to l3fwd-power application to report
   application level busyness, empty and full polls of rte_eth_rx_burst().
 
+* **Updated the QuickAssist Technology (QAT) symmetric crypto PMD.**
+
+  Added support for digest-encrypted cases where digest is appended
+  to the data.
+
+* **Added a FPGA_LTE_FEC bbdev PMD.**
+
+  Added the new ``fpga_lte_fec`` bbdev driver for the Intel® FPGA PAC
+  (Programmable  Acceleration Card) N3000.  See the
+  :doc:`../bbdevs/fpga_lte_fec` BBDEV guide for more details on this new driver.
+
+* **Updated TURBO_SW bbdev PMD.**
+
+  Updated the ``turbo_sw`` bbdev driver with changes including:
+
+  * Added option to build the driver with or without dependency of external
+    SDK libraries.
+  * Added support for 5GNR encode/decode operations.
+
+* **Updated test-compress-perf tool application.**
+
+  Added multiple cores feature to compression perf tool application.
+
 
 Removed Items
 -------------
@@ -259,6 +282,10 @@ API Changes
   offload flag from the library. The application must set this flag if it is
   supported by the platform and application wishes to use it.
 
+* cryptodev: the ``uint8_t *data`` member of ``key`` structure in the xforms
+  structure (``rte_crypto_cipher_xform``, ``rte_crypto_auth_xform``, and
+  ``rte_crypto_aead_xform``) have been changed to ``const uint8_t *data``.
+
 
 ABI Changes
 -----------
Signature · 1 line
2.17.1
#64 lore raw

PATCH v8 5/7 doc: update dpdk-test-compress-perf description

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch updates dpdk-test-compress-perf documentation.

---
 doc/guides/tools/comp_perf.rst | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)
doc/guides/tools/comp_perf.rst +31 -3
index 52869c18c..71eef1821 100644
@@ -6,7 +6,9 @@ dpdk-test-compress-perf Tool
 
 The ``dpdk-test-compress-perf`` tool is a Data Plane Development Kit (DPDK)
 utility that allows measuring performance parameters of PMDs available in the
-compress tree. The tool reads the data from a file (--input-file),
+compress tree. User can use multiple cores to run tests on but only
+one type of compression PMD can be measured during single application
+execution. The tool reads the data from a file (--input-file),
 dumps all the file into a buffer and fills out the data of input mbufs,
 which are passed to compress device with compression operations.
 Then, the output buffers are fed into the decompression stage, and the resulting
@@ -26,9 +28,35 @@ Limitations
 
 * Stateful operation is not supported in this version.
 
+EAL Options
+~~~~~~~~~~~
+
+The following are the EAL command-line options that can be used in conjunction
+with the ``dpdk-test-compress-perf`` application.
+See the DPDK Getting Started Guides for more information on these options.
+
+*   ``-c <COREMASK>`` or ``-l <CORELIST>``
+
+	Set the hexadecimal bitmask of the cores to run on. The corelist is a
+	list cores to use.
+
+.. Note::
+
+	One lcore is needed for process admin, tests are run on all other cores.
+	To run tests on two lcores, three lcores must be passed to the tool.
+
+*   ``-w <PCI>``
+
+	Add a PCI device in white list.
+
+*   ``--vdev <driver><id>``
+
+	Add a virtual device.
+
+Appication Options
+~~~~~~~~~~~~~~~~~~
 
-Command line options
---------------------
+ ``--ptest [benchmark/verify]``: set test type (default: benchmark)
 
  ``--driver-name NAME``: compress driver to use
 
Signature · 1 line
2.17.1
#65 lore raw

PATCH v8 6/7 app/test-compress-perf: add force process termination

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch adds a possibility to force controlled process termination as a result of two signals: SIGTERM and SIGINT

---
 app/test-compress-perf/comp_perf_options.h    |  1 +
 .../comp_perf_test_benchmark.c                | 13 ++++++++++
 .../comp_perf_test_verify.c                   | 14 ++++++++++
 app/test-compress-perf/main.c                 | 26 +++++++++++++++++--
 4 files changed, 52 insertions(+), 2 deletions(-)
app/test-compress-perf/comp_perf_options.h +1 -0
index 0aa29a599..532fb964e 100644
@@ -67,6 +67,7 @@ struct comp_test_data {
 
 	double ratio;
 	enum cleanup_st cleanup;
+	int perf_comp_force_stop;
 };
 
 int
app/test-compress-perf/comp_perf_test_benchmark.c +13 -0
index e0f852bf0..aa1f8eea2 100644
@@ -184,6 +184,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -242,6 +245,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							   mem->qp_id,
 							   deq_ops,
@@ -306,6 +312,13 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
 	return res;
 }
 
app/test-compress-perf/comp_perf_test_verify.c +14 -0
index 7be30ee13..37ac38da6 100644
@@ -188,6 +188,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -268,6 +271,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							mem->qp_id,
 							deq_ops,
@@ -346,6 +352,14 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
+
 	return res;
 }
 
app/test-compress-perf/main.c +24 -2
index dd6ef9a6d..e746e4708 100644
@@ -2,6 +2,10 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
+#include <signal.h>
+#include <sys/types.h>
+#include <unistd.h>
+
 #include <rte_malloc.h>
 #include <rte_eal.h>
 #include <rte_log.h>
@@ -36,6 +40,8 @@ static const struct cperf_test cperf_testmap[] = {
 	}
 };
 
+static struct comp_test_data *test_data;
+
 static int
 comp_perf_check_capabilities(struct comp_test_data *test_data, uint8_t cdev_id)
 {
@@ -277,12 +283,24 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)
 	return ret;
 }
 
+static void
+comp_perf_cleanup_on_signal(int signalNumber __rte_unused)
+{
+	test_data->perf_comp_force_stop = 1;
+}
+
+static void
+comp_perf_register_cleanup_on_signal(void)
+{
+	signal(SIGTERM, comp_perf_cleanup_on_signal);
+	signal(SIGINT, comp_perf_cleanup_on_signal);
+}
+
 int
 main(int argc, char **argv)
 {
 	uint8_t level_idx = 0;
 	int ret, i;
-	struct comp_test_data *test_data;
 	void *ctx[RTE_MAX_LCORE] = {};
 	uint8_t enabled_cdevs[RTE_COMPRESS_MAX_DEVS];
 	int nb_compressdevs = 0;
@@ -304,6 +322,8 @@ main(int argc, char **argv)
 		rte_exit(EXIT_FAILURE, "Cannot reserve memory in socket %d\n",
 				rte_socket_id());
 
+	comp_perf_register_cleanup_on_signal();
+
 	ret = EXIT_SUCCESS;
 	test_data->cleanup = ST_TEST_DATA;
 	comp_perf_options_default(test_data);
@@ -424,8 +444,10 @@ main(int argc, char **argv)
 		/* fallthrough */
 	case ST_COMPDEV:
 		for (i = 0; i < nb_compressdevs &&
-				i < RTE_COMPRESS_MAX_DEVS; i++)
+		     i < RTE_COMPRESS_MAX_DEVS; i++) {
 			rte_compressdev_stop(enabled_cdevs[i]);
+			rte_compressdev_close(enabled_cdevs[i]);
+		}
 		/* fallthrough */
 	case ST_TEST_DATA:
 		rte_free(test_data);
Signature · 1 line
2.17.1
#66 lore raw

PATCH v8 7/7 app/test-compress-perf: 'magic numbers' removed

In reply to Artur Trybula

This patch fixes some minor problems like 'magic numbers', spelling mistakes, enumes naming.

---
 app/test-compress-perf/comp_perf_options.h       | 10 ++++------
 app/test-compress-perf/comp_perf_options_parse.c |  6 +++---
 app/test-compress-perf/comp_perf_test_common.c   |  7 ++++---
 3 files changed, 11 insertions(+), 12 deletions(-)
app/test-compress-perf/comp_perf_options.h +4 -6
index 532fb964e..5a32ed3a6 100644
@@ -5,8 +5,6 @@
 #ifndef _COMP_PERF_OPS_
 #define _COMP_PERF_OPS_
 
-#define MAX_DRIVER_NAME		64
-#define MAX_INPUT_FILE_NAME	64
 #define MAX_LIST		32
 #define MIN_COMPRESSED_BUF_SIZE 8
 #define EXPANSE_RATIO 1.05
@@ -25,7 +23,7 @@ enum cleanup_st {
 	ST_DURING_TEST
 };
 
-enum cperf_perf_test_type {
+enum cperf_test_type {
 	CPERF_TEST_TYPE_BENCHMARK,
 	CPERF_TEST_TYPE_VERIFY
 };
@@ -45,9 +43,9 @@ struct range_list {
 };
 
 struct comp_test_data {
-	char driver_name[64];
-	char input_file[64];
-	enum cperf_perf_test_type test;
+	char driver_name[RTE_DEV_NAME_MAX_LEN];
+	char input_file[PATH_MAX];
+	enum cperf_test_type test;
 
 	uint8_t *input_data;
 	size_t input_data_sz;
app/test-compress-perf/comp_perf_options_parse.c +3 -3
index 3d820197a..01e19eafb 100644
@@ -99,7 +99,7 @@ parse_cperf_test_type(struct comp_test_data *test_data, const char *arg)
 		return -1;
 	}
 
-	test_data->test = (enum cperf_perf_test_type)id;
+	test_data->test = (enum cperf_test_type)id;
 
 	return 0;
 }
@@ -614,8 +614,8 @@ comp_perf_options_default(struct comp_test_data *test_data)
 	test_data->huffman_enc = RTE_COMP_HUFFMAN_DYNAMIC;
 	test_data->test_op = COMPRESS_DECOMPRESS;
 	test_data->window_sz = -1;
-	test_data->level_lst.min = 1;
-	test_data->level_lst.max = 9;
+	test_data->level_lst.min = RTE_COMP_LEVEL_MIN;
+	test_data->level_lst.max = RTE_COMP_LEVEL_MAX;
 	test_data->level_lst.inc = 1;
 	test_data->test = CPERF_TEST_TYPE_BENCHMARK;
 }
app/test-compress-perf/comp_perf_test_common.c +4 -3
index dc9d0b0f4..472c76686 100644
@@ -7,11 +7,12 @@
 #include <rte_log.h>
 #include <rte_compressdev.h>
 
+#include "comp_perf.h"
 #include "comp_perf_options.h"
-#include "comp_perf_test_verify.h"
 #include "comp_perf_test_benchmark.h"
-#include "comp_perf.h"
 #include "comp_perf_test_common.h"
+#include "comp_perf_test_verify.h"
+
 
 #define DIV_CEIL(a, b)  ((a) / (b) + ((a) % (b) != 0))
 
@@ -49,7 +50,7 @@ find_buf_size(uint32_t input_size)
 	 * power of 2 but also should be enough to store incompressible data
 	 */
 
-	/* We're looking for nearest power of 2 buffer size, which is greather
+	/* We're looking for nearest power of 2 buffer size, which is greater
 	 * than input_size
 	 */
 	uint32_t size =
Signature · 1 line
2.17.1
Acked-by on v8 7/7
#67 lore raw

Re: [dpdk-dev] [PATCH v8 7/7] app/test-compress-perf: 'magic numbers' removed

Quoted 9 lines

-----Original Message-----
From: Trybula, ArturX
Sent: Monday, July 8, 2019 7:16 PM
To: [email protected]; Trahe, Fiona <[email protected]>; [email protected]; Dybkowski, AdamX <[email protected]>; Trybula, ArturX <[email protected]>; [email protected]
Subject: [PATCH v8 7/7] app/test-compress-perf: 'magic numbers' removed

Quoted 4 lines

This patch fixes some minor problems like 'magic numbers', spelling mistakes, enumes naming.

Applied
#68 lore raw
In reply to Artur Trybula
Quoted 69 lines

This patchset adds multiple cores feature to compression perf tool. All structures have been aligned and are consistent with crypto perf tool. All test cases have constructor, runner and destructor and can use more cores and compression devices at the same time.

v8 changes:
- some minor fixes (e.g. 'magic numbers', spelling mistake, enum naming)

v7 changes:
- rebase as patch failed to apply due to release note clash
- moved release note change to patch 4 as more appropriate

v6 changes:
- rebase to the recent master (before applying)

    commit 82b9677cb23c

v5 changes:
- changed ctx null ptr detection inside constructors

v4 changes:
- moved release notes update to patch 1
- removed pmd cyclecount template

v3 changes:
- merged with commit 2f6527b70c15
app/compress-perf: add prints for socket id
- fixed wrong compression/decompression throughput calculation

v2 changes:
- fixed max_nb_queue_pairs detection. Based on compression API if max_nb_queue_pairs = 0 that means there is no limit in maximum number of queue pairs
- fixed qp setup on the last device

Artur Trybula (1):
app/test-compress-perf: 'magic numbers' removed

Tomasz Jozwiak (6):
app/test-compress-perf: add weak functions for multi-cores test app/test-compress-perf: add ptest command line option app/test-compress-perf: add verification test case app/test-compress-perf: add benchmark test case
doc: update dpdk-test-compress-perf description app/test-compress-perf: add force process termination

 app/test-compress-perf/Makefile               |   1 +
 app/test-compress-perf/comp_perf.h            |  50 ++
 app/test-compress-perf/comp_perf_options.h    |  51 +-
 .../comp_perf_options_parse.c                 |  54 +-
 .../comp_perf_test_benchmark.c                | 153 +++--
 .../comp_perf_test_benchmark.h                |  25 +-
 .../comp_perf_test_common.c                   | 285 +++++++++
 .../comp_perf_test_common.h                   |  41 ++
 .../comp_perf_test_verify.c                   | 137 +++-
 .../comp_perf_test_verify.h                   |  24 +-
 app/test-compress-perf/main.c                 | 605 +++++++-----------
 app/test-compress-perf/meson.build            |   3 +-
 doc/guides/rel_notes/release_19_08.rst        |  27 +
 doc/guides/tools/comp_perf.rst                |  34 +-
 14 files changed, 1019 insertions(+), 471 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h
Quoted 3 lines

Series acked-by: Shally Verma <[email protected]> --
2.17.1

Applied to dpdk-next-crypto

#69 lore raw

PATCH v7 2/6 app/test-compress-perf: add ptest command line option

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch adds --ptest option to make possible to choose test case from command line.

---
 app/test-compress-perf/comp_perf_options_parse.c | 32 ++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
app/test-compress-perf/comp_perf_options_parse.c +32 -0
index 74ea81d09..3d820197a 100644
@@ -15,6 +15,7 @@
 
 #include "comp_perf_options.h"
 
+#define CPERF_PTEST_TYPE	("ptest")
 #define CPERF_DRIVER_NAME	("driver-name")
 #define CPERF_TEST_FILE		("input-file")
 #define CPERF_SEG_SIZE		("seg-sz")
@@ -37,6 +38,7 @@ static void
 usage(char *progname)
 {
 	printf("%s [EAL options] --\n"
+		" --ptest benchmark / verify :"
 		" --driver-name NAME: compress driver to use\n"
 		" --input-file NAME: file to compress and decompress\n"
 		" --extended-input-sz N: extend file data up to this size (default: no extension)\n"
@@ -76,6 +78,33 @@ get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len,
 }
 
 static int
+parse_cperf_test_type(struct comp_test_data *test_data, const char *arg)
+{
+	struct name_id_map cperftest_namemap[] = {
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
+			CPERF_TEST_TYPE_BENCHMARK
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
+			CPERF_TEST_TYPE_VERIFY
+		}
+	};
+
+	int id = get_str_key_id_mapping(
+			(struct name_id_map *)cperftest_namemap,
+			RTE_DIM(cperftest_namemap), arg);
+	if (id < 0) {
+		RTE_LOG(ERR, USER1, "failed to parse test type");
+		return -1;
+	}
+
+	test_data->test = (enum cperf_perf_test_type)id;
+
+	return 0;
+}
+
+static int
 parse_uint32_t(uint32_t *value, const char *arg)
 {
 	char *end = NULL;
@@ -501,6 +530,8 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
+
+	{ CPERF_PTEST_TYPE, required_argument, 0, 0 },
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -519,6 +550,7 @@ static int
 comp_perf_opts_parse_long(int opt_idx, struct comp_test_data *test_data)
 {
 	struct long_opt_parser parsermap[] = {
+		{ CPERF_PTEST_TYPE,	parse_cperf_test_type },
 		{ CPERF_DRIVER_NAME,	parse_driver_name },
 		{ CPERF_TEST_FILE,	parse_test_file },
 		{ CPERF_SEG_SIZE,	parse_seg_sz },
Signature · 1 line
2.13.6
#70 lore raw

PATCH v7 3/6 app/test-compress-perf: add verification test case

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch adds a verification part to compression-perf-tool as a separate test case, which can be executed multi-threaded.

---
 app/test-compress-perf/Makefile                |   1 +
 app/test-compress-perf/comp_perf_test_verify.c | 123 ++++++++++++++++++-------
 app/test-compress-perf/comp_perf_test_verify.h |  24 ++++-
 app/test-compress-perf/main.c                  |   1 +
 app/test-compress-perf/meson.build             |   1 +
 5 files changed, 113 insertions(+), 37 deletions(-)
app/test-compress-perf/Makefile +1 -0
index de7412961..f54d9a4dd 100644
@@ -12,6 +12,7 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
+SRCS-y += comp_perf_test_verify.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_verify.c +88 -35

243 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_verify.h +22 -2
index 67c6b4980..ae8b7429c 100644
@@ -1,13 +1,33 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018-2019 Intel Corporation
  */
 
 #ifndef _COMP_PERF_TEST_VERIFY_
 #define _COMP_PERF_TEST_VERIFY_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+
+struct cperf_verify_ctx {
+	struct cperf_mem_resources mem;
+	struct comp_test_data *options;
+
+	int silent;
+	size_t comp_data_sz;
+	size_t decomp_data_sz;
+	double ratio;
+};
+
+void
+cperf_verify_test_destructor(void *arg);
 
 int
-cperf_verification(struct comp_test_data *test_data, uint8_t level);
+cperf_verify_test_runner(void *test_ctx);
+
+void *
+cperf_verify_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index 3a3da4c90..51ca9f5b7 100644
@@ -8,6 +8,7 @@
 #include <rte_compressdev.h>
 
 #include "comp_perf_options.h"
+#include "comp_perf_test_verify.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index 00413c6d0..c6246e503 100644
@@ -4,5 +4,6 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
+		'comp_perf_test_verify.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.13.6
#71 lore raw

PATCH v7 4/6 app/test-compress-perf: add benchmark test case

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch adds a benchmark part to compression-perf-tool as a separate test case, which can be executed multi-threaded.
Also updates release notes.

---
 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf_test_benchmark.c | 140 ++++++++++++++++------
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +++-
 app/test-compress-perf/main.c                     |   1 +
 app/test-compress-perf/meson.build                |   1 +
 doc/guides/rel_notes/release_19_08.rst            |   4 +
 6 files changed, 134 insertions(+), 38 deletions(-)
app/test-compress-perf/Makefile +1 -0
index f54d9a4dd..d1a6820e6 100644
@@ -13,6 +13,7 @@ CFLAGS += -O3
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
 SRCS-y += comp_perf_test_verify.c
+SRCS-y += comp_perf_test_benchmark.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_benchmark.c +103 -37

278 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_benchmark.h +24 -1
index b193445a3..d9b2694b8 100644
@@ -5,9 +5,32 @@
 #ifndef _COMP_PERF_TEST_BENCHMARK_
 #define _COMP_PERF_TEST_BENCHMARK_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+#include "comp_perf_test_verify.h"
+
+struct cperf_benchmark_ctx {
+	struct cperf_verify_ctx ver;
+
+	/* Store TSC duration for all levels (including level 0) */
+	uint64_t comp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	uint64_t decomp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	double comp_gbps;
+	double decomp_gbps;
+	double comp_tsc_byte;
+	double decomp_tsc_byte;
+};
+
+void
+cperf_benchmark_test_destructor(void *arg);
 
 int
-cperf_benchmark(struct comp_test_data *test_data, uint8_t level);
+cperf_benchmark_test_runner(void *test_ctx);
+
+void *
+cperf_benchmark_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index 51ca9f5b7..dd6ef9a6d 100644
@@ -9,6 +9,7 @@
 
 #include "comp_perf_options.h"
 #include "comp_perf_test_verify.h"
+#include "comp_perf_test_benchmark.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index c6246e503..1136f04bc 100644
@@ -5,5 +5,6 @@ allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
 		'comp_perf_test_verify.c',
+		'comp_perf_test_benchmark.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
doc/guides/rel_notes/release_19_08.rst +4 -0
index dffad8236..5f2a0d57d 100644
@@ -158,6 +158,10 @@ New Features
     SDK libraries.
   * Added support for 5GNR encode/decode operations.
 
+* **Updated test-compress-perf tool application.**
+
+  Added multiple cores feature to compression perf tool application.
+
 
 Removed Items
 -------------
Signature · 1 line
2.13.6
#72 lore raw

PATCH v7 5/6 doc: update dpdk-test-compress-perf description

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch updates dpdk-test-compress-perf documentation.

---
 doc/guides/tools/comp_perf.rst | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)
doc/guides/tools/comp_perf.rst +31 -3
index 52869c18c..71eef1821 100644
@@ -6,7 +6,9 @@ dpdk-test-compress-perf Tool
 
 The ``dpdk-test-compress-perf`` tool is a Data Plane Development Kit (DPDK)
 utility that allows measuring performance parameters of PMDs available in the
-compress tree. The tool reads the data from a file (--input-file),
+compress tree. User can use multiple cores to run tests on but only
+one type of compression PMD can be measured during single application
+execution. The tool reads the data from a file (--input-file),
 dumps all the file into a buffer and fills out the data of input mbufs,
 which are passed to compress device with compression operations.
 Then, the output buffers are fed into the decompression stage, and the resulting
@@ -26,9 +28,35 @@ Limitations
 
 * Stateful operation is not supported in this version.
 
+EAL Options
+~~~~~~~~~~~
+
+The following are the EAL command-line options that can be used in conjunction
+with the ``dpdk-test-compress-perf`` application.
+See the DPDK Getting Started Guides for more information on these options.
+
+*   ``-c <COREMASK>`` or ``-l <CORELIST>``
+
+	Set the hexadecimal bitmask of the cores to run on. The corelist is a
+	list cores to use.
+
+.. Note::
+
+	One lcore is needed for process admin, tests are run on all other cores.
+	To run tests on two lcores, three lcores must be passed to the tool.
+
+*   ``-w <PCI>``
+
+	Add a PCI device in white list.
+
+*   ``--vdev <driver><id>``
+
+	Add a virtual device.
+
+Appication Options
+~~~~~~~~~~~~~~~~~~
 
-Command line options
---------------------
+ ``--ptest [benchmark/verify]``: set test type (default: benchmark)
 
  ``--driver-name NAME``: compress driver to use
 
Signature · 1 line
2.13.6
#73 lore raw

PATCH v7 6/6 app/test-compress-perf: add force process termination

In reply to Artur Trybula

From: Tomasz Jozwiak <[email protected]>

This patch adds a possibility to force controlled process termination as a result of two signals: SIGTERM and SIGINT

---
 app/test-compress-perf/comp_perf_options.h        |  1 +
 app/test-compress-perf/comp_perf_test_benchmark.c | 13 ++++++++++++
 app/test-compress-perf/comp_perf_test_verify.c    | 14 ++++++++++++
 app/test-compress-perf/main.c                     | 26 +++++++++++++++++++++--
 4 files changed, 52 insertions(+), 2 deletions(-)
app/test-compress-perf/comp_perf_options.h +1 -0
index 0aa29a599..532fb964e 100644
@@ -67,6 +67,7 @@ struct comp_test_data {
 
 	double ratio;
 	enum cleanup_st cleanup;
+	int perf_comp_force_stop;
 };
 
 int
app/test-compress-perf/comp_perf_test_benchmark.c +13 -0
index e0f852bf0..aa1f8eea2 100644
@@ -184,6 +184,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -242,6 +245,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							   mem->qp_id,
 							   deq_ops,
@@ -306,6 +312,13 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
 	return res;
 }
 
app/test-compress-perf/comp_perf_test_verify.c +14 -0
index 7be30ee13..37ac38da6 100644
@@ -188,6 +188,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -268,6 +271,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							mem->qp_id,
 							deq_ops,
@@ -346,6 +352,14 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
+
 	return res;
 }
 
app/test-compress-perf/main.c +24 -2
index dd6ef9a6d..e746e4708 100644
@@ -2,6 +2,10 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
+#include <signal.h>
+#include <sys/types.h>
+#include <unistd.h>
+
 #include <rte_malloc.h>
 #include <rte_eal.h>
 #include <rte_log.h>
@@ -36,6 +40,8 @@ static const struct cperf_test cperf_testmap[] = {
 	}
 };
 
+static struct comp_test_data *test_data;
+
 static int
 comp_perf_check_capabilities(struct comp_test_data *test_data, uint8_t cdev_id)
 {
@@ -277,12 +283,24 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)
 	return ret;
 }
 
+static void
+comp_perf_cleanup_on_signal(int signalNumber __rte_unused)
+{
+	test_data->perf_comp_force_stop = 1;
+}
+
+static void
+comp_perf_register_cleanup_on_signal(void)
+{
+	signal(SIGTERM, comp_perf_cleanup_on_signal);
+	signal(SIGINT, comp_perf_cleanup_on_signal);
+}
+
 int
 main(int argc, char **argv)
 {
 	uint8_t level_idx = 0;
 	int ret, i;
-	struct comp_test_data *test_data;
 	void *ctx[RTE_MAX_LCORE] = {};
 	uint8_t enabled_cdevs[RTE_COMPRESS_MAX_DEVS];
 	int nb_compressdevs = 0;
@@ -304,6 +322,8 @@ main(int argc, char **argv)
 		rte_exit(EXIT_FAILURE, "Cannot reserve memory in socket %d\n",
 				rte_socket_id());
 
+	comp_perf_register_cleanup_on_signal();
+
 	ret = EXIT_SUCCESS;
 	test_data->cleanup = ST_TEST_DATA;
 	comp_perf_options_default(test_data);
@@ -424,8 +444,10 @@ main(int argc, char **argv)
 		/* fallthrough */
 	case ST_COMPDEV:
 		for (i = 0; i < nb_compressdevs &&
-				i < RTE_COMPRESS_MAX_DEVS; i++)
+		     i < RTE_COMPRESS_MAX_DEVS; i++) {
 			rte_compressdev_stop(enabled_cdevs[i]);
+			rte_compressdev_close(enabled_cdevs[i]);
+		}
 		/* fallthrough */
 	case ST_TEST_DATA:
 		rte_free(test_data);
Signature · 1 line
2.13.6
#74 lore raw

PATCH v5 2/6 app/test-compress-perf: add ptest command line option

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds --ptest option to make possible a choose of test case from command line.

---
 app/test-compress-perf/comp_perf_options_parse.c | 32 ++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
app/test-compress-perf/comp_perf_options_parse.c +32 -0
index bc4b98a..7888ab6 100644
@@ -15,6 +15,7 @@
 
 #include "comp_perf_options.h"
 
+#define CPERF_PTEST_TYPE	("ptest")
 #define CPERF_DRIVER_NAME	("driver-name")
 #define CPERF_TEST_FILE		("input-file")
 #define CPERF_SEG_SIZE		("seg-sz")
@@ -37,6 +38,7 @@ static void
 usage(char *progname)
 {
 	printf("%s [EAL options] --\n"
+		" --ptest benchmark / verify :"
 		" --driver-name NAME: compress driver to use\n"
 		" --input-file NAME: file to compress and decompress\n"
 		" --extended-input-sz N: extend file data up to this size (default: no extension)\n"
@@ -76,6 +78,33 @@ get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len,
 }
 
 static int
+parse_cperf_test_type(struct comp_test_data *test_data, const char *arg)
+{
+	struct name_id_map cperftest_namemap[] = {
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
+			CPERF_TEST_TYPE_BENCHMARK
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
+			CPERF_TEST_TYPE_VERIFY
+		}
+	};
+
+	int id = get_str_key_id_mapping(
+			(struct name_id_map *)cperftest_namemap,
+			RTE_DIM(cperftest_namemap), arg);
+	if (id < 0) {
+		RTE_LOG(ERR, USER1, "failed to parse test type");
+		return -1;
+	}
+
+	test_data->test = (enum cperf_perf_test_type)id;
+
+	return 0;
+}
+
+static int
 parse_uint32_t(uint32_t *value, const char *arg)
 {
 	char *end = NULL;
@@ -499,6 +528,8 @@ struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
+
+	{ CPERF_PTEST_TYPE, required_argument, 0, 0 },
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -517,6 +548,7 @@ static int
 comp_perf_opts_parse_long(int opt_idx, struct comp_test_data *test_data)
 {
 	struct long_opt_parser parsermap[] = {
+		{ CPERF_PTEST_TYPE,	parse_cperf_test_type },
 		{ CPERF_DRIVER_NAME,	parse_driver_name },
 		{ CPERF_TEST_FILE,	parse_test_file },
 		{ CPERF_SEG_SIZE,	parse_seg_sz },
Signature · 1 line
2.7.4
#76 lore raw

PATCH v5 3/6 app/test-compress-perf: add verification test case

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds a verification part to compression-perf-tool as a separate test case, which can be executed multi-threaded.

---
 app/test-compress-perf/Makefile                |   1 +
 app/test-compress-perf/comp_perf_test_verify.c | 123 ++++++++++++++++++-------
 app/test-compress-perf/comp_perf_test_verify.h |  24 ++++-
 app/test-compress-perf/main.c                  |   1 +
 app/test-compress-perf/meson.build             |   1 +
 5 files changed, 113 insertions(+), 37 deletions(-)
app/test-compress-perf/Makefile +1 -0
index de74129..f54d9a4 100644
@@ -12,6 +12,7 @@ CFLAGS += -O3
 # all source are stored in SRCS-y
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
+SRCS-y += comp_perf_test_verify.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_verify.c +88 -35

243 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_verify.h +22 -2
index 67c6b49..ae8b742 100644
@@ -1,13 +1,33 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018-2019 Intel Corporation
  */
 
 #ifndef _COMP_PERF_TEST_VERIFY_
 #define _COMP_PERF_TEST_VERIFY_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+
+struct cperf_verify_ctx {
+	struct cperf_mem_resources mem;
+	struct comp_test_data *options;
+
+	int silent;
+	size_t comp_data_sz;
+	size_t decomp_data_sz;
+	double ratio;
+};
+
+void
+cperf_verify_test_destructor(void *arg);
 
 int
-cperf_verification(struct comp_test_data *test_data, uint8_t level);
+cperf_verify_test_runner(void *test_ctx);
+
+void *
+cperf_verify_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index 3a3da4c..51ca9f5 100644
@@ -8,6 +8,7 @@
 #include <rte_compressdev.h>
 
 #include "comp_perf_options.h"
+#include "comp_perf_test_verify.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index 00413c6..c6246e5 100644
@@ -4,5 +4,6 @@
 allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
+		'comp_perf_test_verify.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.7.4
#78 lore raw

PATCH v5 4/6 app/test-compress-perf: add benchmark test case

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds a benchmark part to compression-perf-tool as a separate test case, which can be executed multi-threaded.

---
 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf_test_benchmark.c | 140 ++++++++++++++++------
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +++-
 app/test-compress-perf/main.c                     |   1 +
 app/test-compress-perf/meson.build                |   1 +
 5 files changed, 130 insertions(+), 38 deletions(-)
app/test-compress-perf/Makefile +1 -0
index f54d9a4..d1a6820 100644
@@ -13,6 +13,7 @@ CFLAGS += -O3
 SRCS-y := main.c
 SRCS-y += comp_perf_options_parse.c
 SRCS-y += comp_perf_test_verify.c
+SRCS-y += comp_perf_test_benchmark.c
 SRCS-y += comp_perf_test_common.c
 
 include $(RTE_SDK)/mk/rte.app.mk
app/test-compress-perf/comp_perf_test_benchmark.c +103 -37

278 lines not on this page · raw message

app/test-compress-perf/comp_perf_test_benchmark.h +24 -1
index b193445..d9b2694 100644
@@ -5,9 +5,32 @@
 #ifndef _COMP_PERF_TEST_BENCHMARK_
 #define _COMP_PERF_TEST_BENCHMARK_
 
+#include <stdint.h>
+
 #include "comp_perf_options.h"
+#include "comp_perf_test_common.h"
+#include "comp_perf_test_verify.h"
+
+struct cperf_benchmark_ctx {
+	struct cperf_verify_ctx ver;
+
+	/* Store TSC duration for all levels (including level 0) */
+	uint64_t comp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	uint64_t decomp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
+	double comp_gbps;
+	double decomp_gbps;
+	double comp_tsc_byte;
+	double decomp_tsc_byte;
+};
+
+void
+cperf_benchmark_test_destructor(void *arg);
 
 int
-cperf_benchmark(struct comp_test_data *test_data, uint8_t level);
+cperf_benchmark_test_runner(void *test_ctx);
+
+void *
+cperf_benchmark_test_constructor(uint8_t dev_id, uint16_t qp_id,
+		struct comp_test_data *options);
 
 #endif
app/test-compress-perf/main.c +1 -0
index 51ca9f5..dd6ef9a 100644
@@ -9,6 +9,7 @@
 
 #include "comp_perf_options.h"
 #include "comp_perf_test_verify.h"
+#include "comp_perf_test_benchmark.h"
 #include "comp_perf.h"
 #include "comp_perf_test_common.h"
 
app/test-compress-perf/meson.build +1 -0
index c6246e5..1136f04 100644
@@ -5,5 +5,6 @@ allow_experimental_apis = true
 sources = files('comp_perf_options_parse.c',
 		'main.c',
 		'comp_perf_test_verify.c',
+		'comp_perf_test_benchmark.c',
 		'comp_perf_test_common.c')
 deps = ['compressdev']
Signature · 1 line
2.7.4
#80 lore raw

PATCH v5 5/6 doc: update dpdk-test-compress-perf description

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch updates a dpdk-test-compress-perf documentation.

---
 doc/guides/tools/comp_perf.rst | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)
doc/guides/tools/comp_perf.rst +31 -3
index 52869c1..71eef18 100644
@@ -6,7 +6,9 @@ dpdk-test-compress-perf Tool
 
 The ``dpdk-test-compress-perf`` tool is a Data Plane Development Kit (DPDK)
 utility that allows measuring performance parameters of PMDs available in the
-compress tree. The tool reads the data from a file (--input-file),
+compress tree. User can use multiple cores to run tests on but only
+one type of compression PMD can be measured during single application
+execution. The tool reads the data from a file (--input-file),
 dumps all the file into a buffer and fills out the data of input mbufs,
 which are passed to compress device with compression operations.
 Then, the output buffers are fed into the decompression stage, and the resulting
@@ -26,9 +28,35 @@ Limitations
 
 * Stateful operation is not supported in this version.
 
+EAL Options
+~~~~~~~~~~~
+
+The following are the EAL command-line options that can be used in conjunction
+with the ``dpdk-test-compress-perf`` application.
+See the DPDK Getting Started Guides for more information on these options.
+
+*   ``-c <COREMASK>`` or ``-l <CORELIST>``
+
+	Set the hexadecimal bitmask of the cores to run on. The corelist is a
+	list cores to use.
+
+.. Note::
+
+	One lcore is needed for process admin, tests are run on all other cores.
+	To run tests on two lcores, three lcores must be passed to the tool.
+
+*   ``-w <PCI>``
+
+	Add a PCI device in white list.
+
+*   ``--vdev <driver><id>``
+
+	Add a virtual device.
+
+Appication Options
+~~~~~~~~~~~~~~~~~~
 
-Command line options
---------------------
+ ``--ptest [benchmark/verify]``: set test type (default: benchmark)
 
  ``--driver-name NAME``: compress driver to use
 
Signature · 1 line
2.7.4
#82 lore raw

PATCH v5 6/6 app/test-compress-perf: add force process termination

In reply to Tomasz Jozwiak

From: Tomasz Jozwiak <[email protected]>

This patch adds a possibility to force controlled process termination as a result of two signals: SIGTERM and SIGINT

---
 app/test-compress-perf/comp_perf_options.h        |  1 +
 app/test-compress-perf/comp_perf_test_benchmark.c | 13 ++++++++++++
 app/test-compress-perf/comp_perf_test_verify.c    | 14 ++++++++++++
 app/test-compress-perf/main.c                     | 26 +++++++++++++++++++++--
 4 files changed, 52 insertions(+), 2 deletions(-)
app/test-compress-perf/comp_perf_options.h +1 -0
index 0aa29a5..532fb96 100644
@@ -67,6 +67,7 @@ struct comp_test_data {
 
 	double ratio;
 	enum cleanup_st cleanup;
+	int perf_comp_force_stop;
 };
 
 int
app/test-compress-perf/comp_perf_test_benchmark.c +13 -0
index e0f852b..aa1f8ee 100644
@@ -184,6 +184,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -242,6 +245,9 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							   mem->qp_id,
 							   deq_ops,
@@ -306,6 +312,13 @@ main_loop(struct cperf_benchmark_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
 	return res;
 }
 
app/test-compress-perf/comp_perf_test_verify.c +14 -0
index 7be30ee..37ac38d 100644
@@ -188,6 +188,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 				ops[op_id]->private_xform = priv_xform;
 			}
 
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_enq = rte_compressdev_enqueue_burst(dev_id,
 								mem->qp_id, ops,
 								num_ops);
@@ -268,6 +271,9 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 
 		/* Dequeue the last operations */
 		while (total_deq_ops < total_ops) {
+			if (unlikely(test_data->perf_comp_force_stop))
+				goto end;
+
 			num_deq = rte_compressdev_dequeue_burst(dev_id,
 							mem->qp_id,
 							deq_ops,
@@ -346,6 +352,14 @@ main_loop(struct cperf_verify_ctx *ctx, enum rte_comp_xform_type type)
 	rte_mempool_put_bulk(mem->op_pool, (void **)ops, allocated);
 	rte_compressdev_private_xform_free(dev_id, priv_xform);
 	rte_free(ops);
+
+	if (test_data->perf_comp_force_stop) {
+		RTE_LOG(ERR, USER1,
+		      "lcore: %d Perf. test has been aborted by user\n",
+			mem->lcore_id);
+		res = -1;
+	}
+
 	return res;
 }
 
app/test-compress-perf/main.c +24 -2
index dd6ef9a..e746e47 100644
@@ -2,6 +2,10 @@
  * Copyright(c) 2018 Intel Corporation
  */
 
+#include <signal.h>
+#include <sys/types.h>
+#include <unistd.h>
+
 #include <rte_malloc.h>
 #include <rte_eal.h>
 #include <rte_log.h>
@@ -36,6 +40,8 @@ static const struct cperf_test cperf_testmap[] = {
 	}
 };
 
+static struct comp_test_data *test_data;
+
 static int
 comp_perf_check_capabilities(struct comp_test_data *test_data, uint8_t cdev_id)
 {
@@ -277,12 +283,24 @@ comp_perf_dump_input_data(struct comp_test_data *test_data)
 	return ret;
 }
 
+static void
+comp_perf_cleanup_on_signal(int signalNumber __rte_unused)
+{
+	test_data->perf_comp_force_stop = 1;
+}
+
+static void
+comp_perf_register_cleanup_on_signal(void)
+{
+	signal(SIGTERM, comp_perf_cleanup_on_signal);
+	signal(SIGINT, comp_perf_cleanup_on_signal);
+}
+
 int
 main(int argc, char **argv)
 {
 	uint8_t level_idx = 0;
 	int ret, i;
-	struct comp_test_data *test_data;
 	void *ctx[RTE_MAX_LCORE] = {};
 	uint8_t enabled_cdevs[RTE_COMPRESS_MAX_DEVS];
 	int nb_compressdevs = 0;
@@ -304,6 +322,8 @@ main(int argc, char **argv)
 		rte_exit(EXIT_FAILURE, "Cannot reserve memory in socket %d\n",
 				rte_socket_id());
 
+	comp_perf_register_cleanup_on_signal();
+
 	ret = EXIT_SUCCESS;
 	test_data->cleanup = ST_TEST_DATA;
 	comp_perf_options_default(test_data);
@@ -424,8 +444,10 @@ main(int argc, char **argv)
 		/* fallthrough */
 	case ST_COMPDEV:
 		for (i = 0; i < nb_compressdevs &&
-				i < RTE_COMPRESS_MAX_DEVS; i++)
+		     i < RTE_COMPRESS_MAX_DEVS; i++) {
 			rte_compressdev_stop(enabled_cdevs[i]);
+			rte_compressdev_close(enabled_cdevs[i]);
+		}
 		/* fallthrough */
 	case ST_TEST_DATA:
 		rte_free(test_data);
Signature · 1 line
2.7.4
#84 lore raw
In reply to Tomasz Jozwiak

Hi Tomasz,

This series need a rebase.

Thanks,
Akhil

Quoted 60 lines

This patchset adds multiple cores feature to compression perf tool. All structures have been aligned and are consistent
with crypto perf tool. All test cases have constructor, runner and destructor and can use more cores and compression devices at the same time.

v2 changes:

- fixed checkpatch warning
- fixed max_nb_queue_pairs detection. Based on compression API if max_nb_queue_pairs = 0 that means there is no limit in maximum number of queue pairs
- fixed qp setup on the last device

v3 changes:

- merged with commit 767350e7ede791932cc050bf2a192f6527b70c15 app/compress-perf: add prints for socket id

- fixed wrong compression/decompression throughput calculation

v4 changes:

- moved release notes update to patch 1
- removed pmd cyclecount template

v5 changes:

- changed ctx null ptr detection inside constructors

Tomasz Jozwiak (6):
app/test-compress-perf: add weak functions for multi-cores test app/test-compress-perf: add ptest command line option app/test-compress-perf: add verification test case app/test-compress-perf: add benchmark test case
doc: update dpdk-test-compress-perf description app/test-compress-perf: add force process termination

 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf.h                |  50 ++
 app/test-compress-perf/comp_perf_options.h        |  45 +-
 app/test-compress-perf/comp_perf_options_parse.c  |  54 +-
 app/test-compress-perf/comp_perf_test_benchmark.c | 153 ++++--
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +-
 app/test-compress-perf/comp_perf_test_common.c    | 284 ++++++++++
 app/test-compress-perf/comp_perf_test_common.h    |  41 ++
 app/test-compress-perf/comp_perf_test_verify.c    | 137 +++--
 app/test-compress-perf/comp_perf_test_verify.h    |  24 +-
 app/test-compress-perf/main.c                     | 605 +++++++++-------------
 app/test-compress-perf/meson.build                |   3 +-
 doc/guides/rel_notes/release_19_08.rst            |   3 +
 doc/guides/tools/comp_perf.rst                    |  34 +-
 14 files changed, 992 insertions(+), 467 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h

--
2.7.4

#85 lore raw

Hi Akhil,

Was rebased on Monday. Too dynamic head :) , will do Today and add you in Cc.

Thx, Tomek

Quoted 70 lines · śr., 3.07.2019, 12:21 użytkownik Akhil Goyal <[email protected]> napisał:

Hi Tomasz,

This series need a rebase.

Thanks,
Akhil

Quoted 39 lines

This patchset adds multiple cores feature to compression perf tool. All structures have been aligned and are consistent
with crypto perf tool. All test cases have constructor, runner and destructor and can use more cores and compression devices at the same time.

v2 changes:

- fixed checkpatch warning
- fixed max_nb_queue_pairs detection. Based on compression API if max_nb_queue_pairs = 0 that means there is no limit in maximum number of queue pairs
- fixed qp setup on the last device

v3 changes:

- merged with commit 767350e7ede791932cc050bf2a192f6527b70c15 app/compress-perf: add prints for socket id

- fixed wrong compression/decompression throughput calculation

v4 changes:

- moved release notes update to patch 1
- removed pmd cyclecount template

v5 changes:

- changed ctx null ptr detection inside constructors

Tomasz Jozwiak (6):
app/test-compress-perf: add weak functions for multi-cores test app/test-compress-perf: add ptest command line option app/test-compress-perf: add verification test case app/test-compress-perf: add benchmark test case
doc: update dpdk-test-compress-perf description app/test-compress-perf: add force process termination

Quoted 11 lines
 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf.h                |  50 ++
 app/test-compress-perf/comp_perf_options.h        |  45 +-
 app/test-compress-perf/comp_perf_options_parse.c  |  54 +-
 app/test-compress-perf/comp_perf_test_benchmark.c | 153 ++++--
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +-
 app/test-compress-perf/comp_perf_test_common.c    | 284 ++++++++++
 app/test-compress-perf/comp_perf_test_common.h    |  41 ++
 app/test-compress-perf/comp_perf_test_verify.c    | 137 +++--
 app/test-compress-perf/comp_perf_test_verify.h    |  24 +-
 app/test-compress-perf/main.c                     | 605

+++++++++-------------

Quoted 10 lines
 app/test-compress-perf/meson.build                |   3 +-
 doc/guides/rel_notes/release_19_08.rst            |   3 +
 doc/guides/tools/comp_perf.rst                    |  34 +-
 14 files changed, 992 insertions(+), 467 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h

--
2.7.4

A message that is not in the archive (sent off-list or not yet received): [email protected]

#87 lore raw
Quoted 18 lines

-----Original Message-----
From: Tomasz Jozwiak <[email protected]>
Sent: Sunday, June 9, 2019 3:29 AM
To: [email protected]; [email protected]; [email protected]; Shally Verma <[email protected]>
Subject: [EXT] [PATCH v2 0/7] add multiple cores feature to test-compress- perf

External Email

----------------------------------------------------------------------
This patchset adds multiple cores feature to compression perf tool. All structures have been aligned and are consistent with crypto perf tool. All test cases have constructor, runner and destructor and can use more cores and compression devices at the same time.

Quoted 6 lines

v2 changes:

- fixed checkpatch warning
- fixed max_nb_queue_pairs detection. Based on compression API if max_nb_queue_pairs = 0 that means there is no limit in maximum number of queue pairs

It should mean implementation defined/specific

Quoted 33 lines

- fixed qp setup on the last device

Tomasz Jozwiak (7):
app/test-compress-perf: add weak functions for multi-cores test app/test-compress-perf: add ptest command line option app/test-compress-perf: add verification test case app/test-compress-perf: add benchmark test case
doc: update dpdk-test-compress-perf description app/test-compress-perf: add force process termination
doc: update release notes for 19.08

 app/test-compress-perf/Makefile                   |   1 +
 app/test-compress-perf/comp_perf.h                |  61 +++
 app/test-compress-perf/comp_perf_options.h        |  46 +-
 app/test-compress-perf/comp_perf_options_parse.c  |  58 +-
 app/test-compress-perf/comp_perf_test_benchmark.c | 152 ++++--
 app/test-compress-perf/comp_perf_test_benchmark.h |  25 +-
 app/test-compress-perf/comp_perf_test_common.c    | 285 ++++++++++
 app/test-compress-perf/comp_perf_test_common.h    |  41 ++
 app/test-compress-perf/comp_perf_test_verify.c    | 136 +++--
 app/test-compress-perf/comp_perf_test_verify.h    |  24 +-
 app/test-compress-perf/main.c                     | 633 ++++++++++------------
 app/test-compress-perf/meson.build                |   3 +-
 doc/guides/rel_notes/release_19_08.rst            |   3 +
 doc/guides/tools/comp_perf.rst                    |  34 +-
 14 files changed, 1036 insertions(+), 466 deletions(-)
 create mode 100644 app/test-compress-perf/comp_perf.h
 create mode 100644 app/test-compress-perf/comp_perf_test_common.c
 create mode 100644 app/test-compress-perf/comp_perf_test_common.h

--
2.7.4