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 3648041B8D; Tue, 31 Jan 2023 10:48:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 13CC140DFB; Tue, 31 Jan 2023 10:48:35 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 51F7B4067B for ; Tue, 31 Jan 2023 10:48:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675158512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lDksUg7H3+744R5g6yTJmpK779pYDHKsFQNWNOxMr0A=; b=M+qKRDzlEfUDEBQOMDR8kdAbT8EQugpatgvlnv8BAT2mbWN+c823iPsQw1jQSBoQSbmW5w NHn1BywXcDwRxG/2YWa3NwPIF3aooJxhlsp3EHSXmIXSu1SQTQSIY4c3BgkX+a/hkqd3zU u8SuDCfcKq9qMmLweAUMTlUnMMzQDXI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-322-oL6vJ4ZIMu2LZNM_BrMxhQ-1; Tue, 31 Jan 2023 04:48:29 -0500 X-MC-Unique: oL6vJ4ZIMu2LZNM_BrMxhQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0B7DE811E6E; Tue, 31 Jan 2023 09:48:29 +0000 (UTC) Received: from [10.39.208.22] (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C695D2026D4B; Tue, 31 Jan 2023 09:48:27 +0000 (UTC) Message-ID: <7979e86a-2e3c-99a6-fe79-5b5223aeabdf@redhat.com> Date: Tue, 31 Jan 2023 10:48:26 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 To: Hernan Vargas , dev@dpdk.org, gakhil@marvell.com, trix@redhat.com Cc: nicolas.chautru@intel.com, qi.z.zhang@intel.com References: <20230117165023.20567-1-hernan.vargas@intel.com> <20230117165023.20567-3-hernan.vargas@intel.com> From: Maxime Coquelin Subject: Re: [PATCH v1 02/13] test/bbdev: refactor TB throughput report In-Reply-To: <20230117165023.20567-3-hernan.vargas@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 1/17/23 17:50, Hernan Vargas wrote: > Refactor calculation for tb_size. > No functional impact. > > Signed-off-by: Hernan Vargas > --- > 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); It could be made simpler. static uint32_t calc_ldpc_dec_TB_size(struct rte_bbdev_dec_op *op) { uint8_t i; 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) i = 1 else i = 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) * i; return tb_size; } What do you think? Thanks, Maxime > } > return tb_size; > }