[v3,00/38] crypto/qat: refactor to support multiple services

Message ID 1528892062-4997-1-git-send-email-tomaszx.jozwiak@intel.com (mailing list archive)


Tomasz Jozwiak June 13, 2018, 12:13 p.m. UTC
  From: Pablo de Lara <pablo.de.lara.guarch@intel.com>

The QAT crypto PMD was peppered with references to rte_cryptodev artefacts.
Also the pci device it presented to the API layer was entirely owned by the one
cryptodev device instance created by the probe.
This patchset refactors the PMD so one pci device can present out multiple different
device instances to implement different APIs, specifically cryptodev and compressdev instances.
The code is refactored into
 - common code which handles the pci device discovery, configuration,
   queue-pair setup, stats gathering and data-path enqueue and dequeue.
 - service-specific code for symmetric crypto, which is a thin layer
   implementing the cryptodev API and using the common code.
 - place-holder files for service-specific code to support asymmetric
   crypto and compression services in future.
The code is all still in the crypto/qat directory as it is functionally unchanged,
still only supporting a symmetric crypto service. The code will move to drivers/common,
/crypto and /compress in a future patch when this is needed for a compression PMD.

Changes for v3:
 - fixed some commit messages
 - fixed compilation issue in one of the patches
 - split two commits into multiple commits

Changes for v2:
 - fixed some bugs compiled in when debug enabled
 - added patch to remove MAX_NB_SESSIONS from config file
 - removed SPDX license patch as already applied
 - documented device name formats

Fiona Trahe (36):
  crypto/qat: add qat common header
  crypto/qat: add qat device files
  crypto/qat: add symmetric session file
  crypto/qat: change filename crypto to sym
  crypto/qat: rename fns for consistency
  crypto/qat: renamed sym-specific structs
  crypto/qat: make enqueue function generic
  crypto/qat: make dequeue function generic
  crypto/qat: move generic qp fn to qp file
  crypto/qat: separate sym-specific from generic qp setup
  crypto/qat: move sym-specific qp code to sym file
  crypto/qat: remove dependencies on cryptodev from common
  crypto/qat: move defines from sym to qp header file
  crypto/qat: create structures to support various generations
  crypto/qat: rename sgl related objects
  crypto/qat: move sgl related element to appropriate files
  crypto/qat: add QAT PCI device struct
  crypto/qat: use generic driver name for PCI registration
  crypto/qat: move to using new device structure
  crypto/qat: use common stats structures
  crypto/qat: rename functions which depend on cryptodev
  crypto/qat: move code into appropriate files
  crypto/qat: add lock around csr access and change logic
  crypto/qat: remove incorrect usage of bundle number
  crypto/qat: rename variables
  crypto/qat: modify debug message
  crypto/qat: free cookie pool on queue creation error
  crypto/qat: remove unused macro
  crypto/qat: move macro to common file
  crypto/qat: register appropriately named device
  crypto/qat: add max PCI devices to config file
  crypto/qat: optimize adf modulo function
  crypto/qat: remove unused arguments
  crypto/qat: make response process function inline
  crypto/qat: check for service type
  doc/qat: specify QAT driver and device name formats

Tomasz Jozwiak (2):
  crypto/qat: remove unused includes
  crypto/qat: remove configurable max number of sessions

 config/common_base                            |    6 +-
 config/rte_config.h                           |    7 +-
 doc/guides/cryptodevs/qat.rst                 |   12 +
 drivers/crypto/qat/Makefile                   |   10 +-
 drivers/crypto/qat/meson.build                |    9 +-
 .../qat/qat_adf/adf_transport_access_macros.h |    9 +-
 drivers/crypto/qat/qat_adf/qat_algs.h         |  126 --
 drivers/crypto/qat/qat_asym_pmd.c             |   17 +
 drivers/crypto/qat/qat_asym_pmd.h             |   15 +
 drivers/crypto/qat/qat_common.c               |  107 ++
 drivers/crypto/qat/qat_common.h               |   76 +
 drivers/crypto/qat/qat_comp_pmd.c             |   18 +
 drivers/crypto/qat/qat_comp_pmd.h             |   29 +
 drivers/crypto/qat/qat_crypto.c               | 1696 -----------------
 drivers/crypto/qat/qat_crypto.h               |  150 --
 drivers/crypto/qat/qat_device.c               |  242 +++
 drivers/crypto/qat/qat_device.h               |   78 +
 drivers/crypto/qat/qat_qp.c                   |  463 +++--
 drivers/crypto/qat/qat_qp.h                   |  106 ++
 drivers/crypto/qat/qat_sym.c                  |  568 ++++++
 drivers/crypto/qat/qat_sym.h                  |  154 ++
 ..._capabilities.h => qat_sym_capabilities.h} |    6 +-
 drivers/crypto/qat/qat_sym_pmd.c              |  335 ++++
 drivers/crypto/qat/qat_sym_pmd.h              |   40 +
 ...at_algs_build_desc.c => qat_sym_session.c} |  786 +++++++-
 drivers/crypto/qat/qat_sym_session.h          |  143 ++
 drivers/crypto/qat/rte_qat_cryptodev.c        |  180 --
 27 files changed, 3042 insertions(+), 2346 deletions(-)
 delete mode 100644 drivers/crypto/qat/qat_adf/qat_algs.h
 create mode 100644 drivers/crypto/qat/qat_asym_pmd.c
 create mode 100644 drivers/crypto/qat/qat_asym_pmd.h
 create mode 100644 drivers/crypto/qat/qat_common.c
 create mode 100644 drivers/crypto/qat/qat_common.h
 create mode 100644 drivers/crypto/qat/qat_comp_pmd.c
 create mode 100644 drivers/crypto/qat/qat_comp_pmd.h
 delete mode 100644 drivers/crypto/qat/qat_crypto.c
 delete mode 100644 drivers/crypto/qat/qat_crypto.h
 create mode 100644 drivers/crypto/qat/qat_device.c
 create mode 100644 drivers/crypto/qat/qat_device.h
 create mode 100644 drivers/crypto/qat/qat_qp.h
 create mode 100644 drivers/crypto/qat/qat_sym.c
 create mode 100644 drivers/crypto/qat/qat_sym.h
 rename drivers/crypto/qat/{qat_crypto_capabilities.h => qat_sym_capabilities.h} (99%)
 create mode 100644 drivers/crypto/qat/qat_sym_pmd.c
 create mode 100644 drivers/crypto/qat/qat_sym_pmd.h
 rename drivers/crypto/qat/{qat_adf/qat_algs_build_desc.c => qat_sym_session.c} (59%)
 create mode 100644 drivers/crypto/qat/qat_sym_session.h
 delete mode 100644 drivers/crypto/qat/rte_qat_cryptodev.c