X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcompress%2Fqat%2Fqat_comp.c;h=835aaa83826d6e791ca3093a0383fac0476c4b0b;hb=96c343868dd15ebdc74371a9dea2288b30ce13ea;hp=dd0fe1b34f0dec50513cc58c343278df567b566a;hpb=bf0cd226435ceff18980cfc5c11e2d13b2d56847;p=dpdk.git diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c index dd0fe1b34f..835aaa8382 100644 --- a/drivers/compress/qat/qat_comp.c +++ b/drivers/compress/qat/qat_comp.c @@ -170,6 +170,18 @@ qat_comp_build_request(void *in_op, uint8_t *out_msg, rte_pktmbuf_mtophys_offset(op->m_dst, op->dst.offset); } + if (unlikely(rte_pktmbuf_pkt_len(op->m_dst) < QAT_MIN_OUT_BUF_SIZE)) { + /* QAT doesn't support dest. buffer lower + * than QAT_MIN_OUT_BUF_SIZE. Propagate error mark + * by converting this request to the null one + * and check the status in the response. + */ + QAT_DP_LOG(WARNING, "QAT destination buffer too small - resend with larger buffer"); + comp_req->comn_hdr.service_type = ICP_QAT_FW_COMN_REQ_NULL; + comp_req->comn_hdr.service_cmd_id = ICP_QAT_FW_NULL_REQ_SERV_ID; + cookie->error = RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED; + } + #if RTE_LOG_DP_LEVEL >= RTE_LOG_DEBUG QAT_DP_LOG(DEBUG, "Direction: %s", qat_xform->qat_comp_request_type == QAT_COMP_REQUEST_DECOMPRESS ? @@ -181,10 +193,13 @@ qat_comp_build_request(void *in_op, uint8_t *out_msg, } int -qat_comp_process_response(void **op, uint8_t *resp, uint64_t *dequeue_err_count) +qat_comp_process_response(void **op, uint8_t *resp, void *op_cookie, + uint64_t *dequeue_err_count) { struct icp_qat_fw_comp_resp *resp_msg = (struct icp_qat_fw_comp_resp *)resp; + struct qat_comp_op_cookie *cookie = + (struct qat_comp_op_cookie *)op_cookie; struct rte_comp_op *rx_op = (struct rte_comp_op *)(uintptr_t) (resp_msg->opaque_data); struct qat_comp_xform *qat_xform = (struct qat_comp_xform *) @@ -201,6 +216,17 @@ qat_comp_process_response(void **op, uint8_t *resp, uint64_t *dequeue_err_count) sizeof(struct icp_qat_fw_comp_resp)); #endif + if (unlikely(cookie->error)) { + rx_op->status = cookie->error; + cookie->error = 0; + ++(*dequeue_err_count); + rx_op->debug_status = 0; + rx_op->consumed = 0; + rx_op->produced = 0; + *op = (void *)rx_op; + return 0; + } + if (likely(qat_xform->qat_comp_request_type != QAT_COMP_REQUEST_DECOMPRESS)) { if (unlikely(ICP_QAT_FW_COMN_HDR_CNV_FLAG_GET(