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 890B4A052F; Fri, 31 Jan 2020 15:30:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B989C1C0CC; Fri, 31 Jan 2020 15:30:27 +0100 (CET) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2083.outbound.protection.outlook.com [40.107.20.83]) by dpdk.org (Postfix) with ESMTP id 4D9CD1C0CA for ; Fri, 31 Jan 2020 15:30:26 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GgGtphO/fkQnwbd8wpbBnv9EJku7yXR0tKR7XQGBpkNJhpmjx3BePa4Mh+fRcmSTMvJSOQlED+2lq8pfMVdWXEqD4rVKmuuQ1MhFgtuNma+V4yI5tI2Wdtf4e813bTdBCsJCsjDMIe5S9XUtM6kQr0i+rN3NoHegygV4OdfdlZjdoE2kgevvTaXg5tFuH2lz36qRcJ63dLWZuyioHnOCXd97PsmFzk8Hjv2oNWv87uHVuKH3WZ4pQiJbuC3b3Y3jQGLUClMeErUaFRxMOdqRrTHKP6P6XpR9iYtJ0x4HNj8Am2OjrLy5g8d8NjM8Q+z0Oz7+2zyWpTDl/gD4xBCfcQ== 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=bZ6AsGDk1weQSM34dILyan8G7YAjZzzlxLqHrYwC28c=; b=Llvlsj2XKabDcW13PtrBGsuin1FZ1oy+Hhl3rcQk2SVLx4jWOvKKnsYHRsuoyh1sxqg8JBzJ+Die3mj7vFpViyDUZguKmL4MgAGISo263IWnFsgU+CBxy9L11Cxzv6a+Zygev+QPvTdw30LM62F6P1eEkkvL4T01P9aZ5wGYkQBv1TG32U7jJaBjWPXd8cG63XNGA7WI1qkDxs7HsUHtY3fzrOynGEF+le9cTNpwQPPvCZtmBHP7IC9RjQOZeTO51V1dK8XrSJ8lybuSsLZD1Ei0ZBQwz2Dvwn2GHOiFlIs7GB/YBckv2wRpuSxVt/I+equUY+rxpp++kTOa/pK8gw== 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=bZ6AsGDk1weQSM34dILyan8G7YAjZzzlxLqHrYwC28c=; b=SzRt2oZkNHpFgdh+Q9689BHHOR6OpIozkAE9AtleXRXHYyJu4qIE+NLejhNXr7L3aYQrtpeUMs/9FC5tt+OvZTmCQHhVlvxX5hWabmRSIqr09rs/mK8lBTviXAHdao1yjrLJc5i/5lYvDa0xtn37GEuVPUrGipxh9wa6k5CicqM= Received: from VE1PR04MB6639.eurprd04.prod.outlook.com (10.255.118.11) by VE1PR04MB6688.eurprd04.prod.outlook.com (20.179.235.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.26; Fri, 31 Jan 2020 14:30:25 +0000 Received: from VE1PR04MB6639.eurprd04.prod.outlook.com ([fe80::25b0:b1ac:aed0:63e1]) by VE1PR04MB6639.eurprd04.prod.outlook.com ([fe80::25b0:b1ac:aed0:63e1%7]) with mapi id 15.20.2665.027; Fri, 31 Jan 2020 14:30:25 +0000 From: Akhil Goyal To: Marcin Smoczynski , "konstantin.ananyev@intel.com" , "roy.fan.zhang@intel.com" , "declan.doherty@intel.com" , "radu.nicolau@intel.com" , "pablo.de.lara.guarch@intel.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH v5 1/8] cryptodev: introduce cpu crypto support API Thread-Index: AQHV1eZm80fiirSwME6sakImNCWmdqgE2Qcg Date: Fri, 31 Jan 2020 14:30:25 +0000 Message-ID: References: <20200128031642.15256-1-marcinx.smoczynski@intel.com> <20200128142220.16644-1-marcinx.smoczynski@intel.com> <20200128142220.16644-2-marcinx.smoczynski@intel.com> In-Reply-To: <20200128142220.16644-2-marcinx.smoczynski@intel.com> 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.72] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 6cf9021b-0be5-4d0c-3334-08d7a65a1c97 x-ms-traffictypediagnostic: VE1PR04MB6688: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-forefront-prvs: 029976C540 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(39860400002)(136003)(346002)(396003)(376002)(199004)(189003)(9686003)(2906002)(64756008)(5660300002)(33656002)(316002)(26005)(66556008)(66476007)(66446008)(52536014)(110136005)(44832011)(7696005)(4326008)(66946007)(6506007)(55016002)(186003)(8936002)(71200400001)(8676002)(76116006)(81166006)(86362001)(478600001)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6688; H:VE1PR04MB6639.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: uiCpaqV9TTRw4Zdy/GvnH2iRTmS2ftJpGgI+g/npyzv1y0b3pOdZvbsI/pE83Smg7hpFUOoEtODRf6EvjPC5qNnp3khxuRZe8M5LNKUH4FiVsYolTq4r7oPvPgb2b6YthG9jtKg+cVKoa+cLT2PqsOQ2s/YmbJeCvN5J5Ln5Lpw18Lt6+2KTRcxViCKDWS+yqc3CQl8lyUJcdqWXuFmcKvh/OlV8PPPe/N28dUkrryd2HftQkeguch+7jz+CSgxX8JnEBPIdG+B+c7Z0Vd0VJ1mp+cQ2OX0+9d4K3xoz5q2sHuAKgDdjbNmsEmL/unR8NFGEgFb4oKGX6Cc8FXNErQRszl6/qK3gDoeWV/jmttIRkwSAizxAEqOhvLgkDU/fjWk6evQcbl0Ze5U1F5ZBqxaP9/wqmZYVcjH9ywB+6BRtXqUmbdygNWL4WuulwYwb x-ms-exchange-antispam-messagedata: bV6OKNHdpeA4j/ygq+IlH48ZXV7SzyIM59UCJ6aoDNGSD4YUPpXNGC+SBnKFNxNtS8M/tZNe7l2fF05viJfj7MKPj963pUzSwvTxZLDLQrNTFeYPo64wO+zpd4k1T6Fa7+qnP0FQ80FfF6W79vsnjA== 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: 6cf9021b-0be5-4d0c-3334-08d7a65a1c97 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jan 2020 14:30:25.2173 (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: PthksfVLse43vuE8jaWQXB7Al2m8o1YLy2rHSOu6KiaL5x0RLTNYX0SWDqyCTAzVWUlaWowayzkV6ZpW5zqTXg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6688 Subject: Re: [dpdk-dev] [PATCH v5 1/8] cryptodev: introduce cpu crypto support API 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 Marcin/Konstantin, >=20 > Add new API allowing to process crypto operations in a synchronous > manner. Operations are performed on a set of SG arrays. >=20 > Sync mode is selected by setting appropriate flag in an xform > type number. Cryptodevs which allows CPU crypto operation mode have to > use RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO capability. There is no change in xform. This description need to be updated. I think It was not edited while you removed that xform changes. Documentation missing in this patch. >=20 > Signed-off-by: Konstantin Ananyev > Signed-off-by: Marcin Smoczynski > --- > lib/librte_cryptodev/rte_crypto_sym.h | 63 ++++++++++++++++++- > lib/librte_cryptodev/rte_cryptodev.c | 35 ++++++++++- > lib/librte_cryptodev/rte_cryptodev.h | 22 ++++++- > lib/librte_cryptodev/rte_cryptodev_pmd.h | 21 ++++++- > .../rte_cryptodev_version.map | 1 + > 5 files changed, 138 insertions(+), 4 deletions(-) >=20 > diff --git a/lib/librte_cryptodev/rte_crypto_sym.h > b/lib/librte_cryptodev/rte_crypto_sym.h > index bc356f6ff..d6f3105fe 100644 > --- a/lib/librte_cryptodev/rte_crypto_sym.h > +++ b/lib/librte_cryptodev/rte_crypto_sym.h > @@ -1,5 +1,5 @@ > /* SPDX-License-Identifier: BSD-3-Clause > - * Copyright(c) 2016-2019 Intel Corporation > + * Copyright(c) 2016-2020 Intel Corporation > */ >=20 > #ifndef _RTE_CRYPTO_SYM_H_ > @@ -25,6 +25,67 @@ extern "C" { > #include > #include >=20 > +/** > + * Crypto IO Vector (in analogy with struct iovec) > + * Supposed be used to pass input/output data buffers for crypto data-pa= th > + * functions. > + */ > +struct rte_crypto_vec { > + /** virtual address of the data buffer */ > + void *base; > + /** IOVA of the data buffer */ > + rte_iova_t *iova; > + /** length of the data buffer */ > + uint32_t len; > +}; > + > +/** > + * Crypto scatter-gather list descriptor. Consists of a pointer to an ar= ray > + * of Crypto IO vectors with its size. > + */ > +struct rte_crypto_sgl { > + /** start of an array of vectors */ > + struct rte_crypto_vec *vec; > + /** size of an array of vectors */ > + uint32_t num; > +}; > + > +/** > + * Synchronous operation descriptor. > + * Supposed to be used with CPU crypto API call. > + */ > +struct rte_crypto_sym_vec { > + /** array of SGL vectors */ > + struct rte_crypto_sgl *sgl; > + /** array of pointers to IV */ > + void **iv; > + /** array of pointers to AAD */ > + void **aad; > + /** array of pointers to digest */ > + void **digest; > + /** > + * array of statuses for each operation: > + * - 0 on success > + * - errno on error > + */ > + int32_t *status; > + /** number of operations to perform */ > + uint32_t num; > +}; > + > +/** > + * used for cpu_crypto_process_bulk() to specify head/tail offsets > + * for auth/cipher processing. > + */ > +union rte_crypto_sym_ofs { > + uint64_t raw; > + struct { > + struct { > + uint16_t head; > + uint16_t tail; > + } auth, cipher; > + } ofs; > +}; >=20 > /** Symmetric Cipher Algorithms */ > enum rte_crypto_cipher_algorithm { > diff --git a/lib/librte_cryptodev/rte_cryptodev.c > b/lib/librte_cryptodev/rte_cryptodev.c > index 5c6359b5c..889d61319 100644 > --- a/lib/librte_cryptodev/rte_cryptodev.c > +++ b/lib/librte_cryptodev/rte_cryptodev.c > @@ -1,5 +1,5 @@ > /* SPDX-License-Identifier: BSD-3-Clause > - * Copyright(c) 2015-2017 Intel Corporation > + * Copyright(c) 2015-2020 Intel Corporation > */ >=20 > #include > @@ -494,6 +494,8 @@ rte_cryptodev_get_feature_name(uint64_t flag) > return "RSA_PRIV_OP_KEY_QT"; > case RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED: > return "DIGEST_ENCRYPTED"; > + case RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO: > + return "SYM_CPU_CRYPTO"; Update needed in the doc/guides/cryptodevs/features/default.ini