DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v2 00/16] test/bbdev: changes for 23.03
@ 2023-02-15 17:09 Hernan Vargas
  2023-02-15 17:09 ` [PATCH v2 01/16] test/bbdev: fix seg fault for non supported HARQ len Hernan Vargas
                   ` (16 more replies)
  0 siblings, 17 replies; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas

v2: Made changes requested during review. Added 3 commits.
v1: Upstreaming bbdev-test changes for 23.03.

Hernan Vargas (16):
  test/bbdev: fix seg fault for non supported HARQ len
  test/bbdev: extend HARQ tolerance
  test/bbdev: refactor TB throughput report
  test/bbdev: add timeout for latency tests
  test/bbdev: enable early termination for validation
  test/bbdev: report device status in test-bbdev
  test/bbdev: test start/stop bbdev API
  test/bbdev: add support for BLER for 4G
  test/bbdev: extend support for large TB
  test/bbdev: adjustment for soft output
  test/bbdev: expose warning counters
  test/bbdev: remove check for invalid opaque data
  test/bbdev: remove iteration count check
  test/bbdev: use mbuf reset function
  test/bbdev: remove max iteration from vectors
  test/bbdev: remove iter count from bler test

 app/test-bbdev/test_bbdev_perf.c              | 400 +++++++++++++-----
 app/test-bbdev/test_bbdev_vector.c            |  14 -
 app/test-bbdev/test_bbdev_vector.h            |   1 -
 .../test_vectors/ldpc_dec_HARQ_1_0.data       |   3 -
 .../test_vectors/ldpc_dec_HARQ_1_1.data       |   3 -
 .../test_vectors/ldpc_dec_HARQ_1_2.data       |   3 -
 .../test_vectors/ldpc_dec_v11835.data         |   3 -
 .../test_vectors/ldpc_dec_v2342_drop.data     |   3 -
 .../test_vectors/ldpc_dec_v7813.data          |   3 -
 .../test_vectors/ldpc_dec_v8480.data          |   3 -
 .../test_vectors/ldpc_dec_v8568.data          |   3 -
 .../test_vectors/ldpc_dec_v9503.data          |   3 -
 ...turbo_dec_c1_k40_r0_e17280_sbd_negllr.data |   3 -
 ..._r0_e10376_crc24b_sbd_negllr_high_snr.data |   3 -
 ...4_r0_e10376_crc24b_sbd_negllr_low_snr.data |   3 -
 .../turbo_dec_c1_k6144_r0_e34560_posllr.data  |   3 -
 ...rbo_dec_c1_k6144_r0_e34560_sbd_negllr.data |   3 -
 ...rbo_dec_c1_k6144_r0_e34560_sbd_posllr.data |   3 -
 ...c_c2_k3136_r0_e4920_sbd_negllr_crc24b.data |   3 -
 19 files changed, 301 insertions(+), 162 deletions(-)

-- 
2.37.1


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

* [PATCH v2 01/16] test/bbdev: fix seg fault for non supported HARQ len
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-20 16:08   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 02/16] test/bbdev: extend HARQ tolerance Hernan Vargas
                   ` (15 subsequent siblings)
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas, stable

Fix segmentation fault happening in corner case in test-bbdev.
This fault could happen when running some specific vectors which size
are not supported by the PMD.

Fixes: 335c11fd276 ("app/bbdev: support HARQ validation")
Cc: stable@dpdk.org

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 45e1780df7..027f32cbf1 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -84,7 +84,7 @@
 /* Increment for next code block in external HARQ memory */
 #define HARQ_INCR 32768
 /* Headroom for filler LLRs insertion in HARQ buffer */
-#define FILLER_HEADROOM 1024
+#define FILLER_HEADROOM 2048
 /* Constants from K0 computation from 3GPP 38.212 Table 5.4.2.1-2 */
 #define N_ZC_1 66 /* N = 66 Zc for BG 1 */
 #define N_ZC_2 50 /* N = 50 Zc for BG 2 */
@@ -2111,9 +2111,9 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
 					ops_ld->n_filler;
 			if (data_len > deRmOutSize)
 				data_len = deRmOutSize;
-			if (data_len > orig_op->segments[i].length)
-				data_len = orig_op->segments[i].length;
 		}
+		if (data_len > orig_op->segments[i].length)
+			data_len = orig_op->segments[i].length;
 		/*
 		 * HARQ output can have minor differences
 		 * due to integer representation and related scaling
-- 
2.37.1


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

* [PATCH v2 02/16] test/bbdev: extend HARQ tolerance
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
  2023-02-15 17:09 ` [PATCH v2 01/16] test/bbdev: fix seg fault for non supported HARQ len Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-20 16:09   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 03/16] test/bbdev: refactor TB throughput report Hernan Vargas
                   ` (14 subsequent siblings)
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas, stable

HARQ memory implementation could have different size assumptions.
Extending HARQ tolerance to cover different implementations.

Fixes: 335c11fd276 ("app/bbdev: support HARQ validation")
Cc: stable@dpdk.org

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 027f32cbf1..74e7e13940 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -95,6 +95,7 @@
 #define K0_3_1 56 /* K0 fraction numerator for rv 3 and BG 1 */
 #define K0_3_2 43 /* K0 fraction numerator for rv 3 and BG 2 */
 
+#define HARQ_MEM_TOLERANCE 256
 static struct test_bbdev_vector test_vector;
 
 /* Switch between PMD and Interrupt for throughput TC */
@@ -2090,13 +2091,17 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
 		uint16_t data_len = rte_pktmbuf_data_len(m) - offset;
 		total_data_size += orig_op->segments[i].length;
 
-		TEST_ASSERT(orig_op->segments[i].length <
-				(uint32_t)(data_len + 64),
+		TEST_ASSERT(orig_op->segments[i].length < (uint32_t)(data_len + HARQ_MEM_TOLERANCE),
 				"Length of segment differ in original (%u) and filled (%u) op",
 				orig_op->segments[i].length, data_len);
 		harq_orig = (int8_t *) orig_op->segments[i].addr;
 		harq_out = rte_pktmbuf_mtod_offset(m, int8_t *, offset);
 
+		/* Cannot compare HARQ output data for such cases */
+		if ((ldpc_llr_decimals > 1) && ((ops_ld->op_flags & RTE_BBDEV_LDPC_LLR_COMPRESSION)
+				|| (ops_ld->op_flags & RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION)))
+			break;
+
 		if (!(ldpc_cap_flags &
 				RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS
 				) || (ops_ld->op_flags &
@@ -2172,7 +2177,7 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
 
 	/* Validate total mbuf pkt length */
 	uint32_t pkt_len = rte_pktmbuf_pkt_len(op->data) - op->offset;
-	TEST_ASSERT(total_data_size < pkt_len + 64,
+	TEST_ASSERT(total_data_size < pkt_len + HARQ_MEM_TOLERANCE,
 			"Length of data differ in original (%u) and filled (%u) op",
 			total_data_size, pkt_len);
 
-- 
2.37.1


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

* [PATCH v2 03/16] test/bbdev: refactor TB throughput report
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
  2023-02-15 17:09 ` [PATCH v2 01/16] test/bbdev: fix seg fault for non supported HARQ len Hernan Vargas
  2023-02-15 17:09 ` [PATCH v2 02/16] test/bbdev: extend HARQ tolerance Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-20 16:10   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 04/16] test/bbdev: add timeout for latency tests Hernan Vargas
                   ` (13 subsequent siblings)
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas

Refactor calculation for tb_size.
No functional impact.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 38 ++++++++++++++------------------
 1 file changed, 16 insertions(+), 22 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 74e7e13940..19b9a5b119 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -2580,19 +2580,16 @@ calc_dec_TB_size(struct rte_bbdev_dec_op *op)
 static uint32_t
 calc_ldpc_dec_TB_size(struct rte_bbdev_dec_op *op)
 {
-	uint8_t i;
-	uint32_t c, r, tb_size = 0;
+	uint8_t num_cbs = 0;
+	uint32_t tb_size = 0;
 	uint16_t sys_cols = (op->ldpc_dec.basegraph == 1) ? 22 : 10;
 
-	if (op->ldpc_dec.code_block_mode == RTE_BBDEV_CODE_BLOCK) {
-		tb_size = sys_cols * op->ldpc_dec.z_c - op->ldpc_dec.n_filler;
-	} else {
-		c = op->ldpc_dec.tb_params.c;
-		r = op->ldpc_dec.tb_params.r;
-		for (i = 0; i < c-r; i++)
-			tb_size += sys_cols * op->ldpc_dec.z_c
-					- op->ldpc_dec.n_filler;
-	}
+	if (op->ldpc_dec.code_block_mode == RTE_BBDEV_CODE_BLOCK)
+		num_cbs = 1;
+	else
+		num_cbs = op->ldpc_dec.tb_params.c - op->ldpc_dec.tb_params.r;
+
+	tb_size = (sys_cols * op->ldpc_dec.z_c - op->ldpc_dec.n_filler) * num_cbs;
 	return tb_size;
 }
 
@@ -2618,19 +2615,16 @@ calc_enc_TB_size(struct rte_bbdev_enc_op *op)
 static uint32_t
 calc_ldpc_enc_TB_size(struct rte_bbdev_enc_op *op)
 {
-	uint8_t i;
-	uint32_t c, r, tb_size = 0;
+	uint8_t num_cbs = 0;
+	uint32_t tb_size = 0;
 	uint16_t sys_cols = (op->ldpc_enc.basegraph == 1) ? 22 : 10;
 
-	if (op->ldpc_enc.code_block_mode == RTE_BBDEV_CODE_BLOCK) {
-		tb_size = sys_cols * op->ldpc_enc.z_c - op->ldpc_enc.n_filler;
-	} else {
-		c = op->turbo_enc.tb_params.c;
-		r = op->turbo_enc.tb_params.r;
-		for (i = 0; i < c-r; i++)
-			tb_size += sys_cols * op->ldpc_enc.z_c
-					- op->ldpc_enc.n_filler;
-	}
+	if (op->ldpc_enc.code_block_mode == RTE_BBDEV_CODE_BLOCK)
+		num_cbs = 1;
+	else
+		num_cbs = op->ldpc_enc.tb_params.c - op->ldpc_enc.tb_params.r;
+
+	tb_size = (sys_cols * op->ldpc_enc.z_c - op->ldpc_enc.n_filler) * num_cbs;
 	return tb_size;
 }
 
-- 
2.37.1


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

* [PATCH v2 04/16] test/bbdev: add timeout for latency tests
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
                   ` (2 preceding siblings ...)
  2023-02-15 17:09 ` [PATCH v2 03/16] test/bbdev: refactor TB throughput report Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-20 16:32   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 05/16] test/bbdev: enable early termination for validation Hernan Vargas
                   ` (12 subsequent siblings)
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas

Add a timeout to force exit the latency tests in case dequeue never
happens.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 19b9a5b119..dede0f900e 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -26,6 +26,7 @@
 
 #define MAX_QUEUES RTE_MAX_LCORE
 #define TEST_REPETITIONS 100
+#define TIME_OUT_POLL 1e8
 #define WAIT_OFFLOAD_US 1000
 
 #ifdef RTE_BASEBAND_FPGA_LTE_FEC
@@ -4546,6 +4547,7 @@ latency_test_ldpc_dec(struct rte_mempool *mempool,
 
 	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
 		uint16_t enq = 0, deq = 0;
+		uint32_t time_out = 0;
 		bool first_time = true;
 		last_time = 0;
 
@@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool *mempool,
 				last_time = rte_rdtsc_precise() - start_time;
 				first_time = false;
 			}
-		} while (unlikely(burst_sz != deq));
+			time_out++;
+		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
 
 		*max_time = RTE_MAX(*max_time, last_time);
 		*min_time = RTE_MIN(*min_time, last_time);
@@ -4606,7 +4609,12 @@ latency_test_ldpc_dec(struct rte_mempool *mempool,
 		if (extDdr)
 			retrieve_harq_ddr(dev_id, queue_id, ops_enq, burst_sz);
 
-		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
+		if (burst_sz != deq) {
+			struct rte_bbdev_info info;
+			ret = TEST_FAILED;
+			rte_bbdev_info_get(dev_id, &info);
+			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
+		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
 			ret = validate_ldpc_dec_op(ops_deq, burst_sz, ref_op,
 					vector_mask);
 			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
@@ -4632,6 +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
 
 	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
 		uint16_t enq = 0, deq = 0;
+		uint32_t time_out = 0;
 		bool first_time = true;
 		last_time = 0;
 
@@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool *mempool,
 				last_time += rte_rdtsc_precise() - start_time;
 				first_time = false;
 			}
-		} while (unlikely(burst_sz != deq));
+			time_out++;
+		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
 
 		*max_time = RTE_MAX(*max_time, last_time);
 		*min_time = RTE_MIN(*min_time, last_time);
 		*total_time += last_time;
-
-		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
+		if (burst_sz != deq) {
+			struct rte_bbdev_info info;
+			ret = TEST_FAILED;
+			rte_bbdev_info_get(dev_id, &info);
+			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
+		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
 			ret = validate_enc_op(ops_deq, burst_sz, ref_op);
 			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
 		}
-- 
2.37.1


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

* [PATCH v2 05/16] test/bbdev: enable early termination for validation
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
                   ` (3 preceding siblings ...)
  2023-02-15 17:09 ` [PATCH v2 04/16] test/bbdev: add timeout for latency tests Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-20 20:12   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 06/16] test/bbdev: report device status in test-bbdev Hernan Vargas
                   ` (11 subsequent siblings)
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas

Enhancement to enable early termination for validation tests if the
device supports it.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index dede0f900e..8c4b82efca 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -3775,11 +3775,11 @@ throughput_pmd_lcore_ldpc_dec(void *arg)
 	TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", num_ops);
 
 	/* For throughput tests we need to disable early termination */
-	if (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;
+	if (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;
+
 	ref_op->ldpc_dec.iter_max = get_iter_max();
+	/* Since ET is disabled, the expected iter_count is iter_max */
 	ref_op->ldpc_dec.iter_count = ref_op->ldpc_dec.iter_max;
 
 	if (test_vector.op_type != RTE_BBDEV_OP_NONE)
@@ -4465,7 +4465,7 @@ latency_test_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;
@@ -4481,8 +4481,14 @@ latency_test_dec(struct rte_mempool *mempool,
 			burst_sz = num_to_process - dequeued;
 
 		ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
-		TEST_ASSERT_SUCCESS(ret,
-				"rte_bbdev_dec_op_alloc_bulk() failed");
+		TEST_ASSERT_SUCCESS(ret, "rte_bbdev_dec_op_alloc_bulk() failed");
+
+		ref_op->turbo_dec.iter_max = get_iter_max();
+		/* For validation tests we want to enable early termination */
+		if (!disable_et && !check_bit(ref_op->turbo_dec.op_flags,
+				RTE_BBDEV_TURBO_EARLY_TERMINATION))
+			ref_op->turbo_dec.op_flags |= RTE_BBDEV_TURBO_EARLY_TERMINATION;
+
 		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
 			copy_reference_dec_op(ops_enq, burst_sz, dequeued,
 					bufs->inputs,
@@ -4561,10 +4567,12 @@ latency_test_ldpc_dec(struct rte_mempool *mempool,
 		/* For latency tests we need to disable early termination */
 		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;
+			ref_op->ldpc_dec.op_flags -= RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE;
+
 		ref_op->ldpc_dec.iter_max = get_iter_max();
-		ref_op->ldpc_dec.iter_count = ref_op->ldpc_dec.iter_max;
+		/* When ET is disabled, the expected iter_count is iter_max */
+		if (disable_et)
+			ref_op->ldpc_dec.iter_count = ref_op->ldpc_dec.iter_max;
 
 		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
 			copy_reference_ldpc_dec_op(ops_enq, burst_sz, dequeued,
@@ -4873,7 +4881,7 @@ validation_latency_test(struct active_device *ad,
 		iter = latency_test_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);
+				burst_sz, &total_time, &min_time, &max_time, latency_flag);
 	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,
-- 
2.37.1


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

* [PATCH v2 06/16] test/bbdev: report device status in test-bbdev
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
                   ` (4 preceding siblings ...)
  2023-02-15 17:09 ` [PATCH v2 05/16] test/bbdev: enable early termination for validation Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-20 20:17   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 07/16] test/bbdev: test start/stop bbdev API Hernan Vargas
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas

No functional impact.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 8c4b82efca..057fb5ac9e 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -850,6 +850,8 @@ add_bbdev_dev(uint8_t dev_id, struct rte_bbdev_info *info,
 #endif
 	/* Let's refresh this now this is configured */
 	rte_bbdev_info_get(dev_id, info);
+	if (info->drv.device_status == RTE_BBDEV_DEV_FATAL_ERR)
+		printf("Device Status %s\n", rte_bbdev_device_status_str(info->drv.device_status));
 	nb_queues = RTE_MIN(rte_lcore_count(), info->drv.max_num_queues);
 	nb_queues = RTE_MIN(nb_queues, (unsigned int) MAX_QUEUES);
 
-- 
2.37.1


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

* [PATCH v2 07/16] test/bbdev: test start/stop bbdev API
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
                   ` (5 preceding siblings ...)
  2023-02-15 17:09 ` [PATCH v2 06/16] test/bbdev: report device status in test-bbdev Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-20 20:21   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 08/16] test/bbdev: add support for BLER for 4G Hernan Vargas
                   ` (9 subsequent siblings)
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas

Add a call to queue start and queue stop specifically for testing the
bbdev API.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 057fb5ac9e..e4eb71050a 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -890,6 +890,7 @@ add_bbdev_dev(uint8_t dev_id, struct rte_bbdev_info *info,
 			ret = rte_bbdev_queue_configure(ad->dev_id, queue_id,
 					&qconf);
 		}
+		rte_bbdev_queue_start(ad->dev_id, queue_id);
 		if (ret != 0) {
 			printf("All queues on dev %u allocated: %u\n",
 					dev_id, queue_id);
@@ -898,8 +899,8 @@ add_bbdev_dev(uint8_t dev_id, struct rte_bbdev_info *info,
 		ad->queue_ids[queue_id] = queue_id;
 	}
 	TEST_ASSERT(queue_id != 0,
-			"ERROR Failed to configure any queues on dev %u",
-			dev_id);
+			"ERROR Failed to configure any queues on dev %u\n"
+			"\tthe device may not support or have been configured", dev_id);
 	ad->nb_queues = queue_id;
 
 	set_avail_op(ad, op_type);
@@ -3846,6 +3847,7 @@ throughput_pmd_lcore_ldpc_dec(void *arg)
 		TEST_ASSERT_SUCCESS(ret, "Validation failed!");
 	}
 
+	rte_bbdev_queue_stop(tp->dev_id, queue_id);
 	rte_bbdev_dec_op_free_bulk(ops_enq, num_ops);
 
 	double tb_len_bits = calc_ldpc_dec_TB_size(ref_op);
-- 
2.37.1


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

* [PATCH v2 08/16] test/bbdev: add support for BLER for 4G
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
                   ` (6 preceding siblings ...)
  2023-02-15 17:09 ` [PATCH v2 07/16] test/bbdev: test start/stop bbdev API Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-22 10:48   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 09/16] test/bbdev: extend support for large TB Hernan Vargas
                   ` (8 subsequent siblings)
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas

New feature to add BLER support for 4G in test-bbdev.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 183 ++++++++++++++++++++++++++++++-
 1 file changed, 182 insertions(+), 1 deletion(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index e4eb71050a..acfefb7efa 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -1757,6 +1757,30 @@ gen_qm2_llr(int8_t *llrs, uint32_t j, double N0, double llr_max)
 	llrs[j] = (int8_t) b;
 }
 
+/* Simple LLR generation assuming AWGN and QPSK */
+static void
+gen_turbo_llr(int8_t *llrs, uint32_t j, double N0, double llr_max)
+{
+	double b, b1, n;
+	double coeff = 2.0 * sqrt(N0);
+
+	/* Ignore in vectors null LLRs not to be saturated */
+	if (llrs[j] == 0)
+		return;
+
+	/* Note don't change sign here */
+	n = randn(j % 2);
+	b1 = ((llrs[j] > 0 ? 2.0 : -2.0)
+			+ coeff * n) / N0;
+	b = b1 * (1 << 4);
+	b = round(b);
+	if (b > llr_max)
+		b = llr_max;
+	if (b < -llr_max)
+		b = -llr_max;
+	llrs[j] = (int8_t) b;
+}
+
 /* Generate LLR for a given SNR */
 static void
 generate_llr_input(uint16_t n, struct rte_bbdev_op_data *inputs,
@@ -1792,6 +1816,27 @@ generate_llr_input(uint16_t n, struct rte_bbdev_op_data *inputs,
 	}
 }
 
+/* Generate LLR for turbo decoder for a given SNR */
+static void
+generate_turbo_llr_input(uint16_t n, struct rte_bbdev_op_data *inputs,
+		struct rte_bbdev_dec_op *ref_op)
+{
+	struct rte_mbuf *m;
+	uint32_t i, j, range;
+	double N0, llr_max;
+
+	llr_max = 127;
+	range = ref_op->turbo_dec.input.length;
+	N0 = 1.0 / pow(10.0, get_snr() / 10.0);
+
+	for (i = 0; i < n; ++i) {
+		m = inputs[i].data;
+		int8_t *llrs = rte_pktmbuf_mtod_offset(m, int8_t *, 0);
+		for (j = 0; j < range; ++j)
+			gen_turbo_llr(llrs, j, N0, llr_max);
+	}
+}
+
 static void
 copy_reference_ldpc_dec_op(struct rte_bbdev_dec_op **ops, unsigned int n,
 		unsigned int start_idx,
@@ -2306,6 +2351,30 @@ validate_ldpc_bler(struct rte_bbdev_dec_op **ops, const uint16_t n)
 	return errors;
 }
 
+/* Check Number of code blocks errors */
+static int
+validate_turbo_bler(struct rte_bbdev_dec_op **ops, const uint16_t n)
+{
+	unsigned int i;
+	struct op_data_entries *hard_data_orig = &test_vector.entries[DATA_HARD_OUTPUT];
+	struct rte_bbdev_op_turbo_dec *ops_td;
+	struct rte_bbdev_op_data *hard_output;
+	int errors = 0;
+	struct rte_mbuf *m;
+
+	for (i = 0; i < n; ++i) {
+		ops_td = &ops[i]->turbo_dec;
+		hard_output = &ops_td->hard_output;
+		m = hard_output->data;
+		if (memcmp(rte_pktmbuf_mtod_offset(m, uint32_t *, 0),
+				hard_data_orig->segments[0].addr,
+				hard_data_orig->segments[0].length))
+			errors++;
+	}
+	return errors;
+}
+
+
 static int
 validate_ldpc_dec_op(struct rte_bbdev_dec_op **ops, const uint16_t n,
 		struct rte_bbdev_dec_op *ref_op, const int vector_mask)
@@ -3738,6 +3807,114 @@ bler_pmd_lcore_ldpc_dec(void *arg)
 	return TEST_SUCCESS;
 }
 
+
+static int
+bler_pmd_lcore_turbo_dec(void *arg)
+{
+	struct thread_params *tp = arg;
+	uint16_t enq, deq;
+	uint64_t total_time = 0, start_time;
+	const uint16_t queue_id = tp->queue_id;
+	const uint16_t burst_sz = tp->op_params->burst_sz;
+	const uint16_t num_ops = tp->op_params->num_to_process;
+	struct rte_bbdev_dec_op *ops_enq[num_ops];
+	struct rte_bbdev_dec_op *ops_deq[num_ops];
+	struct rte_bbdev_dec_op *ref_op = tp->op_params->ref_dec_op;
+	struct test_buffers *bufs = NULL;
+	int i, j, ret;
+	struct rte_bbdev_info info;
+	uint16_t num_to_enq;
+
+	TEST_ASSERT_SUCCESS((burst_sz > MAX_BURST),
+			"BURST_SIZE should be <= %u", MAX_BURST);
+
+	rte_bbdev_info_get(tp->dev_id, &info);
+
+	TEST_ASSERT_SUCCESS((num_ops > info.drv.queue_size_lim),
+			"NUM_OPS cannot exceed %u for this device",
+			info.drv.queue_size_lim);
+
+	bufs = &tp->op_params->q_bufs[GET_SOCKET(info.socket_id)][queue_id];
+
+	rte_wait_until_equal_16(&tp->op_params->sync, SYNC_START, __ATOMIC_RELAXED);
+
+	ret = rte_bbdev_dec_op_alloc_bulk(tp->op_params->mp, ops_enq, num_ops);
+	TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", num_ops);
+
+	/* For BLER tests we need to enable early termination */
+	if (!check_bit(ref_op->turbo_dec.op_flags,
+			RTE_BBDEV_TURBO_EARLY_TERMINATION))
+		ref_op->turbo_dec.op_flags +=
+				RTE_BBDEV_TURBO_EARLY_TERMINATION;
+	ref_op->turbo_dec.iter_max = get_iter_max();
+	ref_op->turbo_dec.iter_count = ref_op->turbo_dec.iter_max;
+
+	if (test_vector.op_type != RTE_BBDEV_OP_NONE)
+		copy_reference_dec_op(ops_enq, num_ops, 0, bufs->inputs,
+				bufs->hard_outputs, bufs->soft_outputs,
+				ref_op);
+	generate_turbo_llr_input(num_ops, bufs->inputs, ref_op);
+
+	/* Set counter to validate the ordering */
+	for (j = 0; j < num_ops; ++j)
+		ops_enq[j]->opaque_data = (void *)(uintptr_t)j;
+
+	for (i = 0; i < 1; ++i) { /* Could add more iterations */
+		for (j = 0; j < num_ops; ++j) {
+			mbuf_reset(
+			ops_enq[j]->turbo_dec.hard_output.data);
+		}
+
+		start_time = rte_rdtsc_precise();
+
+		for (enq = 0, deq = 0; enq < num_ops;) {
+			num_to_enq = burst_sz;
+
+			if (unlikely(num_ops - enq < num_to_enq))
+				num_to_enq = num_ops - enq;
+
+			enq += rte_bbdev_enqueue_dec_ops(tp->dev_id,
+					queue_id, &ops_enq[enq], num_to_enq);
+
+			deq += rte_bbdev_dequeue_dec_ops(tp->dev_id,
+					queue_id, &ops_deq[deq], enq - deq);
+		}
+
+		/* dequeue the remaining */
+		while (deq < enq) {
+			deq += rte_bbdev_dequeue_dec_ops(tp->dev_id,
+					queue_id, &ops_deq[deq], enq - deq);
+		}
+
+		total_time += rte_rdtsc_precise() - start_time;
+	}
+
+	tp->iter_count = 0;
+	tp->iter_average = 0;
+	/* get the max of iter_count for all dequeued ops */
+	for (i = 0; i < num_ops; ++i) {
+		tp->iter_count = RTE_MAX(ops_enq[i]->turbo_dec.iter_count,
+				tp->iter_count);
+		tp->iter_average += (double) ops_enq[i]->turbo_dec.iter_count;
+	}
+
+	tp->iter_average /= num_ops;
+	tp->bler = (double) validate_turbo_bler(ops_deq, num_ops) / num_ops;
+
+	rte_bbdev_dec_op_free_bulk(ops_enq, num_ops);
+
+	double tb_len_bits = calc_dec_TB_size(ref_op);
+	tp->ops_per_sec = ((double)num_ops * 1) /
+			((double)total_time / (double)rte_get_tsc_hz());
+	tp->mbps = (((double)(num_ops * 1 * tb_len_bits)) /
+			1000000.0) / ((double)total_time /
+			(double)rte_get_tsc_hz());
+	printf("TBS %.0f Time %.0f\n", tb_len_bits, 1000000.0 *
+			((double)total_time / (double)rte_get_tsc_hz()));
+
+	return TEST_SUCCESS;
+}
+
 static int
 throughput_pmd_lcore_ldpc_dec(void *arg)
 {
@@ -4195,7 +4372,7 @@ print_dec_bler(struct thread_params *t_params, unsigned int used_cores)
 	total_bler /= used_cores;
 	total_iter /= used_cores;
 
-	printf("SNR %.2f BLER %.1f %% - Iterations %.1f %d - Tp %.1f Mbps %s\n",
+	printf("SNR %.2f BLER %.1f %% - Iterations %.1f %d - Tp %.3f Mbps %s\n",
 			snr, total_bler * 100, total_iter, get_iter_max(),
 			total_mbps, get_vector_filename());
 }
@@ -4247,6 +4424,10 @@ bler_test(struct active_device *ad,
 			&& !check_bit(test_vector.ldpc_dec.op_flags,
 			RTE_BBDEV_LDPC_LLR_COMPRESSION))
 		bler_function = bler_pmd_lcore_ldpc_dec;
+	else if ((test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC) &&
+			!check_bit(test_vector.turbo_dec.op_flags,
+			RTE_BBDEV_TURBO_SOFT_OUTPUT))
+		bler_function = bler_pmd_lcore_turbo_dec;
 	else
 		return TEST_SKIPPED;
 
-- 
2.37.1


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

* [PATCH v2 09/16] test/bbdev: extend support for large TB
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
                   ` (7 preceding siblings ...)
  2023-02-15 17:09 ` [PATCH v2 08/16] test/bbdev: add support for BLER for 4G Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-22 10:49   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 10/16] test/bbdev: adjustment for soft output Hernan Vargas
                   ` (7 subsequent siblings)
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas

Add support for large TB when it cannot fit into a true mbuf.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index acfefb7efa..bdddf4f8b2 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -1073,8 +1073,6 @@ init_op_data_objs(struct rte_bbdev_op_data *bufs,
 			 * Special case when DPDK mbuf cannot handle
 			 * the required input size
 			 */
-			printf("Warning: Larger input size than DPDK mbuf %d\n",
-					seg->length);
 			large_input = true;
 		}
 		bufs[i].data = m_head;
@@ -2031,6 +2029,7 @@ validate_op_chain(struct rte_bbdev_op_data *op,
 	struct rte_mbuf *m = op->data;
 	uint8_t nb_dst_segments = orig_op->nb_segments;
 	uint32_t total_data_size = 0;
+	bool ignore_mbuf = false; /* ignore mbuf limitations */
 
 	TEST_ASSERT(nb_dst_segments == m->nb_segs,
 			"Number of segments differ in original (%u) and filled (%u) op",
@@ -2043,21 +2042,25 @@ validate_op_chain(struct rte_bbdev_op_data *op,
 		uint16_t data_len = rte_pktmbuf_data_len(m) - offset;
 		total_data_size += orig_op->segments[i].length;
 
-		TEST_ASSERT(orig_op->segments[i].length == data_len,
-				"Length of segment differ in original (%u) and filled (%u) op",
-				orig_op->segments[i].length, data_len);
+		if (orig_op->segments[i].length > RTE_BBDEV_LDPC_E_MAX_MBUF)
+			ignore_mbuf = true;
+		if (!ignore_mbuf)
+			TEST_ASSERT(orig_op->segments[i].length == data_len,
+					"Length of segment differ in original (%u) and filled (%u) op",
+					orig_op->segments[i].length, data_len);
 		TEST_ASSERT_BUFFERS_ARE_EQUAL(orig_op->segments[i].addr,
 				rte_pktmbuf_mtod_offset(m, uint32_t *, offset),
-				data_len,
+				orig_op->segments[i].length,
 				"Output buffers (CB=%u) are not equal", i);
 		m = m->next;
 	}
 
 	/* Validate total mbuf pkt length */
 	uint32_t pkt_len = rte_pktmbuf_pkt_len(op->data) - op->offset;
-	TEST_ASSERT(total_data_size == pkt_len,
-			"Length of data differ in original (%u) and filled (%u) op",
-			total_data_size, pkt_len);
+	if (!ignore_mbuf)
+		TEST_ASSERT(total_data_size == pkt_len,
+				"Length of data differ in original (%u) and filled (%u) op",
+				total_data_size, pkt_len);
 
 	return TEST_SUCCESS;
 }
-- 
2.37.1


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

* [PATCH v2 10/16] test/bbdev: adjustment for soft output
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
                   ` (8 preceding siblings ...)
  2023-02-15 17:09 ` [PATCH v2 09/16] test/bbdev: extend support for large TB Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-22 10:50   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 11/16] test/bbdev: expose warning counters Hernan Vargas
                   ` (6 subsequent siblings)
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas

Extend test-bbdev for soft output check, notably due to the logic in
test-bbdev to enable termination changing.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index bdddf4f8b2..00090f863f 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -1349,6 +1349,7 @@ fill_queue_buffers(struct test_op_params *op_params,
 				RTE_BBDEV_LDPC_LLR_COMPRESSION;
 		bool harq_comp = op_params->ref_dec_op->ldpc_dec.op_flags &
 				RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION;
+
 		ldpc_llr_decimals = capabilities->cap.ldpc_dec.llr_decimals;
 		ldpc_llr_size = capabilities->cap.ldpc_dec.llr_size;
 		ldpc_cap_flags = capabilities->cap.ldpc_dec.capability_flags;
@@ -2424,7 +2425,7 @@ validate_ldpc_dec_op(struct rte_bbdev_dec_op **ops, const uint16_t n,
 					i);
 
 		if (ref_op->ldpc_dec.op_flags & RTE_BBDEV_LDPC_SOFT_OUT_ENABLE)
-			TEST_ASSERT_SUCCESS(validate_op_chain(soft_output,
+			TEST_ASSERT_SUCCESS(validate_op_so_chain(soft_output,
 					soft_data_orig),
 					"Soft output buffers (CB=%u) are not equal",
 					i);
@@ -2494,7 +2495,6 @@ validate_ldpc_enc_op(struct rte_bbdev_enc_op **ops, const uint16_t n,
 	return TEST_SUCCESS;
 }
 
-
 static inline int
 validate_op_fft_chain(struct rte_bbdev_op_data *op, struct op_data_entries *orig_op)
 {
@@ -3181,11 +3181,11 @@ throughput_intr_lcore_ldpc_dec(void *arg)
 	for (j = 0; j < TEST_REPETITIONS; ++j) {
 		for (i = 0; i < num_to_process; ++i) {
 			if (!loopback)
-				rte_pktmbuf_reset(
-					ops[i]->ldpc_dec.hard_output.data);
+				rte_pktmbuf_reset(ops[i]->ldpc_dec.hard_output.data);
 			if (hc_out || loopback)
-				mbuf_reset(
-				ops[i]->ldpc_dec.harq_combined_output.data);
+				mbuf_reset(ops[i]->ldpc_dec.harq_combined_output.data);
+			if (ops[i]->ldpc_dec.soft_output.data != NULL)
+				rte_pktmbuf_reset(ops[i]->ldpc_dec.soft_output.data);
 		}
 
 		tp->start_time = rte_rdtsc_precise();
@@ -3280,7 +3280,6 @@ throughput_intr_lcore_dec(void *arg)
 				rte_pktmbuf_reset(ops[i]->turbo_dec.soft_output.data);
 		}
 
-
 		tp->start_time = rte_rdtsc_precise();
 		for (enqueued = 0; enqueued < num_to_process;) {
 			num_to_enq = burst_sz;
@@ -3742,10 +3741,11 @@ bler_pmd_lcore_ldpc_dec(void *arg)
 	for (i = 0; i < 1; ++i) { /* Could add more iterations */
 		for (j = 0; j < num_ops; ++j) {
 			if (!loopback)
-				mbuf_reset(
-				ops_enq[j]->ldpc_dec.hard_output.data);
+				mbuf_reset(ops_enq[j]->ldpc_dec.hard_output.data);
 			if (hc_out || loopback)
 				mbuf_reset(ops_enq[j]->ldpc_dec.harq_combined_output.data);
+			if (ops_enq[j]->ldpc_dec.soft_output.data != NULL)
+				mbuf_reset(ops_enq[j]->ldpc_dec.soft_output.data);
 		}
 		if (extDdr)
 			preload_harq_ddr(tp->dev_id, queue_id, ops_enq,
@@ -3977,11 +3977,11 @@ throughput_pmd_lcore_ldpc_dec(void *arg)
 	for (i = 0; i < TEST_REPETITIONS; ++i) {
 		for (j = 0; j < num_ops; ++j) {
 			if (!loopback)
-				mbuf_reset(
-				ops_enq[j]->ldpc_dec.hard_output.data);
+				mbuf_reset(ops_enq[j]->ldpc_dec.hard_output.data);
 			if (hc_out || loopback)
-				mbuf_reset(
-				ops_enq[j]->ldpc_dec.harq_combined_output.data);
+				mbuf_reset(ops_enq[j]->ldpc_dec.harq_combined_output.data);
+			if (ops_enq[j]->ldpc_dec.soft_output.data != NULL)
+				mbuf_reset(ops_enq[j]->ldpc_dec.soft_output.data);
 		}
 		if (extDdr)
 			preload_harq_ddr(tp->dev_id, queue_id, ops_enq,
-- 
2.37.1


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

* [PATCH v2 11/16] test/bbdev: expose warning counters
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
                   ` (9 preceding siblings ...)
  2023-02-15 17:09 ` [PATCH v2 10/16] test/bbdev: adjustment for soft output Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-22 10:52   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 12/16] test/bbdev: remove check for invalid opaque data Hernan Vargas
                   ` (5 subsequent siblings)
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas

Print warnings reported on queues for offload test.
No functional impact.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 00090f863f..a19eda2de8 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -5673,6 +5673,9 @@ offload_cost_test(struct active_device *ad,
 
 	struct rte_bbdev_stats stats = {0};
 	get_bbdev_queue_stats(ad->dev_id, queue_id, &stats);
+	if (stats.enqueue_warn_count > 0)
+		printf("Warning reported on the queue : %10"PRIu64"\n",
+			stats.enqueue_warn_count);
 	if (op_type != RTE_BBDEV_OP_LDPC_DEC) {
 		TEST_ASSERT_SUCCESS(stats.enqueued_count != num_to_process,
 				"Mismatch in enqueue count %10"PRIu64" %d",
-- 
2.37.1


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

* [PATCH v2 12/16] test/bbdev: remove check for invalid opaque data
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
                   ` (10 preceding siblings ...)
  2023-02-15 17:09 ` [PATCH v2 11/16] test/bbdev: expose warning counters Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-22 10:53   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 13/16] test/bbdev: remove iteration count check Hernan Vargas
                   ` (4 subsequent siblings)
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas, stable

Assert also if the opaque data is invalid.
Fixes: 335c11fd276 ("app/bbdev: support HARQ validation")
Cc: stable@dpdk.org

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index a19eda2de8..2ce1c7e7d3 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -79,7 +79,6 @@
 
 #define SYNC_WAIT 0
 #define SYNC_START 1
-#define INVALID_OPAQUE -1
 
 #define INVALID_QUEUE_ID -1
 /* Increment for next code block in external HARQ memory */
@@ -1999,10 +1998,9 @@ check_enc_status_and_ordering(struct rte_bbdev_enc_op *op,
 			"op_status (%d) != expected_status (%d)",
 			op->status, expected_status);
 
-	if (op->opaque_data != (void *)(uintptr_t)INVALID_OPAQUE)
-		TEST_ASSERT((void *)(uintptr_t)order_idx == op->opaque_data,
-				"Ordering error, expected %p, got %p",
-				(void *)(uintptr_t)order_idx, op->opaque_data);
+	TEST_ASSERT((void *)(uintptr_t)order_idx == op->opaque_data,
+			"Ordering error, expected %p, got %p",
+			(void *)(uintptr_t)order_idx, op->opaque_data);
 
 	return TEST_SUCCESS;
 }
-- 
2.37.1


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

* [PATCH v2 13/16] test/bbdev: remove iteration count check
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
                   ` (11 preceding siblings ...)
  2023-02-15 17:09 ` [PATCH v2 12/16] test/bbdev: remove check for invalid opaque data Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-22 10:55   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 14/16] test/bbdev: use mbuf reset function Hernan Vargas
                   ` (3 subsequent siblings)
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas

To make the test compatible with devices that do not support early
termination, the iteration count assert can be removed.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 2ce1c7e7d3..5259404ff6 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -2288,7 +2288,7 @@ validate_op_so_chain(struct rte_bbdev_op_data *op,
 
 static int
 validate_dec_op(struct rte_bbdev_dec_op **ops, const uint16_t n,
-		struct rte_bbdev_dec_op *ref_op, const int vector_mask)
+		struct rte_bbdev_dec_op *ref_op)
 {
 	unsigned int i;
 	int ret;
@@ -2299,17 +2299,12 @@ validate_dec_op(struct rte_bbdev_dec_op **ops, const uint16_t n,
 	struct rte_bbdev_op_turbo_dec *ops_td;
 	struct rte_bbdev_op_data *hard_output;
 	struct rte_bbdev_op_data *soft_output;
-	struct rte_bbdev_op_turbo_dec *ref_td = &ref_op->turbo_dec;
 
 	for (i = 0; i < n; ++i) {
 		ops_td = &ops[i]->turbo_dec;
 		hard_output = &ops_td->hard_output;
 		soft_output = &ops_td->soft_output;
 
-		if (vector_mask & TEST_BBDEV_VF_EXPECTED_ITER_COUNT)
-			TEST_ASSERT(ops_td->iter_count <= ref_td->iter_count,
-					"Returned iter_count (%d) > expected iter_count (%d)",
-					ops_td->iter_count, ref_td->iter_count);
 		ret = check_dec_status_and_ordering(ops[i], i, ref_op->status);
 		TEST_ASSERT_SUCCESS(ret,
 				"Checking status and ordering for decoder failed");
@@ -3058,8 +3053,7 @@ dequeue_event_callback(uint16_t dev_id,
 
 	if (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC) {
 		struct rte_bbdev_dec_op *ref_op = tp->op_params->ref_dec_op;
-		ret = validate_dec_op(tp->dec_ops, num_ops, ref_op,
-				tp->op_params->vector_mask);
+		ret = validate_dec_op(tp->dec_ops, num_ops, ref_op);
 		/* get the max of iter_count for all dequeued ops */
 		for (i = 0; i < num_ops; ++i)
 			tp->iter_count = RTE_MAX(
@@ -3660,8 +3654,7 @@ throughput_pmd_lcore_dec(void *arg)
 	}
 
 	if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
-		ret = validate_dec_op(ops_deq, num_ops, ref_op,
-				tp->op_params->vector_mask);
+		ret = validate_dec_op(ops_deq, num_ops, ref_op);
 		TEST_ASSERT_SUCCESS(ret, "Validation failed!");
 	}
 
@@ -4649,7 +4642,7 @@ throughput_test(struct active_device *ad,
 static int
 latency_test_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,
+		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, bool disable_et)
 {
@@ -4709,8 +4702,7 @@ latency_test_dec(struct rte_mempool *mempool,
 		*total_time += last_time;
 
 		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
-			ret = validate_dec_op(ops_deq, burst_sz, ref_op,
-					vector_mask);
+			ret = validate_dec_op(ops_deq, burst_sz, ref_op);
 			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
 		}
 
@@ -5065,9 +5057,9 @@ validation_latency_test(struct active_device *ad,
 
 	if (op_type == RTE_BBDEV_OP_TURBO_DEC)
 		iter = latency_test_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, latency_flag);
+				op_params->ref_dec_op, ad->dev_id, queue_id,
+				num_to_process, burst_sz, &total_time,
+				&min_time, &max_time, latency_flag);
 	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,
-- 
2.37.1


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

* [PATCH v2 14/16] test/bbdev: use mbuf reset function
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
                   ` (12 preceding siblings ...)
  2023-02-15 17:09 ` [PATCH v2 13/16] test/bbdev: remove iteration count check Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-22 10:56   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 15/16] test/bbdev: remove max iteration from vectors Hernan Vargas
                   ` (2 subsequent siblings)
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas

Use mbuf_reset function for code consistency.
No functional impact.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 5259404ff6..535b9d73dd 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -3173,11 +3173,11 @@ throughput_intr_lcore_ldpc_dec(void *arg)
 	for (j = 0; j < TEST_REPETITIONS; ++j) {
 		for (i = 0; i < num_to_process; ++i) {
 			if (!loopback)
-				rte_pktmbuf_reset(ops[i]->ldpc_dec.hard_output.data);
+				mbuf_reset(ops[i]->ldpc_dec.hard_output.data);
 			if (hc_out || loopback)
 				mbuf_reset(ops[i]->ldpc_dec.harq_combined_output.data);
 			if (ops[i]->ldpc_dec.soft_output.data != NULL)
-				rte_pktmbuf_reset(ops[i]->ldpc_dec.soft_output.data);
+				mbuf_reset(ops[i]->ldpc_dec.soft_output.data);
 		}
 
 		tp->start_time = rte_rdtsc_precise();
@@ -3267,9 +3267,9 @@ throughput_intr_lcore_dec(void *arg)
 
 	for (j = 0; j < TEST_REPETITIONS; ++j) {
 		for (i = 0; i < num_to_process; ++i) {
-			rte_pktmbuf_reset(ops[i]->turbo_dec.hard_output.data);
+			mbuf_reset(ops[i]->turbo_dec.hard_output.data);
 			if (ops[i]->turbo_dec.soft_output.data != NULL)
-				rte_pktmbuf_reset(ops[i]->turbo_dec.soft_output.data);
+				mbuf_reset(ops[i]->turbo_dec.soft_output.data);
 		}
 
 		tp->start_time = rte_rdtsc_precise();
@@ -3356,7 +3356,7 @@ throughput_intr_lcore_enc(void *arg)
 
 	for (j = 0; j < TEST_REPETITIONS; ++j) {
 		for (i = 0; i < num_to_process; ++i)
-			rte_pktmbuf_reset(ops[i]->turbo_enc.output.data);
+			mbuf_reset(ops[i]->turbo_enc.output.data);
 
 		tp->start_time = rte_rdtsc_precise();
 		for (enqueued = 0; enqueued < num_to_process;) {
@@ -3444,7 +3444,7 @@ throughput_intr_lcore_ldpc_enc(void *arg)
 
 	for (j = 0; j < TEST_REPETITIONS; ++j) {
 		for (i = 0; i < num_to_process; ++i)
-			rte_pktmbuf_reset(ops[i]->turbo_enc.output.data);
+			mbuf_reset(ops[i]->turbo_enc.output.data);
 
 		tp->start_time = rte_rdtsc_precise();
 		for (enqueued = 0; enqueued < num_to_process;) {
@@ -3532,7 +3532,7 @@ throughput_intr_lcore_fft(void *arg)
 
 	for (j = 0; j < TEST_REPETITIONS; ++j) {
 		for (i = 0; i < num_to_process; ++i)
-			rte_pktmbuf_reset(ops[i]->fft.base_output.data);
+			mbuf_reset(ops[i]->fft.base_output.data);
 
 		tp->start_time = rte_rdtsc_precise();
 		for (enqueued = 0; enqueued < num_to_process;) {
-- 
2.37.1


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

* [PATCH v2 15/16] test/bbdev: remove max iteration from vectors
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
                   ` (13 preceding siblings ...)
  2023-02-15 17:09 ` [PATCH v2 14/16] test/bbdev: use mbuf reset function Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-22 10:58   ` Maxime Coquelin
  2023-02-15 17:09 ` [PATCH v2 16/16] test/bbdev: remove iter count from bler test Hernan Vargas
  2023-02-20 15:31 ` [PATCH v2 00/16] test/bbdev: changes for 23.03 Maxime Coquelin
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas

Remove iter_max from test vectors as this value is passed as an argument
to the test.
No functional impact.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c                   |  4 ++++
 app/test-bbdev/test_bbdev_vector.c                 | 14 --------------
 app/test-bbdev/test_bbdev_vector.h                 |  1 -
 app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_0.data |  3 ---
 app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_1.data |  3 ---
 app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_2.data |  3 ---
 app/test-bbdev/test_vectors/ldpc_dec_v11835.data   |  3 ---
 .../test_vectors/ldpc_dec_v2342_drop.data          |  3 ---
 app/test-bbdev/test_vectors/ldpc_dec_v7813.data    |  3 ---
 app/test-bbdev/test_vectors/ldpc_dec_v8480.data    |  3 ---
 app/test-bbdev/test_vectors/ldpc_dec_v8568.data    |  3 ---
 app/test-bbdev/test_vectors/ldpc_dec_v9503.data    |  3 ---
 .../turbo_dec_c1_k40_r0_e17280_sbd_negllr.data     |  3 ---
 ...k6144_r0_e10376_crc24b_sbd_negllr_high_snr.data |  3 ---
 ..._k6144_r0_e10376_crc24b_sbd_negllr_low_snr.data |  3 ---
 .../turbo_dec_c1_k6144_r0_e34560_posllr.data       |  3 ---
 .../turbo_dec_c1_k6144_r0_e34560_sbd_negllr.data   |  3 ---
 .../turbo_dec_c1_k6144_r0_e34560_sbd_posllr.data   |  3 ---
 ...bo_dec_c2_k3136_r0_e4920_sbd_negllr_crc24b.data |  3 ---
 19 files changed, 4 insertions(+), 63 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 535b9d73dd..2baa2a0e62 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -3161,6 +3161,8 @@ throughput_intr_lcore_ldpc_dec(void *arg)
 				num_to_process);
 	TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops",
 			num_to_process);
+	ref_op->ldpc_dec.iter_max = get_iter_max();
+
 	if (test_vector.op_type != RTE_BBDEV_OP_NONE)
 		copy_reference_ldpc_dec_op(ops, num_to_process, 0, bufs->inputs,
 				bufs->hard_outputs, bufs->soft_outputs,
@@ -5238,6 +5240,7 @@ offload_latency_test_dec(struct rte_mempool *mempool, struct test_buffers *bufs,
 
 		ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
 		TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", burst_sz);
+		ref_op->turbo_dec.iter_max = get_iter_max();
 		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
 			copy_reference_dec_op(ops_enq, burst_sz, dequeued,
 					bufs->inputs,
@@ -5324,6 +5327,7 @@ offload_latency_test_ldpc_dec(struct rte_mempool *mempool,
 
 		ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
 		TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", burst_sz);
+		ref_op->ldpc_dec.iter_max = get_iter_max();
 		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
 			copy_reference_ldpc_dec_op(ops_enq, burst_sz, dequeued,
 					bufs->inputs,
diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c
index 1125395dbf..c26727cd35 100644
--- a/app/test-bbdev/test_bbdev_vector.c
+++ b/app/test-bbdev/test_bbdev_vector.c
@@ -532,10 +532,6 @@ parse_decoder_params(const char *key_token, char *token,
 		vector->mask |= TEST_BBDEV_VF_RV_INDEX;
 		turbo_dec->rv_index = (uint8_t) strtoul(token, &err, 0);
 		ret = ((err == NULL) || (*err != '\0')) ? -1 : 0;
-	} else if (!strcmp(key_token, "iter_max")) {
-		vector->mask |= TEST_BBDEV_VF_ITER_MAX;
-		turbo_dec->iter_max = (uint8_t) strtoul(token, &err, 0);
-		ret = ((err == NULL) || (*err != '\0')) ? -1 : 0;
 	} else if (!strcmp(key_token, "iter_min")) {
 		vector->mask |= TEST_BBDEV_VF_ITER_MIN;
 		turbo_dec->iter_min = (uint8_t) strtoul(token, &err, 0);
@@ -862,10 +858,6 @@ parse_ldpc_decoder_params(const char *key_token, char *token,
 		vector->mask |= TEST_BBDEV_VF_EXPECTED_ITER_COUNT;
 		ldpc_dec->iter_count = (uint8_t) strtoul(token, &err, 0);
 		ret = ((err == NULL) || (*err != '\0')) ? -1 : 0;
-	} else if (!strcmp(key_token, "iter_max")) {
-		vector->mask |= TEST_BBDEV_VF_ITER_MAX;
-		ldpc_dec->iter_max = (uint8_t) strtoul(token, &err, 0);
-		ret = ((err == NULL) || (*err != '\0')) ? -1 : 0;
 	} else if (!strcmp(key_token, "code_block_mode")) {
 		vector->mask |= TEST_BBDEV_VF_CODE_BLOCK_MODE;
 		ldpc_dec->code_block_mode = (uint8_t) strtoul(token, &err, 0);
@@ -1260,9 +1252,6 @@ check_decoder(struct test_bbdev_vector *vector)
 	if (!(mask & TEST_BBDEV_VF_ITER_MIN))
 		printf(
 			"WARNING: iter_min was not specified in vector file and will be set to 0\n");
-	if (!(mask & TEST_BBDEV_VF_ITER_MAX))
-		printf(
-			"WARNING: iter_max was not specified in vector file and will be set to 0\n");
 	if (!(mask & TEST_BBDEV_VF_EXPECTED_ITER_COUNT))
 		printf(
 			"WARNING: expected_iter_count was not specified in vector file and iter_count will not be validated\n");
@@ -1335,9 +1324,6 @@ check_ldpc_decoder(struct test_bbdev_vector *vector)
 	if (!(mask & TEST_BBDEV_VF_RV_INDEX))
 		printf(
 			"INFO: rv_index was not specified in vector file and will be set to 0\n");
-	if (!(mask & TEST_BBDEV_VF_ITER_MAX))
-		printf(
-			"WARNING: iter_max was not specified in vector file and will be set to 0\n");
 	if (!(mask & TEST_BBDEV_VF_EXPECTED_ITER_COUNT))
 		printf(
 			"WARNING: expected_iter_count was not specified in vector file and iter_count will not be validated\n");
diff --git a/app/test-bbdev/test_bbdev_vector.h b/app/test-bbdev/test_bbdev_vector.h
index 4c53e8f137..2ea271ffb7 100644
--- a/app/test-bbdev/test_bbdev_vector.h
+++ b/app/test-bbdev/test_bbdev_vector.h
@@ -19,7 +19,6 @@ enum {
 	TEST_BBDEV_VF_C = (1ULL << 7),
 	TEST_BBDEV_VF_CAB = (1ULL << 8),
 	TEST_BBDEV_VF_RV_INDEX = (1ULL << 9),
-	TEST_BBDEV_VF_ITER_MAX = (1ULL << 10),
 	TEST_BBDEV_VF_ITER_MIN = (1ULL << 11),
 	TEST_BBDEV_VF_EXPECTED_ITER_COUNT = (1ULL << 12),
 	TEST_BBDEV_VF_EXT_SCALE = (1ULL << 13),
diff --git a/app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_0.data b/app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_0.data
index 5d4d27d607..215c30a610 100644
--- a/app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_0.data
+++ b/app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_0.data
@@ -340,9 +340,6 @@ rv_index=
 code_block_mode=
 1
 
-iter_max=
-20
-
 expected_iter_count=
 20
 
diff --git a/app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_1.data b/app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_1.data
index 63c2d3b618..09ffd7b40a 100644
--- a/app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_1.data
+++ b/app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_1.data
@@ -671,9 +671,6 @@ rv_index=
 code_block_mode=
 1
 
-iter_max=
-20
-
 expected_iter_count=
 4
 
diff --git a/app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_2.data b/app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_2.data
index 2463df6178..c1cd088498 100644
--- a/app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_2.data
+++ b/app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_2.data
@@ -889,9 +889,6 @@ rv_index=
 code_block_mode=
 1
 
-iter_max=
-20
-
 expected_iter_count=
 3
 
diff --git a/app/test-bbdev/test_vectors/ldpc_dec_v11835.data b/app/test-bbdev/test_vectors/ldpc_dec_v11835.data
index 84a04e11cc..e899b95e74 100644
--- a/app/test-bbdev/test_vectors/ldpc_dec_v11835.data
+++ b/app/test-bbdev/test_vectors/ldpc_dec_v11835.data
@@ -36,9 +36,6 @@ rv_index=
 code_block_mode=
 1
 
-iter_max=
-20
-
 expected_iter_count=
 4
 
diff --git a/app/test-bbdev/test_vectors/ldpc_dec_v2342_drop.data b/app/test-bbdev/test_vectors/ldpc_dec_v2342_drop.data
index f30726e46a..31fef581b2 100644
--- a/app/test-bbdev/test_vectors/ldpc_dec_v2342_drop.data
+++ b/app/test-bbdev/test_vectors/ldpc_dec_v2342_drop.data
@@ -732,9 +732,6 @@ rv_index =
 code_block_mode =
 1
 
-iter_max =
-20
-
 expected_iter_count =
 3
 
diff --git a/app/test-bbdev/test_vectors/ldpc_dec_v7813.data b/app/test-bbdev/test_vectors/ldpc_dec_v7813.data
index c656fd3e4a..de8fbbc08c 100644
--- a/app/test-bbdev/test_vectors/ldpc_dec_v7813.data
+++ b/app/test-bbdev/test_vectors/ldpc_dec_v7813.data
@@ -35,9 +35,6 @@ rv_index =
 code_block_mode =
 1
 
-iter_max =
-8
-
 expected_iter_count =
 6
 
diff --git a/app/test-bbdev/test_vectors/ldpc_dec_v8480.data b/app/test-bbdev/test_vectors/ldpc_dec_v8480.data
index ddebf7bee1..197ed837cb 100644
--- a/app/test-bbdev/test_vectors/ldpc_dec_v8480.data
+++ b/app/test-bbdev/test_vectors/ldpc_dec_v8480.data
@@ -61,9 +61,6 @@ rv_index =
 code_block_mode =
 1
 
-iter_max =
-8
-
 expected_iter_count =
 3
 
diff --git a/app/test-bbdev/test_vectors/ldpc_dec_v8568.data b/app/test-bbdev/test_vectors/ldpc_dec_v8568.data
index 0b95e4e0fa..b84361f247 100644
--- a/app/test-bbdev/test_vectors/ldpc_dec_v8568.data
+++ b/app/test-bbdev/test_vectors/ldpc_dec_v8568.data
@@ -242,9 +242,6 @@ rv_index =
 code_block_mode =
 1
 
-iter_max =
-20
-
 expected_iter_count =
 6
 
diff --git a/app/test-bbdev/test_vectors/ldpc_dec_v9503.data b/app/test-bbdev/test_vectors/ldpc_dec_v9503.data
index 7699ae3157..4471f8bf5e 100644
--- a/app/test-bbdev/test_vectors/ldpc_dec_v9503.data
+++ b/app/test-bbdev/test_vectors/ldpc_dec_v9503.data
@@ -1202,9 +1202,6 @@ rv_index =
 code_block_mode =
 1
 
-iter_max =
-20
-
 expected_iter_count =
 3
 
diff --git a/app/test-bbdev/test_vectors/turbo_dec_c1_k40_r0_e17280_sbd_negllr.data b/app/test-bbdev/test_vectors/turbo_dec_c1_k40_r0_e17280_sbd_negllr.data
index d98210ff6f..f147c8af53 100644
--- a/app/test-bbdev/test_vectors/turbo_dec_c1_k40_r0_e17280_sbd_negllr.data
+++ b/app/test-bbdev/test_vectors/turbo_dec_c1_k40_r0_e17280_sbd_negllr.data
@@ -31,9 +31,6 @@ k =
 rv_index =
 1
 
-iter_max =
-8
-
 iter_min =
 4
 
diff --git a/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_high_snr.data b/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_high_snr.data
index 3472c992fd..635078ab27 100644
--- a/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_high_snr.data
+++ b/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_high_snr.data
@@ -617,9 +617,6 @@ k =
 e =
 10376
 
-iter_max =
-8
-
 iter_min =
 4
 
diff --git a/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_low_snr.data b/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_low_snr.data
index 8ff71aac42..de6136bd1b 100644
--- a/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_low_snr.data
+++ b/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e10376_crc24b_sbd_negllr_low_snr.data
@@ -617,9 +617,6 @@ k =
 e =
 10376
 
-iter_max =
-8
-
 iter_min =
 4
 
diff --git a/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e34560_posllr.data b/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e34560_posllr.data
index fe4f5eefd2..cb28ee1e97 100644
--- a/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e34560_posllr.data
+++ b/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e34560_posllr.data
@@ -620,9 +620,6 @@ k =
 rv_index =
 0
 
-iter_max =
-8
-
 iter_min =
 4
 
diff --git a/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e34560_sbd_negllr.data b/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e34560_sbd_negllr.data
index b5ef624616..8ec4911d3c 100644
--- a/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e34560_sbd_negllr.data
+++ b/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e34560_sbd_negllr.data
@@ -1198,9 +1198,6 @@ k =
 rv_index =
 0
 
-iter_max =
-8
-
 iter_min =
 4
 
diff --git a/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e34560_sbd_posllr.data b/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e34560_sbd_posllr.data
index 13ad0908ce..b6a73c6c07 100644
--- a/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e34560_sbd_posllr.data
+++ b/app/test-bbdev/test_vectors/turbo_dec_c1_k6144_r0_e34560_sbd_posllr.data
@@ -1199,9 +1199,6 @@ k =
 rv_index =
 0
 
-iter_max =
-8
-
 iter_min =
 4
 
diff --git a/app/test-bbdev/test_vectors/turbo_dec_c2_k3136_r0_e4920_sbd_negllr_crc24b.data b/app/test-bbdev/test_vectors/turbo_dec_c2_k3136_r0_e4920_sbd_negllr_crc24b.data
index cfff56ad9a..9d17b86c43 100644
--- a/app/test-bbdev/test_vectors/turbo_dec_c2_k3136_r0_e4920_sbd_negllr_crc24b.data
+++ b/app/test-bbdev/test_vectors/turbo_dec_c2_k3136_r0_e4920_sbd_negllr_crc24b.data
@@ -651,9 +651,6 @@ k_pos =
 rv_index =
 0
 
-iter_max =
-8
-
 iter_min =
 4
 
-- 
2.37.1


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

* [PATCH v2 16/16] test/bbdev: remove iter count from bler test
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
                   ` (14 preceding siblings ...)
  2023-02-15 17:09 ` [PATCH v2 15/16] test/bbdev: remove max iteration from vectors Hernan Vargas
@ 2023-02-15 17:09 ` Hernan Vargas
  2023-02-22 11:01   ` Maxime Coquelin
  2023-02-20 15:31 ` [PATCH v2 00/16] test/bbdev: changes for 23.03 Maxime Coquelin
  16 siblings, 1 reply; 40+ messages in thread
From: Hernan Vargas @ 2023-02-15 17:09 UTC (permalink / raw)
  To: dev, maxime.coquelin, gakhil, trix
  Cc: nicolas.chautru, qi.z.zhang, Hernan Vargas

iter_count doesn't need to be set equal to iter_max for bler tests. This
is only needed in throughput and latency tests because early termination
is disabled for those tests.

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
---
 app/test-bbdev/test_bbdev_perf.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index 2baa2a0e62..621feee42b 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -3714,12 +3714,10 @@ bler_pmd_lcore_ldpc_dec(void *arg)
 	TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", num_ops);
 
 	/* For BLER tests we need to enable early termination */
-	if (!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;
+	if (!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;
+
 	ref_op->ldpc_dec.iter_max = get_iter_max();
-	ref_op->ldpc_dec.iter_count = ref_op->ldpc_dec.iter_max;
 
 	if (test_vector.op_type != RTE_BBDEV_OP_NONE)
 		copy_reference_ldpc_dec_op(ops_enq, num_ops, 0, bufs->inputs,
@@ -3838,12 +3836,10 @@ bler_pmd_lcore_turbo_dec(void *arg)
 	TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", num_ops);
 
 	/* For BLER tests we need to enable early termination */
-	if (!check_bit(ref_op->turbo_dec.op_flags,
-			RTE_BBDEV_TURBO_EARLY_TERMINATION))
-		ref_op->turbo_dec.op_flags +=
-				RTE_BBDEV_TURBO_EARLY_TERMINATION;
+	if (!check_bit(ref_op->turbo_dec.op_flags, RTE_BBDEV_TURBO_EARLY_TERMINATION))
+		ref_op->turbo_dec.op_flags += RTE_BBDEV_TURBO_EARLY_TERMINATION;
+
 	ref_op->turbo_dec.iter_max = get_iter_max();
-	ref_op->turbo_dec.iter_count = ref_op->turbo_dec.iter_max;
 
 	if (test_vector.op_type != RTE_BBDEV_OP_NONE)
 		copy_reference_dec_op(ops_enq, num_ops, 0, bufs->inputs,
-- 
2.37.1


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

* Re: [PATCH v2 00/16] test/bbdev: changes for 23.03
  2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
                   ` (15 preceding siblings ...)
  2023-02-15 17:09 ` [PATCH v2 16/16] test/bbdev: remove iter count from bler test Hernan Vargas
@ 2023-02-20 15:31 ` Maxime Coquelin
  16 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-20 15:31 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang

Hi Hernan,

In order to make reviewers and maintainers task easier, please apply the
R-by and A-by given on previous revisions for patches that haven't
changed.

You can do it automatically when initiating a new revision by applying
the previous one from patchwork, which takes care of adding them.

Thanks,
Maxime

On 2/15/23 18:09, Hernan Vargas wrote:
> v2: Made changes requested during review. Added 3 commits.
> v1: Upstreaming bbdev-test changes for 23.03.
> 
> Hernan Vargas (16):
>    test/bbdev: fix seg fault for non supported HARQ len
>    test/bbdev: extend HARQ tolerance
>    test/bbdev: refactor TB throughput report
>    test/bbdev: add timeout for latency tests
>    test/bbdev: enable early termination for validation
>    test/bbdev: report device status in test-bbdev
>    test/bbdev: test start/stop bbdev API
>    test/bbdev: add support for BLER for 4G
>    test/bbdev: extend support for large TB
>    test/bbdev: adjustment for soft output
>    test/bbdev: expose warning counters
>    test/bbdev: remove check for invalid opaque data
>    test/bbdev: remove iteration count check
>    test/bbdev: use mbuf reset function
>    test/bbdev: remove max iteration from vectors
>    test/bbdev: remove iter count from bler test
> 
>   app/test-bbdev/test_bbdev_perf.c              | 400 +++++++++++++-----
>   app/test-bbdev/test_bbdev_vector.c            |  14 -
>   app/test-bbdev/test_bbdev_vector.h            |   1 -
>   .../test_vectors/ldpc_dec_HARQ_1_0.data       |   3 -
>   .../test_vectors/ldpc_dec_HARQ_1_1.data       |   3 -
>   .../test_vectors/ldpc_dec_HARQ_1_2.data       |   3 -
>   .../test_vectors/ldpc_dec_v11835.data         |   3 -
>   .../test_vectors/ldpc_dec_v2342_drop.data     |   3 -
>   .../test_vectors/ldpc_dec_v7813.data          |   3 -
>   .../test_vectors/ldpc_dec_v8480.data          |   3 -
>   .../test_vectors/ldpc_dec_v8568.data          |   3 -
>   .../test_vectors/ldpc_dec_v9503.data          |   3 -
>   ...turbo_dec_c1_k40_r0_e17280_sbd_negllr.data |   3 -
>   ..._r0_e10376_crc24b_sbd_negllr_high_snr.data |   3 -
>   ...4_r0_e10376_crc24b_sbd_negllr_low_snr.data |   3 -
>   .../turbo_dec_c1_k6144_r0_e34560_posllr.data  |   3 -
>   ...rbo_dec_c1_k6144_r0_e34560_sbd_negllr.data |   3 -
>   ...rbo_dec_c1_k6144_r0_e34560_sbd_posllr.data |   3 -
>   ...c_c2_k3136_r0_e4920_sbd_negllr_crc24b.data |   3 -
>   19 files changed, 301 insertions(+), 162 deletions(-)
> 


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

* Re: [PATCH v2 01/16] test/bbdev: fix seg fault for non supported HARQ len
  2023-02-15 17:09 ` [PATCH v2 01/16] test/bbdev: fix seg fault for non supported HARQ len Hernan Vargas
@ 2023-02-20 16:08   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-20 16:08 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang, stable



On 2/15/23 18:09, Hernan Vargas wrote:
> Fix segmentation fault happening in corner case in test-bbdev.
> This fault could happen when running some specific vectors which size
> are not supported by the PMD.
> 
> Fixes: 335c11fd276 ("app/bbdev: support HARQ validation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 45e1780df7..027f32cbf1 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -84,7 +84,7 @@
>   /* Increment for next code block in external HARQ memory */
>   #define HARQ_INCR 32768
>   /* Headroom for filler LLRs insertion in HARQ buffer */
> -#define FILLER_HEADROOM 1024
> +#define FILLER_HEADROOM 2048
>   /* Constants from K0 computation from 3GPP 38.212 Table 5.4.2.1-2 */
>   #define N_ZC_1 66 /* N = 66 Zc for BG 1 */
>   #define N_ZC_2 50 /* N = 50 Zc for BG 2 */
> @@ -2111,9 +2111,9 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
>   					ops_ld->n_filler;
>   			if (data_len > deRmOutSize)
>   				data_len = deRmOutSize;
> -			if (data_len > orig_op->segments[i].length)
> -				data_len = orig_op->segments[i].length;
>   		}
> +		if (data_len > orig_op->segments[i].length)
> +			data_len = orig_op->segments[i].length;
>   		/*
>   		 * HARQ output can have minor differences
>   		 * due to integer representation and related scaling

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* Re: [PATCH v2 02/16] test/bbdev: extend HARQ tolerance
  2023-02-15 17:09 ` [PATCH v2 02/16] test/bbdev: extend HARQ tolerance Hernan Vargas
@ 2023-02-20 16:09   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-20 16:09 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang, stable



On 2/15/23 18:09, Hernan Vargas wrote:
> HARQ memory implementation could have different size assumptions.
> Extending HARQ tolerance to cover different implementations.
> 
> Fixes: 335c11fd276 ("app/bbdev: support HARQ validation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 11 ++++++++---
>   1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 027f32cbf1..74e7e13940 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -95,6 +95,7 @@
>   #define K0_3_1 56 /* K0 fraction numerator for rv 3 and BG 1 */
>   #define K0_3_2 43 /* K0 fraction numerator for rv 3 and BG 2 */
>   
> +#define HARQ_MEM_TOLERANCE 256
>   static struct test_bbdev_vector test_vector;
>   
>   /* Switch between PMD and Interrupt for throughput TC */
> @@ -2090,13 +2091,17 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
>   		uint16_t data_len = rte_pktmbuf_data_len(m) - offset;
>   		total_data_size += orig_op->segments[i].length;
>   
> -		TEST_ASSERT(orig_op->segments[i].length <
> -				(uint32_t)(data_len + 64),
> +		TEST_ASSERT(orig_op->segments[i].length < (uint32_t)(data_len + HARQ_MEM_TOLERANCE),
>   				"Length of segment differ in original (%u) and filled (%u) op",
>   				orig_op->segments[i].length, data_len);
>   		harq_orig = (int8_t *) orig_op->segments[i].addr;
>   		harq_out = rte_pktmbuf_mtod_offset(m, int8_t *, offset);
>   
> +		/* Cannot compare HARQ output data for such cases */
> +		if ((ldpc_llr_decimals > 1) && ((ops_ld->op_flags & RTE_BBDEV_LDPC_LLR_COMPRESSION)
> +				|| (ops_ld->op_flags & RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION)))
> +			break;
> +
>   		if (!(ldpc_cap_flags &
>   				RTE_BBDEV_LDPC_INTERNAL_HARQ_MEMORY_FILLERS
>   				) || (ops_ld->op_flags &
> @@ -2172,7 +2177,7 @@ validate_op_harq_chain(struct rte_bbdev_op_data *op,
>   
>   	/* Validate total mbuf pkt length */
>   	uint32_t pkt_len = rte_pktmbuf_pkt_len(op->data) - op->offset;
> -	TEST_ASSERT(total_data_size < pkt_len + 64,
> +	TEST_ASSERT(total_data_size < pkt_len + HARQ_MEM_TOLERANCE,
>   			"Length of data differ in original (%u) and filled (%u) op",
>   			total_data_size, pkt_len);
>   

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* Re: [PATCH v2 03/16] test/bbdev: refactor TB throughput report
  2023-02-15 17:09 ` [PATCH v2 03/16] test/bbdev: refactor TB throughput report Hernan Vargas
@ 2023-02-20 16:10   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-20 16:10 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang



On 2/15/23 18:09, Hernan Vargas wrote:
> Refactor calculation for tb_size.
> No functional impact.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 38 ++++++++++++++------------------
>   1 file changed, 16 insertions(+), 22 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
  2023-02-15 17:09 ` [PATCH v2 04/16] test/bbdev: add timeout for latency tests Hernan Vargas
@ 2023-02-20 16:32   ` Maxime Coquelin
  2023-02-22 21:13     ` Vargas, Hernan
  0 siblings, 1 reply; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-20 16:32 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang



On 2/15/23 18:09, Hernan Vargas wrote:
> Add a timeout to force exit the latency tests in case dequeue never
> happens.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
>   1 file changed, 19 insertions(+), 5 deletions(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 19b9a5b119..dede0f900e 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -26,6 +26,7 @@
>   
>   #define MAX_QUEUES RTE_MAX_LCORE
>   #define TEST_REPETITIONS 100
> +#define TIME_OUT_POLL 1e8
>   #define WAIT_OFFLOAD_US 1000
>   
>   #ifdef RTE_BASEBAND_FPGA_LTE_FEC
> @@ -4546,6 +4547,7 @@ latency_test_ldpc_dec(struct rte_mempool *mempool,
>   
>   	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>   		uint16_t enq = 0, deq = 0;
> +		uint32_t time_out = 0;
>   		bool first_time = true;
>   		last_time = 0;
>   
> @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool *mempool,
>   				last_time = rte_rdtsc_precise() - start_time;
>   				first_time = false;
>   			}
> -		} while (unlikely(burst_sz != deq));
> +			time_out++;
> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>   
>   		*max_time = RTE_MAX(*max_time, last_time);
>   		*min_time = RTE_MIN(*min_time, last_time);
> @@ -4606,7 +4609,12 @@ latency_test_ldpc_dec(struct rte_mempool *mempool,
>   		if (extDdr)
>   			retrieve_harq_ddr(dev_id, queue_id, ops_enq, burst_sz);
>   
> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> +		if (burst_sz != deq) {
> +			struct rte_bbdev_info info;
> +			ret = TEST_FAILED;
> +			rte_bbdev_info_get(dev_id, &info);

What is the point of calling rte_bbdev_info_get() here and below?
info is not used afterwards.

> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>   			ret = validate_ldpc_dec_op(ops_deq, burst_sz, ref_op,
>   					vector_mask);
>   			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
> @@ -4632,6 +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
>   
>   	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>   		uint16_t enq = 0, deq = 0;
> +		uint32_t time_out = 0;
>   		bool first_time = true;
>   		last_time = 0;
>   
> @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool *mempool,
>   				last_time += rte_rdtsc_precise() - start_time;
>   				first_time = false;
>   			}
> -		} while (unlikely(burst_sz != deq));
> +			time_out++;
> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>   
>   		*max_time = RTE_MAX(*max_time, last_time);
>   		*min_time = RTE_MIN(*min_time, last_time);
>   		*total_time += last_time;
> -
> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> +		if (burst_sz != deq) {
> +			struct rte_bbdev_info info;
> +			ret = TEST_FAILED;
> +			rte_bbdev_info_get(dev_id, &info);

Same here.

> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>   			ret = validate_enc_op(ops_deq, burst_sz, ref_op);
>   			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
>   		}


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

* Re: [PATCH v2 05/16] test/bbdev: enable early termination for validation
  2023-02-15 17:09 ` [PATCH v2 05/16] test/bbdev: enable early termination for validation Hernan Vargas
@ 2023-02-20 20:12   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-20 20:12 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang



On 2/15/23 18:09, Hernan Vargas wrote:
> Enhancement to enable early termination for validation tests if the
> device supports it.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 30 +++++++++++++++++++-----------
>   1 file changed, 19 insertions(+), 11 deletions(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index dede0f900e..8c4b82efca 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -3775,11 +3775,11 @@ throughput_pmd_lcore_ldpc_dec(void *arg)
>   	TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", num_ops);
>   
>   	/* For throughput tests we need to disable early termination */
> -	if (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;
> +	if (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;
> +
>   	ref_op->ldpc_dec.iter_max = get_iter_max();
> +	/* Since ET is disabled, the expected iter_count is iter_max */
>   	ref_op->ldpc_dec.iter_count = ref_op->ldpc_dec.iter_max;
>   
>   	if (test_vector.op_type != RTE_BBDEV_OP_NONE)
> @@ -4465,7 +4465,7 @@ latency_test_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;
> @@ -4481,8 +4481,14 @@ latency_test_dec(struct rte_mempool *mempool,
>   			burst_sz = num_to_process - dequeued;
>   
>   		ret = rte_bbdev_dec_op_alloc_bulk(mempool, ops_enq, burst_sz);
> -		TEST_ASSERT_SUCCESS(ret,
> -				"rte_bbdev_dec_op_alloc_bulk() failed");
> +		TEST_ASSERT_SUCCESS(ret, "rte_bbdev_dec_op_alloc_bulk() failed");
> +
> +		ref_op->turbo_dec.iter_max = get_iter_max();
> +		/* For validation tests we want to enable early termination */
> +		if (!disable_et && !check_bit(ref_op->turbo_dec.op_flags,
> +				RTE_BBDEV_TURBO_EARLY_TERMINATION))
> +			ref_op->turbo_dec.op_flags |= RTE_BBDEV_TURBO_EARLY_TERMINATION;
> +
>   		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
>   			copy_reference_dec_op(ops_enq, burst_sz, dequeued,
>   					bufs->inputs,
> @@ -4561,10 +4567,12 @@ latency_test_ldpc_dec(struct rte_mempool *mempool,
>   		/* For latency tests we need to disable early termination */
>   		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;
> +			ref_op->ldpc_dec.op_flags -= RTE_BBDEV_LDPC_ITERATION_STOP_ENABLE;
> +
>   		ref_op->ldpc_dec.iter_max = get_iter_max();
> -		ref_op->ldpc_dec.iter_count = ref_op->ldpc_dec.iter_max;
> +		/* When ET is disabled, the expected iter_count is iter_max */
> +		if (disable_et)
> +			ref_op->ldpc_dec.iter_count = ref_op->ldpc_dec.iter_max;
>   
>   		if (test_vector.op_type != RTE_BBDEV_OP_NONE)
>   			copy_reference_ldpc_dec_op(ops_enq, burst_sz, dequeued,
> @@ -4873,7 +4881,7 @@ validation_latency_test(struct active_device *ad,
>   		iter = latency_test_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);
> +				burst_sz, &total_time, &min_time, &max_time, latency_flag);
>   	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,

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* Re: [PATCH v2 06/16] test/bbdev: report device status in test-bbdev
  2023-02-15 17:09 ` [PATCH v2 06/16] test/bbdev: report device status in test-bbdev Hernan Vargas
@ 2023-02-20 20:17   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-20 20:17 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang



On 2/15/23 18:09, Hernan Vargas wrote:
> No functional impact.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 8c4b82efca..057fb5ac9e 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -850,6 +850,8 @@ add_bbdev_dev(uint8_t dev_id, struct rte_bbdev_info *info,
>   #endif
>   	/* Let's refresh this now this is configured */
>   	rte_bbdev_info_get(dev_id, info);
> +	if (info->drv.device_status == RTE_BBDEV_DEV_FATAL_ERR)
> +		printf("Device Status %s\n", rte_bbdev_device_status_str(info->drv.device_status));
>   	nb_queues = RTE_MIN(rte_lcore_count(), info->drv.max_num_queues);
>   	nb_queues = RTE_MIN(nb_queues, (unsigned int) MAX_QUEUES);
>   

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* Re: [PATCH v2 07/16] test/bbdev: test start/stop bbdev API
  2023-02-15 17:09 ` [PATCH v2 07/16] test/bbdev: test start/stop bbdev API Hernan Vargas
@ 2023-02-20 20:21   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-20 20:21 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang



On 2/15/23 18:09, Hernan Vargas wrote:
> Add a call to queue start and queue stop specifically for testing the
> bbdev API.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 057fb5ac9e..e4eb71050a 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -890,6 +890,7 @@ add_bbdev_dev(uint8_t dev_id, struct rte_bbdev_info *info,
>   			ret = rte_bbdev_queue_configure(ad->dev_id, queue_id,
>   					&qconf);
>   		}
> +		rte_bbdev_queue_start(ad->dev_id, queue_id);

You may want to check the return value, that would be useful since the
goal is to test the API.

>   		if (ret != 0) {
>   			printf("All queues on dev %u allocated: %u\n",
>   					dev_id, queue_id);
> @@ -898,8 +899,8 @@ add_bbdev_dev(uint8_t dev_id, struct rte_bbdev_info *info,
>   		ad->queue_ids[queue_id] = queue_id;
>   	}
>   	TEST_ASSERT(queue_id != 0,
> -			"ERROR Failed to configure any queues on dev %u",
> -			dev_id);
> +			"ERROR Failed to configure any queues on dev %u\n"
> +			"\tthe device may not support or have been configured", dev_id);
>   	ad->nb_queues = queue_id;
>   
>   	set_avail_op(ad, op_type);
> @@ -3846,6 +3847,7 @@ throughput_pmd_lcore_ldpc_dec(void *arg)
>   		TEST_ASSERT_SUCCESS(ret, "Validation failed!");
>   	}
>   
> +	rte_bbdev_queue_stop(tp->dev_id, queue_id);

Ditto.

>   	rte_bbdev_dec_op_free_bulk(ops_enq, num_ops);
>   
>   	double tb_len_bits = calc_ldpc_dec_TB_size(ref_op);


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

* Re: [PATCH v2 08/16] test/bbdev: add support for BLER for 4G
  2023-02-15 17:09 ` [PATCH v2 08/16] test/bbdev: add support for BLER for 4G Hernan Vargas
@ 2023-02-22 10:48   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-22 10:48 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang



On 2/15/23 18:09, Hernan Vargas wrote:
> New feature to add BLER support for 4G in test-bbdev.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 183 ++++++++++++++++++++++++++++++-
>   1 file changed, 182 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index e4eb71050a..acfefb7efa 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -1757,6 +1757,30 @@ gen_qm2_llr(int8_t *llrs, uint32_t j, double N0, double llr_max)
>   	llrs[j] = (int8_t) b;
>   }
>   
> +/* Simple LLR generation assuming AWGN and QPSK */
> +static void
> +gen_turbo_llr(int8_t *llrs, uint32_t j, double N0, double llr_max)
> +{
> +	double b, b1, n;
> +	double coeff = 2.0 * sqrt(N0);
> +
> +	/* Ignore in vectors null LLRs not to be saturated */
> +	if (llrs[j] == 0)
> +		return;
> +
> +	/* Note don't change sign here */
> +	n = randn(j % 2);
> +	b1 = ((llrs[j] > 0 ? 2.0 : -2.0)
> +			+ coeff * n) / N0;
> +	b = b1 * (1 << 4);
> +	b = round(b);
> +	if (b > llr_max)
> +		b = llr_max;
> +	if (b < -llr_max)
> +		b = -llr_max;
> +	llrs[j] = (int8_t) b;
> +}
> +
>   /* Generate LLR for a given SNR */
>   static void
>   generate_llr_input(uint16_t n, struct rte_bbdev_op_data *inputs,
> @@ -1792,6 +1816,27 @@ generate_llr_input(uint16_t n, struct rte_bbdev_op_data *inputs,
>   	}
>   }
>   
> +/* Generate LLR for turbo decoder for a given SNR */
> +static void
> +generate_turbo_llr_input(uint16_t n, struct rte_bbdev_op_data *inputs,
> +		struct rte_bbdev_dec_op *ref_op)
> +{
> +	struct rte_mbuf *m;
> +	uint32_t i, j, range;
> +	double N0, llr_max;
> +
> +	llr_max = 127;
> +	range = ref_op->turbo_dec.input.length;
> +	N0 = 1.0 / pow(10.0, get_snr() / 10.0);
> +
> +	for (i = 0; i < n; ++i) {
> +		m = inputs[i].data;
> +		int8_t *llrs = rte_pktmbuf_mtod_offset(m, int8_t *, 0);
> +		for (j = 0; j < range; ++j)
> +			gen_turbo_llr(llrs, j, N0, llr_max);
> +	}
> +}
> +
>   static void
>   copy_reference_ldpc_dec_op(struct rte_bbdev_dec_op **ops, unsigned int n,
>   		unsigned int start_idx,
> @@ -2306,6 +2351,30 @@ validate_ldpc_bler(struct rte_bbdev_dec_op **ops, const uint16_t n)
>   	return errors;
>   }
>   
> +/* Check Number of code blocks errors */
> +static int
> +validate_turbo_bler(struct rte_bbdev_dec_op **ops, const uint16_t n)
> +{
> +	unsigned int i;
> +	struct op_data_entries *hard_data_orig = &test_vector.entries[DATA_HARD_OUTPUT];
> +	struct rte_bbdev_op_turbo_dec *ops_td;
> +	struct rte_bbdev_op_data *hard_output;
> +	int errors = 0;
> +	struct rte_mbuf *m;
> +
> +	for (i = 0; i < n; ++i) {
> +		ops_td = &ops[i]->turbo_dec;
> +		hard_output = &ops_td->hard_output;
> +		m = hard_output->data;
> +		if (memcmp(rte_pktmbuf_mtod_offset(m, uint32_t *, 0),
> +				hard_data_orig->segments[0].addr,
> +				hard_data_orig->segments[0].length))
> +			errors++;
> +	}
> +	return errors;
> +}
> +
> +
>   static int
>   validate_ldpc_dec_op(struct rte_bbdev_dec_op **ops, const uint16_t n,
>   		struct rte_bbdev_dec_op *ref_op, const int vector_mask)
> @@ -3738,6 +3807,114 @@ bler_pmd_lcore_ldpc_dec(void *arg)
>   	return TEST_SUCCESS;
>   }
>   
> +
> +static int
> +bler_pmd_lcore_turbo_dec(void *arg)
> +{
> +	struct thread_params *tp = arg;
> +	uint16_t enq, deq;
> +	uint64_t total_time = 0, start_time;
> +	const uint16_t queue_id = tp->queue_id;
> +	const uint16_t burst_sz = tp->op_params->burst_sz;
> +	const uint16_t num_ops = tp->op_params->num_to_process;
> +	struct rte_bbdev_dec_op *ops_enq[num_ops];
> +	struct rte_bbdev_dec_op *ops_deq[num_ops];
> +	struct rte_bbdev_dec_op *ref_op = tp->op_params->ref_dec_op;
> +	struct test_buffers *bufs = NULL;
> +	int i, j, ret;
> +	struct rte_bbdev_info info;
> +	uint16_t num_to_enq;
> +
> +	TEST_ASSERT_SUCCESS((burst_sz > MAX_BURST),
> +			"BURST_SIZE should be <= %u", MAX_BURST);
> +
> +	rte_bbdev_info_get(tp->dev_id, &info);
> +
> +	TEST_ASSERT_SUCCESS((num_ops > info.drv.queue_size_lim),
> +			"NUM_OPS cannot exceed %u for this device",
> +			info.drv.queue_size_lim);
> +
> +	bufs = &tp->op_params->q_bufs[GET_SOCKET(info.socket_id)][queue_id];
> +
> +	rte_wait_until_equal_16(&tp->op_params->sync, SYNC_START, __ATOMIC_RELAXED);
> +
> +	ret = rte_bbdev_dec_op_alloc_bulk(tp->op_params->mp, ops_enq, num_ops);
> +	TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", num_ops);
> +
> +	/* For BLER tests we need to enable early termination */
> +	if (!check_bit(ref_op->turbo_dec.op_flags,
> +			RTE_BBDEV_TURBO_EARLY_TERMINATION))
> +		ref_op->turbo_dec.op_flags +=
> +				RTE_BBDEV_TURBO_EARLY_TERMINATION;
> +	ref_op->turbo_dec.iter_max = get_iter_max();
> +	ref_op->turbo_dec.iter_count = ref_op->turbo_dec.iter_max;
> +
> +	if (test_vector.op_type != RTE_BBDEV_OP_NONE)
> +		copy_reference_dec_op(ops_enq, num_ops, 0, bufs->inputs,
> +				bufs->hard_outputs, bufs->soft_outputs,
> +				ref_op);
> +	generate_turbo_llr_input(num_ops, bufs->inputs, ref_op);
> +
> +	/* Set counter to validate the ordering */
> +	for (j = 0; j < num_ops; ++j)
> +		ops_enq[j]->opaque_data = (void *)(uintptr_t)j;
> +
> +	for (i = 0; i < 1; ++i) { /* Could add more iterations */
> +		for (j = 0; j < num_ops; ++j) {
> +			mbuf_reset(
> +			ops_enq[j]->turbo_dec.hard_output.data);
> +		}
> +
> +		start_time = rte_rdtsc_precise();
> +
> +		for (enq = 0, deq = 0; enq < num_ops;) {
> +			num_to_enq = burst_sz;
> +
> +			if (unlikely(num_ops - enq < num_to_enq))
> +				num_to_enq = num_ops - enq;
> +
> +			enq += rte_bbdev_enqueue_dec_ops(tp->dev_id,
> +					queue_id, &ops_enq[enq], num_to_enq);
> +
> +			deq += rte_bbdev_dequeue_dec_ops(tp->dev_id,
> +					queue_id, &ops_deq[deq], enq - deq);

Please check my reply on v1.

> +		}
> +
> +		/* dequeue the remaining */
> +		while (deq < enq) {
> +			deq += rte_bbdev_dequeue_dec_ops(tp->dev_id,
> +					queue_id, &ops_deq[deq], enq - deq);
> +		}
> +
> +		total_time += rte_rdtsc_precise() - start_time;
> +	}
> +
> +	tp->iter_count = 0;
> +	tp->iter_average = 0;
> +	/* get the max of iter_count for all dequeued ops */
> +	for (i = 0; i < num_ops; ++i) {
> +		tp->iter_count = RTE_MAX(ops_enq[i]->turbo_dec.iter_count,
> +				tp->iter_count);
> +		tp->iter_average += (double) ops_enq[i]->turbo_dec.iter_count;
> +	}
> +
> +	tp->iter_average /= num_ops;
> +	tp->bler = (double) validate_turbo_bler(ops_deq, num_ops) / num_ops;
> +
> +	rte_bbdev_dec_op_free_bulk(ops_enq, num_ops);
> +
> +	double tb_len_bits = calc_dec_TB_size(ref_op);
> +	tp->ops_per_sec = ((double)num_ops * 1) /
> +			((double)total_time / (double)rte_get_tsc_hz());
> +	tp->mbps = (((double)(num_ops * 1 * tb_len_bits)) /
> +			1000000.0) / ((double)total_time /
> +			(double)rte_get_tsc_hz());
> +	printf("TBS %.0f Time %.0f\n", tb_len_bits, 1000000.0 *
> +			((double)total_time / (double)rte_get_tsc_hz()));
> +
> +	return TEST_SUCCESS;
> +}
> +
>   static int
>   throughput_pmd_lcore_ldpc_dec(void *arg)
>   {
> @@ -4195,7 +4372,7 @@ print_dec_bler(struct thread_params *t_params, unsigned int used_cores)
>   	total_bler /= used_cores;
>   	total_iter /= used_cores;
>   
> -	printf("SNR %.2f BLER %.1f %% - Iterations %.1f %d - Tp %.1f Mbps %s\n",
> +	printf("SNR %.2f BLER %.1f %% - Iterations %.1f %d - Tp %.3f Mbps %s\n",
>   			snr, total_bler * 100, total_iter, get_iter_max(),
>   			total_mbps, get_vector_filename());
>   }
> @@ -4247,6 +4424,10 @@ bler_test(struct active_device *ad,
>   			&& !check_bit(test_vector.ldpc_dec.op_flags,
>   			RTE_BBDEV_LDPC_LLR_COMPRESSION))
>   		bler_function = bler_pmd_lcore_ldpc_dec;
> +	else if ((test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC) &&
> +			!check_bit(test_vector.turbo_dec.op_flags,
> +			RTE_BBDEV_TURBO_SOFT_OUTPUT))
> +		bler_function = bler_pmd_lcore_turbo_dec;
>   	else
>   		return TEST_SKIPPED;
>   


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

* Re: [PATCH v2 09/16] test/bbdev: extend support for large TB
  2023-02-15 17:09 ` [PATCH v2 09/16] test/bbdev: extend support for large TB Hernan Vargas
@ 2023-02-22 10:49   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-22 10:49 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang



On 2/15/23 18:09, Hernan Vargas wrote:
> Add support for large TB when it cannot fit into a true mbuf.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 21 ++++++++++++---------
>   1 file changed, 12 insertions(+), 9 deletions(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index acfefb7efa..bdddf4f8b2 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -1073,8 +1073,6 @@ init_op_data_objs(struct rte_bbdev_op_data *bufs,
>   			 * Special case when DPDK mbuf cannot handle
>   			 * the required input size
>   			 */
> -			printf("Warning: Larger input size than DPDK mbuf %d\n",
> -					seg->length);
>   			large_input = true;
>   		}
>   		bufs[i].data = m_head;
> @@ -2031,6 +2029,7 @@ validate_op_chain(struct rte_bbdev_op_data *op,
>   	struct rte_mbuf *m = op->data;
>   	uint8_t nb_dst_segments = orig_op->nb_segments;
>   	uint32_t total_data_size = 0;
> +	bool ignore_mbuf = false; /* ignore mbuf limitations */
>   
>   	TEST_ASSERT(nb_dst_segments == m->nb_segs,
>   			"Number of segments differ in original (%u) and filled (%u) op",
> @@ -2043,21 +2042,25 @@ validate_op_chain(struct rte_bbdev_op_data *op,
>   		uint16_t data_len = rte_pktmbuf_data_len(m) - offset;
>   		total_data_size += orig_op->segments[i].length;
>   
> -		TEST_ASSERT(orig_op->segments[i].length == data_len,
> -				"Length of segment differ in original (%u) and filled (%u) op",
> -				orig_op->segments[i].length, data_len);
> +		if (orig_op->segments[i].length > RTE_BBDEV_LDPC_E_MAX_MBUF)
> +			ignore_mbuf = true;
> +		if (!ignore_mbuf)
> +			TEST_ASSERT(orig_op->segments[i].length == data_len,
> +					"Length of segment differ in original (%u) and filled (%u) op",
> +					orig_op->segments[i].length, data_len);
>   		TEST_ASSERT_BUFFERS_ARE_EQUAL(orig_op->segments[i].addr,
>   				rte_pktmbuf_mtod_offset(m, uint32_t *, offset),
> -				data_len,
> +				orig_op->segments[i].length,
>   				"Output buffers (CB=%u) are not equal", i);
>   		m = m->next;
>   	}
>   
>   	/* Validate total mbuf pkt length */
>   	uint32_t pkt_len = rte_pktmbuf_pkt_len(op->data) - op->offset;
> -	TEST_ASSERT(total_data_size == pkt_len,
> -			"Length of data differ in original (%u) and filled (%u) op",
> -			total_data_size, pkt_len);
> +	if (!ignore_mbuf)
> +		TEST_ASSERT(total_data_size == pkt_len,
> +				"Length of data differ in original (%u) and filled (%u) op",
> +				total_data_size, pkt_len);
>   
>   	return TEST_SUCCESS;
>   }

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* Re: [PATCH v2 10/16] test/bbdev: adjustment for soft output
  2023-02-15 17:09 ` [PATCH v2 10/16] test/bbdev: adjustment for soft output Hernan Vargas
@ 2023-02-22 10:50   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-22 10:50 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang



On 2/15/23 18:09, Hernan Vargas wrote:
> Extend test-bbdev for soft output check, notably due to the logic in
> test-bbdev to enable termination changing.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 26 +++++++++++++-------------
>   1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index bdddf4f8b2..00090f863f 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -1349,6 +1349,7 @@ fill_queue_buffers(struct test_op_params *op_params,
>   				RTE_BBDEV_LDPC_LLR_COMPRESSION;
>   		bool harq_comp = op_params->ref_dec_op->ldpc_dec.op_flags &
>   				RTE_BBDEV_LDPC_HARQ_6BIT_COMPRESSION;
> +
>   		ldpc_llr_decimals = capabilities->cap.ldpc_dec.llr_decimals;
>   		ldpc_llr_size = capabilities->cap.ldpc_dec.llr_size;
>   		ldpc_cap_flags = capabilities->cap.ldpc_dec.capability_flags;
> @@ -2424,7 +2425,7 @@ validate_ldpc_dec_op(struct rte_bbdev_dec_op **ops, const uint16_t n,
>   					i);
>   
>   		if (ref_op->ldpc_dec.op_flags & RTE_BBDEV_LDPC_SOFT_OUT_ENABLE)
> -			TEST_ASSERT_SUCCESS(validate_op_chain(soft_output,
> +			TEST_ASSERT_SUCCESS(validate_op_so_chain(soft_output,
>   					soft_data_orig),
>   					"Soft output buffers (CB=%u) are not equal",
>   					i);
> @@ -2494,7 +2495,6 @@ validate_ldpc_enc_op(struct rte_bbdev_enc_op **ops, const uint16_t n,
>   	return TEST_SUCCESS;
>   }
>   
> -
>   static inline int
>   validate_op_fft_chain(struct rte_bbdev_op_data *op, struct op_data_entries *orig_op)
>   {
> @@ -3181,11 +3181,11 @@ throughput_intr_lcore_ldpc_dec(void *arg)
>   	for (j = 0; j < TEST_REPETITIONS; ++j) {
>   		for (i = 0; i < num_to_process; ++i) {
>   			if (!loopback)
> -				rte_pktmbuf_reset(
> -					ops[i]->ldpc_dec.hard_output.data);
> +				rte_pktmbuf_reset(ops[i]->ldpc_dec.hard_output.data);
>   			if (hc_out || loopback)
> -				mbuf_reset(
> -				ops[i]->ldpc_dec.harq_combined_output.data);
> +				mbuf_reset(ops[i]->ldpc_dec.harq_combined_output.data);
> +			if (ops[i]->ldpc_dec.soft_output.data != NULL)
> +				rte_pktmbuf_reset(ops[i]->ldpc_dec.soft_output.data);
>   		}
>   
>   		tp->start_time = rte_rdtsc_precise();
> @@ -3280,7 +3280,6 @@ throughput_intr_lcore_dec(void *arg)
>   				rte_pktmbuf_reset(ops[i]->turbo_dec.soft_output.data);
>   		}
>   
> -
>   		tp->start_time = rte_rdtsc_precise();
>   		for (enqueued = 0; enqueued < num_to_process;) {
>   			num_to_enq = burst_sz;
> @@ -3742,10 +3741,11 @@ bler_pmd_lcore_ldpc_dec(void *arg)
>   	for (i = 0; i < 1; ++i) { /* Could add more iterations */
>   		for (j = 0; j < num_ops; ++j) {
>   			if (!loopback)
> -				mbuf_reset(
> -				ops_enq[j]->ldpc_dec.hard_output.data);
> +				mbuf_reset(ops_enq[j]->ldpc_dec.hard_output.data);
>   			if (hc_out || loopback)
>   				mbuf_reset(ops_enq[j]->ldpc_dec.harq_combined_output.data);
> +			if (ops_enq[j]->ldpc_dec.soft_output.data != NULL)
> +				mbuf_reset(ops_enq[j]->ldpc_dec.soft_output.data);
>   		}
>   		if (extDdr)
>   			preload_harq_ddr(tp->dev_id, queue_id, ops_enq,
> @@ -3977,11 +3977,11 @@ throughput_pmd_lcore_ldpc_dec(void *arg)
>   	for (i = 0; i < TEST_REPETITIONS; ++i) {
>   		for (j = 0; j < num_ops; ++j) {
>   			if (!loopback)
> -				mbuf_reset(
> -				ops_enq[j]->ldpc_dec.hard_output.data);
> +				mbuf_reset(ops_enq[j]->ldpc_dec.hard_output.data);
>   			if (hc_out || loopback)
> -				mbuf_reset(
> -				ops_enq[j]->ldpc_dec.harq_combined_output.data);
> +				mbuf_reset(ops_enq[j]->ldpc_dec.harq_combined_output.data);
> +			if (ops_enq[j]->ldpc_dec.soft_output.data != NULL)
> +				mbuf_reset(ops_enq[j]->ldpc_dec.soft_output.data);
>   		}
>   		if (extDdr)
>   			preload_harq_ddr(tp->dev_id, queue_id, ops_enq,

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* Re: [PATCH v2 11/16] test/bbdev: expose warning counters
  2023-02-15 17:09 ` [PATCH v2 11/16] test/bbdev: expose warning counters Hernan Vargas
@ 2023-02-22 10:52   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-22 10:52 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang



On 2/15/23 18:09, Hernan Vargas wrote:
> Print warnings reported on queues for offload test.
> No functional impact.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 00090f863f..a19eda2de8 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -5673,6 +5673,9 @@ offload_cost_test(struct active_device *ad,
>   
>   	struct rte_bbdev_stats stats = {0};
>   	get_bbdev_queue_stats(ad->dev_id, queue_id, &stats);
> +	if (stats.enqueue_warn_count > 0)
> +		printf("Warning reported on the queue : %10"PRIu64"\n",
> +			stats.enqueue_warn_count);
>   	if (op_type != RTE_BBDEV_OP_LDPC_DEC) {
>   		TEST_ASSERT_SUCCESS(stats.enqueued_count != num_to_process,
>   				"Mismatch in enqueue count %10"PRIu64" %d",

Reporting from v1:
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* Re: [PATCH v2 12/16] test/bbdev: remove check for invalid opaque data
  2023-02-15 17:09 ` [PATCH v2 12/16] test/bbdev: remove check for invalid opaque data Hernan Vargas
@ 2023-02-22 10:53   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-22 10:53 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang, stable



On 2/15/23 18:09, Hernan Vargas wrote:
> Assert also if the opaque data is invalid.

New line needed before Fixes tag.

> Fixes: 335c11fd276 ("app/bbdev: support HARQ validation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index a19eda2de8..2ce1c7e7d3 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -79,7 +79,6 @@
>   
>   #define SYNC_WAIT 0
>   #define SYNC_START 1
> -#define INVALID_OPAQUE -1
>   
>   #define INVALID_QUEUE_ID -1
>   /* Increment for next code block in external HARQ memory */
> @@ -1999,10 +1998,9 @@ check_enc_status_and_ordering(struct rte_bbdev_enc_op *op,
>   			"op_status (%d) != expected_status (%d)",
>   			op->status, expected_status);
>   
> -	if (op->opaque_data != (void *)(uintptr_t)INVALID_OPAQUE)
> -		TEST_ASSERT((void *)(uintptr_t)order_idx == op->opaque_data,
> -				"Ordering error, expected %p, got %p",
> -				(void *)(uintptr_t)order_idx, op->opaque_data);
> +	TEST_ASSERT((void *)(uintptr_t)order_idx == op->opaque_data,
> +			"Ordering error, expected %p, got %p",
> +			(void *)(uintptr_t)order_idx, op->opaque_data);
>   
>   	return TEST_SUCCESS;
>   }

With typo fixed:
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* Re: [PATCH v2 13/16] test/bbdev: remove iteration count check
  2023-02-15 17:09 ` [PATCH v2 13/16] test/bbdev: remove iteration count check Hernan Vargas
@ 2023-02-22 10:55   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-22 10:55 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang



On 2/15/23 18:09, Hernan Vargas wrote:
> To make the test compatible with devices that do not support early
> termination, the iteration count assert can be removed.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 24 ++++++++----------------
>   1 file changed, 8 insertions(+), 16 deletions(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 2ce1c7e7d3..5259404ff6 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -2288,7 +2288,7 @@ validate_op_so_chain(struct rte_bbdev_op_data *op,
>   
>   static int
>   validate_dec_op(struct rte_bbdev_dec_op **ops, const uint16_t n,
> -		struct rte_bbdev_dec_op *ref_op, const int vector_mask)
> +		struct rte_bbdev_dec_op *ref_op)
>   {
>   	unsigned int i;
>   	int ret;
> @@ -2299,17 +2299,12 @@ validate_dec_op(struct rte_bbdev_dec_op **ops, const uint16_t n,
>   	struct rte_bbdev_op_turbo_dec *ops_td;
>   	struct rte_bbdev_op_data *hard_output;
>   	struct rte_bbdev_op_data *soft_output;
> -	struct rte_bbdev_op_turbo_dec *ref_td = &ref_op->turbo_dec;
>   
>   	for (i = 0; i < n; ++i) {
>   		ops_td = &ops[i]->turbo_dec;
>   		hard_output = &ops_td->hard_output;
>   		soft_output = &ops_td->soft_output;
>   
> -		if (vector_mask & TEST_BBDEV_VF_EXPECTED_ITER_COUNT)
> -			TEST_ASSERT(ops_td->iter_count <= ref_td->iter_count,
> -					"Returned iter_count (%d) > expected iter_count (%d)",
> -					ops_td->iter_count, ref_td->iter_count);
>   		ret = check_dec_status_and_ordering(ops[i], i, ref_op->status);
>   		TEST_ASSERT_SUCCESS(ret,
>   				"Checking status and ordering for decoder failed");
> @@ -3058,8 +3053,7 @@ dequeue_event_callback(uint16_t dev_id,
>   
>   	if (test_vector.op_type == RTE_BBDEV_OP_TURBO_DEC) {
>   		struct rte_bbdev_dec_op *ref_op = tp->op_params->ref_dec_op;
> -		ret = validate_dec_op(tp->dec_ops, num_ops, ref_op,
> -				tp->op_params->vector_mask);
> +		ret = validate_dec_op(tp->dec_ops, num_ops, ref_op);
>   		/* get the max of iter_count for all dequeued ops */
>   		for (i = 0; i < num_ops; ++i)
>   			tp->iter_count = RTE_MAX(
> @@ -3660,8 +3654,7 @@ throughput_pmd_lcore_dec(void *arg)
>   	}
>   
>   	if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> -		ret = validate_dec_op(ops_deq, num_ops, ref_op,
> -				tp->op_params->vector_mask);
> +		ret = validate_dec_op(ops_deq, num_ops, ref_op);
>   		TEST_ASSERT_SUCCESS(ret, "Validation failed!");
>   	}
>   
> @@ -4649,7 +4642,7 @@ throughput_test(struct active_device *ad,
>   static int
>   latency_test_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,
> +		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, bool disable_et)
>   {
> @@ -4709,8 +4702,7 @@ latency_test_dec(struct rte_mempool *mempool,
>   		*total_time += last_time;
>   
>   		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> -			ret = validate_dec_op(ops_deq, burst_sz, ref_op,
> -					vector_mask);
> +			ret = validate_dec_op(ops_deq, burst_sz, ref_op);
>   			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
>   		}
>   
> @@ -5065,9 +5057,9 @@ validation_latency_test(struct active_device *ad,
>   
>   	if (op_type == RTE_BBDEV_OP_TURBO_DEC)
>   		iter = latency_test_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, latency_flag);
> +				op_params->ref_dec_op, ad->dev_id, queue_id,
> +				num_to_process, burst_sz, &total_time,
> +				&min_time, &max_time, latency_flag);
>   	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,

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* Re: [PATCH v2 14/16] test/bbdev: use mbuf reset function
  2023-02-15 17:09 ` [PATCH v2 14/16] test/bbdev: use mbuf reset function Hernan Vargas
@ 2023-02-22 10:56   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-22 10:56 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang



On 2/15/23 18:09, Hernan Vargas wrote:
> Use mbuf_reset function for code consistency.
> No functional impact.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 14 +++++++-------
>   1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 5259404ff6..535b9d73dd 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -3173,11 +3173,11 @@ throughput_intr_lcore_ldpc_dec(void *arg)
>   	for (j = 0; j < TEST_REPETITIONS; ++j) {
>   		for (i = 0; i < num_to_process; ++i) {
>   			if (!loopback)
> -				rte_pktmbuf_reset(ops[i]->ldpc_dec.hard_output.data);
> +				mbuf_reset(ops[i]->ldpc_dec.hard_output.data);
>   			if (hc_out || loopback)
>   				mbuf_reset(ops[i]->ldpc_dec.harq_combined_output.data);
>   			if (ops[i]->ldpc_dec.soft_output.data != NULL)
> -				rte_pktmbuf_reset(ops[i]->ldpc_dec.soft_output.data);
> +				mbuf_reset(ops[i]->ldpc_dec.soft_output.data);
>   		}
>   
>   		tp->start_time = rte_rdtsc_precise();
> @@ -3267,9 +3267,9 @@ throughput_intr_lcore_dec(void *arg)
>   
>   	for (j = 0; j < TEST_REPETITIONS; ++j) {
>   		for (i = 0; i < num_to_process; ++i) {
> -			rte_pktmbuf_reset(ops[i]->turbo_dec.hard_output.data);
> +			mbuf_reset(ops[i]->turbo_dec.hard_output.data);
>   			if (ops[i]->turbo_dec.soft_output.data != NULL)
> -				rte_pktmbuf_reset(ops[i]->turbo_dec.soft_output.data);
> +				mbuf_reset(ops[i]->turbo_dec.soft_output.data);
>   		}
>   
>   		tp->start_time = rte_rdtsc_precise();
> @@ -3356,7 +3356,7 @@ throughput_intr_lcore_enc(void *arg)
>   
>   	for (j = 0; j < TEST_REPETITIONS; ++j) {
>   		for (i = 0; i < num_to_process; ++i)
> -			rte_pktmbuf_reset(ops[i]->turbo_enc.output.data);
> +			mbuf_reset(ops[i]->turbo_enc.output.data);
>   
>   		tp->start_time = rte_rdtsc_precise();
>   		for (enqueued = 0; enqueued < num_to_process;) {
> @@ -3444,7 +3444,7 @@ throughput_intr_lcore_ldpc_enc(void *arg)
>   
>   	for (j = 0; j < TEST_REPETITIONS; ++j) {
>   		for (i = 0; i < num_to_process; ++i)
> -			rte_pktmbuf_reset(ops[i]->turbo_enc.output.data);
> +			mbuf_reset(ops[i]->turbo_enc.output.data);
>   
>   		tp->start_time = rte_rdtsc_precise();
>   		for (enqueued = 0; enqueued < num_to_process;) {
> @@ -3532,7 +3532,7 @@ throughput_intr_lcore_fft(void *arg)
>   
>   	for (j = 0; j < TEST_REPETITIONS; ++j) {
>   		for (i = 0; i < num_to_process; ++i)
> -			rte_pktmbuf_reset(ops[i]->fft.base_output.data);
> +			mbuf_reset(ops[i]->fft.base_output.data);
>   
>   		tp->start_time = rte_rdtsc_precise();
>   		for (enqueued = 0; enqueued < num_to_process;) {

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* Re: [PATCH v2 15/16] test/bbdev: remove max iteration from vectors
  2023-02-15 17:09 ` [PATCH v2 15/16] test/bbdev: remove max iteration from vectors Hernan Vargas
@ 2023-02-22 10:58   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-22 10:58 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang



On 2/15/23 18:09, Hernan Vargas wrote:
> Remove iter_max from test vectors as this value is passed as an argument
> to the test.
> No functional impact.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c                   |  4 ++++
>   app/test-bbdev/test_bbdev_vector.c                 | 14 --------------
>   app/test-bbdev/test_bbdev_vector.h                 |  1 -
>   app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_0.data |  3 ---
>   app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_1.data |  3 ---
>   app/test-bbdev/test_vectors/ldpc_dec_HARQ_1_2.data |  3 ---
>   app/test-bbdev/test_vectors/ldpc_dec_v11835.data   |  3 ---
>   .../test_vectors/ldpc_dec_v2342_drop.data          |  3 ---
>   app/test-bbdev/test_vectors/ldpc_dec_v7813.data    |  3 ---
>   app/test-bbdev/test_vectors/ldpc_dec_v8480.data    |  3 ---
>   app/test-bbdev/test_vectors/ldpc_dec_v8568.data    |  3 ---
>   app/test-bbdev/test_vectors/ldpc_dec_v9503.data    |  3 ---
>   .../turbo_dec_c1_k40_r0_e17280_sbd_negllr.data     |  3 ---
>   ...k6144_r0_e10376_crc24b_sbd_negllr_high_snr.data |  3 ---
>   ..._k6144_r0_e10376_crc24b_sbd_negllr_low_snr.data |  3 ---
>   .../turbo_dec_c1_k6144_r0_e34560_posllr.data       |  3 ---
>   .../turbo_dec_c1_k6144_r0_e34560_sbd_negllr.data   |  3 ---
>   .../turbo_dec_c1_k6144_r0_e34560_sbd_posllr.data   |  3 ---
>   ...bo_dec_c2_k3136_r0_e4920_sbd_negllr_crc24b.data |  3 ---
>   19 files changed, 4 insertions(+), 63 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* Re: [PATCH v2 16/16] test/bbdev: remove iter count from bler test
  2023-02-15 17:09 ` [PATCH v2 16/16] test/bbdev: remove iter count from bler test Hernan Vargas
@ 2023-02-22 11:01   ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-22 11:01 UTC (permalink / raw)
  To: Hernan Vargas, dev, gakhil, trix; +Cc: nicolas.chautru, qi.z.zhang



On 2/15/23 18:09, Hernan Vargas wrote:
> iter_count doesn't need to be set equal to iter_max for bler tests. This
> is only needed in throughput and latency tests because early termination
> is disabled for those tests.
> 
> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> ---
>   app/test-bbdev/test_bbdev_perf.c | 16 ++++++----------
>   1 file changed, 6 insertions(+), 10 deletions(-)
> 
> diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
> index 2baa2a0e62..621feee42b 100644
> --- a/app/test-bbdev/test_bbdev_perf.c
> +++ b/app/test-bbdev/test_bbdev_perf.c
> @@ -3714,12 +3714,10 @@ bler_pmd_lcore_ldpc_dec(void *arg)
>   	TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", num_ops);
>   
>   	/* For BLER tests we need to enable early termination */
> -	if (!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;
> +	if (!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;
> +
>   	ref_op->ldpc_dec.iter_max = get_iter_max();
> -	ref_op->ldpc_dec.iter_count = ref_op->ldpc_dec.iter_max;
>   
>   	if (test_vector.op_type != RTE_BBDEV_OP_NONE)
>   		copy_reference_ldpc_dec_op(ops_enq, num_ops, 0, bufs->inputs,
> @@ -3838,12 +3836,10 @@ bler_pmd_lcore_turbo_dec(void *arg)
>   	TEST_ASSERT_SUCCESS(ret, "Allocation failed for %d ops", num_ops);
>   
>   	/* For BLER tests we need to enable early termination */
> -	if (!check_bit(ref_op->turbo_dec.op_flags,
> -			RTE_BBDEV_TURBO_EARLY_TERMINATION))
> -		ref_op->turbo_dec.op_flags +=
> -				RTE_BBDEV_TURBO_EARLY_TERMINATION;
> +	if (!check_bit(ref_op->turbo_dec.op_flags, RTE_BBDEV_TURBO_EARLY_TERMINATION))
> +		ref_op->turbo_dec.op_flags += RTE_BBDEV_TURBO_EARLY_TERMINATION;
> +
>   	ref_op->turbo_dec.iter_max = get_iter_max();
> -	ref_op->turbo_dec.iter_count = ref_op->turbo_dec.iter_max;
>   
>   	if (test_vector.op_type != RTE_BBDEV_OP_NONE)
>   		copy_reference_dec_op(ops_enq, num_ops, 0, bufs->inputs,

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


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

* RE: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
  2023-02-20 16:32   ` Maxime Coquelin
@ 2023-02-22 21:13     ` Vargas, Hernan
  2023-02-23  8:31       ` Maxime Coquelin
  0 siblings, 1 reply; 40+ messages in thread
From: Vargas, Hernan @ 2023-02-22 21:13 UTC (permalink / raw)
  To: Maxime Coquelin, dev, gakhil, Rix, Tom; +Cc: Chautru, Nicolas, Zhang, Qi Z

Hi Maxime,

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Monday, February 20, 2023 10:33 AM
> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
> 
> 
> 
> On 2/15/23 18:09, Hernan Vargas wrote:
> > Add a timeout to force exit the latency tests in case dequeue never
> > happens.
> >
> > Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> > ---
> >   app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
> >   1 file changed, 19 insertions(+), 5 deletions(-)
> >
> > diff --git a/app/test-bbdev/test_bbdev_perf.c
> > b/app/test-bbdev/test_bbdev_perf.c
> > index 19b9a5b119..dede0f900e 100644
> > --- a/app/test-bbdev/test_bbdev_perf.c
> > +++ b/app/test-bbdev/test_bbdev_perf.c
> > @@ -26,6 +26,7 @@
> >
> >   #define MAX_QUEUES RTE_MAX_LCORE
> >   #define TEST_REPETITIONS 100
> > +#define TIME_OUT_POLL 1e8
> >   #define WAIT_OFFLOAD_US 1000
> >
> >   #ifdef RTE_BASEBAND_FPGA_LTE_FEC
> > @@ -4546,6 +4547,7 @@ latency_test_ldpc_dec(struct rte_mempool
> > *mempool,
> >
> >   	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
> >   		uint16_t enq = 0, deq = 0;
> > +		uint32_t time_out = 0;
> >   		bool first_time = true;
> >   		last_time = 0;
> >
> > @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool
> *mempool,
> >   				last_time = rte_rdtsc_precise() - start_time;
> >   				first_time = false;
> >   			}
> > -		} while (unlikely(burst_sz != deq));
> > +			time_out++;
> > +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
> >
> >   		*max_time = RTE_MAX(*max_time, last_time);
> >   		*min_time = RTE_MIN(*min_time, last_time); @@ -4606,7
> +4609,12 @@
> > latency_test_ldpc_dec(struct rte_mempool *mempool,
> >   		if (extDdr)
> >   			retrieve_harq_ddr(dev_id, queue_id, ops_enq,
> burst_sz);
> >
> > -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> > +		if (burst_sz != deq) {
> > +			struct rte_bbdev_info info;
> > +			ret = TEST_FAILED;
> > +			rte_bbdev_info_get(dev_id, &info);
> 
> What is the point of calling rte_bbdev_info_get() here and below?
> info is not used afterwards.

The reason for calling this function is to check the device status and if there is something wrong the PMD would display it to standard output.

> 
> > +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> > +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >   			ret = validate_ldpc_dec_op(ops_deq, burst_sz,
> ref_op,
> >   					vector_mask);
> >   			TEST_ASSERT_SUCCESS(ret, "Validation failed!"); @@
> -4632,6
> > +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
> >
> >   	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
> >   		uint16_t enq = 0, deq = 0;
> > +		uint32_t time_out = 0;
> >   		bool first_time = true;
> >   		last_time = 0;
> >
> > @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool
> *mempool,
> >   				last_time += rte_rdtsc_precise() - start_time;
> >   				first_time = false;
> >   			}
> > -		} while (unlikely(burst_sz != deq));
> > +			time_out++;
> > +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
> >
> >   		*max_time = RTE_MAX(*max_time, last_time);
> >   		*min_time = RTE_MIN(*min_time, last_time);
> >   		*total_time += last_time;
> > -
> > -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> > +		if (burst_sz != deq) {
> > +			struct rte_bbdev_info info;
> > +			ret = TEST_FAILED;
> > +			rte_bbdev_info_get(dev_id, &info);
> 
> Same here.
> 
> > +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> > +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >   			ret = validate_enc_op(ops_deq, burst_sz, ref_op);
> >   			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
> >   		}


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

* Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
  2023-02-22 21:13     ` Vargas, Hernan
@ 2023-02-23  8:31       ` Maxime Coquelin
  2023-02-24 16:59         ` Vargas, Hernan
  0 siblings, 1 reply; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-23  8:31 UTC (permalink / raw)
  To: Vargas, Hernan, dev, gakhil, Rix, Tom; +Cc: Chautru, Nicolas, Zhang, Qi Z



On 2/22/23 22:13, Vargas, Hernan wrote:
> Hi Maxime,
> 
>> -----Original Message-----
>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>> Sent: Monday, February 20, 2023 10:33 AM
>> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
>> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
>> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
>> <qi.z.zhang@intel.com>
>> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
>>
>>
>>
>> On 2/15/23 18:09, Hernan Vargas wrote:
>>> Add a timeout to force exit the latency tests in case dequeue never
>>> happens.
>>>
>>> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
>>> ---
>>>    app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
>>>    1 file changed, 19 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/app/test-bbdev/test_bbdev_perf.c
>>> b/app/test-bbdev/test_bbdev_perf.c
>>> index 19b9a5b119..dede0f900e 100644
>>> --- a/app/test-bbdev/test_bbdev_perf.c
>>> +++ b/app/test-bbdev/test_bbdev_perf.c
>>> @@ -26,6 +26,7 @@
>>>
>>>    #define MAX_QUEUES RTE_MAX_LCORE
>>>    #define TEST_REPETITIONS 100
>>> +#define TIME_OUT_POLL 1e8
>>>    #define WAIT_OFFLOAD_US 1000
>>>
>>>    #ifdef RTE_BASEBAND_FPGA_LTE_FEC
>>> @@ -4546,6 +4547,7 @@ latency_test_ldpc_dec(struct rte_mempool
>>> *mempool,
>>>
>>>    	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>>>    		uint16_t enq = 0, deq = 0;
>>> +		uint32_t time_out = 0;
>>>    		bool first_time = true;
>>>    		last_time = 0;
>>>
>>> @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool
>> *mempool,
>>>    				last_time = rte_rdtsc_precise() - start_time;
>>>    				first_time = false;
>>>    			}
>>> -		} while (unlikely(burst_sz != deq));
>>> +			time_out++;
>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>>>
>>>    		*max_time = RTE_MAX(*max_time, last_time);
>>>    		*min_time = RTE_MIN(*min_time, last_time); @@ -4606,7
>> +4609,12 @@
>>> latency_test_ldpc_dec(struct rte_mempool *mempool,
>>>    		if (extDdr)
>>>    			retrieve_harq_ddr(dev_id, queue_id, ops_enq,
>> burst_sz);
>>>
>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>> +		if (burst_sz != deq) {
>>> +			struct rte_bbdev_info info;
>>> +			ret = TEST_FAILED;
>>> +			rte_bbdev_info_get(dev_id, &info);
>>
>> What is the point of calling rte_bbdev_info_get() here and below?
>> info is not used afterwards.
> 
> The reason for calling this function is to check the device status and if there is something wrong the PMD would display it to standard output.

What kind of info exactly, I don't see much meaningful logs in
rte_bbdev_info_get() except printing error if dev_info == NULL.

Regards,
Maxime

>>
>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>    			ret = validate_ldpc_dec_op(ops_deq, burst_sz,
>> ref_op,
>>>    					vector_mask);
>>>    			TEST_ASSERT_SUCCESS(ret, "Validation failed!"); @@
>> -4632,6
>>> +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
>>>
>>>    	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>>>    		uint16_t enq = 0, deq = 0;
>>> +		uint32_t time_out = 0;
>>>    		bool first_time = true;
>>>    		last_time = 0;
>>>
>>> @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool
>> *mempool,
>>>    				last_time += rte_rdtsc_precise() - start_time;
>>>    				first_time = false;
>>>    			}
>>> -		} while (unlikely(burst_sz != deq));
>>> +			time_out++;
>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>>>
>>>    		*max_time = RTE_MAX(*max_time, last_time);
>>>    		*min_time = RTE_MIN(*min_time, last_time);
>>>    		*total_time += last_time;
>>> -
>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>> +		if (burst_sz != deq) {
>>> +			struct rte_bbdev_info info;
>>> +			ret = TEST_FAILED;
>>> +			rte_bbdev_info_get(dev_id, &info);
>>
>> Same here.
>>
>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>    			ret = validate_enc_op(ops_deq, burst_sz, ref_op);
>>>    			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
>>>    		}
> 


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

* RE: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
  2023-02-23  8:31       ` Maxime Coquelin
@ 2023-02-24 16:59         ` Vargas, Hernan
  2023-02-27  9:44           ` Maxime Coquelin
  0 siblings, 1 reply; 40+ messages in thread
From: Vargas, Hernan @ 2023-02-24 16:59 UTC (permalink / raw)
  To: Maxime Coquelin, dev, gakhil, Rix, Tom; +Cc: Chautru, Nicolas, Zhang, Qi Z

Hi Maxime,

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Thursday, February 23, 2023 2:32 AM
> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
> 
> 
> 
> On 2/22/23 22:13, Vargas, Hernan wrote:
> > Hi Maxime,
> >
> >> -----Original Message-----
> >> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> >> Sent: Monday, February 20, 2023 10:33 AM
> >> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
> >> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
> >> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
> >> <qi.z.zhang@intel.com>
> >> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency
> >> tests
> >>
> >>
> >>
> >> On 2/15/23 18:09, Hernan Vargas wrote:
> >>> Add a timeout to force exit the latency tests in case dequeue never
> >>> happens.
> >>>
> >>> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> >>> ---
> >>>    app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
> >>>    1 file changed, 19 insertions(+), 5 deletions(-)
> >>>
> >>> diff --git a/app/test-bbdev/test_bbdev_perf.c
> >>> b/app/test-bbdev/test_bbdev_perf.c
> >>> index 19b9a5b119..dede0f900e 100644
> >>> --- a/app/test-bbdev/test_bbdev_perf.c
> >>> +++ b/app/test-bbdev/test_bbdev_perf.c
> >>> @@ -26,6 +26,7 @@
> >>>
> >>>    #define MAX_QUEUES RTE_MAX_LCORE
> >>>    #define TEST_REPETITIONS 100
> >>> +#define TIME_OUT_POLL 1e8
> >>>    #define WAIT_OFFLOAD_US 1000
> >>>
> >>>    #ifdef RTE_BASEBAND_FPGA_LTE_FEC
> >>> @@ -4546,6 +4547,7 @@ latency_test_ldpc_dec(struct rte_mempool
> >>> *mempool,
> >>>
> >>>    	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
> >>>    		uint16_t enq = 0, deq = 0;
> >>> +		uint32_t time_out = 0;
> >>>    		bool first_time = true;
> >>>    		last_time = 0;
> >>>
> >>> @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool
> >> *mempool,
> >>>    				last_time = rte_rdtsc_precise() - start_time;
> >>>    				first_time = false;
> >>>    			}
> >>> -		} while (unlikely(burst_sz != deq));
> >>> +			time_out++;
> >>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
> >>>
> >>>    		*max_time = RTE_MAX(*max_time, last_time);
> >>>    		*min_time = RTE_MIN(*min_time, last_time); @@ -4606,7
> >> +4609,12 @@
> >>> latency_test_ldpc_dec(struct rte_mempool *mempool,
> >>>    		if (extDdr)
> >>>    			retrieve_harq_ddr(dev_id, queue_id, ops_enq,
> >> burst_sz);
> >>>
> >>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>> +		if (burst_sz != deq) {
> >>> +			struct rte_bbdev_info info;
> >>> +			ret = TEST_FAILED;
> >>> +			rte_bbdev_info_get(dev_id, &info);
> >>
> >> What is the point of calling rte_bbdev_info_get() here and below?
> >> info is not used afterwards.
> >
> > The reason for calling this function is to check the device status and if there
> is something wrong the PMD would display it to standard output.
> 
> What kind of info exactly, I don't see much meaningful logs in
> rte_bbdev_info_get() except printing error if dev_info == NULL.

rte_bbdev_info_get() calls the device's info_get function that is specified in the PMD.
For example, for ACC100, acc100_dev_info_get() gets called to check the device status.

Thanks,
Hernan
> 
> Regards,
> Maxime
> 
> >>
> >>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> >>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>>    			ret = validate_ldpc_dec_op(ops_deq, burst_sz,
> >> ref_op,
> >>>    					vector_mask);
> >>>    			TEST_ASSERT_SUCCESS(ret, "Validation failed!"); @@
> >> -4632,6
> >>> +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
> >>>
> >>>    	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
> >>>    		uint16_t enq = 0, deq = 0;
> >>> +		uint32_t time_out = 0;
> >>>    		bool first_time = true;
> >>>    		last_time = 0;
> >>>
> >>> @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool
> >> *mempool,
> >>>    				last_time += rte_rdtsc_precise() - start_time;
> >>>    				first_time = false;
> >>>    			}
> >>> -		} while (unlikely(burst_sz != deq));
> >>> +			time_out++;
> >>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
> >>>
> >>>    		*max_time = RTE_MAX(*max_time, last_time);
> >>>    		*min_time = RTE_MIN(*min_time, last_time);
> >>>    		*total_time += last_time;
> >>> -
> >>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>> +		if (burst_sz != deq) {
> >>> +			struct rte_bbdev_info info;
> >>> +			ret = TEST_FAILED;
> >>> +			rte_bbdev_info_get(dev_id, &info);
> >>
> >> Same here.
> >>
> >>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> >>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>>    			ret = validate_enc_op(ops_deq, burst_sz, ref_op);
> >>>    			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
> >>>    		}
> >


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

* Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
  2023-02-24 16:59         ` Vargas, Hernan
@ 2023-02-27  9:44           ` Maxime Coquelin
  2023-02-28 22:37             ` Chautru, Nicolas
  0 siblings, 1 reply; 40+ messages in thread
From: Maxime Coquelin @ 2023-02-27  9:44 UTC (permalink / raw)
  To: Vargas, Hernan, dev, gakhil, Rix, Tom; +Cc: Chautru, Nicolas, Zhang, Qi Z



On 2/24/23 17:59, Vargas, Hernan wrote:
> Hi Maxime,
> 
>> -----Original Message-----
>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>> Sent: Thursday, February 23, 2023 2:32 AM
>> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
>> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
>> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
>> <qi.z.zhang@intel.com>
>> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
>>
>>
>>
>> On 2/22/23 22:13, Vargas, Hernan wrote:
>>> Hi Maxime,
>>>
>>>> -----Original Message-----
>>>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>>>> Sent: Monday, February 20, 2023 10:33 AM
>>>> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
>>>> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
>>>> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
>>>> <qi.z.zhang@intel.com>
>>>> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency
>>>> tests
>>>>
>>>>
>>>>
>>>> On 2/15/23 18:09, Hernan Vargas wrote:
>>>>> Add a timeout to force exit the latency tests in case dequeue never
>>>>> happens.
>>>>>
>>>>> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
>>>>> ---
>>>>>     app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
>>>>>     1 file changed, 19 insertions(+), 5 deletions(-)
>>>>>
>>>>> diff --git a/app/test-bbdev/test_bbdev_perf.c
>>>>> b/app/test-bbdev/test_bbdev_perf.c
>>>>> index 19b9a5b119..dede0f900e 100644
>>>>> --- a/app/test-bbdev/test_bbdev_perf.c
>>>>> +++ b/app/test-bbdev/test_bbdev_perf.c
>>>>> @@ -26,6 +26,7 @@
>>>>>
>>>>>     #define MAX_QUEUES RTE_MAX_LCORE
>>>>>     #define TEST_REPETITIONS 100
>>>>> +#define TIME_OUT_POLL 1e8
>>>>>     #define WAIT_OFFLOAD_US 1000
>>>>>
>>>>>     #ifdef RTE_BASEBAND_FPGA_LTE_FEC
>>>>> @@ -4546,6 +4547,7 @@ latency_test_ldpc_dec(struct rte_mempool
>>>>> *mempool,
>>>>>
>>>>>     	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>>>>>     		uint16_t enq = 0, deq = 0;
>>>>> +		uint32_t time_out = 0;
>>>>>     		bool first_time = true;
>>>>>     		last_time = 0;
>>>>>
>>>>> @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool
>>>> *mempool,
>>>>>     				last_time = rte_rdtsc_precise() - start_time;
>>>>>     				first_time = false;
>>>>>     			}
>>>>> -		} while (unlikely(burst_sz != deq));
>>>>> +			time_out++;
>>>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>>>>>
>>>>>     		*max_time = RTE_MAX(*max_time, last_time);
>>>>>     		*min_time = RTE_MIN(*min_time, last_time); @@ -4606,7
>>>> +4609,12 @@
>>>>> latency_test_ldpc_dec(struct rte_mempool *mempool,
>>>>>     		if (extDdr)
>>>>>     			retrieve_harq_ddr(dev_id, queue_id, ops_enq,
>>>> burst_sz);
>>>>>
>>>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>> +		if (burst_sz != deq) {
>>>>> +			struct rte_bbdev_info info;
>>>>> +			ret = TEST_FAILED;
>>>>> +			rte_bbdev_info_get(dev_id, &info);
>>>>
>>>> What is the point of calling rte_bbdev_info_get() here and below?
>>>> info is not used afterwards.
>>>
>>> The reason for calling this function is to check the device status and if there
>> is something wrong the PMD would display it to standard output.
>>
>> What kind of info exactly, I don't see much meaningful logs in
>> rte_bbdev_info_get() except printing error if dev_info == NULL.
> 
> rte_bbdev_info_get() calls the device's info_get function that is specified in the PMD.
> For example, for ACC100, acc100_dev_info_get() gets called to check the device status.

Ok, I looked at this function and it might be more relevant to mention 
vrb1 than acc100, because acc100 does not support device status:

	/* Check the status of device */
	dev_info->device_status = RTE_BBDEV_DEV_NOT_SUPPORTED;

Also, this dev_info->device_status field is set by all the drivers but
never read (neither by the driver, nor library nor apps).

So if this is the only reason rte_bbdev_info_get() is called, that is
quite useless. Am I missing someting?

Thanks,
Maxime

> Thanks,
> Hernan
>>
>> Regards,
>> Maxime
>>
>>>>
>>>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
>>>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>>     			ret = validate_ldpc_dec_op(ops_deq, burst_sz,
>>>> ref_op,
>>>>>     					vector_mask);
>>>>>     			TEST_ASSERT_SUCCESS(ret, "Validation failed!"); @@
>>>> -4632,6
>>>>> +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
>>>>>
>>>>>     	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>>>>>     		uint16_t enq = 0, deq = 0;
>>>>> +		uint32_t time_out = 0;
>>>>>     		bool first_time = true;
>>>>>     		last_time = 0;
>>>>>
>>>>> @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool
>>>> *mempool,
>>>>>     				last_time += rte_rdtsc_precise() - start_time;
>>>>>     				first_time = false;
>>>>>     			}
>>>>> -		} while (unlikely(burst_sz != deq));
>>>>> +			time_out++;
>>>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>>>>>
>>>>>     		*max_time = RTE_MAX(*max_time, last_time);
>>>>>     		*min_time = RTE_MIN(*min_time, last_time);
>>>>>     		*total_time += last_time;
>>>>> -
>>>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>> +		if (burst_sz != deq) {
>>>>> +			struct rte_bbdev_info info;
>>>>> +			ret = TEST_FAILED;
>>>>> +			rte_bbdev_info_get(dev_id, &info);
>>>>
>>>> Same here.
>>>>
>>>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
>>>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>>     			ret = validate_enc_op(ops_deq, burst_sz, ref_op);
>>>>>     			TEST_ASSERT_SUCCESS(ret, "Validation failed!");
>>>>>     		}
>>>
> 


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

* RE: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
  2023-02-27  9:44           ` Maxime Coquelin
@ 2023-02-28 22:37             ` Chautru, Nicolas
  2023-03-02 10:12               ` Maxime Coquelin
  0 siblings, 1 reply; 40+ messages in thread
From: Chautru, Nicolas @ 2023-02-28 22:37 UTC (permalink / raw)
  To: Maxime Coquelin, Vargas, Hernan, dev, gakhil, Rix, Tom; +Cc: Zhang, Qi Z

Hi Maxime, 

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Monday, February 27, 2023 1:45 AM
> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
> 
> 
> 
> On 2/24/23 17:59, Vargas, Hernan wrote:
> > Hi Maxime,
> >
> >> -----Original Message-----
> >> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> >> Sent: Thursday, February 23, 2023 2:32 AM
> >> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
> >> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
> >> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
> >> <qi.z.zhang@intel.com>
> >> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency
> >> tests
> >>
> >>
> >>
> >> On 2/22/23 22:13, Vargas, Hernan wrote:
> >>> Hi Maxime,
> >>>
> >>>> -----Original Message-----
> >>>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> >>>> Sent: Monday, February 20, 2023 10:33 AM
> >>>> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
> >>>> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
> >>>> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
> >>>> <qi.z.zhang@intel.com>
> >>>> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency
> >>>> tests
> >>>>
> >>>>
> >>>>
> >>>> On 2/15/23 18:09, Hernan Vargas wrote:
> >>>>> Add a timeout to force exit the latency tests in case dequeue
> >>>>> never happens.
> >>>>>
> >>>>> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
> >>>>> ---
> >>>>>     app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
> >>>>>     1 file changed, 19 insertions(+), 5 deletions(-)
> >>>>>
> >>>>> diff --git a/app/test-bbdev/test_bbdev_perf.c
> >>>>> b/app/test-bbdev/test_bbdev_perf.c
> >>>>> index 19b9a5b119..dede0f900e 100644
> >>>>> --- a/app/test-bbdev/test_bbdev_perf.c
> >>>>> +++ b/app/test-bbdev/test_bbdev_perf.c
> >>>>> @@ -26,6 +26,7 @@
> >>>>>
> >>>>>     #define MAX_QUEUES RTE_MAX_LCORE
> >>>>>     #define TEST_REPETITIONS 100
> >>>>> +#define TIME_OUT_POLL 1e8
> >>>>>     #define WAIT_OFFLOAD_US 1000
> >>>>>
> >>>>>     #ifdef RTE_BASEBAND_FPGA_LTE_FEC @@ -4546,6 +4547,7 @@
> >>>>> latency_test_ldpc_dec(struct rte_mempool *mempool,
> >>>>>
> >>>>>     	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
> >>>>>     		uint16_t enq = 0, deq = 0;
> >>>>> +		uint32_t time_out = 0;
> >>>>>     		bool first_time = true;
> >>>>>     		last_time = 0;
> >>>>>
> >>>>> @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool
> >>>> *mempool,
> >>>>>     				last_time = rte_rdtsc_precise() -
> start_time;
> >>>>>     				first_time = false;
> >>>>>     			}
> >>>>> -		} while (unlikely(burst_sz != deq));
> >>>>> +			time_out++;
> >>>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
> >>>>>
> >>>>>     		*max_time = RTE_MAX(*max_time, last_time);
> >>>>>     		*min_time = RTE_MIN(*min_time, last_time); @@ -
> 4606,7
> >>>> +4609,12 @@
> >>>>> latency_test_ldpc_dec(struct rte_mempool *mempool,
> >>>>>     		if (extDdr)
> >>>>>     			retrieve_harq_ddr(dev_id, queue_id, ops_enq,
> >>>> burst_sz);
> >>>>>
> >>>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>>>> +		if (burst_sz != deq) {
> >>>>> +			struct rte_bbdev_info info;
> >>>>> +			ret = TEST_FAILED;
> >>>>> +			rte_bbdev_info_get(dev_id, &info);
> >>>>
> >>>> What is the point of calling rte_bbdev_info_get() here and below?
> >>>> info is not used afterwards.
> >>>
> >>> The reason for calling this function is to check the device status
> >>> and if there
> >> is something wrong the PMD would display it to standard output.
> >>
> >> What kind of info exactly, I don't see much meaningful logs in
> >> rte_bbdev_info_get() except printing error if dev_info == NULL.
> >
> > rte_bbdev_info_get() calls the device's info_get function that is specified in
> the PMD.
> > For example, for ACC100, acc100_dev_info_get() gets called to check the
> device status.
> 
> Ok, I looked at this function and it might be more relevant to mention
> vrb1 than acc100, because acc100 does not support device status:
> 
> 	/* Check the status of device */
> 	dev_info->device_status = RTE_BBDEV_DEV_NOT_SUPPORTED;
> 
> Also, this dev_info->device_status field is set by all the drivers but never read
> (neither by the driver, nor library nor apps).
> 
> So if this is the only reason rte_bbdev_info_get() is called, that is quite useless.
> Am I missing someting?

Note the device status is printed in the bbdev-test app in that other patchset in the series https://patches.dpdk.org/project/dpdk/patch/20230215170949.60569-7-hernan.vargas@intel.com/
Also calling that function then exercise interaction with underlying HW and PF driver which is valuable and the expected usecase.  
This is indeed relevant from vrb1 in term of current  intel PMD implementation, but the bbdev-test is HW agnostic. 
Let us know if unclear, 
Thanks, 
Nic


> 
> Thanks,
> Maxime
> 
> > Thanks,
> > Hernan
> >>
> >> Regards,
> >> Maxime
> >>
> >>>>
> >>>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> >>>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>>>>     			ret = validate_ldpc_dec_op(ops_deq, burst_sz,
> >>>> ref_op,
> >>>>>     					vector_mask);
> >>>>>     			TEST_ASSERT_SUCCESS(ret, "Validation
> failed!"); @@
> >>>> -4632,6
> >>>>> +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
> >>>>>
> >>>>>     	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
> >>>>>     		uint16_t enq = 0, deq = 0;
> >>>>> +		uint32_t time_out = 0;
> >>>>>     		bool first_time = true;
> >>>>>     		last_time = 0;
> >>>>>
> >>>>> @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool
> >>>> *mempool,
> >>>>>     				last_time += rte_rdtsc_precise() -
> start_time;
> >>>>>     				first_time = false;
> >>>>>     			}
> >>>>> -		} while (unlikely(burst_sz != deq));
> >>>>> +			time_out++;
> >>>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
> >>>>>
> >>>>>     		*max_time = RTE_MAX(*max_time, last_time);
> >>>>>     		*min_time = RTE_MIN(*min_time, last_time);
> >>>>>     		*total_time += last_time;
> >>>>> -
> >>>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>>>> +		if (burst_sz != deq) {
> >>>>> +			struct rte_bbdev_info info;
> >>>>> +			ret = TEST_FAILED;
> >>>>> +			rte_bbdev_info_get(dev_id, &info);
> >>>>
> >>>> Same here.
> >>>>
> >>>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
> >>>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
> >>>>>     			ret = validate_enc_op(ops_deq, burst_sz,
> ref_op);
> >>>>>     			TEST_ASSERT_SUCCESS(ret, "Validation
> failed!");
> >>>>>     		}
> >>>
> >


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

* Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
  2023-02-28 22:37             ` Chautru, Nicolas
@ 2023-03-02 10:12               ` Maxime Coquelin
  0 siblings, 0 replies; 40+ messages in thread
From: Maxime Coquelin @ 2023-03-02 10:12 UTC (permalink / raw)
  To: Chautru, Nicolas, Vargas, Hernan, dev, gakhil, Rix, Tom; +Cc: Zhang, Qi Z



On 2/28/23 23:37, Chautru, Nicolas wrote:
> Hi Maxime,
> 
>> -----Original Message-----
>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>> Sent: Monday, February 27, 2023 1:45 AM
>> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
>> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
>> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
>> <qi.z.zhang@intel.com>
>> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency tests
>>
>>
>>
>> On 2/24/23 17:59, Vargas, Hernan wrote:
>>> Hi Maxime,
>>>
>>>> -----Original Message-----
>>>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>>>> Sent: Thursday, February 23, 2023 2:32 AM
>>>> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
>>>> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
>>>> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
>>>> <qi.z.zhang@intel.com>
>>>> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency
>>>> tests
>>>>
>>>>
>>>>
>>>> On 2/22/23 22:13, Vargas, Hernan wrote:
>>>>> Hi Maxime,
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Maxime Coquelin <maxime.coquelin@redhat.com>
>>>>>> Sent: Monday, February 20, 2023 10:33 AM
>>>>>> To: Vargas, Hernan <hernan.vargas@intel.com>; dev@dpdk.org;
>>>>>> gakhil@marvell.com; Rix, Tom <trix@redhat.com>
>>>>>> Cc: Chautru, Nicolas <nicolas.chautru@intel.com>; Zhang, Qi Z
>>>>>> <qi.z.zhang@intel.com>
>>>>>> Subject: Re: [PATCH v2 04/16] test/bbdev: add timeout for latency
>>>>>> tests
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 2/15/23 18:09, Hernan Vargas wrote:
>>>>>>> Add a timeout to force exit the latency tests in case dequeue
>>>>>>> never happens.
>>>>>>>
>>>>>>> Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
>>>>>>> ---
>>>>>>>      app/test-bbdev/test_bbdev_perf.c | 24 +++++++++++++++++++-----
>>>>>>>      1 file changed, 19 insertions(+), 5 deletions(-)
>>>>>>>
>>>>>>> diff --git a/app/test-bbdev/test_bbdev_perf.c
>>>>>>> b/app/test-bbdev/test_bbdev_perf.c
>>>>>>> index 19b9a5b119..dede0f900e 100644
>>>>>>> --- a/app/test-bbdev/test_bbdev_perf.c
>>>>>>> +++ b/app/test-bbdev/test_bbdev_perf.c
>>>>>>> @@ -26,6 +26,7 @@
>>>>>>>
>>>>>>>      #define MAX_QUEUES RTE_MAX_LCORE
>>>>>>>      #define TEST_REPETITIONS 100
>>>>>>> +#define TIME_OUT_POLL 1e8
>>>>>>>      #define WAIT_OFFLOAD_US 1000
>>>>>>>
>>>>>>>      #ifdef RTE_BASEBAND_FPGA_LTE_FEC @@ -4546,6 +4547,7 @@
>>>>>>> latency_test_ldpc_dec(struct rte_mempool *mempool,
>>>>>>>
>>>>>>>      	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>>>>>>>      		uint16_t enq = 0, deq = 0;
>>>>>>> +		uint32_t time_out = 0;
>>>>>>>      		bool first_time = true;
>>>>>>>      		last_time = 0;
>>>>>>>
>>>>>>> @@ -4597,7 +4599,8 @@ latency_test_ldpc_dec(struct rte_mempool
>>>>>> *mempool,
>>>>>>>      				last_time = rte_rdtsc_precise() -
>> start_time;
>>>>>>>      				first_time = false;
>>>>>>>      			}
>>>>>>> -		} while (unlikely(burst_sz != deq));
>>>>>>> +			time_out++;
>>>>>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>>>>>>>
>>>>>>>      		*max_time = RTE_MAX(*max_time, last_time);
>>>>>>>      		*min_time = RTE_MIN(*min_time, last_time); @@ -
>> 4606,7
>>>>>> +4609,12 @@
>>>>>>> latency_test_ldpc_dec(struct rte_mempool *mempool,
>>>>>>>      		if (extDdr)
>>>>>>>      			retrieve_harq_ddr(dev_id, queue_id, ops_enq,
>>>>>> burst_sz);
>>>>>>>
>>>>>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>>>> +		if (burst_sz != deq) {
>>>>>>> +			struct rte_bbdev_info info;
>>>>>>> +			ret = TEST_FAILED;
>>>>>>> +			rte_bbdev_info_get(dev_id, &info);
>>>>>>
>>>>>> What is the point of calling rte_bbdev_info_get() here and below?
>>>>>> info is not used afterwards.
>>>>>
>>>>> The reason for calling this function is to check the device status
>>>>> and if there
>>>> is something wrong the PMD would display it to standard output.
>>>>
>>>> What kind of info exactly, I don't see much meaningful logs in
>>>> rte_bbdev_info_get() except printing error if dev_info == NULL.
>>>
>>> rte_bbdev_info_get() calls the device's info_get function that is specified in
>> the PMD.
>>> For example, for ACC100, acc100_dev_info_get() gets called to check the
>> device status.
>>
>> Ok, I looked at this function and it might be more relevant to mention
>> vrb1 than acc100, because acc100 does not support device status:
>>
>> 	/* Check the status of device */
>> 	dev_info->device_status = RTE_BBDEV_DEV_NOT_SUPPORTED;
>>
>> Also, this dev_info->device_status field is set by all the drivers but never read
>> (neither by the driver, nor library nor apps).
>>
>> So if this is the only reason rte_bbdev_info_get() is called, that is quite useless.
>> Am I missing someting?
> 
> Note the device status is printed in the bbdev-test app in that other patchset in the series https://patches.dpdk.org/project/dpdk/patch/20230215170949.60569-7-hernan.vargas@intel.com/

Not related to this patch, but maybe you should use an assert in the
patch you link above. Indeed, what is the point of continuing the init
if the device status is "FATAL_ERR"?

> Also calling that function then exercise interaction with underlying HW and PF driver which is valuable and the expected usecase.
> This is indeed relevant from vrb1 in term of current  intel PMD implementation, but the bbdev-test is HW agnostic.
> Let us know if unclear,

OK, that's clearer.

For this patch:
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

> Thanks,
> Nic
> 
> 
>>
>> Thanks,
>> Maxime
>>
>>> Thanks,
>>> Hernan
>>>>
>>>> Regards,
>>>> Maxime
>>>>
>>>>>>
>>>>>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
>>>>>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>>>>      			ret = validate_ldpc_dec_op(ops_deq, burst_sz,
>>>>>> ref_op,
>>>>>>>      					vector_mask);
>>>>>>>      			TEST_ASSERT_SUCCESS(ret, "Validation
>> failed!"); @@
>>>>>> -4632,6
>>>>>>> +4640,7 @@ latency_test_enc(struct rte_mempool *mempool,
>>>>>>>
>>>>>>>      	for (i = 0, dequeued = 0; dequeued < num_to_process; ++i) {
>>>>>>>      		uint16_t enq = 0, deq = 0;
>>>>>>> +		uint32_t time_out = 0;
>>>>>>>      		bool first_time = true;
>>>>>>>      		last_time = 0;
>>>>>>>
>>>>>>> @@ -4667,13 +4676,18 @@ latency_test_enc(struct rte_mempool
>>>>>> *mempool,
>>>>>>>      				last_time += rte_rdtsc_precise() -
>> start_time;
>>>>>>>      				first_time = false;
>>>>>>>      			}
>>>>>>> -		} while (unlikely(burst_sz != deq));
>>>>>>> +			time_out++;
>>>>>>> +		} while ((burst_sz != deq) && (time_out < TIME_OUT_POLL));
>>>>>>>
>>>>>>>      		*max_time = RTE_MAX(*max_time, last_time);
>>>>>>>      		*min_time = RTE_MIN(*min_time, last_time);
>>>>>>>      		*total_time += last_time;
>>>>>>> -
>>>>>>> -		if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>>>> +		if (burst_sz != deq) {
>>>>>>> +			struct rte_bbdev_info info;
>>>>>>> +			ret = TEST_FAILED;
>>>>>>> +			rte_bbdev_info_get(dev_id, &info);
>>>>>>
>>>>>> Same here.
>>>>>>
>>>>>>> +			TEST_ASSERT_SUCCESS(ret, "Dequeue timeout!");
>>>>>>> +		} else if (test_vector.op_type != RTE_BBDEV_OP_NONE) {
>>>>>>>      			ret = validate_enc_op(ops_deq, burst_sz,
>> ref_op);
>>>>>>>      			TEST_ASSERT_SUCCESS(ret, "Validation
>> failed!");
>>>>>>>      		}
>>>>>
>>>
> 


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

end of thread, other threads:[~2023-03-02 10:12 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-15 17:09 [PATCH v2 00/16] test/bbdev: changes for 23.03 Hernan Vargas
2023-02-15 17:09 ` [PATCH v2 01/16] test/bbdev: fix seg fault for non supported HARQ len Hernan Vargas
2023-02-20 16:08   ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 02/16] test/bbdev: extend HARQ tolerance Hernan Vargas
2023-02-20 16:09   ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 03/16] test/bbdev: refactor TB throughput report Hernan Vargas
2023-02-20 16:10   ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 04/16] test/bbdev: add timeout for latency tests Hernan Vargas
2023-02-20 16:32   ` Maxime Coquelin
2023-02-22 21:13     ` Vargas, Hernan
2023-02-23  8:31       ` Maxime Coquelin
2023-02-24 16:59         ` Vargas, Hernan
2023-02-27  9:44           ` Maxime Coquelin
2023-02-28 22:37             ` Chautru, Nicolas
2023-03-02 10:12               ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 05/16] test/bbdev: enable early termination for validation Hernan Vargas
2023-02-20 20:12   ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 06/16] test/bbdev: report device status in test-bbdev Hernan Vargas
2023-02-20 20:17   ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 07/16] test/bbdev: test start/stop bbdev API Hernan Vargas
2023-02-20 20:21   ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 08/16] test/bbdev: add support for BLER for 4G Hernan Vargas
2023-02-22 10:48   ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 09/16] test/bbdev: extend support for large TB Hernan Vargas
2023-02-22 10:49   ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 10/16] test/bbdev: adjustment for soft output Hernan Vargas
2023-02-22 10:50   ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 11/16] test/bbdev: expose warning counters Hernan Vargas
2023-02-22 10:52   ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 12/16] test/bbdev: remove check for invalid opaque data Hernan Vargas
2023-02-22 10:53   ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 13/16] test/bbdev: remove iteration count check Hernan Vargas
2023-02-22 10:55   ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 14/16] test/bbdev: use mbuf reset function Hernan Vargas
2023-02-22 10:56   ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 15/16] test/bbdev: remove max iteration from vectors Hernan Vargas
2023-02-22 10:58   ` Maxime Coquelin
2023-02-15 17:09 ` [PATCH v2 16/16] test/bbdev: remove iter count from bler test Hernan Vargas
2023-02-22 11:01   ` Maxime Coquelin
2023-02-20 15:31 ` [PATCH v2 00/16] test/bbdev: changes for 23.03 Maxime Coquelin

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).