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 057A229CF for ; Mon, 11 Dec 2017 19:22:33 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2017 10:22:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,392,1508828400"; d="scan'208";a="12514976" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by fmsmga001.fm.intel.com with ESMTP; 11 Dec 2017 10:22:31 -0800 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX107.ger.corp.intel.com (163.33.3.99) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 11 Dec 2017 18:22:30 +0000 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.22]) by irsmsx112.ger.corp.intel.com ([169.254.1.12]) with mapi id 14.03.0319.002; Mon, 11 Dec 2017 18:22:29 +0000 From: "Trahe, Fiona" To: "Verma, Shally" , "dev@dpdk.org" CC: "Athreya, Narayana Prasad" , "Challa, Mahipal" , "De Lara Guarch, Pablo" , "Gupta, Ashish" , "Sahu, Sunila" , "Trahe, Fiona" Thread-Topic: [RFC v2] lib: add compressdev API Thread-Index: AQHTZUUxYPpBxyfub02jF9OyvZw+yKM3uXAAgAbQmjA= Date: Mon, 11 Dec 2017 18:22:29 +0000 Message-ID: <348A99DA5F5B7549AA880327E580B435892D04F9@IRSMSX101.ger.corp.intel.com> References: <1511542566-10455-1-git-send-email-fiona.trahe@intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmExZWUyODAtN2Y3ZC00YzJlLTg4NDgtYjJmODIxNjA5NzhiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImNTdUJmb2N4K1U0T1JrY295V29ZeUtCMlhROEhCcjRxbWdDcTB1WGlDRjQ9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 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] [RFC v2] lib: add compressdev API 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: Mon, 11 Dec 2017 18:22:34 -0000 > -----Original Message----- > From: Verma, Shally [mailto:Shally.Verma@cavium.com] > Sent: Thursday, December 7, 2017 9:59 AM > To: Trahe, Fiona ; dev@dpdk.org > Cc: Athreya, Narayana Prasad ; Challa,= Mahipal > ; De Lara Guarch, Pablo ; Gupta, > Ashish ; Sahu, Sunila > Subject: RE: [RFC v2] lib: add compressdev API >=20 >=20 >=20 > > -----Original Message----- > > From: Trahe, Fiona [mailto:fiona.trahe@intel.com] > > Sent: 24 November 2017 22:26 > > To: dev@dpdk.org; Verma, Shally > > Cc: Challa, Mahipal ; Athreya, Narayana > > Prasad ; > > pablo.de.lara.guarch@intel.com; fiona.trahe@intel.com > > Subject: [RFC v2] lib: add compressdev API > > > > compressdev API > > > > Signed-off-by: Trahe, Fiona > > --- >=20 > //snip// >=20 > > +unsigned int > > +rte_compressdev_get_header_session_size(void) > > +{ > > + /* > > + * Header contains pointers to the private data > > + * of all registered drivers > > + */ > > + return (sizeof(void *) * nb_drivers); > > +} > > + > > +unsigned int > > +rte_compressdev_get_private_session_size(uint8_t dev_id) > > +{ > > + struct rte_compressdev *dev; > > + unsigned int header_size =3D sizeof(void *) * nb_drivers; > > + unsigned int priv_sess_size; > > + > > + if (!rte_compressdev_pmd_is_valid_dev(dev_id)) > > + return 0; > > + > > + dev =3D rte_compressdev_pmd_get_dev(dev_id); > > + > > + if (*dev->dev_ops->session_get_size =3D=3D NULL) > > + return 0; > > + > > + priv_sess_size =3D (*dev->dev_ops->session_get_size)(dev); > > + > > + /* > > + * If size is less than session header size, > > + * return the latter, as this guarantees that > > + * sessionless operations will work > > + */ >=20 > [Shally] believe this comment need an edit >=20 > > + if (priv_sess_size < header_size) > > + return header_size; > > + > > + return priv_sess_size; >=20 > [Shally] This doesn't return header_size inclusive which is fine as per A= PI definition. So should application > call > rte_compressdev_get_header_session_size() in case it want to know header_= size overhead per session > and allocate pool with elt_size =3D sess_header_size + dev_priv_sz? >=20 [Fiona] I don't see a need for this and will just return what the PMD retur= ns. Yes, appl should call rte_compressdev_get_header_session_size() And rte_compressdev_get_private_session_size() for (one device in) each dri= ver it wants the session to handle. And pick the largest of these as the element size. The idea is to use one mempool object for the hdr and another object for ea= ch driver. So if the session is intended to be used on 2 drivers, then the pool should= be sized so 3 objects are available (x max_nb_sessions).=20 Else the API layer would need to store offsets for each type of driver as t= heir session size would be different. Instead the API layer doesn't need offsets as each driver just grabs an obj= ect from the pool and stores the ptr to this in the hdr array. =20 > > + > > +} > //snip// >=20 > Thanks > Shally