[PATCH v1 02/13] test/bbdev: refactor TB throughput report

Hernan Vargas hernan.vargas at intel.com
Tue Jan 17 17:50:12 CET 2023


Refactor calculation for tb_size.
No functional impact.

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

diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c
index cc7b5481d6..1a8a6b9f82 100644
--- a/app/test-bbdev/test_bbdev_perf.c
+++ b/app/test-bbdev/test_bbdev_perf.c
@@ -2613,18 +2613,15 @@ 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;
+	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;
+		tb_size = (sys_cols * op->ldpc_enc.z_c - op->ldpc_enc.n_filler)
+				* (op->ldpc_enc.tb_params.c -
+				op->ldpc_enc.tb_params.r);
 	}
 	return tb_size;
 }
-- 
2.37.1



More information about the dev mailing list