From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CCF5641DB8; Thu, 2 Mar 2023 21:22:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F0E6A42C76; Thu, 2 Mar 2023 21:22:01 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id D4ACA40E09 for ; Thu, 2 Mar 2023 21:21:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677788519; x=1709324519; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dac8twLNerpVmMeps9xe8anEh1Na8IaTTfwv9W5u+Gw=; b=VgkWETKvXSJ8vxqKDyXtrXOOdmXVTW0pFGvP7b+KnwFZ8pAbzmG+c7Ya bpPK2S21eFclnOsTn1KRihqdQ2ze+aGq5VFRjnuchAMhC1S82rGlqtyyB nSpkevV+nNCUgDUYLf8MJjgjKGzCBGSfkkvSS+bkPtnY6WeDpxr/Fi3nJ rwv4gOFD1P7hpexsmHiKxHMRcGN3WOwtuXaAJCGqiVEbWfvkrJzy9y8Fx 2Is7eFkur2V4bwjSb8eJk4wWpJJHDpJ1zJZzazwztEgMzLwtdS91FR5oQ P2okbcL3X8+Hr+B4McTKbeqcTzUXfyf1KFpupOI/LAfUnN3RBEXm0ussW g==; X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="334871166" X-IronPort-AV: E=Sophos;i="5.98,228,1673942400"; d="scan'208";a="334871166" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2023 12:21:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10637"; a="705398102" X-IronPort-AV: E=Sophos;i="5.98,228,1673942400"; d="scan'208";a="705398102" Received: from unknown (HELO csl-npg-qt0.la.intel.com) ([10.233.181.103]) by orsmga008.jf.intel.com with ESMTP; 02 Mar 2023 12:21:57 -0800 From: Hernan Vargas To: dev@dpdk.org, gakhil@marvell.com, trix@redhat.com, maxime.coquelin@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com, Hernan Vargas Subject: [PATCH v3 04/17] test/bbdev: refactor TB throughput report Date: Thu, 2 Mar 2023 12:21:58 -0800 Message-Id: <20230302202211.170017-5-hernan.vargas@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230302202211.170017-1-hernan.vargas@intel.com> References: <20230302202211.170017-1-hernan.vargas@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Refactor calculation for tb_size. No functional impact. Signed-off-by: Hernan Vargas Reviewed-by: Maxime Coquelin --- 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 95d63a3548f5..088fc055a148 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -2578,19 +2578,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; } @@ -2616,19 +2613,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