From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id B54781B552 for ; Wed, 11 Jul 2018 14:26:45 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jul 2018 05:26:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,338,1526367600"; d="scan'208";a="73928384" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by orsmga002.jf.intel.com with ESMTP; 11 Jul 2018 05:26:36 -0700 Received: from irsmsx107.ger.corp.intel.com ([169.254.10.193]) by irsmsx105.ger.corp.intel.com ([169.254.7.26]) with mapi id 14.03.0319.002; Wed, 11 Jul 2018 13:26:36 +0100 From: "De Lara Guarch, Pablo" To: Shally Verma CC: "dev@dpdk.org" , "pathreya@caviumnetworks.com" , "mchalla@caviumnetworks.com" , Sunila Sahu , "Sunila Sahu" , Ashish Gupta Thread-Topic: [PATCH v2 3/5] compress/zlib: add xform and stream create support Thread-Index: AQHUEiXXxaSHJzI580GdudwfHCHWXaSJ7B/A Date: Wed, 11 Jul 2018 12:26:35 +0000 Message-ID: References: <1530550631-22841-1-git-send-email-shally.verma@caviumnetworks.com> <1530550631-22841-4-git-send-email-shally.verma@caviumnetworks.com> In-Reply-To: <1530550631-22841-4-git-send-email-shally.verma@caviumnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMmM0OThjOTktMmY0NS00MzQyLTlhZjEtM2M5OTg1OTA1MTJkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNFZUZURrZVVyQWZRNlg2UG1SSDNwOVB4RzFGZjkxR25sVmxwcVJOdEx3K3RjWVwvUjNnWjJNXC91eHBncSt1d0hGIn0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 3/5] compress/zlib: add xform and stream create support 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, 11 Jul 2018 12:26:46 -0000 > -----Original Message----- > From: Shally Verma [mailto:shally.verma@caviumnetworks.com] > Sent: Monday, July 2, 2018 5:57 PM > To: De Lara Guarch, Pablo > Cc: dev@dpdk.org; pathreya@caviumnetworks.com; > mchalla@caviumnetworks.com; Sunila Sahu ; > Sunila Sahu ; Ashish Gupta > > Subject: [PATCH v2 3/5] compress/zlib: add xform and stream create suppor= t Retitle to "compress/zlib: support xform and stream creation" About stateful, since it looks like it is not supported for the moment, I think stream_create/stream_free functions should fail or should not be im= plemented. More comments inline. >=20 > From: Sunila Sahu >=20 > Implement private xform and stream create ops >=20 > Signed-off-by: Sunila Sahu > Signed-off-by: Shally Verma > Signed-off-by: Ashish Gupta > --- > drivers/compress/zlib/zlib_pmd.c | 93 > ++++++++++++++++++++++++++++++++ > drivers/compress/zlib/zlib_pmd_ops.c | 83 ++++++++++++++++++++++++++= -- > drivers/compress/zlib/zlib_pmd_private.h | 4 ++ > 3 files changed, 176 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/compress/zlib/zlib_pmd.c b/drivers/compress/zlib/zli= b_pmd.c > index c4f67bb..7c2614e 100644 > --- a/drivers/compress/zlib/zlib_pmd.c > +++ b/drivers/compress/zlib/zlib_pmd.c ... > + case RTE_COMP_HUFFMAN_DYNAMIC: > + strategy =3D Z_HUFFMAN_ONLY; I don't think this is the suitable value for dynamic compression. Z_HUFFMAN_ONLY does not do LZ77. I think the strategy for this case is Z_DE= FAULT_STRATEGY. > + break; > + default: > + ZLIB_PMD_ERR("Compression strategy not > supported\n"); > + return -1; > + } ... > +++ b/drivers/compress/zlib/zlib_pmd_ops.c ... > + struct rte_mempool *mp =3D rte_mempool_lookup(internals->mp_name); As said in other email, you can directly get the mempool pointer from inter= nals. > + if (rte_mempool_get(mp, zstream)) { > + ZLIB_PMD_ERR( > + "Couldn't get object from session mempool"); This can be in the same line. ... > +/** Configure private xform */ > +static int > +zlib_pmd_private_xform_create(struct rte_compressdev *dev, > + const struct rte_comp_xform *xform, > + void **private_xform) > +{ > + int ret =3D 0; > + > + ret =3D zlib_pmd_stream_create(dev, xform, private_xform); > + return ret; This can be written like "return zlib_pmd_stream_create(...); ... > + .private_xform_create =3D zlib_pmd_private_xform_create, > + .private_xform_free =3D > zlib_pmd_private_xform_free, Fix indentation here. >=20 > - .stream_create =3D NULL, > - .stream_free =3D NULL > + .stream_create =3D zlib_pmd_stream_create, > + .stream_free =3D zlib_pmd_stream_free > };