aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/compress
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/compress')
-rw-r--r--drivers/compress/isal/isal_compress_pmd.c25
-rw-r--r--drivers/compress/octeontx/otx_zip_pmd.c5
-rw-r--r--drivers/compress/qat/qat_comp.c8
-rw-r--r--drivers/compress/qat/qat_comp_pmd.c38
-rw-r--r--drivers/compress/zlib/zlib_pmd.c4
5 files changed, 44 insertions, 36 deletions
diff --git a/drivers/compress/isal/isal_compress_pmd.c b/drivers/compress/isal/isal_compress_pmd.c
index e943336b..9f1e9688 100644
--- a/drivers/compress/isal/isal_compress_pmd.c
+++ b/drivers/compress/isal/isal_compress_pmd.c
@@ -314,24 +314,23 @@ chained_mbuf_decompression(struct rte_comp_op *op, struct isal_comp_qp *qp)
ret = isal_inflate(qp->state);
- /* Check for first segment, offset needs to be accounted for */
- if (remaining_data == op->src.length) {
- consumed_data = src->data_len - qp->state->avail_in -
- src_remaining_offset;
- } else
- consumed_data = src->data_len - qp->state->avail_in;
-
- op->consumed += consumed_data;
- remaining_data -= consumed_data;
-
if (ret != ISAL_DECOMP_OK) {
ISAL_PMD_LOG(ERR, "Decompression operation failed\n");
op->status = RTE_COMP_OP_STATUS_ERROR;
return ret;
}
+ /* Check for first segment, offset needs to be accounted for */
+ if (remaining_data == op->src.length) {
+ consumed_data = src->data_len - src_remaining_offset;
+ } else
+ consumed_data = src->data_len;
+
if (qp->state->avail_in == 0
&& op->consumed != op->src.length) {
+ op->consumed += consumed_data;
+ remaining_data -= consumed_data;
+
if (src->next != NULL) {
src = src->next;
qp->state->next_in =
@@ -460,8 +459,9 @@ process_isal_deflate(struct rte_comp_op *op, struct isal_comp_qp *qp,
return ret;
}
}
- op->consumed = qp->stream->total_in;
- op->produced = qp->stream->total_out;
+ op->consumed = qp->stream->total_in;
+ op->produced = qp->stream->total_out;
+ isal_deflate_reset(qp->stream);
return ret;
}
@@ -538,6 +538,7 @@ process_isal_inflate(struct rte_comp_op *op, struct isal_comp_qp *qp)
op->consumed = op->src.length - qp->state->avail_in;
}
op->produced = qp->state->total_out;
+ isal_inflate_reset(qp->state);
return ret;
}
diff --git a/drivers/compress/octeontx/otx_zip_pmd.c b/drivers/compress/octeontx/otx_zip_pmd.c
index 67ff5066..a1651b22 100644
--- a/drivers/compress/octeontx/otx_zip_pmd.c
+++ b/drivers/compress/octeontx/otx_zip_pmd.c
@@ -647,10 +647,7 @@ static struct rte_pci_driver octtx_zip_pmd = {
RTE_PMD_REGISTER_PCI(COMPRESSDEV_NAME_ZIP_PMD, octtx_zip_pmd);
RTE_PMD_REGISTER_PCI_TABLE(COMPRESSDEV_NAME_ZIP_PMD, pci_id_octtx_zipvf_table);
-RTE_INIT(octtx_zip_init_log);
-
-static void
-octtx_zip_init_log(void)
+RTE_INIT(octtx_zip_init_log)
{
octtx_zip_logtype_driver = rte_log_register("pmd.compress.octeontx");
if (octtx_zip_logtype_driver >= 0)
diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c
index d70c5949..27547428 100644
--- a/drivers/compress/qat/qat_comp.c
+++ b/drivers/compress/qat/qat_comp.c
@@ -141,6 +141,14 @@ qat_comp_process_response(void **op, uint8_t *resp)
resp_msg->comn_resp.comn_status)) !=
ICP_QAT_FW_COMN_STATUS_FLAG_OK) {
+ if (unlikely((ICP_QAT_FW_COMN_RESP_XLAT_STAT_GET(
+ resp_msg->comn_resp.comn_status) !=
+ ICP_QAT_FW_COMN_STATUS_FLAG_OK) &&
+ (qat_xform->qat_comp_request_type
+ == QAT_COMP_REQUEST_DYNAMIC_COMP_STATELESS)))
+ QAT_DP_LOG(ERR, "QAT intermediate buffer may be too "
+ "small for output, try configuring a larger size");
+
rx_op->status = RTE_COMP_OP_STATUS_ERROR;
rx_op->debug_status =
*((uint16_t *)(&resp_msg->comn_resp.comn_error));
diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c
index 01dd7361..ea930772 100644
--- a/drivers/compress/qat/qat_comp_pmd.c
+++ b/drivers/compress/qat/qat_comp_pmd.c
@@ -165,11 +165,14 @@ qat_comp_setup_inter_buffers(struct qat_comp_dev_private *comp_dev,
}
/* Create a memzone to hold intermediate buffers and associated
- * meta-data needed by the firmware. The memzone contains:
+ * meta-data needed by the firmware. The memzone contains 3 parts:
* - a list of num_im_sgls physical pointers to sgls
- * - the num_im_sgl sgl structures, each pointing to 2 flat buffers
- * - the flat buffers: num_im_sgl * 2
- * where num_im_sgls depends on the hardware generation of the device
+ * - the num_im_sgl sgl structures, each pointing to
+ * QAT_NUM_BUFS_IN_IM_SGL flat buffers
+ * - the flat buffers: num_im_sgl * QAT_NUM_BUFS_IN_IM_SGL
+ * buffers, each of buff_size
+ * num_im_sgls depends on the hardware generation of the device
+ * buff_size comes from the user via the config file
*/
size_of_ptr_array = num_im_sgls * sizeof(phys_addr_t);
@@ -202,30 +205,31 @@ qat_comp_setup_inter_buffers(struct qat_comp_dev_private *comp_dev,
offset_of_sgls + i * sizeof(struct qat_inter_sgl);
struct qat_inter_sgl *sgl =
(struct qat_inter_sgl *)(mz_start + curr_sgl_offset);
+ int lb;
array_of_pointers->pointer[i] = mz_start_phys + curr_sgl_offset;
sgl->num_bufs = QAT_NUM_BUFS_IN_IM_SGL;
sgl->num_mapped_bufs = 0;
sgl->resrvd = 0;
- sgl->buffers[0].addr = mz_start_phys + offset_of_flat_buffs +
- ((i * QAT_NUM_BUFS_IN_IM_SGL) * buff_size);
- sgl->buffers[0].len = buff_size;
- sgl->buffers[0].resrvd = 0;
- sgl->buffers[1].addr = mz_start_phys + offset_of_flat_buffs +
- (((i * QAT_NUM_BUFS_IN_IM_SGL) + 1) * buff_size);
- sgl->buffers[1].len = buff_size;
- sgl->buffers[1].resrvd = 0;
#if QAT_IM_BUFFER_DEBUG
QAT_LOG(DEBUG, " : phys addr of sgl[%i] in array_of_pointers"
- "= 0x%"PRIx64, i, array_of_pointers->pointer[i]);
+ " = 0x%"PRIx64, i, array_of_pointers->pointer[i]);
QAT_LOG(DEBUG, " : virt address of sgl[%i] = %p", i, sgl);
- QAT_LOG(DEBUG, " : sgl->buffers[0].addr = 0x%"PRIx64", len=%d",
- sgl->buffers[0].addr, sgl->buffers[0].len);
- QAT_LOG(DEBUG, " : sgl->buffers[1].addr = 0x%"PRIx64", len=%d",
- sgl->buffers[1].addr, sgl->buffers[1].len);
+#endif
+ for (lb = 0; lb < QAT_NUM_BUFS_IN_IM_SGL; lb++) {
+ sgl->buffers[lb].addr =
+ mz_start_phys + offset_of_flat_buffs +
+ (((i * QAT_NUM_BUFS_IN_IM_SGL) + lb) * buff_size);
+ sgl->buffers[lb].len = buff_size;
+ sgl->buffers[lb].resrvd = 0;
+#if QAT_IM_BUFFER_DEBUG
+ QAT_LOG(DEBUG,
+ " : sgl->buffers[%d].addr = 0x%"PRIx64", len=%d",
+ lb, sgl->buffers[lb].addr, sgl->buffers[lb].len);
#endif
}
+ }
#if QAT_IM_BUFFER_DEBUG
QAT_DP_HEXDUMP_LOG(DEBUG, "IM buffer memzone start:",
mz_start, offset_of_flat_buffs + 32);
diff --git a/drivers/compress/zlib/zlib_pmd.c b/drivers/compress/zlib/zlib_pmd.c
index 7d6871b1..5a4d47d4 100644
--- a/drivers/compress/zlib/zlib_pmd.c
+++ b/drivers/compress/zlib/zlib_pmd.c
@@ -425,10 +425,8 @@ static struct rte_vdev_driver zlib_pmd_drv = {
};
RTE_PMD_REGISTER_VDEV(COMPRESSDEV_NAME_ZLIB_PMD, zlib_pmd_drv);
-RTE_INIT(zlib_init_log);
-static void
-zlib_init_log(void)
+RTE_INIT(zlib_init_log)
{
zlib_logtype_driver = rte_log_register("pmd.compress.zlib");
if (zlib_logtype_driver >= 0)