From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0071.outbound.protection.outlook.com [104.47.37.71]) by dpdk.org (Postfix) with ESMTP id 3AFF83237 for ; Tue, 12 Dec 2017 05:43:15 +0100 (CET) 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; bh=8n+pl92RthXgchhWKTL6vqN2Q8MJ/kcQxvSxbpGAgbY=; b=VmPr1/NYszZlc5zN1DP530oWvWNyh4msRCmHqYq5L6Cch5M3fe60ISZ4Uge+rJ4mf1L2omJx5B92gItpIJrRCmppFiHrOvt7+nXGM25YoMdP35mDPtbhtgnCqKkgoDT0vJprKSM6XyC0sMx4zL6ONCAmekYu0ZE4Q7a8eEJwEYg= Received: from BY1PR0701MB1111.namprd07.prod.outlook.com (10.160.104.21) by CO2PR07MB2725.namprd07.prod.outlook.com (10.166.200.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Tue, 12 Dec 2017 04:43:12 +0000 Received: from BY1PR0701MB1111.namprd07.prod.outlook.com ([fe80::c184:ee9b:3c4c:c97c]) by BY1PR0701MB1111.namprd07.prod.outlook.com ([fe80::c184:ee9b:3c4c:c97c%14]) with mapi id 15.20.0282.012; Tue, 12 Dec 2017 04:43:10 +0000 From: "Verma, Shally" To: "Trahe, Fiona" , "dev@dpdk.org" CC: "Athreya, Narayana Prasad" , "Challa, Mahipal" , "De Lara Guarch, Pablo" , "Gupta, Ashish" , "Sahu, Sunila" Thread-Topic: [RFC v2] lib: add compressdev API Thread-Index: AQHTZUUoNQnH1HwH4UCvzElEGQOLDqM0muHwgAn0loCAAK05wA== Date: Tue, 12 Dec 2017 04:43:10 +0000 Message-ID: References: <1511542566-10455-1-git-send-email-fiona.trahe@intel.com> <348A99DA5F5B7549AA880327E580B435892D04F9@IRSMSX101.ger.corp.intel.com> In-Reply-To: <348A99DA5F5B7549AA880327E580B435892D04F9@IRSMSX101.ger.corp.intel.com> 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; CO2PR07MB2725; 6:noIKGZGBz02sPTiJLykGIyh68apamY3lShphMhd0TnNttfNmnR4tidJguVRzAW/ucJ+AGqXT/sVngZafz25/V8KWt7KlEVZJzcfhFHUI6xwQlxzzr5dybDsYyDDkGe4uSrWWoCBTXinGHyRcRKmbljp7r0dFVC47CmQarT4NVdihYbrUvQW1A8uYcX5t0pl1T5iBZBid4x7QnRiXbSfm2OvrUomcnsUTP5FOPZrQZiNZhjgg55A8XtbNXLBg+vxCAUTOwOLsBDjGHr5N/FnGOpUiH0nta6c45uTwoIYtsWFuqpML51R2Ldn6dk2ARlKSYNRNb44YAhROFWiap2nqHiYfUgngNaQBB8EvZQ+3WJQ=; 5:+6pQs5jEGtaRPxislIpfHuJhn+CUeMa9PUFhb+RdgQhsT3mStCGKDa8xIuB5wKwPgnMzPqgVH6fLtPiK5FLEAr/axBZ4/ktrH/9i5byDWy3A9Cz7o0Ursh8e0oZljE7dkATpAhAF1XEZfE+IfOCEHz8VNK32Bj2hl+5wn/e/UHQ=; 24:+0+gS/GYJbW+h8hqXV76oZ7TCNx0EaF5cbcGFN/RzbYTrDaCdqe73sw1l9jOuJMWrPVZFUXOjwMwJIZS00dvLILDlgECDlWBcnZv9kLmvo4=; 7:b8GN+x0vNYTxufr0pz4h7GbjbDTwCa9N9wA4quAZ3So3fzhqZwMLGJFsdeEReNk//7H60ElG+o8PcGo9fe/k3CmfGSq86D1JRgTExQLGWGeVze/KxzwvdpOT64loc8YcJLUKbeQ8vwuWfBgdqDcoSxmhEuFKhqFF34dUBwvVwmoU7T4YkXKLTSscRufSFA2RzLEH/TfujFJlQy2qXcOsyYrim2XnxINpkpvM2grSFZ261gDROWHzkRNHBhqa/icS x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(376002)(366004)(346002)(189003)(199004)(13464003)(3280700002)(2501003)(478600001)(3660700001)(55016002)(33656002)(102836003)(6116002)(2950100002)(8676002)(81156014)(81166006)(86362001)(55236003)(6506006)(76176011)(105586002)(14454004)(97736004)(8936002)(72206003)(7696005)(6436002)(106356001)(66066001)(2900100001)(229853002)(110136005)(53936002)(2906002)(54906003)(5660300001)(305945005)(316002)(74316002)(7736002)(53546010)(4326008)(68736007)(6246003)(25786009)(5250100002)(107886003)(9686003)(99286004)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB2725; H:BY1PR0701MB1111.namprd07.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; x-ms-office365-filtering-correlation-id: db6a21ef-e452-42b9-d6e7-08d5411ad8c2 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:CO2PR07MB2725; x-ms-traffictypediagnostic: CO2PR07MB2725: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231023)(3002001)(10201501046)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(20161123555025)(20161123558100)(6072148)(201708071742011); SRVR:CO2PR07MB2725; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CO2PR07MB2725; x-forefront-prvs: 051900244E received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) 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: db6a21ef-e452-42b9-d6e7-08d5411ad8c2 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Dec 2017 04:43:10.2364 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2725 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: Tue, 12 Dec 2017 04:43:15 -0000 > -----Original Message----- > From: Trahe, Fiona [mailto:fiona.trahe@intel.com] > Sent: 11 December 2017 23:52 > To: Verma, Shally ; dev@dpdk.org > Cc: Athreya, Narayana Prasad ; > Challa, Mahipal ; De Lara Guarch, Pablo > ; Gupta, Ashish > ; Sahu, Sunila ; > Trahe, Fiona > Subject: RE: [RFC v2] lib: add compressdev API >=20 >=20 >=20 > > -----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 > > > > > > > > > -----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 > > > --- > > > > //snip// > > > > > +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 > > > + */ > > > > [Shally] believe this comment need an edit > > > > > + if (priv_sess_size < header_size) > > > + return header_size; > > > + > > > + return priv_sess_size; > > > > [Shally] This doesn't return header_size inclusive which is fine as per= API > 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? > > > [Fiona] I don't see a need for this and will just return what the PMD ret= urns. > Yes, appl should call rte_compressdev_get_header_session_size() > And rte_compressdev_get_private_session_size() for (one device in) each > driver 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 > each driver. > So if the session is intended to be used on 2 drivers, then the pool shou= ld be > sized so 3 objects are available (x max_nb_sessions). > Else the API layer would need to store offsets for each type of driver as= their > session size would be different. > Instead the API layer doesn't need offsets as each driver just grabs an o= bject > from the pool and stores the ptr to this in the hdr array. >=20 [Shally] Ok. Got it. Thanks Shally >=20 > > > + > > > +} > > //snip// > > > > Thanks > > Shally