DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nicolas Chautru <nicolas.chautru@intel.com>
To: dev@dpdk.org, akhil.goyal@nxp.com, trix@redhat.com
Cc: david.marchand@redhat.com, Nicolas Chautru <nicolas.chautru@intel.com>
Subject: [dpdk-dev] [PATCH v6 1/7] app/bbdev: add explicit ut for latency vs validation
Date: Mon, 26 Oct 2020 10:48:04 -0700	[thread overview]
Message-ID: <1603734490-57821-2-git-send-email-nicolas.chautru@intel.com> (raw)
In-Reply-To: <1603734490-57821-1-git-send-email-nicolas.chautru@intel.com>

Adding explicit different ut when testing for validation
or latency (early termination enabled or not).

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
Acked-by: Aidan Goddard <aidan.goddard@accelercomm.com>
Acked-by: Dave Burley <dave.burley@accelercomm.com>
---
 app/test-bbdev/test_bbdev_perf.c | 55 +++++++++++++++++++++++++++-------------
 1 file changed, 38 insertions(+), 17 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 6e5535d..04334e3 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -3999,12 +3999,14 @@ typedef int (test_case_function)(struct active_device *ad,
 	return i;
 }
 
+/* Test case for latency/validation for LDPC Decoder */
 static int
 latency_test_ldpc_dec(struct rte_mempool *mempool,
 		struct test_buffers *bufs, struct rte_bbdev_dec_op *ref_op,
 		int vector_mask, uint16_t dev_id, uint16_t queue_id,
 		const uint16_t num_to_process, uint16_t burst_sz,
-		uint64_t *total_time, uint64_t *min_time, uint64_t *max_time)
+		uint64_t *total_time, uint64_t *min_time, uint64_t *max_time,
+		bool disable_et)
 {
 	int ret = TEST_SUCCESS;
 	uint16_t i, j, dequeued;
@@ -4026,7 +4028,7 @@ typedef int (test_case_function)(struct active_device *ad,
 				"rte_bbdev_dec_op_alloc_bulk() failed");
 
 		/* For latency tests we need to disable early termination */
-		if (check_bit(ref_op->ldpc_dec.op_flags,
+		if (disable_et && check_bit(ref_op->ldpc_dec.op_flags,
 				RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE))
 			ref_op->ldpc_dec.op_flags -=
 					RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE;
@@ -4221,9 +4223,10 @@ typedef int (test_case_function)(struct active_device *ad,
 	return i;
 }
 
+/* Common function for running validation and latency test cases */
 static int
-latency_test(struct active_device *ad,
-		struct test_op_params *op_params)
+validation_latency_test(struct active_device *ad,
+		struct test_op_params *op_params, bool latency_flag)
 {
 	int iter;
 	uint16_t burst_sz = op_params->burst_sz;
@@ -4248,7 +4251,11 @@ typedef int (test_case_function)(struct active_device *ad,
 	TEST_ASSERT_NOT_NULL(op_type_str, "Invalid op type: %u", op_type);
 
 	printf("+ ------------------------------------------------------- +\n");
-	printf("== test: validation/latency\ndev: %s, burst size: %u, num ops: %u, op type: %s\n",
+	if (latency_flag)
+		printf("== test: latency\ndev:");
+	else
+		printf("== test: validation\ndev:");
+	printf("%s, burst size: %u, num ops: %u, op type: %s\n",
 			info.dev_name, burst_sz, num_to_process, op_type_str);
 
 	if (op_type == RTE_BBDEV_OP_TURBO_DEC)
@@ -4256,11 +4263,6 @@ typedef int (test_case_function)(struct active_device *ad,
 				op_params->ref_dec_op, op_params->vector_mask,
 				ad->dev_id, queue_id, num_to_process,
 				burst_sz, &total_time, &min_time, &max_time);
-	else if (op_type == RTE_BBDEV_OP_TURBO_ENC)
-		iter = latency_test_enc(op_params->mp, bufs,
-				op_params->ref_enc_op, ad->dev_id, queue_id,
-				num_to_process, burst_sz, &total_time,
-				&min_time, &max_time);
 	else if (op_type == RTE_BBDEV_OP_LDPC_ENC)
 		iter = latency_test_ldpc_enc(op_params->mp, bufs,
 				op_params->ref_enc_op, ad->dev_id, queue_id,
@@ -4270,13 +4272,14 @@ typedef int (test_case_function)(struct active_device *ad,
 		iter = latency_test_ldpc_dec(op_params->mp, bufs,
 				op_params->ref_dec_op, op_params->vector_mask,
 				ad->dev_id, queue_id, num_to_process,
-				burst_sz, &total_time, &min_time, &max_time);
-	else
+				burst_sz, &total_time, &min_time, &max_time,
+				latency_flag);
+	else /* RTE_BBDEV_OP_TURBO_ENC */
 		iter = latency_test_enc(op_params->mp, bufs,
-					op_params->ref_enc_op,
-					ad->dev_id, queue_id,
-					num_to_process, burst_sz, &total_time,
-					&min_time, &max_time);
+				op_params->ref_enc_op,
+				ad->dev_id, queue_id,
+				num_to_process, burst_sz, &total_time,
+				&min_time, &max_time);
 
 	if (iter <= 0)
 		return TEST_FAILED;
@@ -4295,6 +4298,18 @@ typedef int (test_case_function)(struct active_device *ad,
 	return TEST_SUCCESS;
 }
 
+static int
+latency_test(struct active_device *ad, struct test_op_params *op_params)
+{
+	return validation_latency_test(ad, op_params, true);
+}
+
+static int
+validation_test(struct active_device *ad, struct test_op_params *op_params)
+{
+	return validation_latency_test(ad, op_params, false);
+}
+
 #ifdef RTE_BBDEV_OFFLOAD_COST
 static int
 get_bbdev_queue_stats(uint16_t dev_id, uint16_t queue_id,
@@ -4930,6 +4945,12 @@ typedef int (test_case_function)(struct active_device *ad,
 }
 
 static int
+validation_tc(void)
+{
+	return run_test_case(validation_test);
+}
+
+static int
 interrupt_tc(void)
 {
 	return run_test_case(throughput_test);
@@ -4960,7 +4981,7 @@ typedef int (test_case_function)(struct active_device *ad,
 	.setup = testsuite_setup,
 	.teardown = testsuite_teardown,
 	.unit_test_cases = {
-		TEST_CASE_ST(ut_setup, ut_teardown, latency_tc),
+		TEST_CASE_ST(ut_setup, ut_teardown, validation_tc),
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	}
 };
-- 
1.8.3.1


  reply	other threads:[~2020-10-26 17:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 17:48 [dpdk-dev] [PATCH v6 0/7] BBDEV test updates Nicolas Chautru
2020-10-26 17:48 ` Nicolas Chautru [this message]
2020-10-26 17:48 ` [dpdk-dev] [PATCH v6 2/7] app/bbdev: add explicit check for counters Nicolas Chautru
2020-10-26 17:48 ` [dpdk-dev] [PATCH v6 3/7] app/bbdev: include explicit HARQ preloading Nicolas Chautru
2020-10-26 17:48 ` [dpdk-dev] [PATCH v6 4/7] app/bbdev: define wait for offload Nicolas Chautru
2020-10-26 17:48 ` [dpdk-dev] [PATCH v6 5/7] app/bbdev: skip bler ut when compression is used Nicolas Chautru
2020-10-26 17:48 ` [dpdk-dev] [PATCH v6 6/7] app/bbdev: reduce duration of throughput test Nicolas Chautru
2020-10-26 17:48 ` [dpdk-dev] [PATCH v6 7/7] app/bbdev: update offload test to dequeue full ring Nicolas Chautru
2020-10-28 12:15 ` [dpdk-dev] [PATCH v6 0/7] BBDEV test updates Akhil Goyal

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=1603734490-57821-2-git-send-email-nicolas.chautru@intel.com \
    --to=nicolas.chautru@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=trix@redhat.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).