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 914D2A2F63 for ; Fri, 4 Oct 2019 09:32:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EDAFD1C1C3; Fri, 4 Oct 2019 09:32:37 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 8465B1C1BE for ; Fri, 4 Oct 2019 09:32:36 +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 x947U7L3023334; Fri, 4 Oct 2019 00:32:35 -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=94QE7cbtXFn1IWUWOV3wJm07EeoNo52ES46Q+ZqitG4=; b=VNUn0D67zetadcoTNusNIfUpVkRv6AmXw4l0hHGf3mTgNaNPoDiiqFPLFCVpQfVVvmej nIedycKe7n5+oy0sgJODjp/0/uWL+cWa1SLpjEAgu8DUG8fkyFgtnkgAviFvGcVXzG7y 0Uh6645588snz70AR0TnJTSF4Oq5It7laXdacK7Y5i9mgs5p3abDquIUE9rBTlAEll3J cllVeo1HabgAIBRY8w9gXMLSt01ALRlMjpiTRR+RS6l+o3AjGn+QR7GNNS0J5JM0RajH sE2VPeM6qpB/rdgqARaIajsnhVODNPps9Bd+2CS1jlDenzq5nJo5FGWctuoVJOBfaMPm /w== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2vd0ya748k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 04 Oct 2019 00:32:35 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 4 Oct 2019 00:32:33 -0700 Received: from NAM04-SN1-obe.outbound.protection.outlook.com (104.47.44.58) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Fri, 4 Oct 2019 00:32:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OGS5JW4qJ1jvSfFfpI4l3oMbuRdtlAXY1vPIrsJl0oXb+DJFbFOls1Yn+7S3QOAts4OoM0CPDzi3js05fkjDNO6Iq/pW07eIxdjgcnOKLhj13B/UwE1sE+Ql4c5UHlr13Jp+9IvnERD3D4vpMS62pA6eVf2n7Rn5Xsy3ZD18xZ/d1BgHT5wZFV5/n5hM2VjbEJSM39HqafZRE7h6alkkmhpJ7ppap0ofWWvf6AuK1vjkyF2Xu5XBS6oJABrSGgWl3yZQFWAnCI95cUZY6lljZmf+cWnobGJxpLCbuxm4gsDUu3KbmZQnbCG+bDr622DFDw5c7qsrIzVWRu5D8iUR8Q== 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=94QE7cbtXFn1IWUWOV3wJm07EeoNo52ES46Q+ZqitG4=; b=aklp51G/74GaejrWcCRkw+GLb4m5Nvm/j7XS1T3DtPuMEaL5y0RVlJTGEyDqI1YEicquL+Z6CgR0cVWBCFHypiW4qL7TdHU9c24XRHzQdXvbD3/+5qYqpUVa2f1Q6Z2NOD1qs3j2uMnhb30DHci+JeVyupNUiRxO3r6M9IYIaSH8B5ww8eknk6k691BJZO4QZ5JEEg6QurnLnBTbIWSaa7VAf46neXmiB1Wk9QF5ukWqn4ZGbynD1eCEqbNCELAnUsBqjI7iBBeXtvhVxJOOPWCACxYMHjljcJ+B09b12b4G+eWXI+iYZRh3EuSre4l2DiYhrT0MVCRCo8gwRSXwIg== 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=94QE7cbtXFn1IWUWOV3wJm07EeoNo52ES46Q+ZqitG4=; b=p5ZDm1UAHCZIMWMRr+xnp06NJCVFW9YQKKEJpjExx6Ui4VabRUya9/wHNoif+IF1dVS7E5QH7sYkWd+xekjMZ62B/XJslQw/DVJNgkBphi5Uo1X0Fd7crND7WlABtdaVsVM0Tz9/hgQHCxG5gdLJNOFn9V+Vc1nyTJkH8C4MKR4= Received: from MN2PR18MB2877.namprd18.prod.outlook.com (20.179.20.218) by MN2PR18MB2767.namprd18.prod.outlook.com (20.179.20.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.17; Fri, 4 Oct 2019 07:32:31 +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; Fri, 4 Oct 2019 07:32:31 +0000 From: Anoob Joseph To: Akhil Goyal CC: Kanaka Durga Kotamarthy , "Jerin Jacob Kollanukkaran" , Narayana Prasad Raju Athreya , Fiona Trahe , Shally Verma , Sunila Sahu , "dev@dpdk.org" , Pablo de Lara Thread-Topic: [PATCH 4/8] common/cpt: add helper functions for asymmetric crypto Thread-Index: AQHVZxKT4ukyFSK0sUqqd2uqGw79SKdF43MAgAFxKJCAAuanYA== Date: Fri, 4 Oct 2019 07:32:31 +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: [115.113.156.3] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 76c1f62a-adac-48ff-1d00-08d7489d0476 x-ms-traffictypediagnostic: MN2PR18MB2767: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 018093A9B5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(4636009)(396003)(366004)(376002)(346002)(136003)(39860400002)(199004)(189003)(13464003)(3846002)(8676002)(86362001)(4326008)(6246003)(52536014)(55236004)(33656002)(229853002)(5660300002)(486006)(9686003)(6436002)(55016002)(74316002)(71200400001)(71190400001)(14444005)(26005)(66556008)(256004)(66066001)(99286004)(54906003)(316002)(25786009)(476003)(7736002)(53546011)(478600001)(446003)(186003)(11346002)(305945005)(76176011)(81156014)(8936002)(81166006)(7696005)(6916009)(6506007)(102836004)(66946007)(2906002)(14454004)(76116006)(64756008)(66476007)(66446008)(6116002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2767; H:MN2PR18MB2877.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: L1S+kSsru4SKz3u3yfYK7GxXuhxgr0YABb4Er2lB/X4eGJ7h1BwQJPuFuoSNQbS3cNOSf5pcWK8h4yySmciMM04HZHSTs6YNdH8MyUuIuzr7NZQcPN1eWPuAJS+6QQMp2YJLU0O9zp7VnONH//6qZ1WGh3ozaFa71zqYSzBLTL1Xul0XkeJK3FDfbvwGg1CiZ3fEaaQT6/6cu0L34yAwA4+Wz/kA/RHWchM9+b+yEWnYvoFtQPh97lqCpQyZGfygjRRNZ5WhLrQ4wef+jK9jaNv24fU0HtWDJ8UjhxpdWh6vwNlN59MscEG8jW1XaHqPUnwxmxAQCqQJshO1bqmV9nM+I5ssOc39PW8jhjb2AGe2t0Mq2a3YWh/je1W4iBkADDphanjayXkTXWJLjIUxELYcrKOod+YdX7TTl+lFYEo= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 76c1f62a-adac-48ff-1d00-08d7489d0476 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Oct 2019 07:32:31.6680 (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: YkD3NnztX0VuSJ1gU3eb6jaBR9ORelfFYGt974XOIh8aXcu5l00LIQ0egCPlbG7s8kguPxA0EN1pQdLInI5dEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2767 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-04_05:2019-10-03,2019-10-04 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, Minor correction. Please see inline. Thanks, Anoob > -----Original Message----- > From: Anoob Joseph > Sent: Wednesday, October 2, 2019 4:44 PM > 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 > Subject: RE: [PATCH 4/8] common/cpt: add helper functions for asymmetric > crypto >=20 > Hi Akhil, >=20 > Please see inline. >=20 > Thanks, > Anoob >=20 > > -----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 > > > > 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 > > > --- > > > > > > > > > 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(); > > > + } > > > > 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 both. Hence the above would work. But, you are right. In the above, it > should be, >=20 > sym_lens =3D 0; > asym_lens =3D 0; >=20 > If (SYM) { > /* set various lens for sym */ > } >=20 > If (ASYM) { > /* set various lens for asym */ > } >=20 > len =3D MAX(sym_len, asym_len); >=20 > I'll make the required changes in v2. Hope this clarifies. [Anoob] The above code snippet is only applicable for crypto_octeontx PMD. = And hence the current code should be fine. Initially, I mistook that the su= ggestion was for a common routine. Nevertheless, I'll add a comment stating= that only one feature is supported.=20 =20 >=20 > > > > > > /* Allocate mempool */ > > > > > > -- > > > 2.7.4