From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 5813C235 for ; Wed, 5 Jul 2017 17:21:51 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jul 2017 08:21:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,312,1496127600"; d="scan'208";a="104696793" Received: from dwdohert-mobl1.ger.corp.intel.com (HELO [163.33.228.184]) ([163.33.228.184]) by orsmga004.jf.intel.com with ESMTP; 05 Jul 2017 08:21:47 -0700 To: Pablo de Lara , zbigniew.bodek@caviumnetworks.com, jerin.jacob@caviumnetworks.com, akhil.goyal@nxp.com, hemant.agrawal@nxp.com, fiona.trahe@intel.com, john.griffin@intel.com, deepak.k.jain@intel.com References: <20170702155719.66530-1-pablo.de.lara.guarch@intel.com> <20170705052620.34223-1-pablo.de.lara.guarch@intel.com> Cc: dev@dpdk.org From: Declan Doherty Message-ID: <791ee2d6-2a22-3e7e-0643-748860b18442@intel.com> Date: Wed, 5 Jul 2017 16:21:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170705052620.34223-1-pablo.de.lara.guarch@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 00/12] Device independent crypto sessions 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: , X-List-Received-Date: Wed, 05 Jul 2017 15:21:52 -0000 On 05/07/2017 6:26 AM, Pablo de Lara wrote: > Currently, the cryptodev library requires the session mempools to be created inside each device. > This can be a waste of memory, as several devices with the same driver could be using the same session. > > This patchset makes changes in the library to allow session to contain multiple driver private data, so it can be used by multiple devices (no need to be the same driver). > > SESSION MEMPOOL <---|---> DEVICE INSTANCES > -------------------------------------------- > > .-------------. .----------------------------. > | Crypto |. | mempool obj | > | sym-session |<--. | .--------------------------+ > | mempool || | | | rte_cryptodev_session | .-------------. > `-------------'| | | | | | DEVICE | > `-----|-------' | | | | | INSTANCE | > | `----- | | - device id | > +------------>| | - private data[type idx] | .--| - session | > | `-+=================|..|=====' | | mempool | > | | | | `-------------' > | | | | > | .----------------------. | | | .-------------. > +---->| mempool obj | | | .--------. | | DEVICE | > | | .--------------------+ | | | DRIVER | | | INSTANCE | > | | | PMD's private data |<---+------| - type |<--+--| | > | +-+====================+ | `--------' | ... | > | | | | > | | `-------------' > | | > | .----------------------. | .-------------. > `---->| mempool obj | | .--------. | DEVICE | > | .--------------------+ | | DRIVER | | INSTANCE | > | | PMD's private data |<------+---| - type |<-----| | > `-+====================' `--------' | ... | > | | > `-------------' > Crypto sym-session mempool > > Mempool created to store rte_cryptodev_session objects as well as > private data for supported device types. > > This mempool replaces existing session mempools in device > instances to ease session management and improve consistency > (especially if the session is intended to be used for operations > performed on different devices). > > rte_crypto_session > > New rte_cryptodev_session structure is taken from crypto session > mempool and can store more than one PMD's private data object (one > for each device type supported by sesion). > > Crypto operations will use device type id (unique for each driver) to > retrieve private data from rte_crypto_session right for the device > type they are performed on. > > This patchset was based on the changes proposed in RFC > (http://dpdk.org/ml/archives/dev/2017-May/065259.html) > > This patchset depends on: > http://dpdk.org/dev/patchwork/patch/26156/ > > Changes in v4: > > - Introduced new rte_cryptodev_sym_session_clear() function, > which frees device private session data. > This needs to be called before calling rte_cryptodev_sym_session_free(). > > - Rebased on top of dpdk-next-crypto > > Changes in v3: > > - Removed internal PMD's session initialize function > > - Created session mempool in the right socket in > the sample apps > > - Get two objects (header and private data) from mempool > when using sessionless operations, to get a complete > session > > - Fixed commit message (check-git-log failed) > > - Added note of removed session_mp from rte_cryptodev_config > in documentation > > - Fixed minor issues in documentation > > > Changes in v2: > > - Split the patch in multiple smaller patches to > facilitate the review > > - Removed new API to create the session mempool, > since mempool can be created directly withe mempool_create > > - Session headers and device private sessions can be > allocated from different mempools, for better memory > efficiency. > > - Added a cover letter (partially extracted from RFC) > for better clarification on the intention of this patchset > > Pablo de Lara (5): > cryptodev: remove unused cryptodev session structure > cryptodev: move session init out of session pool creation > cryptodev: add mempool pointer in queue pair setup > cryptodev: remove session init internal function > doc: add new crypto session information > > Slawomir Mrozowicz (7): > cryptodev: add private session size retrieval function > cryptodev: do not create session mempool internally > cryptodev: change attach session to queue pair API > cryptodev: remove device id from crypto session > cryptodev: remove driver id from session > cryptodev: remove mempool from session > cryptodev: support device independent sessions > > app/test-crypto-perf/cperf.h | 5 +- > app/test-crypto-perf/cperf_ops.c | 21 +- > app/test-crypto-perf/cperf_ops.h | 1 + > app/test-crypto-perf/cperf_test_latency.c | 12 +- > app/test-crypto-perf/cperf_test_latency.h | 5 +- > app/test-crypto-perf/cperf_test_throughput.c | 12 +- > app/test-crypto-perf/cperf_test_throughput.h | 5 +- > app/test-crypto-perf/cperf_test_verify.c | 12 +- > app/test-crypto-perf/cperf_test_verify.h | 5 +- > app/test-crypto-perf/main.c | 85 ++++- > doc/guides/prog_guide/cryptodev_lib.rst | 61 ++- > doc/guides/prog_guide/img/cryptodev_sym_sess.svg | 418 ++++++++++++++++++--- > doc/guides/rel_notes/release_17_08.rst | 19 + > drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 51 ++- > drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c | 49 ++- > drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 43 ++- > drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c | 50 ++- > drivers/crypto/armv8/rte_armv8_pmd.c | 39 +- > drivers/crypto/armv8/rte_armv8_pmd_ops.c | 49 ++- > drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 66 +++- > drivers/crypto/kasumi/rte_kasumi_pmd.c | 42 ++- > drivers/crypto/kasumi/rte_kasumi_pmd_ops.c | 51 ++- > drivers/crypto/null/null_crypto_pmd.c | 43 ++- > drivers/crypto/null/null_crypto_pmd_ops.c | 51 ++- > drivers/crypto/openssl/rte_openssl_pmd.c | 41 +- > drivers/crypto/openssl/rte_openssl_pmd_ops.c | 52 ++- > drivers/crypto/qat/qat_crypto.c | 93 +++-- > drivers/crypto/qat/qat_crypto.h | 19 +- > drivers/crypto/qat/qat_qp.c | 2 +- > drivers/crypto/qat/rte_qat_cryptodev.c | 1 - > drivers/crypto/scheduler/scheduler_failover.c | 45 +-- > .../crypto/scheduler/scheduler_pkt_size_distr.c | 18 - > drivers/crypto/scheduler/scheduler_pmd_ops.c | 78 ++-- > drivers/crypto/scheduler/scheduler_pmd_private.h | 4 - > drivers/crypto/scheduler/scheduler_roundrobin.c | 41 -- > drivers/crypto/snow3g/rte_snow3g_pmd.c | 43 ++- > drivers/crypto/snow3g/rte_snow3g_pmd_ops.c | 51 ++- > drivers/crypto/zuc/rte_zuc_pmd.c | 39 +- > drivers/crypto/zuc/rte_zuc_pmd_ops.c | 51 ++- > examples/ipsec-secgw/ipsec-secgw.c | 41 +- > examples/ipsec-secgw/ipsec.c | 8 +- > examples/ipsec-secgw/ipsec.h | 3 +- > examples/l2fwd-crypto/main.c | 77 +++- > lib/librte_cryptodev/rte_cryptodev.c | 252 ++++++------- > lib/librte_cryptodev/rte_cryptodev.h | 122 +++--- > lib/librte_cryptodev/rte_cryptodev_pmd.h | 60 ++- > lib/librte_cryptodev/rte_cryptodev_version.map | 4 + > test/test/test_cryptodev.c | 388 ++++++++++++++----- > test/test/test_cryptodev_blockcipher.c | 18 +- > test/test/test_cryptodev_blockcipher.h | 1 + > test/test/test_cryptodev_perf.c | 216 ++++++++--- > 51 files changed, 2008 insertions(+), 955 deletions(-) > Series Acked-by: Declan Doherty