From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0049.outbound.protection.outlook.com [104.47.40.49]) by dpdk.org (Postfix) with ESMTP id 2F5B1DE0 for ; Thu, 28 Jun 2018 15:40:31 +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=XRTvvlAPFltOLio77Nw4yjwHGCwQ0lE7EoaZ5wSyNGo=; b=AsOeQq+ypE95jm1h/lqwkUFAnQSoWFH89xrLyqvJ4giO9e4gMCn9g30ePUX1agmRwDStG/7jf1dztWtPVdr9NQjSLgAYMrUFiGlRDOHwLXC7h2vkhLeMDYvGdfeufjboBYhSeqkx3RbC7er/qA1F7bJ0ge7PqspYTociEbTfGgw= Received: from CY4PR0701MB3634.namprd07.prod.outlook.com (52.132.101.164) by CY4PR0701MB3731.namprd07.prod.outlook.com (52.132.102.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.24; Thu, 28 Jun 2018 13:40:29 +0000 Received: from CY4PR0701MB3634.namprd07.prod.outlook.com ([fe80::f55a:7354:8d2f:cf0b]) by CY4PR0701MB3634.namprd07.prod.outlook.com ([fe80::f55a:7354:8d2f:cf0b%4]) with mapi id 15.20.0884.025; Thu, 28 Jun 2018 13:40:28 +0000 From: "Verma, Shally" To: Pablo de Lara , "declan.doherty@intel.com" , "akhil.goyal@nxp.com" , "ravi1.kumar@amd.com" , "Jacob, Jerin" , "roy.fan.zhang@intel.com" , "fiona.trahe@intel.com" , "tdu@semihalf.com" , "jianjay.zhou@huawei.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH v3 16/16] cryptodev: check if symmetric sessions are supported Thread-Index: AQHUDr5lMx/yeLnaIE2FAxbG1lCdv6R1rTdg Date: Thu, 28 Jun 2018 13:40:28 +0000 Message-ID: References: <20180608220234.10170-1-pablo.de.lara.guarch@intel.com> <20180628005304.26544-1-pablo.de.lara.guarch@intel.com> <20180628005304.26544-17-pablo.de.lara.guarch@intel.com> In-Reply-To: <20180628005304.26544-17-pablo.de.lara.guarch@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: [106.212.234.132] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR0701MB3731; 7:D/EilQ59W9PFwZZhvFU2EHEMz2pSbWtBrCbsQtz03ffGHr67Jqt7yxNH/IrjYH9tNBClfYknaa0185WC3AdbiH2U9q8RiOq6cFSXGKOt0Znob4Unj70L6782rDpmofBCynio44WiezujeET/BUAhUMU3wrcV0iWRveahSuFW/a9VY/Rc1O94CwaD/a5/h1n+v9nBv9srz2KR/hdktS6yYm3Wbe+3g4dvo4e9uZyGoUv8w9V0+F0QISomkht2JBum x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(376002)(136003)(346002)(366004)(39860400002)(396003)(189003)(199004)(13464003)(99286004)(9686003)(4326008)(7696005)(486006)(446003)(68736007)(476003)(76176011)(6506007)(11346002)(102836004)(14454004)(72206003)(478600001)(8936002)(33656002)(66066001)(6436002)(256004)(6246003)(316002)(186003)(25786009)(14444005)(105586002)(110136005)(6116002)(53936002)(106356001)(86362001)(97736004)(2501003)(5250100002)(5660300001)(2201001)(2900100001)(3846002)(74316002)(229853002)(2906002)(55016002)(305945005)(26005)(7736002)(8676002)(81156014)(81166006)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3731; H:CY4PR0701MB3634.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-office365-filtering-correlation-id: c7a12fd1-45d5-4bfc-689d-08d5dcfcb5b0 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:CY4PR0701MB3731; x-ms-traffictypediagnostic: CY4PR0701MB3731: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197)(767451399110)(228905959029699)(50582790962513); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:CY4PR0701MB3731; BCL:0; PCL:0; RULEID:; SRVR:CY4PR0701MB3731; x-forefront-prvs: 0717E25089 received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 1K492FJ5a8DUDmR9dh8JrxxbAkk1/pc3vdoZCV6VrVEXftxqrCFh0A8JEvNVN698XKpkrrVbEptHiCiKWZpCMMApzp/gEPAe5fdGxjX8C9aTBK0yLpZucWdd9aPDWi/UCPqA+3sGow1tPXkIwTKIVPP3QLCpIXQWbLewJXabbZaz2d6i8jUGJGp07yuMCa7lymwqiMKBUE1mV+FxWusBxRfbPoo9KAcOtaoRvogIM2B263u9sP5sdtEX28KqQVnEXIdmhOHu2bIHOHuZY1T1WlxOX5I7IXlBI0amWOxz/ZduyqFgrOI0x/eOiQbKw+qqvzOTVCH0tDHe7jK4qb15q9Ap30Nmc79BOA59mrGUdlI= 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: c7a12fd1-45d5-4bfc-689d-08d5dcfcb5b0 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jun 2018 13:40:28.0249 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3731 Subject: Re: [dpdk-dev] [PATCH v3 16/16] cryptodev: check if symmetric sessions are supported 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, 28 Jun 2018 13:40:31 -0000 >-----Original Message----- >From: Pablo de Lara [mailto:pablo.de.lara.guarch@intel.com] >Sent: 28 June 2018 06:23 >To: declan.doherty@intel.com; akhil.goyal@nxp.com; Verma, Shally ; ravi1.kumar@amd.com; Jacob, >Jerin ; roy.fan.zhang@intel.com; fion= a.trahe@intel.com; tdu@semihalf.com; >jianjay.zhou@huawei.com >Cc: dev@dpdk.org; Pablo de Lara >Subject: [PATCH v3 16/16] cryptodev: check if symmetric sessions are suppo= rted > >External Email > >Since asymmetric functionality will be implemented soon, >not all PMDs must support symmetric sessions. >Therefore, a check is added if a device does not implement >the symmetric functions, meaning that the device does not >support symmetric operations. > >Signed-off-by: Pablo de Lara >--- > lib/librte_cryptodev/rte_cryptodev.c | 4 ++++ > lib/librte_cryptodev/rte_cryptodev.h | 4 +++- > 2 files changed, 7 insertions(+), 1 deletion(-) > >diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/r= te_cryptodev.c >index 7af527075..58fb21056 100644 >--- a/lib/librte_cryptodev/rte_cryptodev.c >+++ b/lib/librte_cryptodev/rte_cryptodev.c >@@ -1063,6 +1063,8 @@ rte_cryptodev_sym_session_init(uint8_t dev_id, > > index =3D dev->driver_id; > >+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->sym_session_configure, -ENO= TSUP); >+ > if (sess->sess_private_data[index] =3D=3D NULL) { > ret =3D dev->dev_ops->sym_session_configure(dev, xforms, > sess, mp); >@@ -1107,6 +1109,8 @@ rte_cryptodev_sym_session_clear(uint8_t dev_id, > if (dev =3D=3D NULL || sess =3D=3D NULL) > return -EINVAL; > >+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->sym_session_clear, -ENOTSUP= ); >+ > dev->dev_ops->sym_session_clear(dev, sess); > > return 0; >diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/r= te_cryptodev.h >index 32a210b00..c1066d01e 100644 >--- a/lib/librte_cryptodev/rte_cryptodev.h >+++ b/lib/librte_cryptodev/rte_cryptodev.h >@@ -896,7 +896,8 @@ rte_cryptodev_sym_session_free(struct rte_cryptodev_sy= m_session *sess); > * @return > * - On success, zero. > * - -EINVAL if input parameters are invalid. >- * - -ENOTSUP if crypto device does not support the crypto transform. >+ * - -ENOTSUP if crypto device does not support the crypto transform or >+ * does not support symmetric operations. Acked with just one comment here Isn't it sufficient to say if device does = not support symmetric? > * - -ENOMEM if the private session could not be allocated. > */ > int >@@ -917,6 +918,7 @@ rte_cryptodev_sym_session_init(uint8_t dev_id, > * @return > * - 0 if successful. > * - -EINVAL if device is invalid or session is NULL. >+ * - -ENOTSUP if crypto device does not support symmetric operations. > */ > int > rte_cryptodev_sym_session_clear(uint8_t dev_id, >-- >2.14.4