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 2AD2E41CA8; Wed, 15 Feb 2023 18:13:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50D0942D39; Wed, 15 Feb 2023 18:13:04 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id B318241144 for ; Wed, 15 Feb 2023 18:13:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676481181; x=1708017181; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RRWF1eA8TmgsSS6VuTZ3tAnsSy52ttP4WR1Pzy+deAI=; b=HuvKEXuhlb/cAcNOLtl0qO3ENFCbAADEuFXuq/EfmAQm0kL5Vcne7KPW wa+LTW11yooAlQzEUbFin8ypSFnaEU1OF2rfs+xW2MGcex/7vFLzzbCPY ra2SVmW6TmUh56MmvFCng2DxNiZKoUxPKfscnyUGPxW6VympDSmmm6Tmw sFpl8rPXipbWl88pgHMEGN3qC6rS7pUN2hgnxOmssYsscSglbZcyFr4q5 7Q6Mo0qqUnuMUsebgJUYLGNnoigAsjoJbon6bm5vgoOEO2EY68Zsq3V/Q L78xbVGZGgq21GStAzwsb0sWkm4dWCLUByayyvXXdd9tLSYqRvHN3sN70 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="332789792" X-IronPort-AV: E=Sophos;i="5.97,300,1669104000"; d="scan'208";a="332789792" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 09:09:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="758489612" X-IronPort-AV: E=Sophos;i="5.97,300,1669104000"; d="scan'208";a="758489612" Received: from unknown (HELO csl-npg-qt0.la.intel.com) ([10.233.181.103]) by FMSMGA003.fm.intel.com with ESMTP; 15 Feb 2023 09:09:56 -0800 From: Hernan Vargas To: dev@dpdk.org, maxime.coquelin@redhat.com, gakhil@marvell.com, trix@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com, Hernan Vargas Subject: [PATCH v2 03/16] test/bbdev: refactor TB throughput report Date: Wed, 15 Feb 2023 09:09:36 -0800 Message-Id: <20230215170949.60569-4-hernan.vargas@intel.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230215170949.60569-1-hernan.vargas@intel.com> References: <20230215170949.60569-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 --- 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