From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id F354A1B757 for ; Wed, 9 May 2018 19:39:44 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2018 10:39:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,382,1520924400"; d="scan'208";a="47966931" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 09 May 2018 10:39:42 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 9 May 2018 10:39:42 -0700 Received: from fmsmsx104.amr.corp.intel.com ([169.254.3.184]) by fmsmsx120.amr.corp.intel.com ([169.254.15.21]) with mapi id 14.03.0319.002; Wed, 9 May 2018 10:39:42 -0700 From: "Tucker, Greg B" To: "Daly, Lee" , "dev@dpdk.org" CC: "De Lara Guarch, Pablo" , "Jain, Deepak K" , "Trahe, Fiona" Thread-Topic: [PATCH v6 08/10] compress/isal: add ISA-L compression functionality Thread-Index: AQHT57DjBdzI1afzQU24z0499dXK5KQnqMPA Date: Wed, 9 May 2018 17:39:42 +0000 Message-ID: References: <1525782775-138647-2-git-send-email-lee.daly@intel.com> <1525882475-183214-1-git-send-email-lee.daly@intel.com> <1525882475-183214-9-git-send-email-lee.daly@intel.com> In-Reply-To: <1525882475-183214-9-git-send-email-lee.daly@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGEwZTljOWEtNDBhNC00ODFjLTg3MjAtOWFjMDUyODQ2NDdiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkRcL1hRbm56N2E4RXQ2YXJHd3M2UEY4b0hvaEdOaXNHUFk1VFZ4dXpoVzVvPSJ9 dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.1.200.106] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 10 May 2018 00:50:25 +0200 Subject: Re: [dpdk-dev] [PATCH v6 08/10] compress/isal: add ISA-L compression functionality X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2018 17:39:45 -0000 > > Adds compression functionality, this sets internal ISA-L structures, prov= ides > input & output mbuf addresses, executes compression, which ISA-L calls de= flate, > and finally error checks. >=20 > Signed-off-by: Lee Daly Acked-by: Greg Tucker > --- > drivers/compress/isal/isal_compress_pmd.c | 83 +++++++++++++++++= +++++- > drivers/compress/isal/isal_compress_pmd_ops.c | 26 +++++++ > drivers/compress/isal/isal_compress_pmd_private.h | 2 + > 3 files changed, 109 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/compress/isal/isal_compress_pmd.c b/drivers/compress= /isal/isal_compress_pmd.c > index aaa0593..dbdee39 100644 > --- a/drivers/compress/isal/isal_compress_pmd.c > +++ b/drivers/compress/isal/isal_compress_pmd.c > @@ -6,6 +6,7 @@ > #include > #include > #include > +#include > #include >=20 > #include "isal_compress_pmd_private.h" > @@ -187,14 +188,92 @@ isal_comp_set_priv_xform_parameters(struct isal_pri= v_xform *priv_xform, > return 0; > } >=20 > +/* Stateless Compression Function */ > +static int > +process_isal_deflate(struct rte_comp_op *op, struct isal_comp_qp *qp, > + struct isal_priv_xform *priv_xform) > +{ > + int ret =3D 0; > + op->status =3D RTE_COMP_OP_STATUS_SUCCESS; > + > + /* Required due to init clearing level_buf */ > + uint8_t *temp_level_buf =3D qp->stream->level_buf; > + > + /* Initialize compression stream */ > + isal_deflate_stateless_init(qp->stream); > + > + qp->stream->level_buf =3D temp_level_buf; > + > + /* Stateless operation, input will be consumed in one go */ > + qp->stream->flush =3D NO_FLUSH; > + > + /* set op level & intermediate level buffer */ > + qp->stream->level =3D priv_xform->compress.level; > + qp->stream->level_buf_size =3D priv_xform->level_buffer_size; > + > + /* Point compression stream structure to input/output buffers */ > + qp->stream->avail_in =3D op->src.length; > + qp->stream->next_in =3D rte_pktmbuf_mtod(op->m_src, uint8_t *); > + qp->stream->avail_out =3D op->m_dst->data_len; > + qp->stream->next_out =3D rte_pktmbuf_mtod(op->m_dst, uint8_t *); > + qp->stream->end_of_stream =3D 1; /* All input consumed in one go */ > + > + if (unlikely(!qp->stream->next_in || !qp->stream->next_out)) { > + ISAL_PMD_LOG(ERR, "Invalid source or destination buffers\n"); > + op->status =3D RTE_COMP_OP_STATUS_INVALID_ARGS; > + return -1; > + } > + > + /* Set op huffman code */ > + if (priv_xform->compress.deflate.huffman =3D=3D RTE_COMP_HUFFMAN_FIXED) > + isal_deflate_set_hufftables(qp->stream, NULL, > + IGZIP_HUFFTABLE_STATIC); > + else if (priv_xform->compress.deflate.huffman =3D=3D > + RTE_COMP_HUFFMAN_DEFAULT) > + isal_deflate_set_hufftables(qp->stream, NULL, > + IGZIP_HUFFTABLE_DEFAULT); > + /* Dynamically change the huffman code to suit the input data */ > + else if (priv_xform->compress.deflate.huffman =3D=3D > + RTE_COMP_HUFFMAN_DYNAMIC) > + isal_deflate_set_hufftables(qp->stream, NULL, > + IGZIP_HUFFTABLE_DEFAULT); > + > + /* Execute compression operation */ > + ret =3D isal_deflate_stateless(qp->stream); > + > + /* Check that output buffer did not run out of space */ > + if (ret =3D=3D STATELESS_OVERFLOW) { > + ISAL_PMD_LOG(ERR, "Output buffer not big enough\n"); > + op->status =3D RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED; > + return ret; > + } > + > + /* Check that input buffer has been fully consumed */ > + if (qp->stream->avail_in !=3D (uint32_t)0) { > + ISAL_PMD_LOG(ERR, "Input buffer could not be read entirely\n"); > + op->status =3D RTE_COMP_OP_STATUS_ERROR; > + return -1; > + } > + > + if (ret !=3D COMP_OK) { > + op->status =3D RTE_COMP_OP_STATUS_ERROR; > + return ret; > + } > + > + op->consumed =3D qp->stream->total_in; > + op->produced =3D qp->stream->total_out; > + > + return ret; > +} > + --snip--