From patchwork Mon Jul 1 21:27:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chautru, Nicolas" X-Patchwork-Id: 141999 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 2FDCD4553F; Mon, 1 Jul 2024 23:26:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15F7B402D3; Mon, 1 Jul 2024 23:26:54 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by mails.dpdk.org (Postfix) with ESMTP id C24FC4021E 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=XwgwHhEyN3ohuReJEsXYGNwI9+7Gva8y7YgmFSvJiIk=; b=IgIvdCc+tshER2CEgiJE2eyhq4a6fFC5PjNUDYwZxlCshOV8lSiukpyo Lzdf24BPYsLjCBYRD8JJE5pDgpAJo3fVDhBl1tBobdLwVfiZVVcH8c89m dlxG5l3XBXyc2jUxeHc+z9NNzdiT9jXwUVHJeAdWioLk0HOvV2f7dr2+6 LaSKr0I08TzgNVKj+znhbB5aJAK2Cfrp9o0FP9S9SVlIZMv30Y0UE+UbH rLWz7ABA9ZRqiWcSl+g9SaqebgcoSXbGnS9b2iMy1rLgdVEQ56x1oYkxA 3k5M7halwyixLkN6X+IhYjsI+nKBoq9FirvUfjP5GkK8GyMEm4mgy35Ad Q==; X-CSE-ConnectionGUID: IEOUnYMvQ+WQ1+ZKOi6MVw== X-CSE-MsgGUID: lYG1u79RT42HCD+xMnfyDg== X-IronPort-AV: E=McAfee;i="6700,10204,11120"; a="20834734" X-IronPort-AV: E=Sophos;i="6.09,177,1716274800"; d="scan'208";a="20834734" 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:50 -0700 X-CSE-ConnectionGUID: tCKv+8w1RMmD09anSRHr6Q== X-CSE-MsgGUID: CKi0pbfHQ5S5+l45kPzZbg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,177,1716274800"; d="scan'208";a="45559925" 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 1/3] bbdev: new k0 parameter for LDPC decoder operation Date: Mon, 1 Jul 2024 14:27:01 -0700 Message-Id: <20240701212703.417094-2-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 In latest 3GPP 38.212, the k0 value is not necessaraly directly derived from rv_index, in that case a value can be provided in API. When this value is non null this would override the value which would be computed purely from rv_index. Signed-off-by: Nicolas Chautru Reviewed-by: Maxime Coquelin Acked-by: Hemant Agrawal --- doc/guides/prog_guide/bbdev.rst | 2 ++ lib/bbdev/rte_bbdev_op.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/doc/guides/prog_guide/bbdev.rst b/doc/guides/prog_guide/bbdev.rst index 09e5f0d990..e3f356450b 100644 --- a/doc/guides/prog_guide/bbdev.rst +++ b/doc/guides/prog_guide/bbdev.rst @@ -1021,6 +1021,8 @@ The LDPC decode parameters are set out in the table below. +----------------+------------+-------------------------------------------------------+ | |eb |Eb, length of the RM output sequence in bits r >= cab | +----------------+------------+-------------------------------------------------------+ +| |k0 |Optional k0 Rate matching starting position override | ++----------------+------------+-------------------------------------------------------+ The mbuf input ``input`` encoded CB data is mandatory for all BBDEV PMDs and is the Virtual Circular Buffer data stream with null padding. diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h index 459631d0d0..b5dde116ab 100644 --- a/lib/bbdev/rte_bbdev_op.h +++ b/lib/bbdev/rte_bbdev_op.h @@ -562,6 +562,10 @@ struct rte_bbdev_op_ldpc_dec { /** Struct which stores Transport Block specific parameters */ struct rte_bbdev_op_dec_ldpc_tb_params tb_params; }; + /** Optional k0 Rate matching starting position, overrides rv_index when non null + * [3GPP TS38.212, section 5.4.2.1] + */ + uint16_t k0; }; /* >8 End of structure rte_bbdev_op_ldpc_dec. */ 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 { From patchwork Mon Jul 1 21:27:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chautru, Nicolas" X-Patchwork-Id: 142001 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 B07A74553F; Mon, 1 Jul 2024 23:27:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96B4B4060A; Mon, 1 Jul 2024 23:26:56 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by mails.dpdk.org (Postfix) with ESMTP id 6F50F4021E for ; Mon, 1 Jul 2024 23:26:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719869213; x=1751405213; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XvDlc706YXHlI5yaksI/2aU/K8r+mfyd/lAo6oxSYs8=; b=WzN1QQqHEMB/vzM1j+tN4tiyuSpx1Sz3Lpn3Fz4O7Loh5KMC7IM+7rk5 OeaduzkHl3/XZWzNgYqQjB5FNpwa5tHrPMQn72bTS7iW3cxq9tLKtXlGO z0pBRy4h0U+srSedqFN2EdQFjYKh1htWKc12kQOBWzbo9V/9Gfcetj+Zt ezFJtGITBttiQlUb/L2sb5s9zQoqADSbIIsd4KT3qQG75GmCA0O3xHSCS M3oGLuTozdW5MbLR+aBF5tKHViAq+6oaiUNrXGiAcmMR+yoEMdpJ7yWeN 5t9hXP6sqC4/5eAXVzkM8X6V4QPGK42HOnzY470duaaRxRsOOmp/TKiHm Q==; X-CSE-ConnectionGUID: mD4WKm7CQmih42sYAJrPrA== X-CSE-MsgGUID: JNF57a7GRQ6BI8oo75Xezw== X-IronPort-AV: E=McAfee;i="6700,10204,11120"; a="20834742" X-IronPort-AV: E=Sophos;i="6.09,177,1716274800"; d="scan'208";a="20834742" 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: XTf/XY3GTxehqUGIFNm0xw== X-CSE-MsgGUID: B336SS18RMO/n5Pztz1Jvw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,177,1716274800"; d="scan'208";a="45559934" 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:51 -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 3/3] baseband/acc: add support for k0 parameter Date: Mon, 1 Jul 2024 14:27:03 -0700 Message-Id: <20240701212703.417094-4-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 The k0 may be provided to the PMD, which would be used as the circular buffer starting position instead of value which would be computed from legacy rv_index derived computation. Signed-off-by: Nicolas Chautru Reviewed-by: Maxime Coquelin Acked-by: Hemant Agrawal --- drivers/baseband/acc/acc_common.h | 6 ++++-- drivers/baseband/acc/rte_acc100_pmd.c | 2 +- drivers/baseband/acc/rte_vrb_pmd.c | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/baseband/acc/acc_common.h b/drivers/baseband/acc/acc_common.h index e249f37e38..46b564ce65 100644 --- a/drivers/baseband/acc/acc_common.h +++ b/drivers/baseband/acc/acc_common.h @@ -982,8 +982,10 @@ acc_fcw_te_fill(const struct rte_bbdev_enc_op *op, struct acc_fcw_te *fcw) * Starting position of different redundancy versions, k0 */ 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 ? ACC_N_ZC_1 : ACC_N_ZC_2) * z_c; @@ -1020,7 +1022,7 @@ acc_fcw_le_fill(const struct rte_bbdev_enc_op *op, fcw->Zc = op->ldpc_enc.z_c; fcw->ncb = op->ldpc_enc.n_cb; fcw->k0 = get_k0(fcw->ncb, fcw->Zc, op->ldpc_enc.basegraph, - op->ldpc_enc.rv_index); + op->ldpc_enc.rv_index, 0); fcw->rm_e = (default_e == 0) ? op->ldpc_enc.cb_params.e : default_e; fcw->crc_select = check_bit(op->ldpc_enc.op_flags, RTE_BBDEV_LDPC_CRC_24B_ATTACH); diff --git a/drivers/baseband/acc/rte_acc100_pmd.c b/drivers/baseband/acc/rte_acc100_pmd.c index ab69350080..7da421e26c 100644 --- a/drivers/baseband/acc/rte_acc100_pmd.c +++ b/drivers/baseband/acc/rte_acc100_pmd.c @@ -1159,7 +1159,7 @@ acc100_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw, fcw->Zc = op->ldpc_dec.z_c; fcw->ncb = op->ldpc_dec.n_cb; fcw->k0 = get_k0(fcw->ncb, fcw->Zc, op->ldpc_dec.basegraph, - op->ldpc_dec.rv_index); + op->ldpc_dec.rv_index, op->ldpc_dec.k0); if (op->ldpc_dec.code_block_mode == RTE_BBDEV_CODE_BLOCK) fcw->rm_e = op->ldpc_dec.cb_params.e; else diff --git a/drivers/baseband/acc/rte_vrb_pmd.c b/drivers/baseband/acc/rte_vrb_pmd.c index 585dc49bd6..ef34fc1c57 100644 --- a/drivers/baseband/acc/rte_vrb_pmd.c +++ b/drivers/baseband/acc/rte_vrb_pmd.c @@ -1550,7 +1550,7 @@ vrb_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw, fcw->Zc = op->ldpc_dec.z_c; fcw->ncb = op->ldpc_dec.n_cb; fcw->k0 = get_k0(fcw->ncb, fcw->Zc, op->ldpc_dec.basegraph, - op->ldpc_dec.rv_index); + op->ldpc_dec.rv_index, op->ldpc_dec.k0); if (op->ldpc_dec.code_block_mode == RTE_BBDEV_CODE_BLOCK) fcw->rm_e = op->ldpc_dec.cb_params.e; else @@ -2274,7 +2274,7 @@ vrb2_fcw_letb_fill(const struct rte_bbdev_enc_op *op, struct acc_fcw_le *fcw) fcw->Zc = op->ldpc_enc.z_c; fcw->ncb = op->ldpc_enc.n_cb; fcw->k0 = get_k0(fcw->ncb, fcw->Zc, op->ldpc_enc.basegraph, - op->ldpc_enc.rv_index); + op->ldpc_enc.rv_index, 0); fcw->rm_e = op->ldpc_enc.tb_params.ea; fcw->rm_e_b = op->ldpc_enc.tb_params.eb; fcw->crc_select = check_bit(op->ldpc_enc.op_flags,