From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 191AB1B3B5 for ; Wed, 20 Jun 2018 00:13:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jun 2018 15:13:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,244,1526367600"; d="scan'208";a="238585138" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by fmsmga005.fm.intel.com with ESMTP; 19 Jun 2018 15:13:28 -0700 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by irsmsx105.ger.corp.intel.com (163.33.3.28) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 19 Jun 2018 23:13:27 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.139]) by irsmsx112.ger.corp.intel.com ([169.254.1.22]) with mapi id 14.03.0319.002; Tue, 19 Jun 2018 23:13:27 +0100 From: "De Lara Guarch, Pablo" To: Shally Verma CC: "Trahe, Fiona" , "dev@dpdk.org" , "pathreya@caviumnetworks.com" , "mchalla@caviumnetworks.com" , Ashish Gupta , Sunila Sahu Thread-Topic: [PATCH v1 3/7] compress/octeontx: add xform and stream create support Thread-Index: AQHT/LkE24n8p8CsUUS2OSrvt8SNWaRoOiHQ Date: Tue, 19 Jun 2018 22:13:27 +0000 Message-ID: References: <1528194913-25893-1-git-send-email-shally.verma@caviumnetworks.com> <1528194913-25893-4-git-send-email-shally.verma@caviumnetworks.com> In-Reply-To: <1528194913-25893-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTg4ZjQ3ZGYtNzRkZS00MWZmLWI0MmEtYTRiYzIxODA4YTJlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVnV0ZlRNdWVXTTM3SGVWUEhpYWNkRzYydHI4WlJxOHNHa2o4QkpBQnUwNlRoSVVxbFwvdDJDZWxETjBQdmF4QlcifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1 3/7] compress/octeontx: 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: Tue, 19 Jun 2018 22:13:33 -0000 > -----Original Message----- > From: Shally Verma [mailto:shally.verma@caviumnetworks.com] > Sent: Tuesday, June 5, 2018 11:35 AM > To: De Lara Guarch, Pablo > Cc: Trahe, Fiona ; dev@dpdk.org; > pathreya@caviumnetworks.com; mchalla@caviumnetworks.com; Ashish Gupta > ; Sunila Sahu > > Subject: [PATCH v1 3/7] compress/octeontx: add xform and stream create > support >=20 > implement private xform and stream create ops >=20 > Signed-off-by: Ashish Gupta > Signed-off-by: Shally Verma > Signed-off-by: Sunila Sahu > --- > drivers/compress/octeontx/zip_pmd.c | 138 > ++++++++++++++++++++++++++++++++++++ > drivers/compress/octeontx/zipvf.h | 29 ++++++++ > 2 files changed, 167 insertions(+) >=20 > diff --git a/drivers/compress/octeontx/zip_pmd.c > b/drivers/compress/octeontx/zip_pmd.c > index 3bb7f6896..349114626 100644 > --- a/drivers/compress/octeontx/zip_pmd.c > +++ b/drivers/compress/octeontx/zip_pmd.c ... > +static int > +zip_pmd_stream_create(struct rte_compressdev *dev, > + const struct rte_comp_xform *xform, void **stream) { > + int ret; > + struct zip_stream *strm; > + > + strm =3D rte_malloc(NULL, > + sizeof(struct zip_stream), 0); Should not this come from a mempool, as there is an option in the configuration for max number of sessions. > + ret =3D zip_set_stream_parameters(dev, xform, strm); > + if (ret < 0) { > + ZIP_PMD_ERR("failed configure xform parameters"); > + rte_free(strm); > + return ret; > + } > + *stream =3D strm; =09 > + return 0; > +} > + > +static int > +zip_pmd_stream_free(struct rte_compressdev *dev, void *stream) { > + struct zip_vf *vf =3D (struct zip_vf *) (dev->data->dev_private); > + struct zip_stream *z_stream; > + > + if (stream =3D=3D NULL) > + return -1; > + > + z_stream =3D (struct zip_stream *)stream; > + rte_mempool_put_bulk(vf->zip_mp, > + (void *)&(z_stream->bufs[0]), > + MAX_BUFS_PER_STREAM); > + > + /* Zero out the whole structure */ > + memset(stream, 0, sizeof(struct zip_stream)); > + rte_free(stream); I was expecting this stream to be put back into a mempool, but anyway, there is no need to reset this structure if you are freeing the= memory then.