From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0043.outbound.protection.outlook.com [104.47.33.43]) by dpdk.org (Postfix) with ESMTP id E93BF1C00 for ; Thu, 7 Dec 2017 10:58:57 +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=K7aMEyswZCalUrkelxpJLLT8JDyojvDfSfy+hsnPdj8=; b=dtZWj5FH9fQ44kWuNgii3msu8ImPaUlWrRhWrlnTw/Aa64a277Ky6H+bElm7MFZWdFkKjwM4vANkdVzLQ9zOo5MClcy4O0ktRJg0IaDEQJn5DJzU3zmgZ/NLggStKx2B7TsK9RbmSUVuutYYvuFlYPa9aGqe/rCxuT0t2PFIqL4= Received: from BY1PR0701MB1111.namprd07.prod.outlook.com (10.160.104.21) by CY1PR07MB2731.namprd07.prod.outlook.com (10.167.10.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Thu, 7 Dec 2017 09:58:56 +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; Thu, 7 Dec 2017 09:58:55 +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: AQHTZUUoNQnH1HwH4UCvzElEGQOLDqM0muHw Date: Thu, 7 Dec 2017 09:58:54 +0000 Message-ID: References: <1511542566-10455-1-git-send-email-fiona.trahe@intel.com> In-Reply-To: <1511542566-10455-1-git-send-email-fiona.trahe@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; CY1PR07MB2731; 6:WMe37o7kz0I87lcaXC2xk2z8nAuRY3qn4C3ynzO4sNr/8hOrK8xXtn4DlQ8ITyJwOCj/igw2wuddyloa8QXy7X3djsJPasdZZJZSQC1f+K9+/nzE54QaBFmJiLRCwgfd271SkGj3tIN2aHkbSHsRIi4/f+uZZLRqqHyK6pP/JzpirLTX4Igw3uEkvKZyiQ1gASFkjEXanBYTyBFDelczHolwA0q7H/T4DqzWsgxeSJZvPHGsAlrgierAwG/XJ6jNRR6xUlXqQZ2uCzhzt2rD5L/BRz5aL7ARtuzD4TfxUwCfB88XSmxwniWmMwWH2qXYWVhmq9n8TnhcoR2vzFOIBLwPRDBlV+rWJIVHcpbg550=; 5:N4Tl5dYD+HcO3q9+pXH9uFR4O3h6E29/EfSOzIyZfUPEnSOpgFwbGVgX8Wm3SLcRXYIPFxXIoLcVuebMiYXOvagBW9mwgoGnI08/G1EgJr+4LjbeCZa9GGcVJjyRh8Yf+NcRYNQokGOSNirTvHfMpXTTfFJlzW13U3dONvsLf0k=; 24:CgXm2mBWFx2JPkuJenxe7PU8XL0SqW6dvJTJT6DvXhM8lBSECJ8b8eWSzIH0WgW8lAHn6MGiaQKN6wLDOYeLhvBLTAFcZaQaf50+kOSXDIg=; 7:DCmL3uhpTjCJqYXYhssayUOmYzSH5l+DwuYUqKLoi7VhNFTAGTSzYbMpH8AlAUFe4sDUVxlyYaZ6+GYzlhdlxjFHiJsQHHwg6vyiEjNyx5fXOtp3zO0J3QFzoB67UeCRXhh8LRnrRnlLoTV6+EGahc402tGE50xXShv/YRIPejmDlgZgi5rZodTcvFkBHrVWec1Cf3D2Zdz52Q44v1MLvVQVOuTcZP0hgN6H7WyMeiKrAITJYzOXoJN+ZbJ6NQC2 x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(366004)(346002)(376002)(199004)(189003)(13464003)(229853002)(14454004)(72206003)(4326008)(66066001)(105586002)(6116002)(102836003)(5250100002)(3846002)(2900100001)(76176011)(8936002)(68736007)(106356001)(6436002)(6506006)(33656002)(101416001)(110136005)(316002)(54906003)(55016002)(53936002)(5660300001)(3280700002)(86362001)(81166006)(478600001)(107886003)(3660700001)(99286004)(9686003)(305945005)(55236003)(53546010)(2501003)(74316002)(7696005)(81156014)(7736002)(8676002)(25786009)(2950100002)(6246003)(97736004)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2731; H:BY1PR0701MB1111.namprd07.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; x-ms-office365-filtering-correlation-id: 6a9418c9-88ac-4eb7-625e-08d53d592098 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(7168020)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603286); SRVR:CY1PR07MB2731; x-ms-traffictypediagnostic: CY1PR07MB2731: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(3231022)(93006095)(93001095)(3002001)(10201501046)(6041248)(20161123555025)(20161123558100)(20161123560025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:CY1PR07MB2731; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY1PR07MB2731; x-forefront-prvs: 05143A8241 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: 6a9418c9-88ac-4eb7-625e-08d53d592098 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Dec 2017 09:58:54.9315 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2731 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: Thu, 07 Dec 2017 09:58:58 -0000 > -----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 >=20 > compressdev API >=20 > 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=20 rte_compressdev_get_header_session_size() in case it want to know header_si= ze overhead per session and allocate pool with elt_size =3D sess_header_siz= e + dev_priv_sz? > + > +} //snip// Thanks Shally