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 A2E0FA2EDB for ; Wed, 2 Oct 2019 13:13:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 659651BEC8; Wed, 2 Oct 2019 13:13:50 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id DC59F1BEC6 for ; Wed, 2 Oct 2019 13:13:48 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x92B9sFV020467; Wed, 2 Oct 2019 04:13:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=bRvhrwHWrnW8LONIg30iqRZKZ1cncY50L5Taqk4qO2w=; b=wMawMiDTtE/NcAbWMyOcC36eJa45qFQ85n49YhVoJPCFvs7AaH4O3pOVwOuNE9HFcQtq rbXoJKNXMAPVGobdutPn53aGfG0emSHbYg/us8GkapKpXpdEYoemCHh+NStGpwyGY55u /yz9oPc3xDbBBgC/qisrySL24ljx2mSikut702m2FPRtf4TRT+Z+GbdYOrxqSFa8xCJg /bd6ygiuFLuQ6ud8lGJoQU3/FS7tNNIlkGJw7sBBFPccMpEU15LDQ1b21se+Ve1LWc98 Q5gzNL+0gnDFAiLbYn7IpHoRV/yP/5stklaQxeIZAcyfRhGEhqMnf/OFWa7Kr7Vhg5q1 bg== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2va71mpt2f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 02 Oct 2019 04:13:48 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 2 Oct 2019 04:13:46 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (104.47.38.53) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 2 Oct 2019 04:13:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i17i9ARPFQ+gxaV/F6Aae95lOkpCWe32oF13esoUj4j5eUEViyvyktxMcZZR0Ze0sjdWBwpdnxYgwDF6nSUBrHbKcv0Ljg+41ygWRYbQvXpbP1ITlc363f/4SXOsHQHI9WbXTM9kUsW0aabee4cH+J6jqW9sbELP/zimMY/OWcvbGHonK9NC6mvwVlXHWis3TwDXv6zv74nKBgLBTyndwED623iQQo30Qd7C4CgSqdIIheGz46uAD4JtieTYOJZloP/EAwcW4Pd2sEUnEZemo85vpN797EJVKTWjax7ZzCvclvDIPWJrfef3nNnNUfTyS5K66naNwZN3Zl/QYDb8Bw== 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=bRvhrwHWrnW8LONIg30iqRZKZ1cncY50L5Taqk4qO2w=; b=A/xBQGWU1c7tBfysC56AI7liA8Fr+1LdIDpNcO6USn+YzPrt0ZSOLDPly7fKuPgqZu73wImidsY6SLQdtI9+cElFCVjPVywHTnh/1uqrLOM96tcyuA+BQRLgDem+2ZMaPiprXcHDnKP3nGfyGLIQqcfIMhO+KEF7O9mmn/0SkA3GpeVxPESHsLG/JYk6ba8+vx3mIJQe9gF/I1sPjxETSvs1IQY0DyIoyzePtPskLh7GB+NQ5gWgrvAhl7KbMo/aoC6a3HKjA6ZNIQTM2/xbnFg726pDPdwjW6KMIWqObBxBafCOroNCk25r8QPFWiwMqNUkx8BGBcIKPvwHKnbj+w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bRvhrwHWrnW8LONIg30iqRZKZ1cncY50L5Taqk4qO2w=; b=dHkoYh8XTk0Rv/qJLtax82Vx1xKpqO1E26bK1MI6tRve43UU//awOluxJXA1G8wF4OcJikecpQj8Z7OmCSbHK2nJxhaXrr+gSSX/YXnY9g+vJHTR8wgo8EOv3Q0Z2acy1bnTo/x+ViMkFxhRf6vEt8SF4U3aHad4yJykxtlrNHY= Received: from MN2PR18MB2877.namprd18.prod.outlook.com (20.179.20.218) by MN2PR18MB2495.namprd18.prod.outlook.com (20.179.83.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.20; Wed, 2 Oct 2019 11:13:44 +0000 Received: from MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::6d15:3367:4c9:5385]) by MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::6d15:3367:4c9:5385%7]) with mapi id 15.20.2305.023; Wed, 2 Oct 2019 11:13:44 +0000 From: Anoob Joseph To: Akhil Goyal , 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 4/8] common/cpt: add helper functions for asymmetric crypto Thread-Index: AQHVZxKT4ukyFSK0sUqqd2uqGw79SKdF43MAgAFxKJA= Date: Wed, 2 Oct 2019 11:13:44 +0000 Message-ID: References: <1568035687-25492-1-git-send-email-anoobj@marvell.com> <1568035687-25492-5-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: x-originating-ip: [122.175.98.131] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f156fbf8-5719-4842-c965-08d7472996e5 x-ms-traffictypediagnostic: MN2PR18MB2495: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-forefront-prvs: 0178184651 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(366004)(396003)(376002)(346002)(136003)(189003)(199004)(13464003)(9686003)(55016002)(25786009)(6116002)(478600001)(476003)(446003)(11346002)(4326008)(6246003)(74316002)(3846002)(486006)(86362001)(305945005)(7736002)(229853002)(8676002)(64756008)(66446008)(6436002)(66946007)(81156014)(66476007)(66556008)(76116006)(81166006)(8936002)(14444005)(256004)(186003)(76176011)(7696005)(71200400001)(33656002)(53546011)(5660300002)(6506007)(52536014)(102836004)(66066001)(99286004)(26005)(2906002)(316002)(110136005)(14454004)(54906003)(71190400001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2495; H:MN2PR18MB2877.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: RFVzXwDJabu812qP3oGyq2LbWkAgfYL+HGJSIx+dFe/ACi4dR3idIiC3/FAU2jCt0TFLNh8/dyRtyGyPUl0V6IFELlrncC1Fz5IcWwlg4s4DsRFFNzeglf4QpUIABLuqgdI8kxpxK+BzcLYvl0ucGWm1Ywd8IqjTHaRiN7yMXRoqmuRC9dfpjD/vexsjnrmRU6xEJj7Ymvcs0wNd0w9Mb7Do9Ojwl2mtH8EQH8yDN00eDKnaEJ0uA6y6/MLWZjzcCHzZ3hrq7YAsMbf6ghu6wT6VIO56z78ffOiIPEWuffouzNkrhlLepGf4N3RRtPS4yTfB6EnpgTvYvtYDMub/Pzr3x9G504wpG0erEv7Yqm/2Wd5PDPYSVPEAJD0t7oTr1lEQ6oqQNqBbjThFqN+L0q3+HniJOTytZ4xEHgdKLRY= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f156fbf8-5719-4842-c965-08d7472996e5 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Oct 2019 11:13:44.6028 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: P3crIx1wLrJN4v+dvJxCaVjaHTEFiQ0f8WdKYX6kwf0nhJBP1hvf1xUB4eeeXrJnwAdTHbD+Mar4bq038D72Sw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2495 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-02_06:2019-10-01,2019-10-02 signatures=0 Subject: Re: [dpdk-dev] [PATCH 4/8] common/cpt: add helper functions for asymmetric crypto 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 Akhil, Please see inline. Thanks, Anoob > -----Original Message----- > From: Akhil Goyal > Sent: Tuesday, October 1, 2019 6:35 PM > 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 > Subject: RE: [PATCH 4/8] common/cpt: add helper functions for asymmetric > crypto >=20 > Hi Anoob, > > > > From: Kanaka Durga Kotamarthy > > > > Add helper functions to get meta len for asymmetric operations > > > > Signed-off-by: Anoob Joseph > > Signed-off-by: Kanaka Durga Kotamarthy > > Signed-off-by: Sunila Sahu > > --- >=20 > >=20 > > diff --git a/drivers/crypto/octeontx/otx_cryptodev_hw_access.c > > b/drivers/crypto/octeontx/otx_cryptodev_hw_access.c > > index ad64bf4..0543494 100644 > > --- a/drivers/crypto/octeontx/otx_cryptodev_hw_access.c > > +++ b/drivers/crypto/octeontx/otx_cryptodev_hw_access.c > > @@ -412,24 +412,34 @@ otx_cpt_metabuf_mempool_create(const struct > > rte_cryptodev *dev, > > int nb_elements) > > { > > char mempool_name[RTE_MEMPOOL_NAMESIZE]; > > - int sg_mlen, lb_mlen, max_mlen, ret; > > struct cpt_qp_meta_info *meta_info; > > struct rte_mempool *pool; > > + int max_mlen =3D 0; > > + int sg_mlen =3D 0; > > + int lb_mlen =3D 0; > > + int ret; > > > > - /* Get meta len for scatter gather mode */ > > - sg_mlen =3D cpt_pmd_ops_helper_get_mlen_sg_mode(); > > + if (dev->feature_flags & RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO) { > > > > - /* Extra 32B saved for future considerations */ > > - sg_mlen +=3D 4 * sizeof(uint64_t); > > + /* Get meta len for scatter gather mode */ > > + sg_mlen =3D cpt_pmd_ops_helper_get_mlen_sg_mode(); > > > > - /* Get meta len for linear buffer (direct) mode */ > > - lb_mlen =3D cpt_pmd_ops_helper_get_mlen_direct_mode(); > > + /* Extra 32B saved for future considerations */ > > + sg_mlen +=3D 4 * sizeof(uint64_t); > > > > - /* Extra 32B saved for future considerations */ > > - lb_mlen +=3D 4 * sizeof(uint64_t); > > + /* Get meta len for linear buffer (direct) mode */ > > + lb_mlen =3D cpt_pmd_ops_helper_get_mlen_direct_mode(); > > > > - /* Check max requirement for meta buffer */ > > - max_mlen =3D RTE_MAX(lb_mlen, sg_mlen); > > + /* Extra 32B saved for future considerations */ > > + lb_mlen +=3D 4 * sizeof(uint64_t); > > + > > + /* Check max requirement for meta buffer */ > > + max_mlen =3D RTE_MAX(lb_mlen, sg_mlen); > > + } else if (dev->feature_flags & > > RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO) { > > + > > + /* Get meta len for asymmetric operations */ > > + max_mlen =3D cpt_pmd_ops_helper_asym_get_mlen(); > > + } >=20 > I am not sure how this is working. > In your octeontx device, you will have both > RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO > and RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO will be set together. So it will > not go in else in any case. > Please check in rest of the PMD also if this assumption is made somewhere= else > also. >=20 [Anoob] The crypto VFs on octeontx would be either sym/asym and cannot be b= oth. Hence the above would work. But, you are right. In the above, it shoul= d be, sym_lens =3D 0; asym_lens =3D 0; If (SYM) { /* set various lens for sym */ } If (ASYM) { /* set various lens for asym */ } len =3D MAX(sym_len, asym_len); I'll make the required changes in v2. Hope this clarifies. =20 > > > > /* Allocate mempool */ > > > > -- > > 2.7.4