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 C3710A3160 for ; Wed, 9 Oct 2019 18:09:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0D9651C1D4; Wed, 9 Oct 2019 18:09:17 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id A41981C1D3 for ; Wed, 9 Oct 2019 18:09:14 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 09:09:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,276,1566889200"; d="scan'208";a="277467778" Received: from akusztax-mobl.ger.corp.intel.com ([10.104.116.172]) by orsmga001.jf.intel.com with ESMTP; 09 Oct 2019 09:09:11 -0700 From: Arek Kusztal To: dev@dpdk.org Cc: akhil.goyal@nxp.com, fiona.trahe@intel.com, shallyv@marvell.com, anoobj@marvell.com, Arek Kusztal Date: Wed, 9 Oct 2019 18:08:48 +0200 Message-Id: <20191009160848.15944-1-arkadiuszx.kusztal@intel.com> X-Mailer: git-send-email 2.19.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4] cryptodev: extend api of asymmetric crypto by sessionless 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" This commit adds asymmetric session-less option to rte_crypto_asym_op. Feature flag for sessionless is added to rte_cryptodev. Signed-off-by: Arek Kusztal --- v2: - added union v3: - added entry into feature matrix - added information to prog_guide v4: - fixed formatting - fixed grammar doc/guides/cryptodevs/features/default.ini | 1 + doc/guides/prog_guide/cryptodev_lib.rst | 9 ++++++++- lib/librte_cryptodev/rte_crypto_asym.h | 9 +++++++-- lib/librte_cryptodev/rte_cryptodev.h | 2 ++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini index d3ee1af..b7f9a0a 100644 --- a/doc/guides/cryptodevs/features/default.ini +++ b/doc/guides/cryptodevs/features/default.ini @@ -26,6 +26,7 @@ OOP LB In LB Out = RSA PRIV OP KEY EXP = RSA PRIV OP KEY QT = Digest encrypted = +Asymmetric sessionless = ; ; Supported crypto algorithms of a default crypto driver. diff --git a/doc/guides/prog_guide/cryptodev_lib.rst b/doc/guides/prog_guide/cryptodev_lib.rst index 9719944..4584834 100644 --- a/doc/guides/prog_guide/cryptodev_lib.rst +++ b/doc/guides/prog_guide/cryptodev_lib.rst @@ -876,7 +876,14 @@ private asymmetric session data. Once this is done, session should be freed usin Asymmetric Sessionless Support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Currently asymmetric crypto framework does not support sessionless. +Asymmetric crypto framework supports sessionless operations. + +Fields that should be set by user are: + +Member xform of struct rte_crypto_asym_op should point to the user created rte_crypto_asym_xform. +Note that this rte_crypto_asym_xform should be immutable for the lifetime of associated crypto_op. + +Member sess_type of rte_crypto_op should be set to RTE_CRYPTO_OP_SESSIONLESS. Transforms and Transform Chaining ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/librte_cryptodev/rte_crypto_asym.h b/lib/librte_cryptodev/rte_crypto_asym.h index 4fbef2f..0d34ce8 100644 --- a/lib/librte_cryptodev/rte_crypto_asym.h +++ b/lib/librte_cryptodev/rte_crypto_asym.h @@ -522,8 +522,13 @@ struct rte_crypto_dsa_op_param { * */ struct rte_crypto_asym_op { - struct rte_cryptodev_asym_session *session; - /**< Handle for the initialised session context */ + RTE_STD_C11 + union { + struct rte_cryptodev_asym_session *session; + /**< Handle for the initialised session context */ + struct rte_crypto_asym_xform *xform; + /**< Session-less API crypto operation parameters */ + }; __extension__ union { diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index e175b83..c6ffa3b 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -448,6 +448,8 @@ rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum, /**< Support RSA Private Key OP with CRT (quintuple) Keys */ #define RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED (1ULL << 19) /**< Support encrypted-digest operations where digest is appended to data */ +#define RTE_CRYPTODEV_FF_ASYM_SESSIONLESS (1ULL << 20) +/**< Support asymmetric session-less operations */ /** -- 2.1.0