[v1,3/3] baseband/acc: add support for k0 parameter

Message ID 20240701212703.417094-4-nicolas.chautru@intel.com (mailing list archive)
State New
Delegated to: Maxime Coquelin
Headers
Series bbdev: new k0 parameter |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build fail github build: failed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-abi-testing warning Testing issues
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Nicolas Chautru July 1, 2024, 9:27 p.m. UTC
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 <nicolas.chautru@intel.com>
---
 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(-)
  

Comments

Maxime Coquelin Aug. 29, 2024, 8:01 a.m. UTC | #1
On 7/1/24 23:27, Nicolas Chautru wrote:
> 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 <nicolas.chautru@intel.com>
> ---
>   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(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Also reporting Hemant's Ack on the cover letter as patchwork doesn't
report them:
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Thanks,
Maxime
  

Patch

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,