When operation calls for auth (digest generation), followed by
encryption of both data plus digest, the digest-in-buffer
flag must be set for QAT.
Fixes: 39e0bee48e ("crypto/qat: rework request builder for performance")
Cc: stable@dpdk.org
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
This patch fixes sgl filling to handle offset
greater than first sgl segment
Fixes: 1947bd1858 ("compress/qat: support scatter-gather buffers")
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
This patch refactors the sgl struct so it includes a flexible
array of flat buffers as sym and compress PMDs can have
different size sgls.
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
QAT driver checks byte alignment for KASUMI/SNOW 3G/ZUC algorithms using
cipher/auth_param, which are not initialized at this moment yet. Use
operation params instead.
Fixes: 39e0bee48e ("crypto/qat: rework request builder for performance")
Cc: stable@dpdk.org
Reported-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
The PMD specific API to configure, clear and
obtain session private size is renamed, including
the word _sym_ to clarify that it is API
for symmetric sessions, so there will not be any
conflicts for asymmetric and other type of sessions
in the future.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
For all trace on the data-path move to dynamic logging.
Add new QAT_DP_LOG macro to separate from non-dp trace.
Use the overall RTE_LOG_DP_LEVEL to override and compile out
debug data-path trace.
Add "unlikely" in two appropriate error checks.
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Optimize the dequeue function by inlining the response
processing function, assuming only symmetric
operations are supported.
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Process response function is only implemented
for crypto symmetric operations, which do not require
some of the arguments.
Therefore, these arguments can be removed from the
function prototype.
Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Move all code into appropriate files, no actual code changes. Specifically:
- Rename rte_qat_cryptodev.c to qat_sym_pmd.c
- Create qat_sym_pmd.h and populate with fn prototypes for qat_sym_pmd.c
- Create qat_comp_pmd.c/.h and populate with placeholder functions
- Create qat_asym_pmd.c/.h and populate with placeholder functions
- Rename qat_crypto_capabilities.h to qat_sym_capabilities.h
- Move CRYPTODEV_NAME_QAT_SYM_PMD from qat_common.h to qat_sym_pmd.h
- Move qat_sym_dev_private from qat_device.h to qat_sym_pmd.h
- Move prototype for qat_sym_dev_info_get frm qat_device.h 2 qat_sym_pmd.h
- Move all qat_device.c sym dev_ops fns to qat_sym_pmd.c file
- Move all qat_sym.c dev_ops fns to qat_sym_pmd.c file
- Remove unused header file #includes from all files.
- Move pci_id_qat_map, probe/release/register from
rte_qat_cryptodev.c to qat_device.c
- Moved stray comment for bpi_cipher_ctx_init() from qat_sym.c
to qat_sym_session.c
- Changed all files to use SPDX license header
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Split qat_sym_stats_get/reset into 2 functions, a wrapper function calling
a new qat_stats_get/reset function which can be called per service.
Remove cryptodev stats struct from qat_qp, replace with qat_common_stats.
Add links for qat_qp into qat_pci_device using an array per service to
avoid need for a lock and so qp_id for the service can be used as index.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Struct qat_pmd_private held the data needed by cryptodev, common code
now gets most data from struct qat_pci_device instead. qat_pmd_private
is trimmed to hold only sym crypto data and renamed qat_sym_private
to reflect its usage.
Specifically
- remove max_nb_queue_pairs from qat_pmd_private, get from qp_hw_data
- remove max_nb_sesssions from qat_pmd_private as not needed.
- remove qat_gen from qat_pmd_private, get from qat_pci_device instead.
- use qat_pci_device throughout common code instead of qat_pmd_private
- rename qat_pmd_private to qat_sym_dev_private - this now holds only
sym-specific data for the cryptodev API
- extend pci device name to <bdf>_qat for clarity, was just <bdf>
- update qp mem and cookiepool names to reflect the appropriate device,
service and qp.
- rename qat_dev_info_get() to qat_sym_dev_info_get() as mostly sym,
not enough common info to warrant a generic fn.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Create data structures to support different generations
of qat hardware supplying services through different queue pairs.
- Add two new structs qat_gen_hw_data and qat_qp_hw_dat
- Add a qat_service_type enum
An array of qat_qp_hw_data elements is
initialised with constants, these are arranged so that the qp_id used
on the API can be used as an index to pick up the qp data to use.
The constants are common to current generations,
new arrays will be added for future generations.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Remove dependence on rte_cryptodev from common qp code
to facilitate being used by other device types in future.
Transferred required data into qat-specific structures.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Move the generic enqueue and dequeue fns from
the qat_sym.c file to the qat_qp.c file
Move generic qp structs to a new qat_qp.h file
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Queue-handling code in dequeue is made generic, so it can
be used by other services in future. This is done by
- Removing all sym-specific refs in input params - replace with void ptrs.
- Wrapping this generic dequeue with the sym-specific dequeue
called through the API.
- extracting the sym-specific response processing into a new fn.
- Setting a fn ptr for process_response in qp on qp creation
- Passing void * params to this, in the service-specific implementation
qat_sym_process_response cast back to sym structs.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Queue-handling code in enqueue is made generic, so it can
be used by other services in future. This is done by
- Removing all sym-specific refs in input params - replace with void ptrs.
- Wrapping this generic enqueue with the sym-specific enqueue
called through the API.
- Setting a fn ptr for build_request in qp on qp creation
- Passing void * params to this, in the service-specific implementation
qat_sym_build_request cast back to sym structs.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
This commit renames qat_crypto.c/h to qat_sym.c/h
And makes a few whitespace changes to resolve line-length
issues.
Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>