baseband/acc100: fix null HARQ input case

An invalid HW operation may be caused in case the user provide
the BBDEV API and HARQ operation with input enabled and zero input.
Added protection for that case.

Fixes: 5ad5060f8f ("baseband/acc100: add LDPC processing functions")
Cc: stable@dpdk.org

Signed-off-by: Hernan Vargas <hernan.vargas@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
This commit is contained in:
Hernan Vargas 2022-10-20 22:20:45 -07:00 committed by Akhil Goyal
parent badb3b79b9
commit 75114f78cf

View File

@ -1068,6 +1068,14 @@ acc100_fcw_ld_fill(struct rte_bbdev_dec_op *op, struct acc_fcw_ld *fcw,
op->ldpc_dec.tb_params.ea :
op->ldpc_dec.tb_params.eb;
if (unlikely(check_bit(op->ldpc_dec.op_flags,
RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE) &&
(op->ldpc_dec.harq_combined_input.length == 0))) {
rte_bbdev_log(WARNING, "Null HARQ input size provided");
/* Disable HARQ input in that case to carry forward. */
op->ldpc_dec.op_flags ^= RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE;
}
fcw->hcin_en = check_bit(op->ldpc_dec.op_flags,
RTE_BBDEV_LDPC_HQ_COMBINE_IN_ENABLE);
fcw->hcout_en = check_bit(op->ldpc_dec.op_flags,