The previous processing logic of ecc_sqe_parse() was not clear enough, so it was modified.
Signed-off-by: Zhiqi Song songzhiqi1@huawei.com --- drv/hisi_hpre.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/drv/hisi_hpre.c b/drv/hisi_hpre.c index a232e84..877b2a5 100644 --- a/drv/hisi_hpre.c +++ b/drv/hisi_hpre.c @@ -557,6 +557,7 @@ static void hpre_result_check(struct hisi_hpre_sqe *hw_msg, __u8 *result) { *result = WD_SUCCESS; + if (hw_msg->done != HPRE_HW_TASK_DONE || hw_msg->etype || hw_msg->etype1) { WD_ERR("failed to do hpre task! done=0x%x, etype=0x%x, etype1=0x%x!\n", @@ -2258,18 +2259,22 @@ static int ecc_sqe_parse(struct hisi_qp *qp, struct wd_ecc_msg *msg, }
hpre_result_check(hw_msg, &msg->result); - if (!msg->result) { - ret = ecc_out_transfer(msg, hw_msg, qp->q_info.qp_mode); - if (ret) { - msg->result = WD_OUT_EPARA; - WD_ERR("failed to transfer out ecc BD, ret = %d!\n", ret); - } - } else { + if (msg->result) { ret = -msg->result; + goto err; }
- if (unlikely(msg->result != WD_SUCCESS)) - dump_hpre_msg(temp_msg, "ecc"); + ret = ecc_out_transfer(msg, hw_msg, qp->q_info.qp_mode); + if (ret) { + msg->result = WD_OUT_EPARA; + WD_ERR("failed to transfer out ecc BD, ret = %d!\n", ret); + goto err; + } + + return ret; + +err: + dump_hpre_msg(temp_msg, "ecc");
return ret; }