From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 75E26A04A2;
	Wed,  6 Nov 2019 05:55:01 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id C97541BEF8;
	Wed,  6 Nov 2019 05:55:00 +0100 (CET)
Received: from EUR02-VE1-obe.outbound.protection.outlook.com
 (mail-eopbgr20076.outbound.protection.outlook.com [40.107.2.76])
 by dpdk.org (Postfix) with ESMTP id 33D541BEF3;
 Wed,  6 Nov 2019 05:54:58 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; 
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QgpThjNQITSbe1die60TplFzcmCLumKX1GKZISECnjk=;
 b=B7gd4TpxtI+QL58VYZgO2O1AGe0HXCAFTuVnogH6aVPOHmemDhsYgKGAA9BrpiUJybuivvCuA56KH3dIhrNe+cfxhIIJOVtnd4PwKGGpTojFDGS2fL/Y8Cpp+1bYLdQGDcw+/J3Ws5tlLkqf/RYz28tlJyXQo+K22u6fQjhCLGM=
Received: from VI1PR08CA0270.eurprd08.prod.outlook.com (2603:10a6:803:dc::43)
 by AM6PR08MB5191.eurprd08.prod.outlook.com (2603:10a6:20b:e6::29)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2408.24; Wed, 6 Nov
 2019 04:54:57 +0000
Received: from AM5EUR03FT016.eop-EUR03.prod.protection.outlook.com
 (2a01:111:f400:7e08::206) by VI1PR08CA0270.outlook.office365.com
 (2603:10a6:803:dc::43) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.20 via Frontend
 Transport; Wed, 6 Nov 2019 04:54:57 +0000
Authentication-Results: spf=fail (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified)
 header.d=armh.onmicrosoft.com;dpdk.org; dmarc=none action=none
 header.from=arm.com;
Received-SPF: Fail (protection.outlook.com: domain of arm.com does not
 designate 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM5EUR03FT016.mail.protection.outlook.com (10.152.16.142) with
 Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.2387.20 via Frontend Transport; Wed, 6 Nov 2019 04:54:56 +0000
Received: ("Tessian outbound 851a1162fca7:v33");
 Wed, 06 Nov 2019 04:54:56 +0000
X-CR-MTA-TID: 64aa7808
Received: from 441a04af7d3c.1 (cr-mta-lb-1.cr-mta-net [104.47.9.55])
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 FE77E199-EB25-4896-9152-7D8634ACB2EC.1; 
 Wed, 06 Nov 2019 04:54:51 +0000
Received: from EUR03-VE1-obe.outbound.protection.outlook.com
 (mail-ve1eur03lp2055.outbound.protection.outlook.com [104.47.9.55])
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 441a04af7d3c.1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384);
 Wed, 06 Nov 2019 04:54:51 +0000
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
 b=M9qPtGnimO/UN0XsZcjMh2o/UhxAf7/56qQeIhPgu7frCYKkKbMshAViz4WUWiSNpzxaoqz+RvyVUhplaWk3EHxpEXW9tTNyAcQlkia1AYxc8p1PzNkbBYldKzLH9lMZ+5HzAA50JZ2kieIGyk3vRho1MMFKUtn6qHM2zhoUnAPM0+gPrGQ+Axu4DNjzZFRa3Y4VDmQjZ2/6wpDG894hLFTA3rBxGYh3KJauPgb155e8F62LcdF+gfAoqKBSm8bqjZiOGrZJha2gskXm2t3lEhTQD+EhCpGjrs2B87jLg+7m4QrVP0bD6xcxWcVDAbwsWeCiBrbV1/S66WUChNILPQ==
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=QgpThjNQITSbe1die60TplFzcmCLumKX1GKZISECnjk=;
 b=H0tTKPNyAkoxaR5rr8GJKzqNljGRlcf1Gqpf8dSqotXgioqplUO6+4HkOoG6j/zBnBwH7MNub4ZKkj8pRRPUJIuDRjNhYDDnSeq1+luA76nJBhx/Bc1uL8ZsnvDSAgRAA0P0CTG37oOZl3Lv7NkIVBhl/zIMv8zVquRz43kJJDFNYP22ekx2muYLy3ue8wtc3qPYN9bue8IxlWLtkY6yoC5935dxYRN1Ms+C7yNqZhfpYkdARiDlDbVwVuW2DpUJnRsFlvQrpkjM5bHhD5u7SjfHR/kbtrISnMv1WUr7eqqa1ixU9p0AL0gTa18iaQw3QmFfhvx5SSFf09BLMhAtHA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; 
 s=selector2-armh-onmicrosoft-com;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QgpThjNQITSbe1die60TplFzcmCLumKX1GKZISECnjk=;
 b=B7gd4TpxtI+QL58VYZgO2O1AGe0HXCAFTuVnogH6aVPOHmemDhsYgKGAA9BrpiUJybuivvCuA56KH3dIhrNe+cfxhIIJOVtnd4PwKGGpTojFDGS2fL/Y8Cpp+1bYLdQGDcw+/J3Ws5tlLkqf/RYz28tlJyXQo+K22u6fQjhCLGM=
Received: from VE1PR08MB5149.eurprd08.prod.outlook.com (20.179.30.27) by
 VE1SPR01MB0005.eurprd08.prod.outlook.com (10.255.115.210) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.2430.20; Wed, 6 Nov 2019 04:54:50 +0000
Received: from VE1PR08MB5149.eurprd08.prod.outlook.com
 ([fe80::85ed:1642:c:78a1]) by VE1PR08MB5149.eurprd08.prod.outlook.com
 ([fe80::85ed:1642:c:78a1%2]) with mapi id 15.20.2408.024; Wed, 6 Nov 2019
 04:54:50 +0000
From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
To: Konstantin Ananyev <konstantin.ananyev@intel.com>, "dev@dpdk.org"
 <dev@dpdk.org>, "techboard@dpdk.org" <techboard@dpdk.org>
CC: "roy.fan.zhang@intel.com" <roy.fan.zhang@intel.com>,
 "declan.doherty@intel.com" <declan.doherty@intel.com>, "Akhil.goyal@nxp.com"
 <akhil.goyal@nxp.com>, nd <nd@arm.com>
Thread-Topic: [dpdk-techboard] [RFC 0/4] cpu-crypto API choices
Thread-Index: AQHVlAit6ZP5K/UzvE2SH0EPhgbPead9k4sQ
Date: Wed, 6 Nov 2019 04:54:50 +0000
Message-ID: <VE1PR08MB5149D75515B55AA3D750F83998790@VE1PR08MB5149.eurprd08.prod.outlook.com>
References: <20191105184122.15172-1-konstantin.ananyev@intel.com>
In-Reply-To: <20191105184122.15172-1-konstantin.ananyev@intel.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-ts-tracking-id: fdf6131c-5386-4fa6-9a49-0428d8def138.0
x-checkrecipientchecked: true
Authentication-Results-Original: spf=none (sender IP is )
 smtp.mailfrom=Honnappa.Nagarahalli@arm.com; 
x-originating-ip: [217.140.111.135]
x-ms-publictraffictype: Email
X-MS-Office365-Filtering-HT: Tenant
X-MS-Office365-Filtering-Correlation-Id: cc567806-2b17-4d7c-27fa-08d76275788b
X-MS-TrafficTypeDiagnostic: VE1SPR01MB0005:|AM6PR08MB5191:
x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr
X-Microsoft-Antispam-PRVS: <AM6PR08MB519187EA428757163747A4AB98790@AM6PR08MB5191.eurprd08.prod.outlook.com>
x-checkrecipientrouted: true
x-ms-oob-tlc-oobclassifiers: OLM:10000;OLM:10000;
x-forefront-prvs: 02135EB356
X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;
 SFS:(10009020)(4636009)(396003)(346002)(136003)(376002)(366004)(39860400002)(199004)(189003)(305945005)(71190400001)(229853002)(71200400001)(66946007)(64756008)(33656002)(66556008)(66446008)(66476007)(81156014)(8676002)(2201001)(86362001)(6116002)(3846002)(99286004)(110136005)(2501003)(76116006)(54906003)(316002)(14444005)(256004)(66066001)(74316002)(6506007)(102836004)(4326008)(26005)(76176011)(9686003)(7696005)(478600001)(486006)(14454004)(7736002)(8936002)(81166006)(11346002)(25786009)(476003)(5660300002)(2906002)(6246003)(186003)(446003)(6436002)(55016002)(52536014);
 DIR:OUT; SFP:1101; SCL:1; SRVR:VE1SPR01MB0005;
 H:VE1PR08MB5149.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en;
 PTR:InfoNoRecords; A:1; MX:1; 
received-spf: None (protection.outlook.com: arm.com does not designate
 permitted sender hosts)
X-MS-Exchange-SenderADCheck: 1
X-Microsoft-Antispam-Untrusted: BCL:0;
X-Microsoft-Antispam-Message-Info-Original: zHWWujAZ1/0prMUJtwYAdhtOfodxXuP0NaQK6cfjVfA5CPlm91On4rrB5SfBJkhjEjWt5yZzoelX2K8MWkQ9c+vIc4mZP6Ogeg5VzmBIS4JSBQ8ftlSXxSjJkqjOUPiXkaKB7XfdwwLZucwmf3eCaSEVl8XoeyarCoEeyj0FEzPEnx9j3YYlsBisIHgI1mQMxKjpezWWIQ9BoJ6Jdj5X+cR5p6MKtNjlaxNeOSlgTZ7264nL+OB/ELBeIdiSxvWR6NKg2Dx4eO3fvlIKChI+iXeAU9jWY9kdXCy65HJlESNTqyuWhsd+OGLsUcAt7ZwSOARElSrUUMI/F0yPSoaFyzl2qlJ7b35sRceVPedTpkgsjnkmGjvxzifn23ywe2FrLOFIeWszFs1WLLthCeld/CIAJNSTIwtNcVWZ9uZP3SSMY5+576AKKznkdXdf9oyA
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1SPR01MB0005
Original-Authentication-Results: spf=none (sender IP is )
 smtp.mailfrom=Honnappa.Nagarahalli@arm.com; 
X-EOPAttributedMessage: 0
X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT016.eop-EUR03.prod.protection.outlook.com
X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE;
 EFV:NLI; SFV:NSPM;
 SFS:(10009020)(4636009)(136003)(346002)(39860400002)(396003)(376002)(1110001)(339900001)(189003)(199004)(356004)(25786009)(2201001)(86362001)(4326008)(47776003)(66066001)(55016002)(6246003)(81156014)(2501003)(52536014)(81166006)(14454004)(8936002)(2906002)(14444005)(46406003)(6116002)(22756006)(76130400001)(23726003)(3846002)(33656002)(50466002)(486006)(305945005)(7736002)(11346002)(446003)(126002)(99286004)(478600001)(8676002)(450100002)(336012)(9686003)(97756001)(8746002)(110136005)(229853002)(54906003)(316002)(70206006)(26005)(70586007)(7696005)(76176011)(105606002)(186003)(6506007)(74316002)(26826003)(476003)(102836004)(36906005)(5660300002);
 DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR08MB5191;
 H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Fail; LANG:en;
 PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; MX:1; A:1; 
X-MS-Office365-Filtering-Correlation-Id-Prvs: adb63c1b-3b90-46ec-69f9-08d7627574af
NoDisclaimer: True
X-Forefront-PRVS: 02135EB356
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: d5yNo3C47phrjL2qhPn68bjO98TfW02C1YpqEK/ncx66oyPhU94IC2UNpinTyH8jmXdw9pTtmnQVyxRB9X00vhzJvDuSEC6xKWL54VMOK/y+Cr8dSXCuI4p17ZgwJgJDbpzp0Ui1BMuCq79q+NKOIs0x3v+74kIgUx7CjuvmMNZ5GLZshfXzxTeswaOCYBEUrk8IhwAIRo56VHnUIXC1GnujCOgP3AqLNBa/yg5auzT9LBPpJ7tIlCfXY/poqPYKil4VMBqz6t/EYuK3442MWiwdU/AmJbk7byNxOx8HMwjoxwoz5cvBGpHMaOvKFX/7sMyAHpogMXi19wN67w1z3BdYT16EQToVB5mtW7M8kV+CpwjuXiSidUOtU7EqvSQqhwpf5cakRlAamQTvfzdgczSi2c3fUP633f0GfvPnW+8cqEyb4qEEdPIZft0o1iWR
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2019 04:54:56.8545 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: cc567806-2b17-4d7c-27fa-08d76275788b
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123];
 Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5191
Subject: Re: [dpdk-dev] [dpdk-techboard] [RFC 0/4] cpu-crypto API choices
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

<snip>

>=20
> Originally both SW and HW crypto PMDs use rte_crypot_op based API to
> process the crypto workload asynchronously. This way provides uniformity =
to
> both PMD types, but also introduce unnecessary performance penalty to SW
> PMDs that have to "simulate" HW async behavior (crypto-ops
> enqueue/dequeue, HW addresses computations, storing/dereferencing user
> provided data (mbuf) for each crypto-op, etc).
>=20
> The aim is to introduce a new optional API for SW crypto-devices to perfo=
rm
> crypto processing in a synchronous manner.
> As summarized by Akhil, we need a synchronous API to perform crypto
> operations on raw data using SW PMDs, that provides:
>  - no crypto-ops.
>  - avoid using mbufs inside this API, use raw data buffers instead.
>  - no separate enqueue-dequeue, only single process() API for data path.
>  - input data buffers should be grouped by session,
>    i.e. each process() call takes one session and group of input buffers
>    that  belong to that session.
>  - All parameters that are constant accross session, should be stored
>    inside the session itself and reused by all incoming data buffers.
>=20
> While there seems no controversy about need of such functionality, there
> seems to be no agreement on what would be the best API for that.
> So I am requesting for TB input on that matter.
>=20
> Series structure:
> - patch #1 - intorduce basic data structures to be used by sync API
>   (no controversy here, I hope ..)
>   [RFC 1/4] cpu-crypto: Introduce basic data structures
> - patch #2 - Intel initial approach for new API (via rte_security)
>   [RFC 2/4] security: introduce cpu-crypto API
> - patch #3 - approach that reuses existing rte_cryptodev API as much as
>   possible
>   [RFC 3/4] cryptodev: introduce cpu-crypto API
> - patch #4 - approach via introducing new session data structure and API
>   [RFC 4/4] cryptodev: introduce rte_crypto_cpu_sym_session API
>=20
> Patches 2,3,4 are mutually exclusive,
> and we probably have to choose which one to go forward with.
> I put some explanations in each of the patches, hopefully that will help =
to
> understand pros and cons of each one.
>=20
> Akhil strongly supports #3, AFAIK mainly because it allows PMDs to reuse
> existing API and minimize API level changes.
IMO, from application perspective, it should not matter who (CPU or an acce=
lerator) does the crypto functionality. It just needs to know if the result=
 will be returned synchronously or asynchronously.

> My favorite is #4, #2 is less preferable but ok too.
> #3 seems problematic to me by the reasons I outlined in #4 patch descript=
ion.
>=20
> Please provide your opinion.
>=20
> Konstantin Ananyev (4):
>   cpu-crypto: Introduce basic data structures
>   security: introduce cpu-crypto API
>   cryptodev: introduce cpu-crypto API
>   cryptodev: introduce rte_crypto_cpu_sym_session API
>=20
>  lib/librte_cryptodev/rte_crypto_sym.h     | 63 +++++++++++++++++++++--
>  lib/librte_cryptodev/rte_cryptodev.c      | 14 +++++
>  lib/librte_cryptodev/rte_cryptodev.h      | 24 +++++++++
>  lib/librte_cryptodev/rte_cryptodev_pmd.h  | 22 ++++++++
>  lib/librte_security/rte_security.c        | 11 ++++
>  lib/librte_security/rte_security.h        | 28 +++++++++-
>  lib/librte_security/rte_security_driver.h | 20 +++++++
>  7 files changed, 177 insertions(+), 5 deletions(-)
>=20
> --
> 2.17.1