Commit Graph

1438 Commits

Author SHA1 Message Date
Thomas Monjalon
abb98ed0b3 drivers: remove unused build variable
The variable fmt_name has been removed from DPDK 21.02-rc1.
Then some drivers were integrated in the same year with this variable.
Of course it has no effect, so it is cleaned up.

Fixes: 832a4cf1d1 ("compress/mlx5: introduce PMD")
Fixes: a7c86884f1 ("crypto/mlx5: introduce Mellanox crypto driver")
Fixes: 5e7596ba7c ("vdpa/sfc: introduce Xilinx vDPA driver")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
2022-11-22 13:35:32 +01:00
Luca Boccassi
bdab530919 drivers: fix typos found by Lintian
Signed-off-by: Luca Boccassi <bluca@debian.org>
2022-11-15 17:17:14 +01:00
David Marchand
1094dd940e cleanup compat header inclusions
With symbols going though experimental/stable stages, we accumulated
a lot of discrepancies about inclusion of the rte_compat.h header.

Some headers are including it where unneeded, while others rely on
implicit inclusion.

Fix unneeded inclusions:
$ git grep -l include..rte_compat.h |
  xargs grep -LE '__rte_(internal|experimental)' |
  xargs sed -i -e '/#include..rte_compat.h/d'

Fix missing inclusion, by inserting rte_compat.h before the first
inclusion of a DPDK header:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h |
  xargs sed -i -e \
    '0,/#include..\(rte_\|.*pmd.h.$\)/{
      s/\(#include..\(rte_\|.*pmd.h.$\)\)/#include <rte_compat.h>\n\1/
    }'

Fix missing inclusion, by inserting rte_compat.h after the last
inclusion of a non DPDK header:
$ for file in $(git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h); do
    tac $file > $file.$$
    sed -i -e \
      '0,/#include../{
        s/\(#include..*$\)/#include <rte_compat.h>\n\n\1/
      }' $file.$$
    tac $file.$$ > $file
    rm $file.$$
  done

Fix missing inclusion, by inserting rte_compat.h after the header guard:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h |
  xargs sed -i -e \
    '0,/#define/{
      s/\(#define .*$\)/\1\n\n#include <rte_compat.h>/
    }'

And finally, exclude rte_compat.h itself.
$ git checkout lib/eal/include/rte_compat.h

At the end of all this, we have a clean tree:
$ git grep -lE '__rte_(internal|experimental)' |
  xargs grep -L include..rte_compat.h
buildtools/check-symbols.sh
devtools/checkpatches.sh
doc/guides/contributing/abi_policy.rst
doc/guides/rel_notes/release_20_11.rst
lib/eal/include/rte_compat.h

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2022-11-15 08:39:14 +01:00
Ciara Power
e0e095d314 crypto/ipsec_mb: fix queue setup in secondary process
If a secondary process is using a queue pair that has been setup by the
primary process, we need to reset mb_mgr pointers.
This commit removes an error return in this case, allowing secondary to
do the remaining setup for the existing qp.

Fixes: b35848bc01 ("crypto/ipsec_mb: add multi-process IPC request handler")

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
2022-11-07 05:42:54 +01:00
Kai Ji
6f1f7a271c crypto/ipsec_mb: fix multiprocess request registration
This patch fix the EEXIST error handling when calling
rte_mp_action_register().

Fixes: b35848bc01 ("crypto/ipsec_mb: add multi-process IPC request handler")

Signed-off-by: Kai Ji <kai.ji@intel.com>
Tested-by: Brian Dooley <brian.dooley@intel.com>
2022-11-03 12:59:18 +01:00
Brian Dooley
3625d12ed6 crypto/qat: fix reallocate OpenSSL version check
Move the ossl_legacy_provider_unload() into the right place for secure
protocol for QAT. Remove unnecessary unload from session destroy.

Fixes: 52d59b92b0 ("crypto/qat: enable OpenSSL legacy provider in session")
Cc: stable@dpdk.org

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
2022-11-03 11:52:31 +01:00
Ciara Power
f436fdcbf6 crypto/scheduler: fix session retrieval
In cases where some ops failed to enqueue, the op session was never being
reset. This resulted in a segmentation fault when processing ops the
next time. To fix this, only set the op session after the failure
condition is checked.

Also, the incorrect ops index was being used for session retrieval when
dequeueing for the secondary worker.

Fixes: 6812b9bf47 ("crypto/scheduler: use unified session")

Reported-by: Kevin O'Sullivan <kevin.osullivan@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
2022-11-03 09:09:16 +01:00
Kai Ji
16d6ebb65d crypto/ipsec_mb: fix null checks
This patch fix the NULL pointer check when dereference qp
and ring lookup.

Coverity issue: 381625
Fixes: c75542ae42 ("crypto/ipsec_mb: introduce IPsec_mb framework")
Cc: stable@dpdk.org

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2022-11-03 09:07:37 +01:00
Abdullah Ömer Yamaç
7dde9c844a drivers: omit symbol map when unneeded
In this patch, we removed the necessity of the version files and
you don't need to update these files for each release, you can just
remove them.

Suggested-by: Ferruh Yigit <ferruh.yigit@amd.com>
Signed-off-by: Abdullah Ömer Yamaç <omer.yamac@ceng.metu.edu.tr>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Ferruh Yigit <ferruh.yigit@amd.com>
2022-11-14 15:22:46 +01:00
Thomas Monjalon
e9cc7c7abc common/mlx5: use build configuration dictionary
A recent commit added an explicit dependency check on common/mlx5.
For consistency, query dpdk_conf instead of the list of common drivers.
The lists *_drivers should be used only for printing.

Fixes: 3df380f617 ("common/mlx5: fix disabling build")

Suggested-by: Bruce Richardson <bruce.richardson@intel.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2022-11-14 11:28:49 +01:00
Brian Dooley
7283c59e37 crypto/qat: fix null hash algorithm digest size
Add check for null hash algorithm digest size.
Digest size should be 4B or request will be rejected.

Fixes: 1703e94ac5 ("qat: add driver for QuickAssist devices")
Cc: stable@dpdk.org

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2022-10-29 13:01:41 +02:00
Zhangfei Gao
ec23c28625 crypto/uadk: support auth algorithms
Add support for MD5, SHA1, SHA224, SHA256, SHA384, SHA512
Authentication algorithms with and without HMAC.

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-10-29 13:01:41 +02:00
Zhangfei Gao
3b3cd89ea1 crypto/uadk: support cipher algorithms
Add support for cipher algorithms,
including AES_ECB, AES_CBC, AES_XTS, and DES_CBC mode.

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-10-29 13:01:41 +02:00
Zhangfei Gao
be2874cd4b crypto/uadk: support enqueue/dequeue operations
This commit adds the enqueue and dequeue operations.

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-10-29 13:01:41 +02:00
Zhangfei Gao
53ae139336 crypto/uadk: support basic operations
Support the basic dev control operations: configure, close, start,
stop and get info, as well as queue pairs operations.

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-10-29 13:01:41 +02:00
Zhangfei Gao
8c515d9680 crypto/uadk: introduce HiSilicon UADK crypto driver
Introduce a new crypto PMD for hardware accelerators based on UADK [1].

UADK is a framework for user applications to access hardware accelerators.
UADK relies on IOMMU SVA (Shared Virtual Address) feature, which share
the same page table between IOMMU and MMU.
Thereby user application can directly use virtual address for device dma,
which enhances the performance as well as easy usability.

This patch adds the basic framework.

[1] https://github.com/Linaro/uadk

Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-10-29 13:01:41 +02:00
Ciara Power
7ae361307d crypto/scheduler: fix session in size-based distribution
The index for sess_ctx was incorrect when setting the op session.

Fixes: 6812b9bf47 ("crypto/scheduler: use unified session")

Signed-off-by: Ciara Power <ciara.power@intel.com>
2022-10-29 13:01:41 +02:00
Kai Ji
b35848bc01 crypto/ipsec_mb: add multi-process IPC request handler
As the queue pair used in secondary process needs to be set up by
the primary process, this patch adds an IPC register function to help
secondary process to send out queue-pair setup request to primary
process via IPC request messages. A new "qp_in_used_pid" param stores
the PID to provide the ownership of the queue-pair so that only the PID
matched queue-pair can be free'd in the request.

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2022-10-29 13:01:41 +02:00
Kai Ji
17e48da618 crypto/qat: fix multi-process build request session
This patch fix the session pointer passed in set_session()
when ctx has NULL build request pointer in multi-processes
scenario.

Fixes: fb3b9f4922 ("crypto/qat: rework burst data path")
Cc: stable@dpdk.org

Signed-off-by: Kai Ji <kai.ji@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2022-10-29 13:01:41 +02:00
Arek Kusztal
60fe006fde crypto/qat: add ECDH public key verification
This commit adds verification option for elliptic curve
points when used along ECDH algorithm.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
2022-10-29 13:01:41 +02:00
Arek Kusztal
305e1f856f crypto/qat: add ECDH key exchange algorithm
This commit adds ECDH key exchange algorithm to Intel QuickAssist
Technology driver.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
2022-10-29 13:01:41 +02:00
Arek Kusztal
841cea1c7e crypto/qat: improve asymmetric cookies free
Improve the way that cookies are freed and cleared.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
2022-10-29 13:01:41 +02:00
Arek Kusztal
d4f17d6b6c crypto/qat: make immutable parameters constant
All pointers passed to functions that are not supposed
to have its data changed should be marked as constant.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
2022-10-29 13:01:41 +02:00
Anoob Joseph
bb0e4a96d8 crypto/cnxk: remove dead code
Coverity issue: 381022
Fixes: d94414d162 ("crypto/cnxk: separate out PDCP cipher datapath")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2022-10-29 13:01:40 +02:00
Anoob Joseph
4f030d8674 crypto/cnxk: verify IV length during session create
For Kasumi cipher operation, IV is a must. Verify the arg provided in
session creation and remove datapath check.

Coverity issue: 381020, 381019
Fixes: 7a59ccc1b5 ("crypto/cnxk: remove extra indirection for FC and Kasumi")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
2022-10-29 13:01:40 +02:00
Vidya Sagar Velumuri
e0cb7b8987 crypto/cnxk: acquire lock for anti-replay
Acquired locks in antireplay logic to avoid race condition.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
2022-10-29 13:01:40 +02:00
Tejasree Kondoj
5fc5e9d23b crypto/cnxk: support PDCP AAD in CPT
Adding support for PDCP AAD in 96xx crypto pmd.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
2022-10-29 13:01:40 +02:00
Vidya Sagar Velumuri
729085b508 common/cnxk: generate MD5 ipad opad
Add support to generate ipad and opad for MD5.
Skip the call to additional command WRITE_SA during SA creation.
Instead use the software defined function to generate opad and ipad.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
2022-10-29 13:01:40 +02:00
Vidya Sagar Velumuri
379bc7f43f crypto/cnxk: support DES and MD5 for IPsec offload
Add supoort for cipher DES and auth MD5 for IPsec offload.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
2022-10-29 13:01:40 +02:00
Vidya Sagar Velumuri
91c8925f99 crypto/cnxk: update lookaside RLEN calculation
For transport mode, IP header will not be part of encryption.
Update the response len calculation accordingly for transport mode.

Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
2022-10-29 13:01:40 +02:00
Tejasree Kondoj
7c19abdd0c common/cnxk: support 103XX CPT
Added support for 103XX CPT variant.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
2022-10-29 13:01:40 +02:00
Tejasree Kondoj
cb6bfc96c3 crypto/cnxk: update capabilities as per firmware
Updated CPT engine capabilities structure as per microcode.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
2022-10-29 13:01:40 +02:00
Tejasree Kondoj
48c551761b common/cnxk: set in-place bit of lookaside IPsec
Set inplace bit of lookaside IPsec and
remove rptr population in datapath.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
2022-10-29 13:01:40 +02:00
Tejasree Kondoj
0b976b987f crypto/cnxk: fix AES-CMAC length
AES-CMAC uses PDCP opcode and hence
length should be passed in bits.

Fixes: 759b5e6535 ("crypto/cnxk: support AES-CMAC")
Cc: stable@dpdk.org

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
2022-10-29 13:01:40 +02:00
Arek Kusztal
b6ac58aee5 crypto/qat: read HW slice configuration
Read slice configuration of QAT capabilities.
This will allow to recognize if specific HW function
is available on particular generation of device.

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
2022-10-29 13:01:40 +02:00
Arek Kusztal
112b6215e0 crypto/qat: fix RSA length
Fixed not set output length in asym pmd when doing RSA.

Fixes: 002486db23 ("crypto/qat: refactor asymmetric session")
Cc: stable@dpdk.org

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2022-10-29 13:01:40 +02:00
Arek Kusztal
521cd3f947 crypto/qat: fix unnecessary asymmetric session check
Removed unnecessary session check which could lead to segfault,
in case api was changed.

Fixes: 002486db23 ("crypto/qat: refactor asymmetric session")
Cc: stable@dpdk.org

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2022-10-29 13:01:40 +02:00
Arek Kusztal
fdf9cdaca7 crypto/qat: fix asymmetric session cookie clearing
Fixed incorrectly placed clean function in asym response.

Fixes: 002486db23 ("crypto/qat: refactor asymmetric session")
Cc: stable@dpdk.org

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
2022-10-29 13:01:40 +02:00
Anoob Joseph
af37f4e481 crypto/cnxk: fix IPsec with CN9K
Post security session rework, CPTR got changed affecting cn9k IPsec
functionality. Address the same. Also, move all s/w accessible
fast path fields to rte_security_session cacheline for better perf.

Fixes: 3f3fc3308b ("security: remove private mempool usage")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-10-29 13:01:38 +02:00
Anoob Joseph
aa6dc34fe3 crypto/cnxk: align HW accessible fields to ROC
Hardware accessible memory need to be aligned to ROC.
Enforced the same. Moved software specific fields to padding space.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
2022-10-29 13:01:38 +02:00
Gowrishankar Muthukrishnan
410d016961 crypto/cnxk: support exponent type private key
This patch adds support for RTE_RSA_KEY_TYPE_EXP in cnxk crypto
driver.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2022-10-29 13:01:38 +02:00
Ciara Power
f9dfb59edb crypto/ipsec_mb: support remaining SGL
The intel-ipsec-mb library supports SGL for GCM and ChaChaPoly
algorithms using the JOB API.
This support was added to AESNI_MB PMD previously, but the SGL feature
flags could not be added due to no SGL support for other algorithms.

This patch adds a workaround SGL approach for other algorithms
using the JOB API. The segmented input buffers are copied into a
linear buffer, which is passed as a single job to intel-ipsec-mb.
The job is processed, and on return, the linear buffer is split into the
original destination segments.

Existing AESNI_MB testcases are passing with these feature flags added.

Signed-off-by: Ciara Power <ciara.power@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2022-10-29 13:01:38 +02:00
Brian Dooley
f7f2e8a9dd crypto/qat: reallocate on OpenSSL version check
This patch reallocates the OpenSSL version check from
qat_session_configure() to a proper qat_security_session_create()
routine.

Fixes: 3227bc7138 ("crypto/qat: use intel-ipsec-mb for partial hash and AES")
Cc: stable@dpdk.org

Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Kai Ji <kai.ji@intel.com>
2022-10-29 13:01:37 +02:00
Thomas Monjalon
3df380f617 common/mlx5: fix disabling build
If the dependency common/mlx5 is explicitly disabled,
but net/mlx5 is not explicitly disabled,
Meson will read the full recipe of net/mlx5
and will fail when accessing a variable from common/mlx5:
drivers/net/mlx5/meson.build:76:4: ERROR: Unknown variable "mlx5_config".

The solution is to stop parsing net/mlx5 if common/mlx5 is disabled.
The deps array must be defined before stopping, in order to automatically
disable the build of net/mlx5 and print the reason.

The same protection is applied to other mlx5 drivers,
so it will allow using the variable mlx5_config in future.

Fixes: 22681deead ("net/mlx5/hws: enable hardware steering")

Reported-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Tested-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Alex Vesker <valex@nvidia.com>
2022-10-30 15:55:10 +01:00
Pablo de Lara
7babda4316 crypto/ipsec_mb: support all tag sizes for ZUC-EIA3-256
Add support for 8-byte and 16-byte tags for ZUC-EIA3-256.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
2022-10-07 19:46:11 +02:00
Gowrishankar Muthukrishnan
8e39b13323 crypto/cnxk: support fixed point multiplication
Add fixed point multiplication for EC curve in CNXK.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
2022-10-07 19:46:11 +02:00
Shijith Thotton
b1ae367ab8 drivers: mark SW PMDs to support disabling IOVA as PA
Enabled software PMDs in IOVA as PA disabled build
as they work with IOVA as VA.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2022-10-09 13:14:57 +02:00
Shijith Thotton
6771216c2f drivers: mark cnxk to support disabling IOVA as PA
Enabled the flag pmd_supports_disable_iova_as_pa in cnxk driver build
files as they work with IOVA as VA. Updated cn9k and cn10k soc build
configurations to disable the IOVA as PA build by default.

Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
2022-10-09 13:14:57 +02:00
Akhil Goyal
7244858b29 crypto/mvsam: fix build after session rework
mvsam build was broken due to the recent session rework,
as it was not enabled in default build.
This patch fixes the build.

Fixes: 3f3fc3308b ("security: remove private mempool usage")
Fixes: bdce2564db ("cryptodev: rework session framework")
Fixes: 66837861d3 ("drivers/crypto: support security session size query")

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
2022-10-06 12:16:16 +02:00
Akhil Goyal
2973dbf93b security: hide session structure
Structure rte_security_session is moved to internal
headers which are not visible to applications.
The only field which should be used by app is opaque_data.
This field can now be accessed via set/get APIs added in this
patch.
Subsequent changes in app and lib are made to compile the code.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Tested-by: Gagandeep Singh <g.singh@nxp.com>
Tested-by: David Coyle <david.coyle@intel.com>
Tested-by: Kevin O'Sullivan <kevin.osullivan@intel.com>
2022-10-04 22:37:54 +02:00