From patchwork Mon Jul 1 21:27:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chautru, Nicolas" X-Patchwork-Id: 142000 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EEEF74553F; Mon, 1 Jul 2024 23:27:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 52731402E0; Mon, 1 Jul 2024 23:26:55 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by mails.dpdk.org (Postfix) with ESMTP id 261004026B for ; Mon, 1 Jul 2024 23:26:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719869212; x=1751405212; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=F3YcRNNntEJGVU4aBvgrS9u9+NVsPlx6J3YkB90orJc=; b=FbOVmbKD5koibS7qwHR3m80uacj8vzejCk/SIbnntuF5hLXl8ZPs3dcp VUe1EjQWs/65vU7aG1Wqqc7NVW9T5c9w28YUnt2px7Nwz2K2Bc3dXuZnM GrZQEIVZTxXTg/uFC7sKH7is5lxfRclypcROABnl82LLhWoTngZeJs2Ce 4+TIiScoOttMBEC1vwrMRmKEsPkQTyZrmbW0EQtNuqb7UVK0i10UlQjsP TbkjJBOUDTIzduNLiKLnl6ONcNB4uI1Q/j9l8Oksh9XA8i0OT37NTglDs JQNIwqkvxIr10B3AwOtId0HlA6IkF/ciNQ3p2PDmeEl5XyqtRKWlceqg+ Q==; X-CSE-ConnectionGUID: p5Iwkxh2So+tFv1SvrUJCw== X-CSE-MsgGUID: LltcytwEQW2QfQf4txCTyg== X-IronPort-AV: E=McAfee;i="6700,10204,11120"; a="20834738" X-IronPort-AV: E=Sophos;i="6.09,177,1716274800"; d="scan'208";a="20834738" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jul 2024 14:26:51 -0700 X-CSE-ConnectionGUID: jtxy4LcISm6Ump2Qiq+uJw== X-CSE-MsgGUID: dUGMA61nQM2V0glUWTBalw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,177,1716274800"; d="scan'208";a="45559929" Received: from spr-npg-bds1-eec2.sn.intel.com (HELO spr-npg-bds1-eec2..) ([10.233.181.123]) by orviesa010.jf.intel.com with ESMTP; 01 Jul 2024 14:26:50 -0700 From: Nicolas Chautru To: dev@dpdk.org, maxime.coquelin@redhat.com Cc: hemant.agrawal@nxp.com, david.marchand@redhat.com, hernan.vargas@intel.com, Nicolas Chautru Subject: [PATCH v1 2/3] test/bbdev: add support for k0 parameter Date: Mon, 1 Jul 2024 14:27:02 -0700 Message-Id: <20240701212703.417094-3-nicolas.chautru@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240701212703.417094-1-nicolas.chautru@intel.com> References: <20240701212703.417094-1-nicolas.chautru@intel.com> MIME-Version: 1.0 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 New k0 added in LDPC decoder structure can be parsed by the bbdev test application. Signed-off-by: Nicolas Chautru Reviewed-by: Maxime Coquelin Acked-by: Hemant Agrawal --- app/test-bbdev/test_bbdev_perf.c | 7 +++++-- app/test-bbdev/test_bbdev_vector.c | 4 ++++ app/test-bbdev/test_bbdev_vector.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/test-bbdev/test_bbdev_perf.c b/app/test-bbdev/test_bbdev_perf.c index 3a94f15a30..67c55605fd 100644 --- a/app/test-bbdev/test_bbdev_perf.c +++ b/app/test-bbdev/test_bbdev_perf.c @@ -1923,6 +1923,7 @@ copy_reference_ldpc_dec_op(struct rte_bbdev_dec_op **ops, unsigned int n, ops[i]->ldpc_dec.n_cb = ldpc_dec->n_cb; ops[i]->ldpc_dec.iter_max = ldpc_dec->iter_max; ops[i]->ldpc_dec.rv_index = ldpc_dec->rv_index; + ops[i]->ldpc_dec.k0 = ldpc_dec->k0; ops[i]->ldpc_dec.op_flags = ldpc_dec->op_flags; ops[i]->ldpc_dec.code_block_mode = ldpc_dec->code_block_mode; @@ -2171,8 +2172,10 @@ validate_op_chain(struct rte_bbdev_op_data *op, * As per definition in 3GPP 38.212 Table 5.4.2.1-2 */ static inline uint16_t -get_k0(uint16_t n_cb, uint16_t z_c, uint8_t bg, uint8_t rv_index) +get_k0(uint16_t n_cb, uint16_t z_c, uint8_t bg, uint8_t rv_index, uint16_t k0) { + if (k0 > 0) + return k0; if (rv_index == 0) return 0; uint16_t n = (bg == 1 ? N_ZC_1 : N_ZC_2) * z_c; @@ -2202,7 +2205,7 @@ compute_harq_len(struct rte_bbdev_op_ldpc_dec *ops_ld) { uint16_t k0 = 0; uint8_t max_rv = (ops_ld->rv_index == 1) ? 3 : ops_ld->rv_index; - k0 = get_k0(ops_ld->n_cb, ops_ld->z_c, ops_ld->basegraph, max_rv); + k0 = get_k0(ops_ld->n_cb, ops_ld->z_c, ops_ld->basegraph, max_rv, ops_ld->k0); /* Compute RM out size and number of rows */ uint16_t parity_offset = (ops_ld->basegraph == 1 ? 20 : 8) * ops_ld->z_c - ops_ld->n_filler; diff --git a/app/test-bbdev/test_bbdev_vector.c b/app/test-bbdev/test_bbdev_vector.c index e48947b211..8b32850982 100644 --- a/app/test-bbdev/test_bbdev_vector.c +++ b/app/test-bbdev/test_bbdev_vector.c @@ -865,6 +865,10 @@ parse_ldpc_decoder_params(const char *key_token, char *token, vector->mask |= TEST_BBDEV_VF_RV_INDEX; ldpc_dec->rv_index = (uint8_t) strtoul(token, &err, 0); ret = ((err == NULL) || (*err != '\0')) ? -1 : 0; + } else if (!strcmp(key_token, "k0")) { + vector->mask |= TEST_BBDEV_VF_K0; + ldpc_dec->k0 = (uint16_t) strtoul(token, &err, 0); + ret = ((err == NULL) || (*err != '\0')) ? -1 : 0; } else if (!strcmp(key_token, "n_cb")) { vector->mask |= TEST_BBDEV_VF_NCB; ldpc_dec->n_cb = (uint16_t) strtoul(token, &err, 0); diff --git a/app/test-bbdev/test_bbdev_vector.h b/app/test-bbdev/test_bbdev_vector.h index ba1d0d20f9..9a2942132b 100644 --- a/app/test-bbdev/test_bbdev_vector.h +++ b/app/test-bbdev/test_bbdev_vector.h @@ -34,6 +34,7 @@ enum { TEST_BBDEV_VF_CODE_BLOCK_MODE = (1ULL << 23), TEST_BBDEV_VF_OP_FLAGS = (1ULL << 24), TEST_BBDEV_VF_EXPECTED_STATUS = (1ULL << 25), + TEST_BBDEV_VF_K0 = (1ULL << 26), }; enum op_data_type {