[dpdk-dev] [PATCH v4 00/12] Device independent crypto sessions

Akhil Goyal akhil.goyal at nxp.com
Wed Jul 5 18:26:06 CEST 2017


On 7/5/2017 10:56 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(-)
> 
Tested for dpaa2_sec
Series Acked-by: Akhil Goyal <akhil.goyal at nxp.com>



More information about the dev mailing list