From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680083.outbound.protection.outlook.com [40.107.68.83]) by dpdk.org (Postfix) with ESMTP id EE2EE1B44C for ; Wed, 20 Jun 2018 08:12:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uy2YIncozDghruvcIz4/0+Dz4Kkh7zEaiOT1qEvOMak=; b=IoWC103cXkUdhKPpEq7NP7rADqcBg2PE/Yds1ykl0HeZnQySeBj7d2SOe6Ym++OFthj4ZXnLmGrTVQw8cJlMu9Z68UD546X7th3wxGE5uNny3nKdpSk9JN6x2RFSf/LnndtW0zTF/+x4viZnIrTZXoNvGzMgJP3T5B93t7z8nME= Received: from CY4PR0701MB3634.namprd07.prod.outlook.com (52.132.101.164) by CY4PR0701MB3779.namprd07.prod.outlook.com (52.132.102.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.19; Wed, 20 Jun 2018 06:12:27 +0000 Received: from CY4PR0701MB3634.namprd07.prod.outlook.com ([fe80::f55a:7354:8d2f:cf0b]) by CY4PR0701MB3634.namprd07.prod.outlook.com ([fe80::f55a:7354:8d2f:cf0b%2]) with mapi id 15.20.0863.016; Wed, 20 Jun 2018 06:12:26 +0000 From: "Verma, Shally" To: "De Lara Guarch, Pablo" CC: "Trahe, Fiona" , "dev@dpdk.org" , "Athreya, Narayana Prasad" , "Challa, Mahipal" , "Gupta, Ashish" , "Sahu, Sunila" Thread-Topic: [PATCH v1 3/7] compress/octeontx: add xform and stream create support Thread-Index: AQHUCBrE+irdAQQU7UWiJfqjlK12m6Roqp4g Date: Wed, 20 Jun 2018 06:12:26 +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: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Shally.Verma@cavium.com; x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR0701MB3779; 7:m/RdYi/fU3mw3cI1JU6ZIdVoNT9j7lchu0MKbhtLHhll1HfmXkWaYF6hN98gB3LhIX576S0yKtwCR62X+hDqXxoIswFpvam2x3Q0OguKUJaHxpjg/JK/LlJiFHDvveotgBvPlNTw4xe/FPOzTNO1HTb8Cn+8+ETvg65DLRN4sTPdc2bIAqTaVj6RgxrzJTvewCzPFkAj2cQttOgwg2TOK5w5NB2bXxNZuW9o474DaGwciAvuUG8uy/5XYWqZ5wLe x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(396003)(346002)(39380400002)(39850400004)(366004)(376002)(52314003)(189003)(199004)(13464003)(478600001)(25786009)(3280700002)(2906002)(26005)(5250100002)(3660700001)(53936002)(107886003)(102836004)(4326008)(86362001)(2900100001)(55236004)(6506007)(106356001)(6246003)(68736007)(53546011)(105586002)(99286004)(14454004)(6116002)(81166006)(8676002)(81156014)(54906003)(3846002)(7696005)(72206003)(76176011)(33656002)(8936002)(9686003)(186003)(6916009)(229853002)(97736004)(316002)(6436002)(446003)(11346002)(305945005)(476003)(74316002)(66066001)(7736002)(486006)(5660300001)(55016002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3779; H:CY4PR0701MB3634.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-office365-filtering-correlation-id: 6a57267b-cff2-4181-f7ce-08d5d674cb8b x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:CY4PR0701MB3779; x-ms-traffictypediagnostic: CY4PR0701MB3779: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:CY4PR0701MB3779; BCL:0; PCL:0; RULEID:; SRVR:CY4PR0701MB3779; x-forefront-prvs: 070912876F received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: nI3DFmGzPOiln/9rBdW8M6q3jpTVXmgB42q1Zuxm2ghSwOgXUWCVyMb7sJ/QirJqAu3Mm+seQNeR8qoue8ItFSwpOXkuiD1Ti0zStfvwd2PcUYvKeerFF7xdR2VSDEwGRCGzx1e0oEU+9zzQfCNFGfKSIJ4rc8d/3LRPoNLpX0/h4NdqzFWVdScNTgQ1zif4eNIOVlqoOh0DThGt+C4t3Q3vxoyxjPRH+vM43WbK2a+MKZLwgA5bIYVoBCJQQu4sULJibU/ndF2jo3URAFazsf/29ic4zHJDRyRH55dgh7iqF8hYXEJ3mXvnd8I4NT/kXHcenmd3KP0kZcns5zrERA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a57267b-cff2-4181-f7ce-08d5d674cb8b X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jun 2018 06:12:26.1197 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3779 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: Wed, 20 Jun 2018 06:12:29 -0000 >-----Original Message----- >From: De Lara Guarch, Pablo [mailto:pablo.de.lara.guarch@intel.com] >Sent: 20 June 2018 03:43 >To: Verma, Shally >Cc: Trahe, Fiona ; dev@dpdk.org; Athreya, Narayana = Prasad ; >Challa, Mahipal ; Gupta, Ashish ; Sahu, Sunila > >Subject: RE: [PATCH v1 3/7] compress/octeontx: add xform and stream create= support > >External Email > >> -----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 >> >> implement private xform and stream create ops >> >> 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(+) >> >> 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. > [Shally] We're using mempool for per-stream resources but not specifically = for stream struct itself. We, though, had thought about approach too but it turns out to be more feas= ible to keep it this way for now. > >> + 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; >> + 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 th= e memory then. > Thanks for review. Shally