[dpdk-dev] [PATCH 0/4] A proposed DPDK Crypto API and device framework

Declan Doherty declan.doherty at intel.com
Thu Aug 20 16:07:19 CEST 2015


Co-authored-by: Des O Dea <des.j.o.dea at intel.com>
Co-authored-by: John Griffin <john.griffin at intel.com>
Co-authored-by: Fiona Trahe <fiona.trahe at intel.com>

This series of patches proposes a set of application burst oriented APIs for
asynchronous symmetric cryptographic  functions within DPDK. It also contains a
poll mode driver cryptographic device framework for the implementation of
crypto devices within DPDK.

In the patch set we also have included 2 reference implementations of crypto
PMDs, both are still early in development but act as an example of how we
envisage the APIs and device framework to be used. Currently both
implementations only support AES128-CBC with HMAC_SHA1/SHA256/SHA512
authentication operations. The first device is a purely software PMD based on
Intel's multi-buffer library, which utilises both AES-NI instructions and
vector operations to accelerate crypto operations and the second PMD utilises
Intel's Quick Assist Technology (on DH895xxC) to provide hardware accelerated
crypto operations.

 The proposed API set supports two functional modes of operation: 

1, A session oriented mode. In this mode the user creates a crypto session
which defines all the immutable data required to perform a particular crypto
operation in advance, including cipher/hash algorithms and operations to be
performed as well as the keys to used etc. The session is then referenced by
the crypto operation data structure which is a data structure specific to each
mbuf. It is used to contain all mutable data about the cryto operation to be
performed, such as data offsets and lengths into the mbuf's data payload for
cipher and hash operations to be performed. 

2, A session-less mode. In this mode the user is able to provision crypto
operations on an mbuf without the need to have a cached session created in
advance, but at the cost of entailing the overhead of calculating
authentication pre-computes and preforming key expansions in-line with the
crypto operation. Only the crypto operation data structure must be completed in
this mode but all of immutable crypto operation  parameters that would be
normally set within a session are now specified within the crypto operation
data structure. Once all mutable and immutable parameters are set the crypto
operation data structure can be attached to the specified mbuf and enqueued on
a specified crypto device for processing. 

The patch set contains the following features:
- Crypto device APIs and device framework
- Example implementation of a software crypto PMD based on multi-buffer library
- Example implementation of a hardware crypto PMD baed on Intel QAT(DH895xxC)
- Unit and performance test's which give and example of utilising the crypto API's.


Current Status: The patch set has only been compiled and tested with 64-bit
gcc. There is no support for chained mbuf's and as mentioned above the PMD's
have only currently implemented support for AES128-CBC/AES256-CBC/AES512-CBC
and HMAC_SHA1/SHA256/SHA512. At this stage we are looking for feedback on the
proposed API's and the framework implementations. 


Declan Doherty (3):
  cryptodev: Initial DPDK Crypto APIs and device framework release
  aesni_mb_pmd: Initial implementation of multi buffer based crypto
    device
  app/test: add cryptodev unit and performance tests

John Griffin (1):
  qat_crypto_pmd: Addition of a new QAT DPDK PMD.

 app/test/Makefile                                  |    7 +-
 app/test/test.c                                    |   91 +-
 app/test/test.h                                    |   34 +-
 app/test/test_cryptodev.c                          | 1079 +++++++++++++++
 app/test/test_cryptodev_perf.c                     | 1438 ++++++++++++++++++++
 app/test/test_link_bonding.c                       |    6 +-
 app/test/test_link_bonding_mode4.c                 |    7 +-
 config/common_bsdapp                               |   30 +-
 config/common_linuxapp                             |   29 +-
 doc/api/doxy-api-index.md                          |    1 +
 doc/api/doxy-api.conf                              |    1 +
 doc/guides/cryptodevs/aesni_mb.rst                 |   76 ++
 doc/guides/cryptodevs/index.rst                    |   43 +
 doc/guides/cryptodevs/qat.rst                      |  155 +++
 doc/guides/index.rst                               |    1 +
 drivers/Makefile                                   |    1 +
 drivers/crypto/Makefile                            |   38 +
 drivers/crypto/aesni_mb/Makefile                   |   67 +
 drivers/crypto/aesni_mb/aesni_mb_ops.h             |  206 +++
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c         |  550 ++++++++
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c     |  346 +++++
 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h |  224 +++
 drivers/crypto/aesni_mb/rte_pmd_aesni_version.map  |    5 +
 drivers/crypto/qat/Makefile                        |   63 +
 .../qat/qat_adf/adf_transport_access_macros.h      |  173 +++
 drivers/crypto/qat/qat_adf/icp_qat_fw.h            |  316 +++++
 drivers/crypto/qat/qat_adf/icp_qat_fw_la.h         |  404 ++++++
 drivers/crypto/qat/qat_adf/icp_qat_hw.h            |  305 +++++
 drivers/crypto/qat/qat_adf/qat_algs.h              |  124 ++
 drivers/crypto/qat/qat_adf/qat_algs_build_desc.c   |  462 +++++++
 drivers/crypto/qat/qat_crypto.c                    |  469 +++++++
 drivers/crypto/qat/qat_crypto.h                    |   99 ++
 drivers/crypto/qat/qat_logs.h                      |   78 ++
 drivers/crypto/qat/qat_qp.c                        |  372 +++++
 drivers/crypto/qat/rte_pmd_qat_version.map         |    5 +
 drivers/crypto/qat/rte_qat_cryptodev.c             |  128 ++
 lib/Makefile                                       |    1 +
 lib/librte_cryptodev/Makefile                      |   60 +
 lib/librte_cryptodev/rte_crypto.h                  |  649 +++++++++
 lib/librte_cryptodev/rte_crypto_version.map        |   40 +
 lib/librte_cryptodev/rte_cryptodev.c               |  966 +++++++++++++
 lib/librte_cryptodev/rte_cryptodev.h               |  550 ++++++++
 lib/librte_cryptodev/rte_cryptodev_pmd.h           |  622 +++++++++
 lib/librte_eal/common/include/rte_log.h            |    1 +
 lib/librte_eal/common/include/rte_memory.h         |   14 +-
 lib/librte_mbuf/rte_mbuf.c                         |    1 +
 lib/librte_mbuf/rte_mbuf.h                         |   51 +
 mk/rte.app.mk                                      |    8 +
 48 files changed, 10346 insertions(+), 50 deletions(-)
 create mode 100644 app/test/test_cryptodev.c
 create mode 100644 app/test/test_cryptodev_perf.c
 create mode 100644 doc/guides/cryptodevs/aesni_mb.rst
 create mode 100644 doc/guides/cryptodevs/index.rst
 create mode 100644 doc/guides/cryptodevs/qat.rst
 create mode 100644 drivers/crypto/Makefile
 create mode 100644 drivers/crypto/aesni_mb/Makefile
 create mode 100644 drivers/crypto/aesni_mb/aesni_mb_ops.h
 create mode 100644 drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
 create mode 100644 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
 create mode 100644 drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h
 create mode 100644 drivers/crypto/aesni_mb/rte_pmd_aesni_version.map
 create mode 100644 drivers/crypto/qat/Makefile
 create mode 100644 drivers/crypto/qat/qat_adf/adf_transport_access_macros.h
 create mode 100644 drivers/crypto/qat/qat_adf/icp_qat_fw.h
 create mode 100644 drivers/crypto/qat/qat_adf/icp_qat_fw_la.h
 create mode 100644 drivers/crypto/qat/qat_adf/icp_qat_hw.h
 create mode 100644 drivers/crypto/qat/qat_adf/qat_algs.h
 create mode 100644 drivers/crypto/qat/qat_adf/qat_algs_build_desc.c
 create mode 100644 drivers/crypto/qat/qat_crypto.c
 create mode 100644 drivers/crypto/qat/qat_crypto.h
 create mode 100644 drivers/crypto/qat/qat_logs.h
 create mode 100644 drivers/crypto/qat/qat_qp.c
 create mode 100644 drivers/crypto/qat/rte_pmd_qat_version.map
 create mode 100644 drivers/crypto/qat/rte_qat_cryptodev.c
 create mode 100644 lib/librte_cryptodev/Makefile
 create mode 100644 lib/librte_cryptodev/rte_crypto.h
 create mode 100644 lib/librte_cryptodev/rte_crypto_version.map
 create mode 100644 lib/librte_cryptodev/rte_cryptodev.c
 create mode 100644 lib/librte_cryptodev/rte_cryptodev.h
 create mode 100644 lib/librte_cryptodev/rte_cryptodev_pmd.h

-- 
1.9.3



More information about the dev mailing list