DPDK patches and discussions
 help / color / mirror / Atom feed
From: <agupta3@marvell.com>
To: <yipeng1.wang@intel.com>, <sameh.gobriel@intel.com>,
	<bruce.richardson@intel.com>, <pablo.de.lara.guarch@intel.com>
Cc: <dev@dpdk.org>, Amit Gupta <agupta3@marvell.com>
Subject: [dpdk-dev] [PATCH 1/2] test/meson: hash test split into shorter subtests
Date: Fri, 6 Sep 2019 11:19:32 +0530	[thread overview]
Message-ID: <1567748973-24192-2-git-send-email-agupta3@marvell.com> (raw)
In-Reply-To: <1567748973-24192-1-git-send-email-agupta3@marvell.com>

From: Amit Gupta <agupta3@marvell.com>

hash_readwrite meson test was taking longer time to complete.
The test always get TIMEOUT, hence test is split into
functional and perf test. perf test is being moved under
dpdk perf testsuites in  meson build.

Signed-off-by: Amit Gupta <agupta3@marvell.com>
---
 app/test/meson.build           |   3 +-
 app/test/test_hash_readwrite.c | 146 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 148 insertions(+), 1 deletion(-)

diff --git a/app/test/meson.build b/app/test/meson.build
index ec40943..94fd9f8 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -219,7 +219,7 @@ fast_test_names = [
         'distributor_autotest',
         'eventdev_common_autotest',
         'fbarray_autotest',
-        'hash_readwrite_autotest',
+        'hash_readwrite_func_autotest',
         'hash_readwrite_lf_autotest',
         'ipsec_autotest',
         'kni_autotest',
@@ -262,6 +262,7 @@ perf_test_names = [
         'stack_perf_autotest',
         'stack_lf_perf_autotest',
         'rand_perf_autotest',
+        'hash_readwrite_perf_autotest',
 ]
 
 driver_test_names = [
diff --git a/app/test/test_hash_readwrite.c b/app/test/test_hash_readwrite.c
index 4376b09..c25e904 100644
--- a/app/test/test_hash_readwrite.c
+++ b/app/test/test_hash_readwrite.c
@@ -606,6 +606,150 @@ struct {
 }
 
 static int
+test_hash_rw_perf_main(void)
+{
+	/*
+	 * Variables used to choose different tests.
+	 * use_htm indicates if hardware transactional memory should be used.
+	 * reader_faster indicates if the reader threads should finish earlier
+	 * than writer threads. This is to timing either reader threads or
+	 * writer threads for performance numbers.
+	 */
+	int use_htm, reader_faster;
+	unsigned int i = 0, core_id = 0;
+
+	if (rte_lcore_count() < 3) {
+		printf("Not enough cores for hash_readwrite_autotest, expecting at least 3\n");
+		return TEST_SKIPPED;
+	}
+
+	RTE_LCORE_FOREACH_SLAVE(core_id) {
+		slave_core_ids[i] = core_id;
+		i++;
+	}
+
+	setlocale(LC_NUMERIC, "");
+
+	if (rte_tm_supported()) {
+		printf("Hardware transactional memory (lock elision) "
+			"is supported\n");
+
+		printf("Test read-write with Hardware transactional memory\n");
+
+		use_htm = 1;
+
+		reader_faster = 1;
+		if (test_hash_readwrite_perf(&htm_results, use_htm,
+							reader_faster) < 0)
+			return -1;
+
+		reader_faster = 0;
+		if (test_hash_readwrite_perf(&htm_results, use_htm,
+							reader_faster) < 0)
+			return -1;
+	} else {
+		printf("Hardware transactional memory (lock elision) "
+			"is NOT supported\n");
+	}
+
+	printf("Test read-write without Hardware transactional memory\n");
+	use_htm = 0;
+
+	reader_faster = 1;
+	if (test_hash_readwrite_perf(&non_htm_results, use_htm,
+							reader_faster) < 0)
+		return -1;
+	reader_faster = 0;
+	if (test_hash_readwrite_perf(&non_htm_results, use_htm,
+							reader_faster) < 0)
+		return -1;
+
+	printf("================\n");
+	printf("Results summary:\n");
+	printf("================\n");
+
+	printf("single read: %u\n", htm_results.single_read);
+	printf("single write: %u\n", htm_results.single_write);
+	for (i = 0; i < NUM_TEST; i++) {
+		printf("+++ core_cnt: %u +++\n", core_cnt[i]);
+		printf("HTM:\n");
+		printf("  read only: %u\n", htm_results.read_only[i]);
+		printf("  write only: %u\n", htm_results.write_only[i]);
+		printf("  read-write read: %u\n", htm_results.read_write_r[i]);
+		printf("  read-write write: %u\n", htm_results.read_write_w[i]);
+
+		printf("non HTM:\n");
+		printf("  read only: %u\n", non_htm_results.read_only[i]);
+		printf("  write only: %u\n", non_htm_results.write_only[i]);
+		printf("  read-write read: %u\n",
+			non_htm_results.read_write_r[i]);
+		printf("  read-write write: %u\n",
+			non_htm_results.read_write_w[i]);
+	}
+
+	return 0;
+}
+
+static int
+test_hash_rw_func_main(void)
+{
+	/*
+	 * Variables used to choose different tests.
+	 * use_htm indicates if hardware transactional memory should be used.
+	 * reader_faster indicates if the reader threads should finish earlier
+	 * than writer threads. This is to timing either reader threads or
+	 * writer threads for performance numbers.
+	 */
+	int use_htm, use_ext;
+	unsigned int i = 0, core_id = 0;
+
+	if (rte_lcore_count() < 3) {
+		printf("Not enough cores for hash_readwrite_autotest, expecting at least 3\n");
+		return TEST_SKIPPED;
+	}
+
+	RTE_LCORE_FOREACH_SLAVE(core_id) {
+		slave_core_ids[i] = core_id;
+		i++;
+	}
+
+	setlocale(LC_NUMERIC, "");
+
+	if (rte_tm_supported()) {
+		printf("Hardware transactional memory (lock elision) "
+			"is supported\n");
+
+		printf("Test read-write with Hardware transactional memory\n");
+
+		use_htm = 1;
+		use_ext = 0;
+
+		if (test_hash_readwrite_functional(use_ext, use_htm) < 0)
+			return -1;
+
+		use_ext = 1;
+		if (test_hash_readwrite_functional(use_ext, use_htm) < 0)
+			return -1;
+
+	} else {
+		printf("Hardware transactional memory (lock elision) "
+			"is NOT supported\n");
+	}
+
+	printf("Test read-write without Hardware transactional memory\n");
+	use_htm = 0;
+	use_ext = 0;
+	if (test_hash_readwrite_functional(use_ext, use_htm) < 0)
+		return -1;
+
+	use_ext = 1;
+	if (test_hash_readwrite_functional(use_ext, use_htm) < 0)
+		return -1;
+
+	return 0;
+}
+
+static int
 test_hash_readwrite_main(void)
 {
 	/*
@@ -706,3 +850,5 @@ struct {
 }
 
 REGISTER_TEST_COMMAND(hash_readwrite_autotest, test_hash_readwrite_main);
+REGISTER_TEST_COMMAND(hash_readwrite_func_autotest, test_hash_rw_func_main);
+REGISTER_TEST_COMMAND(hash_readwrite_perf_autotest, test_hash_rw_perf_main);
-- 
1.8.3.1


  reply	other threads:[~2019-09-06  5:50 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06  5:49 [dpdk-dev] [PATCH 0/2] test/meson: fix hash readwrite timeout failure agupta3
2019-09-06  5:49 ` agupta3 [this message]
2019-09-11 17:05   ` [dpdk-dev] [PATCH 1/2] test/meson: hash test split into shorter subtests Wang, Yipeng1
2019-10-17  5:02     ` Amit Gupta
2019-11-01  4:54       ` Amit Gupta
2019-11-01 17:04         ` Wang, Yipeng1
2019-11-05 16:37           ` Ferruh Yigit
2019-11-07  3:32             ` [dpdk-dev] [EXT] " Amit Gupta
2019-12-31  4:56               ` Amit Gupta
2019-09-06  5:49 ` [dpdk-dev] [PATCH 2/2] test/meson: hash lf test moved to dpdk perf testsuite agupta3
2019-09-11 17:13   ` Wang, Yipeng1
2019-09-12 15:00     ` Honnappa Nagarahalli
2019-09-13  8:24       ` Amit Gupta
2019-09-13  8:12   ` [dpdk-dev] [PATCH v2 1/1] " agupta3
2019-09-13 14:40     ` Aaron Conole
2019-09-13 15:09       ` Wang, Yipeng1
2019-09-13 15:46         ` Honnappa Nagarahalli
2019-09-16  4:39           ` Amit Gupta
2019-10-17  4:57           ` Amit Gupta
2019-10-17 13:16             ` Aaron Conole
2019-10-24  7:22               ` David Marchand
2019-09-13  8:15   ` agupta3
2019-09-11  5:55 ` [dpdk-dev] [PATCH 0/2] test/meson: fix hash readwrite timeout failure Amit Gupta
2020-02-03 19:49 ` [dpdk-dev] [PATCH v2 0/5] " Honnappa Nagarahalli
2020-02-03 19:49   ` [dpdk-dev] [PATCH v2 1/5] test/meson: hash test split into shorter subtests Honnappa Nagarahalli
2020-02-03 19:49   ` [dpdk-dev] [PATCH v2 2/5] test/hash: remove duplicated test code Honnappa Nagarahalli
2020-02-05  8:48     ` David Marchand
2020-02-05 16:42       ` David Marchand
2020-02-03 19:49   ` [dpdk-dev] [PATCH v2 3/5] test/hash: add lock free reader writer functional tests Honnappa Nagarahalli
2020-02-05  9:07     ` David Marchand
2020-02-05 16:22       ` Honnappa Nagarahalli
2020-02-05 16:41         ` David Marchand
2020-02-05 19:34           ` Wang, Yipeng1
2020-02-05 19:52             ` Honnappa Nagarahalli
2020-02-05 19:57               ` Wang, Yipeng1
2020-02-03 19:49   ` [dpdk-dev] [PATCH v2 4/5] test/hash: move reader writer lock free tests to perf tests Honnappa Nagarahalli
2020-02-03 19:49   ` [dpdk-dev] [PATCH v2 5/5] hash: correct lock free extendable table support Honnappa Nagarahalli
2020-02-05 18:41   ` [dpdk-dev] [PATCH v2 0/5] test/meson: fix hash readwrite timeout failure David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1567748973-24192-2-git-send-email-agupta3@marvell.com \
    --to=agupta3@marvell.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=sameh.gobriel@intel.com \
    --cc=yipeng1.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).