We used hardcoded value set by bdev module, however
this value might be changed, so get a real value
from iobug config
Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: Id15b602f699f3dd63aeff11fb063bb62c384663d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16601
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
All DPDK related code is removed, handling of
RESET command was sligthly updated.
Handling of -ENOMEM was updated for cases when
accel API returns -ENOMEM
Crypto tests in blockdev.sh were extended with more
crypto_bdevs to verify NOMEM cases - that failed
with original vbdev_crypto implementation
Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: If1feba2449bee852c6c4daca4b3406414db6fded
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14860
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Make vbdev_crypto_destruct() return 1 to signal that program
execution should wait for spdk_bdev_destruct_done() function,
which is added inside _device_unregister_cb().
This change is related to _vdev_dev_get() not being able
to find the devices, when called from _cryptodev_sym_session_free(),
as it uses device driver name, which might already be freed.
This occurs only during bdev module finish, when crypto bdevs
are being unregistered and vbdev_crypto_finish() proceeds to
call bdev name deletion without waiting for the unregister
callbacks to complete, which ultimately results in reading
freed pointers.
This only happens when code execution takes path for DPDK 22.11+.
Change-Id: Id9a43d07c90aef7a82867383fd77354ac521a3e7
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16290
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Currently delete_crypto_disk() calls spdk_bdev_unregister_bdev_by_name()
and immediately after exiting that function, it proceeds to bdev name
deletion. This causes callbacks triggered by above call to run with
references to bdev names that are partially unavailable due to free()
functions in vbdev_crypto_delete_name().
Add an intermediate callback that will call vbdev_crypto_delete_name()
and then the original callback that was sent as an argument to
delete_crypto_disk(). That way we are sure that bdev name deletion
is performed right after bdev unregister.
Change-Id: I483ce5c3c63596f54d44220ca61c5e97c3807faf
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16253
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
In DPDK 22.11 rte_cryptodev_sym_session_create() now takes
a single mempool with element size big enough to hold session
data and session private data.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6c9db063825843a903d1ff84dd8d77f198a841a1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15435
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
Adjusts use of rte_crypto API after DPDK patch below:
(bdce2564dbf78e1fecc0db438b562ae19f0c057c)
For DPDK 22.11 and later, rte_cryptodev_sym_session_init()
is no longer used and only calling
rte_cryptodev_sym_session_create/free().
Change-Id: I89d8fa737fd6c199a4a5a810b85d6d5b79d5d27b
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15391
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
Found with misspell-fixer.
Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: If062df0189d92e4fb2da3f055fb981909780dc04
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15207
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
With DPDK 19.02 the private session mempool was introduced.
See patch below in SPDK:
(5c1c946) bdev/crypto: compile with DPDK 19.02
As of latest SPDK, the privae session mempool was always
passed to rte_cryptodev_sym_session_init(). Since #ifdefs
for older DPDK versions were removed.
This patch makes it obvious which mempool is used.
Change-Id: I6572c925d8532a6cf81c516e3e274eef45236fb1
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15434
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Starting with DPDK 22.11 the struct rte_cryptodev_sym_session
is no longer part of public API. Instead the void * is used.
There is no need for SPDK to track the type of session variable,
so replace that with void * regardless of DPDK version.
Change-Id: I29f82e87a593dd1886673fe2a56145da2dbe8354
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15433
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This patch separates out the session creation and freeing
to two static functions. Later in the series it will
limit the required changes.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I9fb1070d0f5a062991ba82580886ff41c2eeaa4a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15432
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This patch is first in series that updates bdev crypto
to support DPDK 22.11. See changelog entry from DPDK:
* cryptodev: The structure ``rte_cryptodev_sym_session`` was made internal.
The API ``rte_cryptodev_sym_session_init`` and
``rte_cryptodev_sym_session_clear``
were removed and user would only need to call
``rte_cryptodev_sym_session_create``
and ``rte_cryptodev_sym_session_free`` to create/destroy sessions.
The API ``rte_cryptodev_sym_session_create`` was updated to take a single
mempool
with element size big enough to hold session data and session private
data.
So this patch abstracts out lookup for vbdev_dev as it will be used from
multiple places later in the series.
Change-Id: Ibd9ca3456b297c84f8cec162fae27f4ef064cd42
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15431
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
per Intel policy to include file commit date using git cmd
below. The policy does not apply to non-Intel (C) notices.
git log --follow -C90% --format=%ad --date default <file> | tail -1
and then pull just the 4 digit year from the result.
Intel copyrights were not added to files where Intel either had
no contribution ot the contribution lacked substance (ie license
header updates, formatting changes, etc). Contribution date used
"--follow -C95%" to get the most accurate date.
Note that several files in this patch didn't end the license/(c)
block with a blank comment line so these were added as the vast
majority of files do have this last blank line. Simply there for
consistency.
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Id5b7ce4f658fe87132f14139ead58d6e285c04d4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15192
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
hexlify and unhexlify utils from vbdev_crypto.h have been moved so that
they could be included and reused outside of vbdev_crypto module.
Signed-off-by: Blachut, Bartosz <bartosz.blachut@intel.com>
Change-Id: Ia074250176907f4803b84024239ecd4e9d8a5fc1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14191
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
In SPDK, declarations have the return type on the same line. Definitions
have the return type on a separate line. Astyle has an option for
enforcing this. Unfortunately, it seems to have two bugs:
1) It doesn't work correctly at all on C++ files.
2) It often fails on functions that return enums, or long type names
Deal with 1) by adjusting the check_format.sh script to only tell astyle
to fix return type line breaks for C files and not C++. Deal with 2) by
adding a few typedefs to work around the problem.
Change-Id: Idf28281466cab8411ce252d5f02ab384166790c6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13437
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Many open source projects have moved to using SPDX identifiers
to specify license information, reducing the amount of
boilerplate code in every source file. This patch replaces
the bulk of SPDK .c, .cpp and Makefiles with the BSD-3-Clause
identifier.
Almost all of these files share the exact same license text,
and this patch only modifies the files that contain the
most common license text. There can be slight variations
because the third clause contains company names - most say
"Intel Corporation", but there are instances for Nvidia,
Samsung, Eideticom and even "the copyright holder".
Used a bash script to automate replacement of the license text
with SPDX identifier which is checked into scripts/spdx.sh.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iaa88ab5e92ea471691dc298cfe41ebfb5d169780
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12904
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: <qun.wan@intel.com>
There are a few places where a typo, extra character
or newline was added to the BSD 3-clause license text
which made it differ very slightly from the rest of
the license headers in the source tree. Remove those
differences in this patch, to help with automation of
SPDX identifier replacement in the next patch.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I542dc53cd252b1699253fd6dcc3ccac9643d7878
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12905
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Replace spdk_bdev_get_by_name() + spdk_bdev_unregister() by
spdk_bdev_unregister_by_name() wherever possible.
This simplifies the code and makes the code more reliable.
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I91388c9d0b2e244cb745720a480803b03c42a226
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12066
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
- More user-friendly style of error and debug messages.
- Remove "ERROR" word from SPDK_ERRLOG() to avoid duplicating
in the log.
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: Iaee068f96e66f567fc23b34ae0ae6221c1bd710c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11632
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
- Fixed duplication of key, key2, drv_name, cipher, etc., fields in
struct bdev_names and struct vbdev_crypto. Moved all of them into
the new struct vbdev_crypto_opts, which is re-used by both structs.
This aslo removes duplication in error handling and fininalization
logic that checks the keys are zeroed out and properly freed.
- Moved unhexlify into vbdev rpc code. All keys passed to vbdev
already in the binary form.
- Provide meaningful error messages in the rpc response on keys
validation issues during setup of crypto vbdev.
- Updated unit tests.
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: I1fab8771bbbc0cd2f359f0d105fec28fb86893b3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11631
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
- Added hexlify() and unhexlify() for key and key2. This is required
for keys that contain zero and non-ascii characters. Since binary
keys may contain zero character, strlen(key) cannot be used and
key_size and key2_size are used instead. Non-asci chars are not
allowed in json and using hexlified keys fixes this issue as well.
- Updated documentation to clearly state that hexlified keys must
be used.
- Updated test scripts.
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: I3fce7839f7eaa67d0307071eba80b4cea472d731
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11891
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
At the moment MLX5 uses different number of qp descriptors than the
other pmd crypto drivers. Adding it to vbdev_crypto on init and re-use
everywhere we need it.
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: Iea4d4787fc5fd91f27c4a70cf78c5660f09bc854
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11878
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Even released memory contains key and key2 until it is re-allocated
for other purposes. Zero out key and key2 when not longer needed.
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: If80f3faeb98b5b5acab7f2f857f284909247d1ac
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11877
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Since IV length is the same for all pmd crypto drivers,
AES_CBC_IV_LENGTH is renamed to IV_LENGTH.
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: If8769db119eb599a17c267e8950f18f5a0ea995b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11875
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
In vbdev_crypto_init_crypto_drivers() when g_session_mp init failed it
was possible to jump to cleanup label but return 0 instead of -ENOMEM.
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: I128968699b0d2dbb2f769ac5fd7bd53ab409562b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11659
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
_crypto_operation_complete(bdev_io) should not be called in
_crypto_operation() because it is done by caller function
on read or write.
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: Ie03412c72f41abf661b069d4b00eaf74f40261d6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11629
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
- Fixed missed spdk_bdev_module_release_bdev() during error handling.
- Fill the keys with zeros before releasing memory.
- Fixed issue with g_number_of_claimed_volumes that can become negative
because of invalid error handling.
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: I4171f4326d87b1d8f886416bf53b0f2043ccbfe7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11628
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
It is possible that physical address returned from spdk_vtophys() will
lie on the page boundary for the mbuf size we want. In this case we have
to allocate one more mbuf and setup its chaining with the original mbuf.
This holds true for src and dst mbufs, though reproduced only for dst.
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: Ibf82a97fac2ee0217a906a7c6f8558bdc2eedda2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11626
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
If re-enqueue of pending crypto ops failed in crypto_dev_poller()
and DPDK reports errors then stop re-enqueue, remove the ops from
the re-submit queue and fail the IO.
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: I258f7b8986f35fa70e4af25bc8ad2b3b26aa206b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11625
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
- Continue init of the other crypto devices (mlx5) after failure of
rte_vdev_init(AESNI_MB) in vbdev_crypto_init_crypto_drivers(). It
simply may not be enabled in DPDK because it requires IPSec_MB>=1.0
installed in the system. Reproduces with --with-dpdk=dpdk/install
option used, when the target DPDK is built without control of IPSec
version from the SPDK side.
- Updated crypto_ut to test the new behavior of error handling from
rte_vdev_init(AESNI_MB) in vbdev_crypto_init_crypto_drivers().
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: Icd4db8877afe87db8166c40d6e7b414cd43c9c25
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11624
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
- Switched to using rte_mempool for mbufs instead of spdk_mempool. This
allows using rte pkt_mbuf API that properly handles mbuf fields we need
for mlx5 and we don't have to do it manually when sending crypto ops.
- Using rte_mempool *g_mbuf_mp in vbdev crypto ut and added the mocking
API code.
- crypto_ut update to follow pkt_mbuf API rules.
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: Ia5576c672ac2eebb260bfdbb528ddb9edcd8f036
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11623
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
- Properly rte_cryptodev_stop() and rte_cryptodev_close() device on
errors in create_vbdev_dev().
- Check for device id before removing its qp from the qp list.
- Maintain correct g_qat_total_qp counter if qat qp is removed on
errors.
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: I088d7057eebff89ff0d995adcc2a05c724c3323b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11622
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
- Fixed bug in vbdev_crypto_config_json(). crypto_bdev->key was used
for "key2" json field.
- Fixed bug in vbdev_crypto_dump_info_json(). crypto_bdev->key was used
for "key2" json field.
Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: Iac441bc30b03234c96d646db14ee36ad56a546dc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11621
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Historically only QAT_SYM devices for crypto
were supported. The DPDK submodule explicitly
disabled its compilation.
For details please see:
https://review.spdk.io/gerrit/c/spdk/dpdk/+/9217
Starting with DPDK 21.11 QAT_SYM and QAT_ASYM were
merged together, so it is no longer possible to
disable it QAT_ASYM as it was before.
As vbdev_crypto didn't make use of it,
this driver is now skipped in preparation for
update to DPDK 21.11.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib606a4b450cd224d96bc21a64384297b2182967c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11178
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Call rte_cryptodev_close() to free qpair memory instead of using
an internal function.
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I1bd7f0dd86de83f278f6be3263cdf3fbd8e1c77f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9720
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Need to manage how we store IO context based on DPDK updates
made in 19.11.
Fixes issue #1671
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: If1183808cd30987b6c999912f563949b7ade7fcb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5799
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
SPDK supports two latest DPDK LTS releases and DPDK 20.11
is out now.
Remove all functionality and checks for versions <= DPDK 19.11.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I9c354b7bc56d35a9ab04375f9f5255ca914d53e1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5344
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
vbdev_crypto_claim() gets bdev name instead of bdev pointer
as a parameter, and open the corresponding base bdev first using
spdk_bdev_open_ext().
The purpose is to fix the race condition due to the time gap
between spdk_bdev_get_by_name() and spdk_bdev_open(). A bdev pointer
is valid only while the bdev is opened.
Resize event is not supported for now.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia0e1ce2ce696f431bb26af94729931c3ffb9a9d0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4588
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
There is nothing left here, so remove it.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib947d42bc577dbebb4650b1be885e05a80f8f8cf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4541
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI
This patch removes the string from register component.
Removed are all instances in libs or hardcoded in apps.
Starting with this patch literal passed to register,
serves as name for the flag.
All instances of SPDK_LOG_* were replaced with just *
in lowercase.
No actual name change for flags occur in this patch.
Affected are SPDK_LOG_REGISTER_COMPONENT() and
SPDK_*LOG() macros.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I002b232fde57ecf9c6777726b181fc0341f1bb17
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4495
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Mellanox Build Bot
Reviewed-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI
Couple log flags did not follow previous scheme of naming
so rename it.
This will simplify next patch that replaces all the literals
with names provided for the flags. Avoiding accidental
changes in log flag names.
SPDK_NOTIFY_RPC -> SPDK_LOG_NOTIFY_RPC
SPDK_LOG_CRYPTO -> SPDK_LOG_VBDEV_CRYPTO
SPDK_TRACE_VBDEV_OCF_VOLUME -> SPDK_LOG_VBDEV_OCF_VOLUME
SPDK_LOG_JSON -> SPDK_LOG_JSON_UTIL
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I00cb0a7994d8aaf28b03828b93b1dbb18215089f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4498
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
crypto_dev_poller() had set IO error to bdev_io->internal.status
but _crypto_operation_complete() checked io_ctx->bdev_io_status
and overwritten bdev_io->internal.status by spdk_bdev_io_complete().
On the other hand, internal fields of struct spdk_bdev_io should
have been avoided.
This patch fixes both.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia3d4887f34fdecc765b88246c3e66ce1871ff30f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1907
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
We will be create fine name for each poller but it will need large
effort. Replacing spdk_poller_register by the macro SPDK_POLLER_REGISTER
will provide better name than function address with minimum effort.
Following patches may improve function name for clarification.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If862a274c5879065c3f7cb04dcb5ca7844523e68
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1781
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Community-CI: Broadcom CI
Default was 8 which meant max of 8 bdevs. Bump it up to 64.
Fixes issue #1232
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I966e90de5c27910df0e4da0d1062d9d1665f8de6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1063
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>