From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3FB5CA2F18 for ; Thu, 3 Oct 2019 10:03:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6AE2C1BFF1; Thu, 3 Oct 2019 10:03:46 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00057.outbound.protection.outlook.com [40.107.0.57]) by dpdk.org (Postfix) with ESMTP id 346D81BFF0 for ; Thu, 3 Oct 2019 10:03:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HkZTbQ0N8c5ruo8zTrPDQX9pIYDOdLqOoo/htBW1G9fp9/GIU4hZvaY/BcZcw5A/U5o2jxkviw5FecHwPOEYqzUeakO5mpKkSGmteyvDFlfb0GszDG1rpCpu96PVsv+0MbYZUfv3cqQPNuTs0sEVutRbANXkzf3jNwySxK0vTbf8a/WODPqKSu9npxKZ2ZXEq3fUizVS2sLyhHkoLnMN8L4IYeSkpZAjmo2aF20jYEUFHsu5JO0xNFK22WC5RpBfAIaQe8pFBYjtAOLMo7HBicHHjBkBa1QrYFGb8r7kTn/lbn2aIORdwFHBwXl1aOtwbmlLrLi0dy1RRvtBxcQBVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BhcLYYHFPqavrwPtj1RU/r+1LeAF7FkUtaxmDVuxkLs=; b=MHwvvT5MzxdoydFJV9MyiZVAfvUTnnFnZCv3cb4ICZ3Ig72WMdayWgbOB6up6XalHQFhGX6eQN8Qh0hwcFQxNybGfg0vV6yqJgEGJ0+3JJ/wPdGtLdbLY1HQPsFLg4OuCzCW1zWI+fklW3IM+GxbQ8xoq27jkdrTFhDpB+w4/KiebrSvT/2BZpvv3cDzIonEKQHlz8bzDJkxZoGEBhj3GYkE1WkeEzKBfA8LoRIRRWnAdbmrBAlyYKh0dh6RBDGRiaomr3ADtCmN54mWyp8+GUuajJ1ohV/tPEhaU7Sdj4ZscikLIjwKWHtkNgq89EvlZSdL+qQUU4acoXZwqniQZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BhcLYYHFPqavrwPtj1RU/r+1LeAF7FkUtaxmDVuxkLs=; b=AVWi4iSS9BaQ+ir8B2rJlePyLF+6QtpN7d+VCVM92aqWWvMYHjUnCl89ye8tr4wwyhaIHlvbDzMsQ5QD6wsWGop8A126mBQLfbSNYs+Y5QnjWktu5YkD+mWGfXPeSk74A+otkph2/NSekTGnamsNQ0cSQsfzxmk2ABdppT1eLpI= Received: from VE1PR04MB6639.eurprd04.prod.outlook.com (10.255.118.11) by VE1PR04MB6720.eurprd04.prod.outlook.com (20.179.234.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.20; Thu, 3 Oct 2019 08:03:44 +0000 Received: from VE1PR04MB6639.eurprd04.prod.outlook.com ([fe80::c045:5df2:ba1f:c3ee]) by VE1PR04MB6639.eurprd04.prod.outlook.com ([fe80::c045:5df2:ba1f:c3ee%5]) with mapi id 15.20.2305.023; Thu, 3 Oct 2019 08:03:44 +0000 From: Akhil Goyal To: Anoob Joseph , Pablo de Lara CC: Kanaka Durga Kotamarthy , Jerin Jacob Kollanukkaran , Narayana Prasad Raju Athreya , Fiona Trahe , Shally Verma , Sunila Sahu , "dev@dpdk.org" Thread-Topic: [PATCH 2/8] crypto/octeontx: add RSA and modexp asym capabilities Thread-Index: AQHVZxKQEmb/u2Z88E6+kRnaLipSoKdF2xlQgAF0f4CAAWPpAA== Date: Thu, 3 Oct 2019 08:03:44 +0000 Message-ID: References: <1568035687-25492-1-git-send-email-anoobj@marvell.com> <1568035687-25492-3-git-send-email-anoobj@marvell.com> In-Reply-To: Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; x-originating-ip: [92.120.1.65] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0702e894-971a-425a-4332-08d747d8363e x-ms-office365-filtering-ht: Tenant x-ms-traffictypediagnostic: VE1PR04MB6720: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 01792087B6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(346002)(396003)(39860400002)(376002)(136003)(189003)(199004)(4326008)(486006)(44832011)(66066001)(76176011)(5660300002)(11346002)(446003)(6506007)(25786009)(476003)(74316002)(6436002)(7736002)(71190400001)(71200400001)(99286004)(229853002)(6116002)(305945005)(3846002)(9686003)(66476007)(66556008)(64756008)(66446008)(256004)(14454004)(66946007)(478600001)(76116006)(7696005)(2906002)(52536014)(6246003)(55016002)(110136005)(54906003)(81166006)(81156014)(316002)(86362001)(186003)(8676002)(26005)(102836004)(33656002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6720; H:VE1PR04MB6639.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: O8VME7t2GokhjvhWy4TL0oEPIXb4fodeJLcrTE/AAwwiHzNaMZdIFz+zRbPr3+LaV2t2iE73/CTHjTXF5G/n5IqLdM5hsazyLpoA/9HpCD8lgGvM7NvFcWjDzePYIaKyWbOuMbSh3uxRHc5t29Zc6pDjdXz9ZN2knyH1KKSGzJeRq88Ygn7tuPMUVET8gYuEMgNh7pBSpZV5vnvNpMGF5D5j5x/0WN9d++IGbO7kcc4pnzN1fKIqGvOjVGJ0hHB3mt5m+OMoBZuTYLajcQL6+HgVIg7cEObg0oasob+goe24eTWjzqrDsQTCHGUamUv0FDjEmNnuW+trALV8+wWXErpKALaDJqOWafs868QFrDmzZL+Btb8viQvJcJ4KJ2RPbKwMiTyLS1lPDc8k3swMpB+sj54fkCaMqFaT8pf51tY= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0702e894-971a-425a-4332-08d747d8363e X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2019 08:03:44.3713 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5cdhhZLkk8WX5qoGiZx3z1sehfH0HabauRwZOJkDkhhHyBklGBplN2YXJo5WyrnnzHZZDiw4Cxo5EDDoixOnWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6720 Subject: Re: [dpdk-dev] [PATCH 2/8] crypto/octeontx: add RSA and modexp asym capabilities 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > > > > Hi Anoob, > > > > > const struct rte_cryptodev_capabilities * > > > -otx_get_capabilities(void) > > > +otx_get_capabilities(uint64_t flags) > > > { > > > - return otx_capabilities; > > > + if (flags & RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO) > > > + return otx_asym_capabilities; > > > + else > > > + return otx_sym_capabilities; > > > + > > > } > > > > I believe this will give Asym capabilities always. As the feature flag > > RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO will always be set, as the flags > are > > set in init. > > > > It will never go in else. >=20 > [Anoob] The flags is set based on the type of underlying device. The cryp= to > module on OCTEONTX exposes two kinds of VFs. One which does only > symmetric and one which does only asymmetric. Both are never supported > together for a VF, and hence the if...else. OK probably a comment should be added to avoid this confusion while calling= infos_get. And add this info in doc as well if not already there. >=20 > From the first patch, crypto/octeontx: add device type mailbox routine >=20 > switch (cptvf->vftype) { > case OTX_CPT_VF_TYPE_AE: > /* Set asymmetric cpt feature flags */ > c_dev->feature_flags =3D > RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO | > RTE_CRYPTODEV_FF_HW_ACCELERATED; > break; > case OTX_CPT_VF_TYPE_SE: > /* Set symmetric cpt feature flags */ > c_dev->feature_flags =3D > RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | > RTE_CRYPTODEV_FF_HW_ACCELERATED | >=20 > RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | > RTE_CRYPTODEV_FF_IN_PLACE_SGL | > RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT | > RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT; > break; >=20 > Hope this clarifies. >=20 > > > > > diff --git a/drivers/crypto/octeontx/otx_cryptodev_capabilities.h > > > b/drivers/crypto/octeontx/otx_cryptodev_capabilities.h > > > index fc62821..439b50e 100644 > > > --- a/drivers/crypto/octeontx/otx_cryptodev_capabilities.h > > > +++ b/drivers/crypto/octeontx/otx_cryptodev_capabilities.h > > > @@ -8,10 +8,9 @@ > > > #include > > > > > > /* > > > - * Get capabilities list for the device > > > - * > > > + * Get capabilities list for the device, based on device type > > > */ > > > const struct rte_cryptodev_capabilities * > > > -otx_get_capabilities(void); > > > +otx_get_capabilities(uint64_t flags); > > > > > > #endif /* _OTX_CRYPTODEV_CAPABILITIES_H_ */ diff --git > > > a/drivers/crypto/octeontx/otx_cryptodev_ops.c > > > b/drivers/crypto/octeontx/otx_cryptodev_ops.c > > > index 88efed3..b59a001 100644 > > > --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c > > > +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c > > > @@ -105,7 +105,7 @@ otx_cpt_dev_info_get(struct rte_cryptodev *dev, > > > struct rte_cryptodev_info *info) > > > if (info !=3D NULL) { > > > info->max_nb_queue_pairs =3D CPT_NUM_QS_PER_VF; > > > info->feature_flags =3D dev->feature_flags; > > > - info->capabilities =3D otx_get_capabilities(); > > > + info->capabilities =3D otx_get_capabilities(info->feature_flags); > > > info->sym.max_nb_sessions =3D 0; > > > info->driver_id =3D otx_cryptodev_driver_id; > > > info->min_mbuf_headroom_req =3D > > > OTX_CPT_MIN_HEADROOM_REQ; > > > @@ -635,7 +635,8 @@ otx_cpt_dev_create(struct rte_cryptodev *c_dev) > > > case OTX_CPT_VF_TYPE_AE: > > > /* Set asymmetric cpt feature flags */ > > > c_dev->feature_flags =3D > > > RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO | > > > - RTE_CRYPTODEV_FF_HW_ACCELERATED; > > > + RTE_CRYPTODEV_FF_HW_ACCELERATED | > > > + RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT; > > > break; > > > case OTX_CPT_VF_TYPE_SE: > > > /* Set symmetric cpt feature flags */ > > > -- > > > 2.7.4