From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id B534B2C37 for ; Sat, 1 Jul 2017 03:09:24 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jun 2017 18:09:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,289,1496127600"; d="scan'208";a="121072570" Received: from silpixa00399464.ir.intel.com (HELO silpixa00399464.ger.corp.intel.com) ([10.237.222.157]) by fmsmga005.fm.intel.com with ESMTP; 30 Jun 2017 18:09:21 -0700 From: Pablo de Lara To: declan.doherty@intel.com, 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 Cc: dev@dpdk.org, Pablo de Lara Date: Fri, 30 Jun 2017 18:09:22 +0100 Message-Id: <20170630170933.56631-1-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170526184538.27292-1-michalx.k.jastrzebski@intel.com> References: <20170526184538.27292-1-michalx.k.jastrzebski@intel.com> Subject: [dpdk-dev] [PATCH v2 00/11] 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: Sat, 01 Jul 2017 01:09:25 -0000 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 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 (4): cryptodev: remove unused cryptodev session structure cryptodev: move session init out of session pool creation cryptodev: add mempool pointer in queue pair setup 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 dev_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 | 30 +- app/test-crypto-perf/cperf_ops.h | 1 + app/test-crypto-perf/cperf_test_latency.c | 7 +- app/test-crypto-perf/cperf_test_latency.h | 5 +- app/test-crypto-perf/cperf_test_throughput.c | 7 +- app/test-crypto-perf/cperf_test_throughput.h | 5 +- app/test-crypto-perf/cperf_test_verify.c | 7 +- app/test-crypto-perf/cperf_test_verify.h | 5 +- app/test-crypto-perf/main.c | 42 ++- doc/guides/prog_guide/cryptodev_lib.rst | 59 ++- doc/guides/prog_guide/img/cryptodev_sym_sess.svg | 418 ++++++++++++++++++--- doc/guides/rel_notes/release_17_08.rst | 16 +- drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 58 +-- drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c | 32 +- drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 34 +- drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c | 31 +- drivers/crypto/armv8/rte_armv8_pmd.c | 13 +- drivers/crypto/armv8/rte_armv8_pmd_ops.c | 35 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 56 ++- drivers/crypto/kasumi/rte_kasumi_pmd.c | 20 +- drivers/crypto/kasumi/rte_kasumi_pmd_ops.c | 32 +- drivers/crypto/null/null_crypto_pmd.c | 17 +- drivers/crypto/null/null_crypto_pmd_ops.c | 35 +- drivers/crypto/openssl/rte_openssl_pmd.c | 14 +- drivers/crypto/openssl/rte_openssl_pmd_ops.c | 32 +- drivers/crypto/qat/qat_crypto.c | 66 ++-- drivers/crypto/qat/qat_crypto.h | 15 +- 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 | 84 ++--- drivers/crypto/scheduler/scheduler_pmd_private.h | 4 - drivers/crypto/scheduler/scheduler_roundrobin.c | 41 -- drivers/crypto/snow3g/rte_snow3g_pmd.c | 20 +- drivers/crypto/snow3g/rte_snow3g_pmd_ops.c | 32 +- drivers/crypto/zuc/rte_zuc_pmd.c | 19 +- drivers/crypto/zuc/rte_zuc_pmd_ops.c | 32 +- examples/ipsec-secgw/ipsec-secgw.c | 41 +- examples/ipsec-secgw/ipsec.c | 8 +- examples/ipsec-secgw/ipsec.h | 3 +- examples/l2fwd-crypto/main.c | 55 ++- lib/librte_cryptodev/rte_cryptodev.c | 240 +++++------- lib/librte_cryptodev/rte_cryptodev.h | 101 ++--- lib/librte_cryptodev/rte_cryptodev_pmd.h | 38 +- lib/librte_cryptodev/rte_cryptodev_version.map | 3 + test/test/test_cryptodev.c | 383 ++++++++++++++----- test/test/test_cryptodev_blockcipher.c | 15 +- test/test/test_cryptodev_blockcipher.h | 1 + test/test/test_cryptodev_perf.c | 198 +++++++--- 51 files changed, 1620 insertions(+), 861 deletions(-) -- 2.9.4