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 AC8BEA0352; Thu, 16 Jan 2020 11:11:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C81EE1C1CD; Thu, 16 Jan 2020 11:11:54 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 9D6A01C1C8 for ; Thu, 16 Jan 2020 11:11:52 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2020 02:11:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,325,1574150400"; d="scan'208";a="373265308" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga004.jf.intel.com with ESMTP; 16 Jan 2020 02:11:51 -0800 Received: from orsmsx116.amr.corp.intel.com (10.22.240.14) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 16 Jan 2020 02:11:51 -0800 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX116.amr.corp.intel.com (10.22.240.14) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 16 Jan 2020 02:11:51 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.175) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 16 Jan 2020 02:11:50 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CYa1at1gbkiD/y+mvbVArRORgzsPQd9j5Xal2mZ5To/km1w9A5/MToBeIBltPCXFWiliqKQcADJFjoX248D01+IxuUMzIyF2SpXFnfUUzO6PjJXHamVoeTgp2YcAZUABH/pNVfadrPWPvUzQZiVIvrbA2aw31N997ve+IETMqYHs34Lb5JKm3sFkp0eZTxPPlq4OkRGhCnbgpZaH8DtJIeYhJj4CexyF7VqLnJGNB1wO4GOf75azS+q8SoPlCpWPXgOcVZmm6OA41LhgPGjJm+dI7zvr8cAZJ07jT1oODuZax3NYKQuzHJ8gqgAlMGqxHYgJYMbWCGMhr4/V/sLaqw== 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=DRy2G1AsE8VK1XQjt9PREQbPjYOJTgSeyJLzlbI7N28=; b=Ij3XHEBQq8LIW3/an085f1FFm/EqyQ6efo1JxpIfhN4CwtNtWWJek6ktjOi3TpflM+4gX0clHrNPgemhZgRlT7eBXvuPmiMvecDYjp69tMtCtZjdN1J6C70dFiNKHV0eJ0vZ9bYUcHvBxYKoXM49ITledD4yTFdUqjZ/CsBINz3aJphq+hiZ5Rq6KuJXElzmqI79/ubtvHdmtTeCiqLpQpJxc0UFHgX48xUZg5XlCLGc+5t1+K8Kz4BvKRq0z/l+zf4qADqZbN0EnKdAguxX6AoDC92mS1JMQZt1IgUgeZq17aoeR9ibh93xyu45Q4os8eaXz3Ajds6fdshVYuAe6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DRy2G1AsE8VK1XQjt9PREQbPjYOJTgSeyJLzlbI7N28=; b=qXZUeJ/GLCYoWSQNw6tCmyPO8vXLqMg8874U9VFsDI5w29X78Tuiy5NsgXsSU/4AT4hWP+Jq2Gfvb84jmo2c34/kNilfz6N85cGwx9164sJUqyAvvcGtsOMYXhzjIgTI1R9IygzSiAr9LY4WW2PfF1zC146avztAx3FHkP0ebb4= Received: from SN6PR11MB2622.namprd11.prod.outlook.com (52.135.91.31) by SN6PR11MB2831.namprd11.prod.outlook.com (52.135.90.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2623.10; Thu, 16 Jan 2020 10:11:48 +0000 Received: from SN6PR11MB2622.namprd11.prod.outlook.com ([fe80::d149:ac01:a9:58ce]) by SN6PR11MB2622.namprd11.prod.outlook.com ([fe80::d149:ac01:a9:58ce%6]) with mapi id 15.20.2623.018; Thu, 16 Jan 2020 10:11:48 +0000 From: "Zhang, Roy Fan" To: "Smoczynski, MarcinX" , "akhil.goyal@nxp.com" , "Ananyev, Konstantin" , "Doherty, Declan" , "Nicolau, Radu" CC: "dev@dpdk.org" Thread-Topic: [PATCH v3 1/6] cryptodev: introduce cpu crypto support API Thread-Index: AQHVy9H3V/k59pjg/UmIMrsxbbA5g6ftED7g Date: Thu, 16 Jan 2020 10:11:48 +0000 Message-ID: References: <20200115182832.17012-1-marcinx.smoczynski@intel.com> <20200115182832.17012-2-marcinx.smoczynski@intel.com> In-Reply-To: <20200115182832.17012-2-marcinx.smoczynski@intel.com> Accept-Language: zh-Hans-HK, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjI1NjUzYmQtMDVlZi00MzUwLTg1YTYtODcwZmE2MmIyYjljIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiY2Q4UmVtUkNHY2lBaW9teDE0SUFvb2JXTmdGOVYwTzI3S2luSlN5OFRzUkVCajVsejdESmRHeG9KYzJ6R1ZsTCJ9 x-ctpclassification: CTP_NT dlp-version: 11.2.0.6 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: spf=none (sender IP is ) smtp.mailfrom=roy.fan.zhang@intel.com; x-originating-ip: [192.198.151.166] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 95d05654-5e29-4015-e1ce-08d79a6c7fd6 x-ms-traffictypediagnostic: SN6PR11MB2831: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-forefront-prvs: 02843AA9E0 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(39860400002)(396003)(136003)(346002)(376002)(189003)(199004)(110136005)(7696005)(478600001)(26005)(186003)(8936002)(66946007)(4326008)(6506007)(53546011)(316002)(2906002)(33656002)(66476007)(76116006)(86362001)(81156014)(8676002)(81166006)(9686003)(64756008)(5660300002)(71200400001)(66446008)(55016002)(66556008)(6636002)(52536014); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR11MB2831; H:SN6PR11MB2622.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: y5yAodZKtIbefmKLzOgIGEDkzcX9Bixjbrn1lmAAJ3SEeKhg1eh7QJaQNft9Ldu++gR7SKvtU4oGT/KP9RVELFEK3uqPGveTHvrNlXWlag180BewDoc6LgltfJnBNsTYfFnMY2YRG7JNKkZRcbNL0uhWplyNWm8L5y9/DT5FsP7vMKm1H2YJDEabVQj/zdbr2iMJNNNWs9fETxWpsSXl25DhNGZwQ6BhtOecOTIMc1bW63i9ZSY3DmF6wa3JNHlWqTQYTmXpBNYKSqJqrMIZIilB+jSaPQZYI2BCPhszLSlCv8rtmlpbrbAXwc8MHMI25GOZsND+LvLDvh0qa6QCXtVJXpQVYm9h0Lr8r24dLV9n7ocVJWJIJLvM+FYs8l3HuqbNjHxmCAUiEINyryOqrM/E1wPLNprxONlGdcnVaT74JHHpy2mys1QePku38NkT Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 95d05654-5e29-4015-e1ce-08d79a6c7fd6 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jan 2020 10:11:48.6939 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 41DdNbgVc5v8PfAl1S7BQXCBMBm9y2oBaGC/8gzYwToseq//wBYOv8U+qucETK6bwNr/lDOLKXF/ijhZLR1LZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2831 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3 1/6] 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, > -----Original Message----- > From: Smoczynski, MarcinX > Sent: Wednesday, January 15, 2020 6:28 PM > To: akhil.goyal@nxp.com; Ananyev, Konstantin > ; Zhang, Roy Fan > ; Doherty, Declan ; > Nicolau, Radu > Cc: dev@dpdk.org; Smoczynski, MarcinX > Subject: [PATCH v3 1/6] cryptodev: introduce cpu crypto support API >=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. >=20 > Signed-off-by: Konstantin Ananyev > Signed-off-by: Marcin Smoczynski > --- > lib/librte_cryptodev/rte_crypto_sym.h | 62 ++++++++++++++++++- > lib/librte_cryptodev/rte_cryptodev.c | 30 +++++++++ > lib/librte_cryptodev/rte_cryptodev.h | 20 ++++++ > lib/librte_cryptodev/rte_cryptodev_pmd.h | 19 ++++++ > .../rte_cryptodev_version.map | 1 + > 5 files changed, 131 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_cryptodev/rte_crypto_sym.h > b/lib/librte_cryptodev/rte_crypto_sym.h > index ffa038dc4..f5dd05ab0 100644 > --- a/lib/librte_cryptodev/rte_crypto_sym.h > +++ b/lib/librte_cryptodev/rte_crypto_sym.h > @@ -25,6 +25,59 @@ 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-path > + * 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; > +}; > + > +struct rte_crypto_sgl { > + /** start of an array of vectors */ > + struct rte_crypto_vec *vec; > + /** size of an array of vectors */ > + uint32_t num; > +}; > + > +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 { > @@ -425,7 +478,14 @@ enum rte_crypto_sym_xform_type { > RTE_CRYPTO_SYM_XFORM_NOT_SPECIFIED =3D 0, /**< No > xform specified */ > RTE_CRYPTO_SYM_XFORM_AUTH, /**< Authentication > xform */ > RTE_CRYPTO_SYM_XFORM_CIPHER, /**< Cipher xform */ > - RTE_CRYPTO_SYM_XFORM_AEAD /**< AEAD xform */ > + RTE_CRYPTO_SYM_XFORM_AEAD, /**< AEAD xform */ > + > + RTE_CRYPTO_SYM_XFORM_TYPE_MASK =3D 0xFFFF, > + /**< xform type mask value */ > + RTE_CRYPTO_SYM_XFORM_FLAG_MASK =3D 0xFFFF0000, > + /**< xform flag mask value */ > + RTE_CRYPTO_SYM_CPU_CRYPTO =3D 0x80000000, > + /**< xform flag for cpu-crypto */ > }; >=20 Fan: what I believe RTE_CRYPTO_SYM_XFORM_TYPE_MASK and RTE_CRYPTO_SYM_XFORM= _FLAG_MASK should be define outside the enum, but as a marco define. Also I= think we missed a doc update patch in the patchset. Other than that everything looks great.