Commit Graph

1655 Commits

Author SHA1 Message Date
Boris Glimcher
2de485346e sock/ssl: move SSL_CTX creation to accept()
This will allow to have context per connection.
And free context when connection closes.

Fixes #2689

Change-Id: Ic4e9adfa3f1bd8574b9ccf75ff42c4f3bd442b26
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14443
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-14 07:45:09 +00:00
Boris Glimcher
35f7f0ce1e nvme/tcp: Allow to choose SSL socket implementation
Adding `psk` field to `spdk_nvme_ctrlr_opts`

Adding `psk` parameter to `bdev_nvme_attach_controller` RPC

Change-Id: Ie6f0d8b04ce472e6153934e985c026acded6cdfc
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14046
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-14 07:44:53 +00:00
Amir Haroush
ef65d8467c bdev/raid: fix flush on raid0
the calculation (offset_blocks + num_blocks - 1) didn't check if num_blocks is 0
which it is in case of flush.
in flush case, offset_blocks was also 0, so we got (-1) and we got big unsigned number.
just replace it with (offset_blocks + num_blocks - (num_blocks > 0)) to solve the issue.
NOTE this is only fixing the wrong math, there might be more issues that outside the scope of this commit
for example, if flush(x, y) called, no bdev implementation really use those values, and all bdevs just flush the whole disk
also, a convention is that fluch(0, 0) should flush it all (but like I said before, all bdevs flush the whole disk anyway)

Change-Id: I7e991653bc3050349dc155365b2c37ecc2d6b24c
Signed-off-by: Amir Haroush <amir.haroush@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13579
Community-CI: Mellanox Build Bot
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>
2022-09-14 07:44:19 +00:00
Yifan Bian
c6824c7944 bdev/rbd: return a error value(-1) when create RBD bdev on non
existing RBD image

Fix issue #2690

Change-Id: Ia41b32a7f54be7e9a63c9b6284fba7d8ad4eebd6
Signed-off-by: Yifan Bian <yifan.bian@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14484
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2022-09-13 07:28:57 +00:00
Boris Glimcher
4f8bf4c380 sock/ssl: free SSL on socket close()
Fixes #2684

Change-Id: I0a91e7a70c53c8130921c70872b28d199d862346
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14432
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2022-09-12 07:23:10 +00:00
Kozlowski Mateusz
2c7c8b6ceb ftl: Add rpc functionality for unmap
Trim is now also available as a management operation via RPC.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I05b778a611e9809a14bfed50b01986bb4649a35c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13379
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>
2022-09-09 19:44:29 +00:00
Kozlowski Mateusz
66fe5f75bb ftl: Unmap functionality
Adds ability to send trim commands to FTL - only 4MiB aligned requests (both
for offset and length of request) will be processed. During a trim
operation an L2P page (containing 1024 4B entries, 1 per user LBA; which
is where the 4MiB alignment comes from) will be marked as unmapped.
After this point any L2P access to that page will actually set the
entries themselves as FTL_ADDR_INVALID. This is done to make the trim as
fast as possible, since for large requests it's probable that most of
the L2P pages aren't actually in DRAM.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I4a04ee9498a2a6939af31b06f2e45d2b7cccbf19
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13378
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>
2022-09-09 19:44:29 +00:00
gongwei
c8e594c2a0 bdev_iscsi: modify the timeout parameter name of iscsi opts
the current timeout parameter of the interface bdev_iscsi_set_opts is
duplicated with the timeout parameter of the JSONRPCClient parameter,
which may cause the iscsi timeout and JSONRPCClient parameters to
overwrite each other.

Signed-off-by: gongwei <gongwei833x@gmail.com>
Change-Id: I96604a7e1a495ac2e99518812297230680df42fd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14306
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>
2022-09-09 13:02:25 +00:00
Shuhei Matsumoto
dd3460582b bdev/nvme: Rename check_multipath_params by check_io_error_resiliency_params
These checked parameters are necessary themselves even for single path
configuration.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ie1eb2f51eeec1dbc634c6bae462a41d4c209d6ac
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12052
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dong Yi <yidong0635@126.com>
Community-CI: Mellanox Build Bot
2022-09-09 12:56:12 +00:00
Shuhei Matsumoto
57f15765f7 bdev/nvme: Use custom decoder for multipath param of bdev_nvme_attach_controller RPC
Clean up the code by using a custom decoder. Use multipath mode to
follow doc/nvme_multipath.doc.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ie1f4109dae3a2929dcf933939a9c1b67bece0caf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12051
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
2022-09-09 12:56:12 +00:00
Shuhei Matsumoto
72cb529751 bdev/rbd: Reset returns completion after all inflight I/Os complete
Previously, reset just set a long timer to wait until all inflight
I/Os complete.

As already noted as a TODO item, check if any I/O is still inflight
before completing the reset by using a new API
spdk_bdev_get_current_qd().

The RBD bdev module can count outstanding I/Os itself but is not
efficient.

Signed-off-by: liu-darong <liu.darong@xsky.com>
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Iecaf90b06cae8e21198ec3822b978b54f5404d2b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13945
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>
Reviewed-by: Dong Yi <yidong0635@126.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
2022-09-09 12:55:39 +00:00
Konrad Sztyber
a8a7edcd52 sock/ssl: don't free SSL_CTX on accept() failure
SSL_CTX isn't created in accept(), but when a socket on which accept()
is called is created, so it shouldn't be freed when accept() fails, as
this makes the socket unusable (any subsequent operations using SSL_CTX
would be using freed memory).

This caused the segfaults reported in issue #2681, where the second
connection would crash the application.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I1a01a748c5a34ce3dd0fd3c557b860c0ff314b85
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14355
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2022-09-07 07:04:11 +00:00
Konrad Sztyber
f2ddc6e78b sock: make sure ssl impl has lowest priority
Bumped up the priority of the posix and uring sock implementations to
make sure they are selected before SSL, when no impl is explicitly
specified.

Fixes #2681

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic8e1e2e13f7bce7ccd746f66087e348677df28d9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14354
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-09-07 07:04:11 +00:00
Blachut, Bartosz
503835ee63 util: made hexlify and unhexlify functions public
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>
2022-09-06 07:17:13 +00:00
Blachut, Bartosz
1a24dc8fef hexlify util: v2c helper function return type is signed char
`v2c` helper function returns -1 on error, hovewer its return type was
char - which may cause an overflow situation on architectures where char
is interpreted as unsigned char, which was reported by the CI.
The return type has been changed to signed char.

Signed-off-by: Blachut, Bartosz <bartosz.blachut@intel.com>
Change-Id: I84f5784b2de7d681f78c69b5f3646e851e8dee88
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14273
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: Jacek Kalwas <jacek.kalwas@intel.com>
2022-09-06 07:17:13 +00:00
Ben Walker
34c48f1b3b accel: Do not refer to the "framework" as "engine"
The word engine was both used (interchangeably with module) to refer to
the things that plug into the framework and to the framework itself.
This patch eliminates all use of the word engine that meant the
framework. It leaves uses of the word that meant "module".

Change-Id: I6b9b50e2f045ac39f2a74d0152ee8d6269be4bd1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13918
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-09-06 07:16:17 +00:00
Ben Walker
dd7140e627 accel: Rename spdk_accel_engine_module_finish to
spdk_accel_module_finish

Also move it into the internal header that defines the interface used by
modules.

Change-Id: I3aeb41e643f27a69556099cb8d166f64c9e5d67f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13917
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2022-09-06 07:16:17 +00:00
Evgeniy Kochetov
2e7a7fe530 blob: Optimize copy-on-write flow for clusters backed by zeroes device
Writing to unallocated cluster triggers copy-on-write sequence. If
this cluster is backed by zeroes device we can skip the copy part. For
a simple thin provisioned volume copy this shortcut is already
implemented because `blob->parent_id == SPDK_BLOBID_INVALID`. But this
will not work for thin provisioned volumes created from snapshot. In
this case we need to traverse the whole stack of underlying
`spdk_bs_dev` devices for specific cluster to check if it is zeroes
backed.

This patch adds `is_zeroes` operation to `spdk_bs_dev`. For zeroes
device it always returns 'true', for real bdev (`blob_bs_dev`) always
returns false, for another layer of `blob_bs_dev` does lba conversion
and forwards to backing device.

In blobstore's cluster copy flow we check if cluster is backed by
zeroes device and skip copy part if it is.

Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: I640773ac78f8f466b96e96a34c3a6c3c91f87dab
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13446
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-09-05 12:49:46 +00:00
Kozlowski Mateusz
e7e5bc07b2 FTL: Add initial L2P cache logic
L2P cache allows for partial storing of L2P in memory, paging in and out
as necessary, lowering the total memory consumption.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I727fec9d2f0ade4ca73e872d62a2ec10cfdb0a88
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13353
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-02 17:40:09 +00:00
Konrad Sztyber
4cbd23e28b vmd: method for forcing a rescan
Added a new RPC, vmd_rescan, that forces the VMD driver to do a rescan
of all devices behind the VMD.  A device that was previously removed via
spdk_vmd_remove_device() will be found again during vmd_rescan.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ide87eb44c1d6d524234820dc07c78ba5b8bcd3ad
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13958
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tom Nabarro <tom.nabarro@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-01 08:48:32 +00:00
Konrad Sztyber
052ea0baac vmd: method for removing devices behind VMD
Added new RPC, vmd_remove_device, that allows users to remove a PCI
device managed by the VMD library simulating a hot-remove.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ifb84818ce8d147d1d586b52590527e85fe9c10de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13957
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tom Nabarro <tom.nabarro@intel.com>
2022-09-01 08:48:32 +00:00
Konrad Sztyber
f0441b29db vmd: rename enable_vmd RPC to vmd_enable
The new name is consistent with the naming scheme of
<subsystem>_<action> that all of our other RPCs use.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2cae7af5715add8eba26501cd192a6ac4884ec69
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13952
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Tom Nabarro <tom.nabarro@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-01 08:48:32 +00:00
Konrad Sztyber
dc5b33d982 module/vmd: move subsystem start to ->init()
This makes sure that if the app is killed before the subsystems have
been initialized (i.e. before framework_start_init is called), we don't
leak resources.  Before this change, we initialized the VMD library and
registered the hotplug poller from the context of the RPC and we only
freed it in subsystem's fini().  However, if subsystems were never
initialized, we never freed them.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I56b746c46b94135ef56a478c5f80194ebe51a942
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13951
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tom Nabarro <tom.nabarro@intel.com>
2022-09-01 08:48:32 +00:00
Shuhei Matsumoto
03f8da8819 bdev/nvme: Set multipath policy correctly when creating nvme_bdev_channel
bdev_nvme_create_bdev_channel_cb() did not initialized the multipath
policy of the newly created channel. 0 was active-passive and hence
multipath policy was always initialized to active-passive.

Fix the bug and add unit tests for verification.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I6e44108740da4b9ff72311ae4b5500558c65c5c3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14225
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: Aleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2022-09-01 08:25:22 +00:00
Shuhei Matsumoto
db75f4b678 bdev/nvme: Remove admin passthrough retry and failover
Admin passthrough supported retry and failover as same as I/O by
using the bdev_retry_count. However, doing retry or failover for
admin passthrough may have unexpected side effects and its value
is not clear. The safest way is to limit retry and failover for I/O.
If we need to support retry and failover for admin passthrough,
restore the code and add a new option bdev_admin_retry_count.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I680513a40a80041f6ea6f546c74c672f2a81812d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14227
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-09-01 08:25:22 +00:00
Shuhei Matsumoto
fc912a0284 bdev/nvme: Prioritize aborted_by_request higher than ctrlr_is_unavailable
Abort is used usually for error cases. When abort is done, controller
may not be available. At completion, controller availability was checked
prior to aborted by request. Hence if abort is done when controller is
not available, the aborted request is retried.

Fix the case in this patch.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I3e7b356797dd50faed0e5113f6f7a47fea26d9cc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14098
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-01 08:25:22 +00:00
Kozlowski Mateusz
0e33da4974 ftl: fast shutdown
Adds API for fast shutdown - the ability for FTL to skip most
of the metadata persists made during clean shutdown, and relying
on their representation in shared memory instead. This allows for
faster update of SPDK (or just FTL, assuming no metadata changes),
with downtime reduction from 2-5 seconds to 500-1000 ms (for
14TiB+800GiB base and cache drives).

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Change-Id: I5999d31698a81512db8d5893eabee7b505c80d06
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13348
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>
2022-08-30 14:48:50 +00:00
Indraneel M
8b8401959e bdev/uring: Add support for zoned io in uring bdev.
Enables the use of uring bdev with ZNS devices.
Uses BLKXXXZONE ioctls for implementing the zone operations.

Signed-off-by: Indraneel M <Indraneel.Mukherjee@wdc.com>
Change-Id: I440e316138182e25d89eb7224932e19bef9a005f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13550
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>
2022-08-30 07:17:06 +00:00
yidong0635
fc3a8514c7 xnvme: Remove unused rc.
Here no need to define a variable only return.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I6babb8ef94a9b111d5522f1e782cbd095c7da83a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14207
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: wanghailiang <hailiangx.e.wang@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
2022-08-29 11:40:08 +00:00
yidong0635
43c5293e16 xnvme: Fix memory leak for xnvme dev.
If we use dd or bdevperf to run the xnvme bdev.
the destruct function of xnvme misses to free
dev while destructing bdev_xnvme.

xnvme_dev_close does free dev, and we can put it
in bdev_xnvme_free.

Meanwhile fixing cleanup for delete_xnvme_bdev.

This rpc for delete_xnvme_bdev doesn't really cleanup
to remove the bdev from the list and  free the names.

Fixes issue: #2654

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I1c493cb8130b012d891ba8ee90cd0bfb127207d4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14177
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-08-29 11:40:08 +00:00
Jim Harris
08422b5843 bdev_virtio: fix use-after-free in scsi scan_ctx
Found while debugging issue #2596, unfortunately this
is not the root cause of that issue.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I27501e283ce7c9bf7a431e8b48842c83f80792c8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14165
Community-CI: Mellanox Build Bot
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: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
2022-08-29 10:51:48 +00:00
gongwei
1519aa4715 bdev_iscsi: support iscsi timeout setting
Change-Id: I189ae677dfb13feb834b73fd1f55bf2545679213
Signed-off-by: gongwei <gongwei833x@gmail.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14110
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
2022-08-25 07:43:24 +00:00
0xe0f
2e283fcb67 bdev/daos: introduction of daos bdev
This commmit introduces a new bdev type backed up by DAOS DFS.

Design wise this bdev is a file named as the bdev itself in the DAOS POSIX
container that uses daos event queue per io channel.
Having an event queue per io channel is showing the best IO throughput.
The implementation uses the independent pool and container connections per
device's channel for the best IO throughput.

The semantic of usage is the same as any other bdev type.

To build SPDK with daos support, daos-devel package has to be installed.
The current supported DAOS version is v2.X, please see the installatoin and
setup guide here: https://docs.daos.io/v2.0/

$ ./configure --with-daos

To run it, the target machine should have daos_agent up and running, as
well as the pool and POSIX container ready to use, please see the
detailed requirements here: https://docs.daos.io/v2.0/admin/hardware/.

To export bdev over tcp:

$ ./nvmf_tgt &
$ ./scripts/rpc.py nvmf_create_transport -t TCP -u 2097152 -i 2097152

$ ./scripts/rpc.py bdev_daos_create daosdev0 <pool-label> <cont-label>
1048576 4096

$ ./scripts/rpc.py nvmf_create_subsystem nqn.2016-06.io.spdk1:cnode1 -a -s
SPDK00000000000001 -d SPDK_Virtual_Controller_1
$ ./scripts/rpc.py nvmf_subsystem_add_ns nqn.2016-06.io.spdk1:cnode1
daosdev0
$ ./scripts/rpc.py nvmf_subsystem_add_listener nqn.2016-06.io.spdk1:cnode1
-t tcp -a <IP> -s 4420

On the initiator side, make sure that `nvme-tcp` module is loaded then
connect drives, for instance:

$ nvme connect-all -t tcp -a 172.31.91.61 -s 4420
$ nvme list

Signed-off-by: Denis Barakhtanov <denis.barahtanov@croit.io>
Change-Id: I51945465122e0fb96de4326db742169419966806
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12260
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>
2022-08-23 07:15:13 +00:00
Artur Paszkiewicz
0291b2845a FTL: Add read path
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Ib5bac109b59d5a21a7dad1f8e79b5da7633ffa9d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13334
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>
2022-08-19 17:37:14 +00:00
Jim Harris
e36f0d363e nvme/pcie, nvme/tcp: add cb_arg context tracepoint argument
This allows mapping an nvme_request back to the
nvme_bdev_io.

This requires bumping up the max number of arguments per
tracepoint.  5 was previously chosen as max since it
exactly fit in 64 bytes (1 cacheline) when all
arguments were stored as uint64_t, but now that we
support uint32_t arguments we can afford extra
arguments when some of them are uint32_t.  I've
bumped it to 8 so we can avoid having to touch
this value multiple times if we find some cases
where we need 7 or 8 args.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie2ef5e59d10549860b47542e68c1c34efa63047f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13995
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-08-19 11:06:31 +00:00
Jim Harris
54f1603954 bdev/nvme: add tracepoint support
This will allow us to map spdk_bdev_io events
to nvme_request events coming in a future patch.
Since we pass the nvme_bdev_io to the nvme driver
(not the spdk_bdev_io), we need to add tracepoints
for the nvme_bdev_io so that spdk_trace can
do the spdk_bdev_io->nvme_bdev_io->nvme_request
mapping.

An alternative would have been to pass the spdk_bdev_io
as the cb_arg to the nvme driver, but that change
seemed to invasive, and I think we will find other
uses for the nvme_bdev_io events anyways.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id7519e689b01875093359f41a1ca2af912061a8b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13994
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-08-19 11:06:31 +00:00
Jim Harris
8bc1165edd bdev/nvme: add __bdev_nvme_io_complete
This is just a simple wrapper for now around the
calls to spdk_bdev_io_complete and its
nvme status variant.  Upcoming patch will
add an spdk_trace_record to this function as well.
This avoids having to litter spdk_trace_record calls
in too many places.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id2fb3aeb8b070ad6e09c1dfb9a30a61666a35688
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13993
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
2022-08-19 11:06:31 +00:00
Kozlowski Mateusz
1bbefed63b FTL: Remove leftover ZNS code
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Change-Id: Ica358805a69582d78e0d6c4f17b5a97ff38e44ca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14112
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-08-18 19:09:50 +00:00
Kozlowski Mateusz
e8c5ccf039 FTL: Add write path
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I41985617b5879bd3f4bf6d49d2a03eaffdd5ccb5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13322
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-08-18 08:34:47 +00:00
GangCao
8b6fc34939 NVMe Bdev: add explicit warning on not permitted operation
Below command is failed without intuitive warning on why the
operation is not permitted:

request:
{
  "action_on_timeout": "abort",
  "delay_cmd_submit": true,
  "disable_auto_failback": false,
  "method": "bdev_nvme_set_options",
  "req_id": 1
}

Got JSON-RPC error response
response:
{
  "code": -1,
  "message": "RPC not permitted with nvme controllers already attached"
}

Change-Id: Ic35292885aa4b507fe8bb278a4b41363cfbae9a5
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13950
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2022-08-16 10:25:55 +00:00
Ben Walker
081f080a49 accel: Rename public header to accel.h
The public interface of lib/accel is now include/spdk/accel.h

Change-Id: Id94f623a494eb1b524b060f4413f633073ea7466
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13916
Tested-by: SPDK CI Jenkins <sys_sgci@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@nvidia.com>
2022-08-16 10:22:55 +00:00
Ben Walker
225ae35a2f accel: Add per-module task structures
These hold a pointer to the channel which eliminates the need to look it
back up in the completion path.

Change-Id: Ie4fc98d92d6434262e64b9483ef8b3b0591d764a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13914
Tested-by: SPDK CI Jenkins <sys_sgci@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@nvidia.com>
2022-08-16 10:22:55 +00:00
Ben Walker
df892eed67 accel: Return correct values for .get_ctx_size()
This expects the full size of the task for each module. This only worked
because the software module returned the right size.

Change-Id: I481cfad8b4bb9c3748301bdacd90e7f44fd2d878
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13913
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@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@nvidia.com>
2022-08-16 10:22:55 +00:00
Ben Walker
aa156d53be accel: Combine spdk_accel_engine and spdk_accel_module_if
These are 1:1 - they do not need to be separate objects.

Change-Id: I74ab52863f911d9be59ce98e1525302b5bd40846
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13910
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-08-16 10:22:55 +00:00
Krishna Kanth Reddy
17948bcaa9 bdev : xNVMe BDEV module performance fix
This change fixes the lower performance issue of the
xNVMe BDEV for libaio and io_uring backends. There is no
drop in the performance for the io_uring passthrough backend.

Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I21de1b49a534cfc642d1873ef623271063da6af8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14015
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-08-15 19:11:14 +00:00
Boris Glimcher
6212597bda sock/ssl: Add psk_key and psk_identity options to spdk_sock_impl_opts
Note, this change only sets defaults for the ID/KEY,
more specific use cases like NVMe/TCP may set the ID and KEY on a per connection basis.

Also simplify PSK identity string, that isn't NVMe focused.
NVMe libraries using this will need to construct more complicated
identity strings and pass them to the sock layer.

Example:
  rpc.py sock_impl_set_options -i ssl --psk-key 4321DEADBEEF1234
  rpc.py sock_impl_set_options -i ssl --psk-identity psk.spdk.io

  ./build/examples/perf --psk-key 4321DEADBEEF1234 --psk-identity psk.spdk.io

  ./build/examples/hello_sock --psk-key 4321DEADBEEF1234 --psk-identity psk.spdk.io

Change-Id: I1cb5b0b706bdeafbccbc71f8320bc8e2961cbb55
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13759
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2022-08-15 16:52:28 +00:00
Shuhei Matsumoto
a4ebc5714f bdev/nvme: Fix race between for_each_channel() and io_device_unregister()
If a nvme_ctrlr is unregistered while I/O path caches are clearing, the
unregistration would fail. This race was not considered for a case that
a nvme_ctrlr is unregsitered when adminq poller started I/O path cache
clearing.

As a bug fix, control ANA log page updating and I/O path cache clearing
separately by adding a new flag io_path_cache_clearing.

Fixes issue #2617

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Id58684caf9b2a10fa68bdb717288ff2bd799c3f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13924
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
2022-08-12 09:00:59 +00:00
Jim Harris
b7f04e2be0 bdev/nvme: add newline in aer_cb WARNLOG
Noticed while looking at mhae's log in issue #2632.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie7f17a010368696eb59585a2d31191e309c4576c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13888
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: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-08-11 21:04:38 +00:00
Ben Walker
32ee475a5e accel: SPDK_ACCEL_MODULE_REGISTER is now passed the module
Instead of passing each parameter to create a module, just have the user
make one and pass it in. This makes it easier to change the module
definition later.

Change-Id: I3a29f59432a6f0773129d7b210fbc011175b2252
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13909
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-08-10 11:00:17 +00:00
Shuhei Matsumoto
6b8de2ea66 bdev/nvme: Move up _nvme_ctrlr_read_ana_log_page_done() in a file
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ida517be9e16dd6f7cf39a0c6ef2044fd500f19a3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13923
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-08-10 07:26:10 +00:00
Changpeng Liu
a02483e67c module/bdev_virtio_scsi: use the correct num_queues value
Parameter `num_queues` for virtio_scsi PCI device means
maximum number of queues, it SHOULD include the `eventq`
and `controlq`, while for `vhost_user` RPC call, it means
the number of IO queues, so here we use it as `max_queues`
in lib/virtio and add the fixed number queues for `vhost_user`
SCSI device.

Also fix `vhost_fuzz` to get `num_queues` earlier than
negotiate the feature bits.

Change-Id: I41b3da5e4b4dc37127befd414226ea6eafcd9ad0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13791
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>
2022-08-04 11:24:40 +00:00
Changpeng Liu
515d028ec4 bdev/virtio_blk|scsi: don't negotiate VHOST_USER_F_BITS for PCI devices
VHOST_USER_F_PROTOCOL_FEATURES is used for `vhost_user` transport,
so unmask it for PCI devices.

Change-Id: If84d6c0ee7558886f14647dad07e41530e306206
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13790
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-08-04 11:24:40 +00:00
Changpeng Liu
c60cb1a8be lib/nvmf: don't raise assertion in nvmf_tgt_destroy_cb
While running into this function, even the subsystem can't be
destroyed due to error subsystem state, it's better to continue
the execution.

Continue to fix #2590, QEMU is stuck for the failure case, and
nvmf target should process such error because it may support other
normal subsystems at the same time.

Change-Id: Ib05e24996378b52070d2b760519f476f9b2d7e76
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13839
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-08-04 07:29:27 +00:00
Artur Paszkiewicz
884980d0aa ftl: vss null buffer workaround
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Change-Id: I94ea399ed30fae29f92b4216eaa9209c02b3478b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13310
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>
2022-08-02 19:00:42 +00:00
Artur Paszkiewicz
06790f25f1 FTL: Add ftl_io helper structure
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I608b500c6fb14efe289932955f508484f2ecf1b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13305
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-08-02 19:00:42 +00:00
Artur Paszkiewicz
be90ea6e7b FTL: Add bdev_ftl_create and delete rpc definitions
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I0837028fbe349e8df7f05fb3c9db1f4682f04679
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13301
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>
2022-08-02 19:00:42 +00:00
Changpeng Liu
78ca4b27c5 nvmf: don't raise assertion when destroying an non-inactive subsystem
Sometimes VM may get a kernel panic when starting, and SPDK CI will kill
`nvmf_tgt` after 60 seconds, and for this exception, SPDK will raise an
assertion when destroying the subsystem, while here, we remove this
assertion and print the error information.

CI will still mark this case as a failed case, then we can use this error
information to understand error subsystem state in vfio-user.

Fix issue #2590.

Change-Id: I20b16f9e96a566730eca2dd9ea165645bd9160bd
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13773
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: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-08-02 01:26:10 +00:00
Konrad Sztyber
bae771fcdb sock: add assertions checking sock_impl_opts size
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I5afc3481470f876a59505d9c4c9dc3d699c5cfd9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13714
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: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-07-29 16:49:54 +00:00
Artur Paszkiewicz
83a4b155ca module/raid: raid5: rename to raid5f
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I4ccd54f995f0f413dadd700ba3f6ed82fe17e223
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12395
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2022-07-27 08:51:21 +00:00
Artur Paszkiewicz
c682c78992 FTL: Add FTL bdev module
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I8c40b96f0726d83d6a307e8b9a04b7c210b80255
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13299
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-07-25 07:19:29 +00:00
Chuanwei Ji
2460515509 aio: aio rescan rpc response is sent incorrectly.
Failed rpc response will be sent when rescan successfully.

Signed-off-by: Chuanwei Ji <chuanwei.ji@jaguarmicro.com>
Change-Id: I99a2491ec76b63cb01fb384e621b41b10ee0ed83
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13711
Community-CI: Mellanox Build Bot
Reviewed-by: Qingmin Liu <qingmin.liu@jaguarmicro.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-07-22 07:28:49 +00:00
Changpeng Liu
c88345ab3d nvme: apply nvme_pcie_poll_group_get_stats to vfio-user
Both PCIE and VFIO-USER can use the same APIs to get IO queue
pair statistic data, so merge them here.

Change-Id: Iadf9ead2bd5abaf11d2ef5d1884acb67369f85bb
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13538
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: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-07-22 06:43:35 +00:00
Boris Glimcher
806744b7c8 sock: Add ktls and tls_version to spdk_sock_impl_opts
Since `sock_impl_opts` was added to `sock_opts`
Can remove `ktls` and `tls_version` from spdk_sock_opts

Example:
  rpc.py sock_impl_set_options -i ssl --enable-ktls
  rpc.py sock_impl_set_options -i ssl --disable-ktls
  rpc.py sock_impl_set_options -i ssl --tls-version=12

  ./build/examples/perf --enable-ktls
  ./build/examples/perf --disable-ktls
  ./build/examples/perf --tls-version=12

Check kTLS statistics here: /proc/net/tls_stat

Change-Id: Icf7ee822bad92fda149710be77feb77fc8d4f163
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13510
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-07-22 06:41:39 +00:00
Konrad Sztyber
7f83361553 sock: add sock_impl_opts to sock_opts
Some of the options in sock_impl_opts could be different for different
sockets (even if they're using the same impl).  However, outside of a
few selected options (recv_buf_size, send_buf_size), there was no
interface to change them.

This change will allow users to change impl_opts on a per-socket basis
when creating a socket.  Sockets created through accept() inherit
impl_opts from the listening socket.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I7628ae19def25cef6ffa62aa54bd34e446632579
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13661
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>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2022-07-19 09:35:03 +00:00
Konrad Sztyber
50afaf1ee8 sock: store impl_opts in socket structure
It'll make it possible to change some of the impl_opts options on a
per-socket basis, as well as make it easier to use fields common to all
implementations in the generic layer.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Id3b5e0a0b302fdecc2387d07fb87b75b487dc5c5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13659
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
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>
2022-07-19 09:35:03 +00:00
Alexey Marchuk
36589e1e44 bdev_nvme_rpc: Update bdev_nvme_get_io_paths RPC
This RPC prints only cntlid, to identify a controller
it is needed to issue bdev_get_bdevs and find more info
using cntlid. Printing the controller's trid helps to
identify the controller faster.

Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: I97325b822528ef9e71afbe2ff1c30b3bce2ae203
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13655
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-07-19 08:05:07 +00:00
Krishna Kanth Reddy
6f338d4bf3 bdev : xNVMe BDEV module implementation
This implementation of xNVMe BDEV module supports the char-device / ioctl-over-uring,
along with the "regular" io_uring, libaio, POSIX aio, emulated aio (via threadpools) etc.

Code changes done :
a. Addition of xNVMe submodule to SPDK
b. Modification of RPC scripts to Create / Delete xNVMe BDEVs
c. Implementation of xNVMe BDEV module

Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: If814ca1c784124df429d283015a6570068b44f87
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11161
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-07-15 12:52:13 +00:00
Konrad Sztyber
030bbebeb2 sock: extract copying impl_opts to a function
Both get_opts and set_opts use very similar macros to achieve almost the
same thing, so it makes sense to extract it to a separate function.
Additionally, it'll be also useful in subsequent patches introducing
per-sock impl_opts, as there will be more places when we want to copy
impl_opts.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I8ab27298d62ea0118463ee945c708acd91aa5104
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13658
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@nvidia.com>
2022-07-14 09:48:25 +00:00
Konrad Sztyber
38f82ecf1e sock: move (get|set)_opts up
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I9ddbfb1018d23117582b947058fcd6c322c2ef6b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13657
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@nvidia.com>
2022-07-14 09:48:25 +00:00
Shuhei Matsumoto
81e92f6bca bdev/nvme: Calculate and use active ns count to read ANA log page
nvme_ctrlr_init_ana_log_page() had used cdata->mnan as active ns count
to allocate a buffer and read a ANA log page into the buffer.

However, cdata->mnan was larger than the real active ns count and caused
an issue when the corresponding NVMe-oF target set the bit 18 of the SGL
support field in the Identify Controller Data structure.

We still need to use cdata->mnan to allocate the buffer because
number of namespaces may be increased dynamically after initialization.

Hence, rename nvme_ctrlr::ana_log_page_size to
nvme_ctrlr::max_ana_log_page_size and calculate and use the active ns
count to read the ANA log page. Check if the current ana_log_page_size
is not larger than nvme_ctrlr->max_ana_log_page_size.

Fixes issue #2584

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ieb10b9c793c4f48ffd88d517c0e9a55184b7d935
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13653
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-07-14 09:47:41 +00:00
yidong0635
256bfe7685 raid/concat: update bdev readv/writev to ext API.
Other parts have changed these since readv and writev
support ext_opts.
And change corresponding unittest.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I79260a7e6110aa46df2016e579f1da5c241c9844
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13620
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2022-07-14 09:46:56 +00:00
Konrad Sztyber
c61554bb68 sock/uring: mark non-listen sockets as blocking
Instead, we pass MSG_DONTWAIT flag to all recvmsg()/sendmsg() calls.
That way, the IOs remain non-blocking, but the socket is marked as
blocking allowing us to pass flags like MSG_WAITALL, which only make
sense if a socket is in blocking mode.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic52162e84aa14efaf6ad0fb3343d289822758e81
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12592
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-07-14 09:45:54 +00:00
Konrad Sztyber
6d3506d893 sock/uring: extract advancing req's offset to a function
It'll make it possible to reuse this code for asynchronous read
requests.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I56dab62587884e2e37fad11b5f0d12df92e175ea
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12590
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-07-14 09:45:54 +00:00
Konrad Sztyber
6453cbe783 sock/uring: rename sock_complete_reqs -> sock_complete_write_reqs
This function processes and completes asynchronous write requests, so it
makes sense to rename it.  This is done in preparation for handling
asychronous read requests.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I3f36631dc24a3170204aaaba56f4968be0672fe5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12172
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-07-14 09:45:54 +00:00
Konrad Sztyber
98b3ff5656 sock/uring: rename recv task to errqueue
This task is used to receive the socket's error queue to check for
completed zero-copy write requests.  The rename is done in preparation
for adding a read task that will actually receive the data from the
socket.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I61bf45e210bb09bd89f3161a75478b41bd8eb070
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12171
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-07-14 09:45:54 +00:00
Konrad Sztyber
3e47d7fa22 sock: asynchronous readv interface
This patch defines a new function, spdk_sock_readv_async(), which allows
the user to send a readv request and receive a callback once the
supplied buffer is filled with data from the socket.  It works simiarly
to asynchronous writes, but there can only be a single outstanding read
request at a time.

For now, the interface isn't implemented and any calls will return
-ENOTSUP.  Subsequent patches will add support for it in the uring
module and as well as emulation in the posix module.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I924e2cdade49ffa18be6390109dc7e65c2728087
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12170
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-07-14 09:45:54 +00:00
Wojciech Malikowski
81dca28884 ftl: remove deprecated ftl library
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Change-Id: I3ebb05be3f1b9864b238cb74f469b4fdf573cd0d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11120
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: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2022-07-11 07:23:58 +00:00
Konrad Sztyber
0e25e2a6e2 bdev/compress: make lb_size optional in bdev_compress_create
Treat it as zero if the user doesn't provide it.  This will make it
consistent with other RPCs and the behavior of that command in
scripts/rpc.py.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic5505f853bc203fb1144ba3f1f44c736563a3677
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13529
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-07-04 07:23:26 +00:00
Boris Glimcher
7104c8332d sock: Add ktls and tls_version to spdk_sock_opts
See https://docs.kernel.org/networking/tls-offload.html
See https://www.openssl.org/docs/man3.0/man3/SSL_set_options.html

Change-Id: I2fb433cbc34061cb03e1591bb0b47063fcafc68c
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13071
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-06-30 07:44:26 +00:00
yupeng
1f0b8df7b0 blobstore: implement spdk_bs_grow and bdev_lvol_grow_lvstore RPC
The bdev_lvol_grow_lvstore will grow the lvstore size if the undering
bdev size is increased. It invokes spdk_bs_grow internally. The
spdk_bs_grow will extend the used_clusters bitmap. If there is no
enough space resereved for the used_clusters bitmap, the api will
fail. The reserved space was calculated according to the num_md_pages
at blobstore creating time.

Signed-off-by: Peng Yu <yupeng0921@gmail.com>
Change-Id: If6e8c0794dbe4eaa7042acf5031de58138ce7bca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9730
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
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>
2022-06-28 17:55:43 +00:00
yupeng
88833020eb blobstore: reserve space for growing blobstore
Reserve space for used_cluster bitmap. The reserved space is calculated
according to the num_md_pages. The reserved space would be used when
the blobstore is extended in the future.
Add the num_md_pages_per_cluster_ratio parameter to the
bdev_lvol_create_lvstore API. Then calculate the num_md_pages
according to the num_md_pages_per_cluster_ratio and bdev total size, then
pass the num_md_pages to the blobstore.

Signed-off-by: Peng Yu <yupeng0921@gmail.com>
Change-Id: I61a28a3c931227e0fd3e1ef6b145fc18a3657751
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9517
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
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>
2022-06-28 17:55:43 +00:00
Ben Walker
8dd1cd2104 check_format: For C files only, fix return type breaks
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>
2022-06-27 09:33:48 +00:00
GangCao
df1e07e909 Bdev/RAID: cleanup the RAID config even there is no base bdev added
Fix issue: #2557

Related test also added.

Change-Id: I1fa8895cf9dd81c75e5b8b1092733e62be8abd32
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13061
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
2022-06-21 07:55:09 +00:00
Boris Glimcher
120382b7ec test/sock: Fixing hexstr2buf for PSK
Adding more unit tests using standard openssl

The unfortunate small sleep is needed due to issue:
https://www.mail-archive.com/openssl-users@openssl.org/msg02937.html

Change-Id: I6f55453f12371bec6a402ba4c1d20e21aed73cf4
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12625
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-06-20 14:59:47 +00:00
Boris Glimcher
2fb5ff4985 sock: Add support for SSL
Added new `ssl` based socket implementation.
For now we are using hard-coded PSK and only support TLS 1.3

One can use it via sock_set_default_impl RPCs

Nvme/TCP published secure channel specification (TP 8011)
Which is based on TLS 1.3 and PSK.
So this is a primary but not the oly use case.

Before any SSL connection can be established
we need to create SSL context.
The context should be client/server aware.

Similar to regular sockets, to establish connection
server must call SSL_accept and client must call SSL_connect.

For now I'm using PSK and not certificates since
we aim this for NVMe/TCP TP-8011 which supports only PSK.

Adding certificates later on will be very easy.

The complication with SSL state machine during accep and connect
comes with returned SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE.
According to documentation, call have to be repeated in this case.

Using openssl here for TLS from user space.
openssl also has support for kTLS.
Will be part of the next changes.

openssl doesn't have implemetation for iovec
only basic SSL_read and SSL_write.
So adding here SSL_readv and SSL_writev wrappers.

Tested using:
  ./build/examples/hello_sock -N ssl -H 127.0.0.1 -P 12345
  ./build/examples/hello_sock -N ssl -H 127.0.0.1 -P 12345 -S

Also tested using:
  nvmf_tgt + sock_set_default_impl + perf

Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Change-Id: Ie730077c5c581b7e112c18f5f9e1b683015e7b4b
Signed-off-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12327
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-06-20 14:59:47 +00:00
Tomasz Zawadzki
f7e1f48a79 lib/event: do not set default scheduling period during init
reactor_run() decides whether to start gather_metrics
based on non-zero scheduler period.
The default of 1 sec was set during initialization,
in scheduler_subsystem_init().

This resulted in unessecary operations each second,
even if only 'static' scheduler is used.

This patch moves setting default scheduling period to
respective schedulers.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I953aee271a959b6314c8e83434c922dba9638de4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9492
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-06-20 09:56:09 +00:00
Anton Eidelman
0b9100e8a5 bdev/nvme: replace nn with mnan in ana_log size calculation
Calculation of the ANA log page size should use the
identify ctrl MNAN field
(maximum number of allowed namespaces)
not the NN (maximum valid nsid value).

An ANA-enabled controller must have a non-zero MNAN value,
see NVMe Base Specification, Figure 251,
therefore nvme_ctrlr_init_ana_log_page() may safely use MNAN.

Since NN might be much higher than MNAN,
ANA log size based on NN may results in a very large
log page and cause a failure to get ANA log,
e.g. if it is larger than the controller's MDTS.

Fix: replace cdata->nn with cdata->mnan
in nvme_ctrlr_init_ana_log_page()

Signed-off-by: Anton Eidelman <anton@lightbitslabs.com>
Change-Id: I2a522dca833a27dddad25848d7688efa23d23091
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13039
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
2022-06-15 08:10:48 +00:00
Tomasz Zawadzki
0f3ddc9c98 env/dpdk: skip build of DPDK based governors when missing rte_power
rte_power was added to DPDK long time ago,
but some of the DPDK packages do not include it.

For those cases just skip building components that depend on in.

This change still allows to use dynamic scheduler, since
the dpdk_governor usage is optional.

Fixes #2534

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ied88edc8d58aae07d1384c1c40203fc80b919d80
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12993
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-06-15 08:08:55 +00:00
Tomasz Zawadzki
ec1d6fb71e env/dpdk: simplify checks for rte_power
dpdk_governor and gscheduler use rte_power,
which is only available on Linux and when
DPDK env is used.

Rather than repeat those checks in each mk or Makefile,
added DPDK_POWER flag directly to DPDK env.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I438caad8d333a4df697a79aa45de2930cce71d23
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12992
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: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-06-15 08:08:55 +00:00
Jim Harris
488570ebd4 Replace most BSD 3-clause license text with SPDX identifier.
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>
2022-06-09 07:35:12 +00:00
Jim Harris
68108360f9 bdev/nvme: check bdev's module when setting multipath policy
We cannot try to set multipath policy on a non-nvme bdev.

While here, make the error messages match what we use for
setting preferred path.

Fixes issue #2543.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I823077f92634ee3c16e77e7e0d67eb343ec3584e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12916
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: <qun.wan@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-06-08 08:08:04 +00:00
Liu Xiaodong
9be660eabd bdev_aio: fix aio error indication
From aio_abi.h, io_event.res is defined __s64, negative
errno is assigned to io_event.res for error situation
in Linux Kernel.
But from libaio.h, io_event.res is defined unsigned long,
so convert it to signed value for error detection.

Fixes issue #2325

Change-Id: I99f8b03e8bfedfa260fe91f3e9e8ef0e5ecd0b77
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12882
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-06-07 00:04:09 +00:00
Monica Kenguva
95e057210e test/nvmf: test reconnect_delay_sec parameter
Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Change-Id: I45dc2b2fe660e5a53c8976dea2640ea53ec00a3d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12184
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-06-06 07:51:54 +00:00
Jim Harris
89c939e0a6 Eliminate license header differences.
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>
2022-06-06 07:34:55 +00:00
wanghailiangx
465f99e9ff accel module: remove support for deprecated RPC names
These were deprecated in 2019, it's time to remove
support for them now.

Change-Id: I5a715e9b9e991c6febec5e505384728281eee8b7
Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12773
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-23 16:14:41 +00:00
wanghailiangx
25114fce69 mvnf module: remove support for deprecated RPC names(missed two)
These were deprecated in 2019, it's time to remove
support for them now.

Change-Id: Ia28abb9b724c9589e1da66f0f22a1ba95d96f5dc
Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12776
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-23 16:14:16 +00:00
wanghailiangx
7aa92ad513 bdev module: remove support for deprecated RPC names
These were deprecated in 2019, it's time to remove
support for them now.

Change-Id: I9e203a52877802127df8144e68090d7975f9d200
Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12772
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-23 16:13:00 +00:00
paul luse
b483811ff1 modules/accel/iaa: add IAA accel_fw module
And associated RPC to enable.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I06785bcd8b8957293ad41d13bab556fe62f29fd5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12765
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>
2022-05-23 16:04:57 +00:00
wanghailiangx
3ac967baa6 bdev_iscsi: remove support for deprecated RPC names
These were deprecated in 2019, it's time to remove
support for them now.

Change-Id: I25aea510648a55d751db3740b36fb9924d1f52ed
Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12747
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-05-23 07:02:37 +00:00
paul luse
ecaa8e1000 lib/idxd: prepare some plumbing for adding IAA
Misc internal IDXD changes needed to support the upcoming addition
of IAA.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Idb180088af545b174ed33a4f8ee113e58640477f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12764
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-23 07:02:21 +00:00
paul luse
ffef30ae0d modules/accel_dsa: update IDXD references to DSA where it makes sense
IDXD has always been used everywhere but technically it stands for
the driver, not the HW (Intel Data Streaming Accelerator Driver)
where the X comes from "Streaming Accelerator" somehow.  Anyway, the
underlying hardware is just DSA.  It doesn't matter much now but
upcoming patches will add support for a new HW accelerator called
the Intel In-Memory Analytics Accelerator which we'll call IAA and
it will use the same (mostly) device driver (IDXD) as DSA.  So, calling
the HW what it is will lessen confusion when adding IAA support.

This patch just does renaming for the accel_fw module and associated
files (RPC, etc).

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ib3b1f982cc60359ecfea5dbcbeeb33e4d69aee6a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11984
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-23 07:02:21 +00:00
Alexey Marchuk
366e19efe8 vbdev_compress: Remove mentioning of 2MiB huge pages
We explicitly refer to 2MiB huge pages when a buffer
spans huge page boundary. That is not correct since
it may happen even with 1GiB huge pages.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reported-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ief72b677ccf3d8c1d9835bb8b74621f2b349175a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12250
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>
2022-05-20 17:39:57 +00:00
Tomasz Zawadzki
e0516095fc event/vhost: separate vhost subsystem to scsi and blk
Separate out SCSI and BLK vhost subsystems to later add
virtio_blk transport abstraction.

This allows for further changes to the vhost_blk, not
affecting vhost_scsi.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Id1ecfeafeb936809a479a43c321e13f75cb3d5ad
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9539
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-05-20 09:20:07 +00:00
Changpeng Liu
e1b5d28c8b bdev/nvme: set max_segment_size and max_num_segments
Maximum Data Transfer Size indicates the maximum data transfer size
for a command that transfers data between memory and the controller.
SPDK NVMe driver will split IO request based on MDTS and stripe
boundary, however, if user submited a big enough IO size, SPDK
NVMe driver will run out of requests data structure and return
-EINVAL as the error code, it's OK for application who call SPDK
NVMe driver directly.

SPDK bdev module also will do similar split based on `max_segment_size`
and `max_num_segments`, but we don't set them for bdev/nvme driver,
once there was a big enough IO request, the NVMe driver will return
-EINVAL to bdev module, here we set `max_segment_size` based on MDTS
and set `max_num_segments` based on number of requests of NVMe
controller.

Fix #2403.

Change-Id: Ic6e14a0b12413783597122285ac648b87e1f1e16
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12186
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-05-20 09:18:56 +00:00
GangCao
7cfb12f437 Bdev/Lvol: check base bdev's md before examining
To fix issue #2514

Change-Id: If507382202e729f5934a354e2515a035ad5aeb0c
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12750
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-20 09:18:18 +00:00
Shuhei Matsumoto
e4584d937e bdev/nvme: Poll adminq more often during ctrlr disconnection
During ctrlr reconnection, spdk_nvme_ctrlr_reconnect_poll_async()
is executed by a non-timed poller.

We should poll adminq more often during ctrlr disconnection too.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ib1f5b41015aed20deda8df6f2c837981ac233c04
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12615
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-20 09:17:28 +00:00
Shuhei Matsumoto
fcf52fbff5 bdev/nvme: Reversed orderings for reset between PCIe and NVMe-oF
As described in the NVMe specification, a controller level reset
includes the following actions:
- the controller stops processing any outstanding admin or I/O
  commands;
- all I/O SQs and CQs are deleted.

In a full controller reset sequence for a PCIe controller, if we do
a controller level reset first, we can abort outstanding commands
after the hardware has actually been stopped.

For NVMe-oF controller, each I/O qpair is an independent network
connection and is disconnected safely. We do not want to change
NVMe-oF controller.

Fixes the issue #2360

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: If05febac74705bfd3df5abd15064c1203126e027
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12447
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: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-05-20 09:17:28 +00:00
wanghailiangx
c77f17a53e bdev_malloc and bdev_null : remove support for deprecated RPC names
These were deprecated in 2019, it's time to remove
support for them now.

Change-Id: Ic80ce74344b24814dad792cfff6a4791d0430527
Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12741
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-19 13:07:41 +00:00
Konrad Sztyber
e5f9e82291 bdev/nvme: add timeout option to start_discovery
It's now possible to specify a time to wait until a connection to the
discovery controller and the NVM controllers it exposes is made.

Whenever that time is exceeded, a callback is immediately executed.
However, depending on the stage of the discovery process, we might need
to wait a while before actually stopping it (e.g. because a controller
attach is in progress).  That means that a discovery service might be
visible for a while after it timed out.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2d01837b581e0fa24c8e777730d88d990c94b1d8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12684
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-18 07:24:06 +00:00
Konrad Sztyber
10dbbf6d8a bdev/nvme: free log_page when freeing discovery ctx
Currently this should be a no-op as the log_page is always freed in
discovery_remove_controllers(), but it'll make it easier to handle cases
when we want to stop the discovery service while it's attaching NVM
controllers.  We'll be relying on this in the subsequent patch adding
attach timeout to start_discovery().

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ia03fde92bf5ae5590bca507b7a0f963885d85f4f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12721
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: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
2022-05-18 07:24:06 +00:00
Shuhei Matsumoto
00d46b80b2 bdev/nvme: Disable automatic failback in multipath mode
By default, failback to the preferred I/O path is done automatically
if it is restored. Some users may want to keep using the backup I/O
path even if the preferred I/O path is restored. In this case,
bdev_nvme_set_preferred_path can be used to do manual failback.

We may be able to clear/fill I/O path cache more strictly but it will
be complicated and have bugs. This patch does the minimal change,
just skips an apparent case.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I78fe5faee6ff04e88ae3d7c6be6da1c20637c912
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12431
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-05-17 12:54:45 +00:00
Konrad Sztyber
0aa212bddb bdev/nvme: use stop_discovery in module_fini
Using stop_discovery() will also free the entry contexts tied to that
discovery service.  It's not a big deal to leave them, as module_fini is
usually called on app shutdown, but this gets rid of asan reporting
memory leaks.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I81fc843708694791a5846c24cbde4b32e0fa7287
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12683
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-05-16 10:20:49 +00:00
Konrad Sztyber
82889ba8e5 bdev/nvme: free entry_ctx_in_use
It was never freed, so we leaked it.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I9e17d043ebd0d8d11bb776cb2676ac7f53f8ee41
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12682
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: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-05-16 10:20:49 +00:00
Konrad Sztyber
3c61b8ca6d bdev/nvme: extract stopping discovery to a function
For now, it's only called from a single location,
bdev_nvme_stop_discovery, but it'll make it possible to stop the
discovery from other places.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I3ba447f30fd8ed23c392d008b3d03cdad30cdb33
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12681
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-05-16 10:20:49 +00:00
Konrad Sztyber
623105bb09 bdev/nvme: zero out the referred discovery trid
If the trid is not zeroed out, trid.trstring might contain garbage
value, which means that nvme_probe_internal() might not populate it
based on trtype and will use that garbage value to get a transport,
leading to the following failure:

```
nvme.c: 834:nvme_probe_internal: *ERROR*: NVMe trtype 3 () not available
```

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I56bc6502d285ee5ce094184e00d3297f6332e8c0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12680
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-05-16 10:20:49 +00:00
Konrad Sztyber
5c2b5fc14b bdev/nvme: fix wait_for_attach assignment
Moved assigning ctx->start_cb_fn before it's checked for NULL to set
ctx->wait_for_attach, otherwise it was always false.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I819d9e326dbb36f943279c3714695ae604dd64b2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12628
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-05-16 10:20:49 +00:00
Konrad Sztyber
ef675d38c1 bdev/nvme: check discovery service trids during start
Check that we're not already connected to a discovery service that has
the same address (or has a referall to) as the service we're trying to
start.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I84863fd959f62b30e9a348f69d10c7f1edffda7a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12627
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-05-16 10:20:49 +00:00
Konrad Sztyber
33c14a1445 bdev/nvme: don't allow duplicate discovery service names
Otherwise, we'll try to use the same name to create the bdevs.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I38cfb9073f343a7bf3966754008065c7ab89e609
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12626
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-05-16 10:20:49 +00:00
Gal Hammer
90aba31ac3 bdev/ocf: Implement ENOMEM handling when submitting IO to base device
Replaced the TODO comment with an error handing in case SPDK fails to
allocate memory for the IO request. Returning the proper error code
will use the bdev's no memory retry mechanism to handle the failure.

Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
Change-Id: I151668f26b7f122dca95eaf65934be675e601952
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12372
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-16 10:15:27 +00:00
Alexey Marchuk
b0262063d3 vbdev_lvol: Report memory domains
Update functional test to verify that lvol supports
memory domains

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I5e91eedc8879359c3add45d417b6f3eaad4d75b9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11375
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-05-16 10:14:26 +00:00
Alexey Marchuk
248ccd8607 lvol: Use blobstore ext API in data path
The new blobstore ext API is used when the user
provides ext_io_opts in bdev layer.
To store blobstore ext_io_opts, vbdev_lvol reports
non-zero get_ctx_size in bdev module interface.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I64076b5369533be0c1d69ca48aef9d70a9abe488
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11373
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-05-16 10:14:26 +00:00
Alexey Marchuk
c3a40396cf blob/bdev: Use extended blob API
Queued vectored IOs use extended API -
if ext_opts is NULL there is no difference
between regular and extended blob API

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I091f36d81dab04bcd483ea61e667a368441d70e4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11372
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-05-16 10:14:26 +00:00
Alexey Marchuk
ba8f1a9e5d blob: Add readv/writev ext ops to spdk_bs_dev
Introduce spdk_blob_ext_io_opts structure which
is used in the new *_ext functions.
Zeroes dev is updated with implementation of
readv_ext which uses  memory domains memzero
or regular memset().

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Id94542196eff999827bf00591fd43804256fccb4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11369
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.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>
2022-05-16 10:14:26 +00:00
Shuhei Matsumoto
fe9a8fab7b bdev/nvme: Factor out set callback and call ctrlr_disconnect() into a helper function
The following patches will swap the ordering of destroying I/O qpairs
and disconnecting a controller for PCIe transport to fix a github issue.

Setting callback and calling spdk_nvme_ctrlr_disconnect() have been
executed in two cases now.

After the following patches, these will be executed in three cases.

Factoring out these into a helper function will be rewarded.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I8597908d7fd8acc6dc62ec442ba2e8c4c08f11a4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12562
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: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-05-12 07:28:02 +00:00
Shuhei Matsumoto
91165150cc bdev/nvme: Factor out deleting all I/O qpairs for reset into a helper function
The following patches will swap the ordering of destroying I/O qpairs
and disconnecting a controller for PCIe transport to fix a github issue.
For PCIe transport, destroying I/O qpairs will be as the completion
callback to controller disconnection. To do this easier, factor out
destroying I/O qpairs into a helper function.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I96bb6d0487fc67b71c759ee64200bd7fb71aceb1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12561
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: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-05-12 07:28:02 +00:00
Gal Hammer
84863d99a8 bdev/ocf: Fix no memory error value check
On I/O request completion, OCF uses OCF_ERR_NO_MEM (and not ENOMEM) to
report a memory allocation failure.

Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
Change-Id: If06608d7aa0fc747a79564b7372c915d99307235
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12352
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: Rafal Stefanowski <rafal.stefanowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-05-11 09:34:45 +00:00
Konrad Sztyber
f331ae167b bdev/nvme: add RPC returning information about discovery service
The RPC returns a list of active discovery service connections.  Each
discovery service is described by a name, its trid, and a list of
discovery service trids it refers to.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ifa4b9501dd353e7b4948ad830575a6c94dafd86b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12380
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-05-05 14:08:57 +00:00
paul luse
d58a2f6cc5 lib/accel: support multiple accel modules (aka engines) at once
We enable multiple engines by:

* getting rid of the globals that point to the one available HW
and one available SW engine

* adding a submit_tasks() entry point for the SW engine so that
it is treated like any other engine allowing us to just call
submit_tasks() to the assigned engine for the opcode instead of
checking what is supported

* changing the definition of engine capabilities from
"HW accelerated" to simply "supported"

* during init, use a global (g_engines_opc) that contains engines
and is indexed by opcode so we know what the best engine is for each
op code

* future patches will add RPC's to override engine priorities or
specifically assign an opcode(s) to an engine.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I9b9f3d5a2e499124aa7ccf71f0da83c8ee3dd9f9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11870
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-05-05 07:11:32 +00:00
Shuhei Matsumoto
8f9b977504 bdev/nvme: Add active/active policy for multipath mode
The NVMe bdev module supported active-passive policy for multipath mode
first. By this patch, the NVMe bdev module supports active-active policy
for multipath node next. Following the Linux kernel native NVMe multipath,
the NVMe bdev module supports round robin algorithm for active-active
policy.

The multipath policy, active-passive or active-active, is managed per
nvme_bdev. The multipath policy is copied to all corresponding
nvme_bdev_channels.

Different from active-passive, active-active caches even non_optimized
path to provide load balance across multiple paths.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ie18b24db60d3da1ce2f83725b6cd3079f628f95b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12001
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-05-05 07:11:24 +00:00
Shuhei Matsumoto
0869265d66 bdev/nvme: Factor out searching io_path operation from find_io_path()
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I26939b39cfd4b92bdbc1d4ef10961ba35145043c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12000
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-05-05 07:11:24 +00:00
Shuhei Matsumoto
22b77a3c80 bdev/nvme: Set preferred I/O path in multipath mode
If we specify a preferred path manually for each NVMe bdev, we will
be able to realize a simple static load balancing and make the failover
more controllable in the multipath mode.

The idea is to move I/O path to the NVMe-oF controller to the head of
the list and then clear the I/O path cache for each NVMe bdev channel.
We can set the I/O path to the I/O path cache directly but it must be
conditional and make the code very complex. Hence, let find_io_path() do
that.

However, a NVMe bdev channel may be acquired after setting the preferred
path. To cover such case, sort the nvme_ns list of the NVMe bdev too.

This feature supports only multipath mode. The NVMe bdev module supports
failover mode too. However, to support the latter, the new RPC needs to
have trid as parameters and the code and the usage will be come very
complex. Add a note for such limitation.

To verify one by one exactly, add unit test.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ia51c74f530d6d7dc1f73d5b65f854967363e76b0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12262
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: <tanl12@chinatelecom.cn>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-05-05 07:11:24 +00:00
Richael Zhuang
9bff828f99 sock: introduce dynamic zerocopy according to data size
MSG_ZEROCOPY is not always effective as mentioned in
https://www.kernel.org/doc/html/v4.15/networking/msg_zerocopy.html.

Currently in spdk, once we enable sendmsg zerocopy, then all data
transferred through _sock_flush are sent with zerocopy, and vice
versa. Here dynamic zerocopy is introduced to allow data sent with
MSG_ZEROCOPY or not according to its size, which can be enabled by
setting "enable_dynamic_zerocopy" as true.

Test with 16 P4610 NVMe SSD, 2 initiators, target's and initiators'
configurations are the same as spdk report:
https://ci.spdk.io/download/performance-reports/SPDK_tcp_perf_report_2104.pdf

For posix socket, rw_percent=0(randwrite), it has 1.9%~8.3% performance boost
tested with target 1~40 cpu cores and qdepth=128,256,512. And it has no obvious
influence when read percentage is greater than 50%.

For uring socket, rw_percent=0(randwrite), it has 1.8%~7.9% performance boost
tested with target 1~40 cpu cores and qdepth=128,256,512. And it still has
1%~7% improvement when read percentage is greater than 50%.

The following is part of the detailed data.

posix:
qdepth=128
rw_percent      0             |           30
cpu  origin  thisPatch  opt   | origin  thisPatch opt
1	286.5	298.5	4.19%		 307	304.15	-0.93%
4	1042.5	1107	6.19%		1135.5	1136	0.04%
8	1952.5	2058	5.40%		2170.5	2170.5	0.00%
12	2658.5	2879	8.29%		3042	3046	0.13%
16	3247.5	3460.5	6.56%		3793.5	3775	-0.49%
24	4232.5	4459.5	5.36%		4614.5	4756.5	3.08%
32	4810	5095	5.93%		4488	4845	7.95%
40	5306.5	5435	2.42%		4427.5	4902	10.72%

qdepth=512
rw_percent      0             |           30
cpu  origin  thisPatch  opt   | origin  thisPatch opt
1    275	 287	4.36%		294.4	295.45	0.36%
4	 979	1041	6.33%		1073	1083.5	0.98%
8	1822.5	1914.5	5.05%		2030.5	2018.5	-0.59%
12	2441	2598.5	6.45%		2808.5	2779.5	-1.03%
16	2920.5	3109.5	6.47%		3455	3411.5	-1.26%
24	3709	3972.5	7.10%		4483.5	4502.5	0.42%
32	4225.5	4532.5	7.27%		4463.5	4733	6.04%
40	4790.5	4884.5	1.96%		4427	4904.5	10.79%

uring:
qdepth=128
rw_percent      0             |           30
cpu  origin  thisPatch  opt   | origin  thisPatch opt
1	270.5	287.5	6.28%		295.75	304.75	3.04%
4	1018.5	1089.5	6.97%		1119.5	1156.5	3.31%
8	1907	2055	7.76%		2127	2211.5	3.97%
12	2614	2801	7.15%		2982.5	3061.5	2.65%
16	3169.5	3420	7.90%		3654.5	3781.5	3.48%
24	4109.5	4414	7.41%		4691.5	4750.5	1.26%
32	4752.5	4908	3.27%		4494	4825.5	7.38%
40	5233.5	5327	1.79%		4374.5	4891	11.81%

qdepth=512
rw_percent      0             |           30
cpu  origin  thisPatch  opt   | origin  thisPatch opt
1	259.95	 276	6.17%		286.65	294.8	2.84%
4	955 	1021	6.91%		1070.5	1100	2.76%
8	1772	1903.5	7.42%		1992.5	2077.5	4.27%
12	2380.5	2543.5	6.85%		2752.5	2860	3.91%
16	2920.5	3099	6.11%		3391.5	3540	4.38%
24	3697	3912	5.82%		4401	4637	5.36%
32	4256.5	4454.5	4.65%		4516	4777	5.78%
40	4707	4968.5	5.56%		4400.5	4933	12.10%

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Change-Id: I730dcf89ed2bf3efe91586421a89045fc11c81f0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12210
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: Ben Walker <benjamin.walker@intel.com>
2022-04-28 07:29:28 +00:00
Jim Harris
ab9c7a6a81 bdev/nvme: account for ACWU values being 0-based
ACWU and NACWU are 0-based values.  But spdk_bdev_get_acwu()
specifies the compare-and-write-unit in terms of blocks
(i.e. 1-based).  So the bdev/nvme module needs to add 1
to this value before registering the bdev.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7c19975a2bd8c09bb65374838fe20aad690d1ecf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12384
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-04-27 07:36:44 +00:00
Alex Michon
2bc134eb4b bdev/nvme: Fix aborting fuse commands
When sending a fused compare and write command, we pass a callback
bdev_nvme_comparev_and_writev_done that we expect to be called twice
before marking the io as completed. In order to detect if a call to
bdev_nvme_comparev_and_writev_done is the first or the second one, we
currently rely on the opcode in cdw0. However, cdw0 may be set to 0,
especially when aborting the command. This may cause use-after-free
issues and this may call the user callbacks twice instead of once.
Use a bit in the nvme_bdev_io instead to keep track of the number of
calls to bdev_nvme_comparev_and_writev_done.

Signed-off-by: Alex Michon <amichon@kalrayinc.com>
Change-Id: I0474329e87648e44b08998d0552b2a9dd5d34ac2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12180
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: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-04-26 07:47:09 +00:00
Shuhei Matsumoto
2a6a64485c bdev/nvme: Add bdev_nvme_get_io_paths RPC to monitor I/O path states
Add an new RPC bdev_nvme_get_io_paths to query all active I/O paths.

One io_path belongs to One nvme_bdev_channel.
Each nvme_bdev_channel is associated with one nvme_bdev.

If the RPC bdev_nvme_get_io_paths has a bdev name as a parameter
it can use spdk_for_each_channel() simply for the corresponding
nvme_bdev.

However, users will want to know I/O paths of all nvme_bdevs like
the RPC bdev_get_bdevs.

One io_path has one nvme_qpair. One nvme_qpair belongs to one
nvme_poll_group. By relying on these relationships, the RPC
bdev_nvme_get_io_paths traverses all nvme_poll_groups by using
spdk_for_each_channel() to g_bdev_nvme_ctrlrs.

The RPC bdev_nvme_get_io_paths has two modes, display all or
the specified NVMe bdev's active I/O paths.

The specified bdev name is used just for comparison and empty
array is returned if no matched io_path is found.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I4a0dbf3ef7aaa9a7b7345fc03dc493cc6d37bc99
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12146
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-04-22 09:44:57 +00:00
Shuhei Matsumoto
2730f5cac0 bdev/nvme: Add cntlid to bdev_get_bdevs and bdev_nvme_get_controllers RPCs
NVMe bdev name already includes the name of the NVMe bdev controller and
the NSID. CNTLID will be a good ID to identify a namespace from a NVMe
bdev when multipath is configured. However, the query RPCs,
bdev_get_bdevs and bdev_nvme_get_controllers had not returned such
information.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I2f2e355ff13f69ced616be803a3152c838cdc980
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12276
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2022-04-22 09:44:57 +00:00
Shuhei Matsumoto
972a9f6c40 bdev/nvme: Add multipath info to the bdev_get_bdevs RPC
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Iacc3458a209e31b758455f55ab3bae276ae60dd8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12312
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-04-22 09:44:57 +00:00
Shuhei Matsumoto
50b6329ca0 bdev/nvme: Factor out ctrlr info json dump into a helper function
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I7f1e08ff13d890cb780e7b66c18a77ab85c82029
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12311
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-04-22 09:44:57 +00:00
Shuhei Matsumoto
13ca6e52d3 bdev/nvme: Handle ANA transition (change or inaccessible state) correctly
Previously, if a namespace is in ANA inaccessible state, I/O had been
queued infinitely. Fix this issue according to the NVMe spec.

Add a temporary poller anatt_timer and a flag ana_transition_timedout for
each nvme_ns.

Start anatt_timer if the nvme_ns enters ANA transition. If anatt_timer
is expired, set ana_transition_timedout to true. Cancel anatt_timer or
clear ana_transition_timedout if the nvme_ns exits ANA transition.

nvme_io_path_become_available() returns false if ana_transition_timedout
is true.

Add unit test case to verify these addition.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ic76933242046b3e8e553de88221b943ad097c91c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12194
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
2022-04-22 09:44:57 +00:00
Shuhei Matsumoto
da2fc15f2a bdev/nvme: Factor out updating ANA state of ns operation
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ib703f57c4bc00c7305856b2f0613fe68428c953e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12193
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-04-22 09:44:57 +00:00
paul luse
bf5aca3274 module/accel/idxd: change json write of kernel mode from U32 to bool
g_kernel_mode is a bool everywhere it is used but was written as a U32
in write_config_json routine.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I16b68b88a259df0d8240b64464729bd4a0ef84ec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12275
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <wayne.gao@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-04-21 08:12:37 +00:00
Shuhei Matsumoto
e63eebca1b bdev/nvme: Retry creating qpair if it fails when creating bdev channel
We may fail creating qpair when adding io_path while creating a bdev_channel
if connection is down. But if we enable I/O error recovery, we can retry
creating qpair later.

So let nvme_qpair_create() succeed if the ctrlr is being reset or
I/O error recovery is enabled even if creating qpair failed.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I7d4ff036187bb79ada258cfc299582b4d287018b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12288
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: <tanl12@chinatelecom.cn>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-04-20 10:56:54 +00:00
Shuhei Matsumoto
8cd418883d bdev/nvme: Call failover() instead of reset() if I/O qpair gets error first
Previously, only if admin qpair gets error, bdev_nvme_failover() was
called.

However, I/O qpair may get error earlier than admin qpair. In this case,
bdev_nvme_failover() was called but reset was already in progress. So
bdev_nvme_failover() returned without doing anything.

bdev_nvme_reset_complete() executes bdev_nvme_failover() if reset
failed. However the test time of test/nvmf/host/failover.sh was very
short. Timeout came before trying bdev_nvme_failover().

We can replace other bdev_nvme_reset() calls by bdev_nvme_failover()
but this patch focuses on the critical case.

Fixes issue #2128.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I68f54bbf54f92343aa56ae41f2b4cd92421c4bbb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12295
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>
2022-04-20 10:56:54 +00:00
zhangduan
87cfed8442 sock: Add ack_timeout to spdk_sock_opts
Due to the same reason as transport_ack_timeout for
RDMA transport, TCP transport also needs ack timeout.
This timeout in msec will make TCP socket to wait for
ack util closes connection.

Signed-off-by: zhangduan <zhangd28@chinatelecom.cn>
Change-Id: I81c0089ac0d4afe4afdd2f2c7e5bff1790f59199
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12214
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-04-14 08:34:29 +00:00
paul luse
37b68d7287 accel: cleanup by getting rid of capabilties enum
In support of upcoming patches and to greatly simplify things,
the capabilites enum which held bit positions for each opcode
has been removed.  Only the opcodes enum remains and thus only
opcodes are used throughout.  For the capabiltiies bitmap a helper
function is added to convert from opcode to bit position.  Right
now it is used in the IO path but in upcoming patches that goes away
and the conversion is only done at init time.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ic4ad15b9f24ad3675a7bba4831f4e81de9b7bc70
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11949
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-04-14 08:32:50 +00:00
yupeng
df80e8ffc6 bdev/raid: stop the raid bdev in raid_bdev_destruct
The raid bdev may receive IO requests after the raid layer
invokes spdk_bdev_unregister function. This patch moves the
raid_bdev->module->stop to the raid_bdev_destruct function.
Then there will be no IO after the raid_bdev->module->stop
is invoked.
Below is a way to reproduce this issue:
(1) create a malloc bdev
sudo ./scripts/rpc.py bdev_malloc_create --name malloc0 128 4096
(2) create a concat bdev base on the malloc bdev
sudo ./scripts/rpc.py bdev_raid_create --name concat0 \
--raid-level concat --base-bdevs malloc0 --strip-size-kb 4
(3) create a lvstore base on the concat bdev
sudo ./scripts/rpc.py bdev_lvol_create_lvstore \
--cluster-sz 4194304 --clear-method unmap concat0 lvs0
(4) remove the concat bdev
sudo ./scripts/rpc.py bdev_raid_delete concat0
In the step(4), the spdk app will crash because an IO request
is sent to the concat bdev after the concat_stop is invoked.

Signed-off-by: Peng Yu <yupeng0921@gmail.com>
Change-Id: I76d6964ee9528d4590ed86e9c5c28d53e85da32f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12221
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-04-13 08:33:19 +00:00
Jim Harris
0ab324dd2c bdev/pmem: add support for IO_TYPE_FLUSH
There's nothing to actually flush, the support just
immediately completes the command with success.

Fixes issue #2446.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib634bbb2dfc6f68b273a2d933d6c9b5dbfa03758
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12203
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: fengchunsong <fengchunsong@huawei.com>
Reviewed-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-04-11 07:43:23 +00:00
Ben Walker
c86778398b bdev/nvme: Remove ctrlr from nvme_ctrlr_channel
This was neither set nor used.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I3119135843c5fc0b8724e593db40df46e6b5bdb0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12097
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: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-04-07 07:23:56 +00:00
yupeng
64eebbd132 bdev/raid: Add concat module
The concat module can combine multiple underlying bdevs to a single
bdev. It is a special raid level. You can add a new bdev to the end of
the concat bdev, then the concat bdev size is increased, and it won't
change the layout of the exist data. This is the major difference
between concat and raid0. If you add a new underling device to raid0,
the whole data layout will be changed. So the concat bdev is extentable.

Change-Id: Ibbeeaf0606ff79b595320c597a5605ab9e4e13c4
Signed-off-by: Peng Yu <yupeng0921@gmail.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11070
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>
2022-04-05 07:39:00 +00:00
Alexey Marchuk
cff525d336 vbdev_gpt: Report memory domains
vbdev_gpt reports memory domains of its base
bdev if the base bdev is not configured to check
DIF refence tag since in that case bdev_part will
remap reftags thereby it will touch metadata.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ie1fee7f267c318b3cede47fbbbe9f7639571bdeb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11050
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-04-04 09:57:56 +00:00
Alexey Marchuk
be440c01c9 raid: Report memory domains
Use spdk_bdev_readv/writev_block_ext even when
there is no ext opts passed by bdev layer

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I0b9f17150cdba1a1023478bae745ab4438ea99bb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10070
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-04-04 09:57:56 +00:00
Alexey Marchuk
99719ef049 raid0: Use extended bdev rw API
That is a preparation for support of  memory domains
in bdev_raid

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I3a6e01eccd4d7e4bc197dc5ffe268d42081d41de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11429
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-04-04 09:57:56 +00:00
Shuhei Matsumoto
18c6e89d9a bdev/split: Use bdev_open_ext() for creation instead of bdev_get_by_name()
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I218816a01ddadd637ea37bfef99745c8580b8033
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12074
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-04-04 09:57:43 +00:00
Shuhei Matsumoto
e35849764a bdev/rbd: Use bdev_open_ext() for resize instead of bdev_get_by_name()
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Iaa6f43a2691e9b5095abd5e518239a45927cef11
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12073
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-04-04 09:57:43 +00:00
Shuhei Matsumoto
02e3c62cb1 bdev/null: Use bdev_open_ext() for resize instead of bdev_get_by_name()
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I9381aad017fae63b725deb21790bf4e3f717c88e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12072
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-04-04 09:57:43 +00:00
Shuhei Matsumoto
cf1e19c707 bdev/error: Use bdev_open_ext() to inject error instead of bdev_get_by_name()
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Iba05ed816c2ecb4346dd6a77e9579c6af6d2b06f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12071
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-04-04 09:57:43 +00:00
Shuhei Matsumoto
d77d3179f0 bdev/aio: Use bdev_open_ext() for rescan instead of bdev_get_by_name()
Use spdk_bdev_open_ext() + spdk_bdev_desc_get_bdev() +
spdk_bdev_close() instead of spdk_bdev_get_by_name().

Additionally, use bdev pointer instead of &fdisk->disk because it is
more readable.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I924595268e6785592a6e777e90a8c245a0346719
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12070
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-04-04 09:57:43 +00:00
Shuhei Matsumoto
2515621184 bdev/delay: Find delay_bdev directly from g_delay_node list
spdk_bdev_get_by_name() uses RB tree and is fast. However it is not
secure from race condition. We can use spdk_bdev_open_ext() instead
but what we want to get is not spdk_bdev but vbdev_delay.
vbdev_delay is managed by the g_delay_nodes list.

The g_delay_nodes includes only vbdev_delay. Even if its performance
is O(N), it is more intutive, more secure, and small list.

So replace spdk_bdev_get_by_name() by simple list traversal.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I3e184066e237e10132523591133900231055b5af
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12069
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-04-04 09:57:43 +00:00
Shuhei Matsumoto
4573e4cc23 module/bdev: Use spdk_bdev_unregister_by_name() if possible
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>
2022-04-04 09:57:43 +00:00
Shuhei Matsumoto
d3e394ae3f module/bdev: Send not boolean false but error response for deletion RPCs
For deletion RPCs, a boolean false response had been sent rather than
a error response when they failed. However, boolean false resonse had
caused false negative, that is, test code had regarded as success by
mistake. For example, the following test code regards as success if
JSON RPC returns a boolean false response.

	if $rpc_py bdev_pmem_delete $pmem_bdev_name; then
		error "bdev_pmem_delete deleted pmem bdev for second time!"
	fi

This patch fixes such false negative issue by explicitly returning a
error response if deletion RPCs fail.

Only the bdev_virtio_detach_controller RPC has implemented this.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I5409a070cbd2364dbb63b42421b032534c6f9a0b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12077
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>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
2022-04-04 09:57:43 +00:00
Tomasz Zawadzki
6301f8915d lib/sock: provide a hint to picking optimal poll group
The process of matching qpair to poll group is split into
two distinct parts that occur on different threads.
See spdk_nvmf_tgt_new_qpair().

This results in a race condition for TCP between spdk_sock_map_lookup()
and spdk_sock_map_insert(), which are called in spdk_nvmf_get_optimal_poll_group()
and spdk_nvmf_poll_group_add() respectively.

Fixes #2113

This patch picks a hint from nvmf_tcp for next poll group,
which is then passed down to spdk_sock_map_lookup().

When matching placement_id exists, but does not have
a poll group assigned - the hint will be used.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I4abde2bc9c39225c9f5dd7c3654fa2639bb0a27f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10271
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2022-04-01 12:41:26 +00:00
Jim Harris
0bd7ace836 bdev/nvme: add wait_for_attach param to discovery RPC
Setting this optional parameter to true makes the
RPC completion wait until the attach for all
discovered NVM subsystems have completed.

This is especially useful for fio or bdevperf, to
ensure that all of the namespaces are actually
available before testing.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Icf04a122052f72e263a26b3c7582c81eac32a487
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12044
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-04-01 10:03:45 +00:00
Rafal Stefanowski
494b1ba8e6 ocf/rpc: Add RPC method to manage sequential cutoff
Introduce bdev_ocf_set_seqcutoff RPC method for
changing OCF sequential cutoff policy and parameters.

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Change-Id: I509644115402c00c4a026c1c37e887c8fc90289f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8459
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-04-01 08:31:32 +00:00
Richael Zhuang
449cab9569 posix: update sendmsg_idx only if zerocopy is enabled
Sendmsg_idx is used in _sock_check_zcopy to check whether idx in
MSG_ERRQUEUE and req's idx match. There is no need to update
it if zerocopy is disabled.

Change-Id: I24bb367e0bff006782d9052470857f6e4db90681
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12104
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-04-01 08:31:07 +00:00
Shuhei Matsumoto
5fd1f68b63 sock/posix: Add MSG_NOSIGNAL to prevent SIGPIPE for a socket that may be closed
We try avoiding write a closed socket by checking if the return value
of recv() is zero. However it is not possible to completely avoid writing
a socket which is already closed by the target.

Repeatedly adding/removing listener in the NVMe-oF TCP target caused
SIGPIPE to the NVMe-oF initiator.

Fix the issue by adding MSG_NOSIGINAL to the flag of sendmsg().

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I273679c91c4b867792e966b1dc2121f6d2188f16
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12119
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: Aleksey Marchuk <alexeymar@mellanox.com>
2022-04-01 08:31:01 +00:00
Gal Hammer
a2340f36fa bdev/ocf: Fix set_data callback's data pointer check
The function returns -ENOBUFS when handling OCF_WRITE_FLUSH requests
on a disk with a size which its lower 32-bits are zeros. Zeroing the
request buffer length occurs when creating a new ocf_io and assigning
a 64-bit value to a 32-bit value in vbdev_ocf.c:io_handle.

This patch fixes the condition to check if the request have a payload
(data->iovs) before checking for the size limitation.

Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
Change-Id: I2c6d03fee32a8fbed7beffdac6fef6a478ea4211
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10896
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: Rafal Stefanowski <rafal.stefanowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-04-01 08:29:40 +00:00
Shuhei Matsumoto
963cb0038e bdev/nvme: disconnected_qpair_cb gets NOTICELOG only when disconnection was unexpected
After the change that the NVMe bdev module disconnects qpair asynchronously,
disconnected_qpair_cb() got NOTICELOG always when a qpair was disconnected
and freed. This was very noisy.

We have three cases that disconnected_qpair_cb() is called now, 1) qpair
was destroyed in a full ctrlr reset sequence, 2) the upper layer closed
I/O channel, and 3) qpair detected error, and was disconnected and freed.
Get NOTICELOG for 3) but get DEBUGLOG for 1) and 2) with some rewording.

Additionally, to improve readability, change if-else ordering.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ib63bcfd4b72a82a13d3cda208c71cdb40a42fd6b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12085
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: Aleksey Marchuk <alexeymar@mellanox.com>
2022-04-01 08:28:45 +00:00
Jim Harris
d086d56415 bdev/nvme: save discovery configuration
We want to be able to save the discovery configuration
in a generated JSON-RPC file.

The obvious change needed here is to add a
bdev_nvme_start_discovery RPC to the config file
for each discovery context.

But we also need to make sure we do not emit
bdev_nvme_attach_controller RPCs for controllers
that were attached via the discovery service.  These
controllers will be attached by the discovery service
instead - or maybe not at all if the discovery
log page returns different results.

Do both of these changes here, since they are
somewhat tied to each other.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic2072150c3efdd0a8d01da09e33a647e4929779b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11818
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-03-31 10:39:38 +00:00
Alexey Marchuk
ce49d2f91f bdev/compress: Update error handling in IO submission path
The only rc that we may get in _comp_bdev_io_submit func
is ENOTSUP. ENOMEM is not available since submission funcs
are void.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I8980644a02889c5e64a2b9b1382dff6d8a7ffa9b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11974
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-31 09:34:52 +00:00
Alexey Marchuk
f530abcab3 bdev/compress: Verify mbuf chain if the driver doesn't suppot SGL
With recent changes libreduce should provide correct buffers
if the driver doesn't support SGL in/out. This patch verifies
that we don't use SGLs when they are not supported.
Since even a single buffer can be split on 2MB page
boundary, it is not enough just to check iovs count.

Added asserts that the first elements of mbufs are
not null to avoid scan build errors

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I620e43bf5b1abd25cab412fe08346a6d767c9be9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11973
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-31 09:34:52 +00:00
Alexey Marchuk
731ddc7107 bdev/compress: Correctly free mbufs in error case
rte_pktmbuf_free frees the given mbuf and any chained mbufs.
It can cause double free of some mbuf if we free every mbuf
in a loop. Instead use rte_pktmbuf_free_bulk which correctly release
chained mbufs.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I55fd7832ff656f519a4ed2f02de8ef1a0f637a02
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11972
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-03-31 09:34:52 +00:00
Alexey Marchuk
bfd7fcb8fe bdev/compress: Update error handling of compress operation
In case of any error (except of device one) the compression
operation is queued for further resubmission. However in some
cases (e.g. mbufs config error or compress driver error) this
resubmission doesn't have any sense since we'll hit the same
problem later. This patch enqueues operations when there were
no mbufs or comp_operation descriptors or the compress operation
was not processed.

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I1e0eab5e4ea80f84d969814a916b6cd783a77fe1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11971
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>
2022-03-31 09:34:52 +00:00
Shuhei Matsumoto
c0415feda3 bdev/nvme: Copy prchk_flags from first to new ctrlr for multipath
When configuring multipath, if the first controller did not have
namespace#0 but the second controller had namespace#0, prchk_flags
was not set as expected because we could set prchk only for the first
controller.

This patch fixes the bug by copying prchk_flags from the first
controller to the following controllers.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ib866fc88bfdf981d1e89ef5a863f50ff41f4e159
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12050
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-03-29 07:32:41 +00:00
Shuhei Matsumoto
edb03a183f bdev/nvme: Simplify the code flow to handle multipath in bdev_nvme_attach_controller
This clean up makes the following patches a little easier.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I0415de9b99567b4de1ad7b35298ea51a664d4a32
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12049
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>
2022-03-29 07:32:41 +00:00
Shuhei Matsumoto
36e81f15ff bdev/nvme: Initialize nvme_ctrlr_opts by default values for hotplug case
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I677ce8e63a6b089406e95e9ed72526cacf836481
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12048
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>
2022-03-29 07:32:41 +00:00
Jim Harris
9da3d742ff bdev_nvme: add nvme_ctrlr::from_discovery_service
This keeps track if an nvme_ctrlr was created
implicitly by the discovery service.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I493b7cacfe563737f45a1fffca98855a1929a751
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11817
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-28 17:10:04 +00:00
Jim Harris
13cffc5e76 bdev_nvme: add timeout parameters to start_discovery RPC
These parameters will be used for any controller created
by the discovery service.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I221b791f38b9c5797ba084c647a98b82c102a121
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11942
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-28 17:10:04 +00:00
Jim Harris
9ff419a90e bdev/nvme: modify discovery_poller timer period
Attempt to start a connection once per second, but
after a connection is successfully started, change
the timer period to one millisecond instead.

This ensures lower response time to AER events when
the discovery controller is operational, but then
decreasing rate of unsuccessful connect attempts (and
associated log messages) if/when a discovery controller
fails.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie24036303f5b00f4a42b6575656f401ea4d578f2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11774
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-28 17:10:04 +00:00
Jim Harris
9f860c310f bdev/nvme: cycle through discovery paths on ctrlr failure
Also cycle through the discovery paths if the initial
connect_async() operation fails.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I50f36949d9bba0e3bff81505712076f1a1a7aad5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11773
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-28 17:10:04 +00:00
Jim Harris
68e5f0ae00 bdev/nvme: add detach step to discovery_poller
If a discovery controller fails at some point, we
will want to detach it.  This can happen separately
from detaching the controller because we are stopping
the discovery service.  So break out the ctrlr
detach operation into a separate phase of the
discovery_poller.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia601b767d32bda1c8899d3a95029781c0aeee136
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11772
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-28 17:10:04 +00:00
paul luse
bc72388eb6 modules/accel/ioat: remove duplicate call to free device
It's already done in ioat_destroy_cb(). Proper fix required moving
the rest of the cleanup code in accel_engine_ioat_exit() to a new
device unregister callback.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Iaaa595cf5b51f7a4842315fc06270b0857ebf0c5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11930
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-25 08:18:16 +00:00
paul luse
dacb66d7f4 module/accel/ioat: fix bug with 'fill' handling
Fill is sent in as a uint8, we need to populate the full uint64
input with the uint8 pattern or we'll get a miscompare. This is
how idxd was doing it, instead of adding the same code to ioat just
move it up a layer.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ia4aab1c6230f35ab88bb8a0e3b8e16dbd93007c7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11947
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-25 08:18:16 +00:00
Alexey Marchuk
8d48071a3e reduce: Add a check that driver supports SGL
Some compress drivers may not support SGL for in or
out buffers. Extend spdk_reduce_backing_dev with two
flags that will be used by reduce library to correctly
build iovs

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Icee9383364124888c2109894c959c06710d91250
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11968
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-25 08:17:56 +00:00
Jonas Pfefferle
6d9822c12b bdev/rbd: add unmap support
Add support for unmap operation.

Signed-off-by: Jonas Pfefferle <pepperjo@japf.ch>
Change-Id: I7acce77d002f833ecb50482ee00653cd91cbc0d1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11824
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2022-03-24 11:35:12 +00:00
Jonas Pfefferle
8ccdd956d2 bdev/rbd: add write zeroes support
Add write zeroes support to rbd bdev.

Change-Id: I77213709de612a750d6343021addf52db31d7bca
Signed-off-by: Jonas Pfefferle <pepperjo@japf.ch>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11823
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2022-03-24 11:35:12 +00:00
Yuriy Umanets
4a11579eaf bdev/crypto: Improved debug messages
- 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>
2022-03-24 09:21:35 +00:00
Yuriy Umanets
5ba9b78e17 bdev/crypto: Cleanup with crypto opts fields duplication
- 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>
2022-03-24 09:21:35 +00:00
Yuriy Umanets
1434e255ef bdev/crypto: Critical fix about using binary keys
- 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>
2022-03-24 09:21:35 +00:00
Yuriy Umanets
45f24aebe7 bdev/crypto: MLX5 AES_XTS general support
- General MLX5 crypto support.
- Unit-tests MLX5 crypto support.
- Documentation update to list the MLX5 driver as supported,
  enumerate the cipher algorithms and provide some configuration
  hints.

Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: I0da1f49f4acd068d75a4d8633f84fe626d774431
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11630
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-24 09:21:35 +00:00
Alexey Marchuk
c20dd8afee bdev: Add ext_opts in public bdev_io section
Bdev modules must not access internal bdev_io
structure, so add a new pointer in a public
section. Pointer in internal section will be
used in next patch

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ib631563015b3e5fa9300d22b7ae59d8db43c8275
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10421
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-23 09:01:40 +00:00
Ben Walker
f0bf4e75f5 idxd: Eliminate configs
SPDK has settled on what the optimal DSA configuration is, so let's
always use it.

Change-Id: I24b9b717709d553789285198b1aa391f4d7f0445
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11532
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2022-03-21 11:05:28 +00:00
Jim Harris
26d4436a52 bdev/nvme: rename discovery_ctx->detach to ->stop
Detach and stop are two different operations.  This
->detach field was used to denote when the associated
discovery service should be stopped.  So call the field
'stop' instead.  That may trigger the currently
attached discovery controller to be detached.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I61c7fc860cd9dbcfab71eedfd223c06c51a41f27
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11771
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-21 11:05:17 +00:00
Jim Harris
40a9d6a03e bdev/nvme: add entry_ctx_in_use
We will now keep a list of the possible paths to
the discovery subsystem.  One of them will be the
path we are currently connected to (which at service
start, is the path specified by the user).

Additional entries are added for discovery log page
entries referencing the discovery subsystem.

When the discovery service starts, we just have the
initial entry in the list - the discovery poller
tries to connect to it, and if the connect starts
successfully, removes it from the list and points
ctx->entry_ctx_in_use to it.

This will be useful later when we want to iterate
through the available paths to the discovery
subsystem if the current path fails.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5b18e0f20c4607e29ac0f12f27ba7eb169d0206d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11770
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-21 11:05:17 +00:00
Jim Harris
5428fb0133 bdev/nvme: add function to create an entry_ctx for discovery
This reduces some code duplication since the same
function will be reused in an upcoming patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id6764171ff93c95de49792a4488f2c205b8eddb6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11769
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-21 11:05:17 +00:00
Jim Harris
81587f0663 bdev/nvme: always defer start of discovery service
We used to wait until the discovery service could
connect to the discovery subsystem before calling
the callback function provided by the caller (mainly
the start_discovery RPC).

Moving forward, we will be handling the case where
the discovery subsystem is unavailable temporarily.
For now, let's not fail the bdev_nvme_start_discovery
call if we cannot connect to the discovery subsystem.
This will keep the initial service start path the same
as the path where the discovery subsystem is temporarily
unavailable.  In the future, we can consider adding
functionality to the start_discovery RPC that waits
up to X number of seconds to see if we were able to
connect and fail otherwise.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Icb05523b9d59f508bfbc0233595c8bf58c10488f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11768
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-21 11:05:17 +00:00
Shuhei Matsumoto
0b32309bf6 bdev/nvme: Check not only I/O qpair but also adminq when finding optimal I/O path
For RDMA transport, adminq will find transport error first because
usually only adminq polls CM events.

Change-Id: I7b22cc8883bf02198f1a90d2654c1de6f2e736e6
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11331
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: Ben Walker <benjamin.walker@intel.com>
2022-03-21 10:49:11 +00:00
Shuhei Matsumoto
3edbcba287 bdev/nvme: Factor out clearing all I/O path caches into a helper function
This is a preparation to the following patches.

Change-Id: I1bb0052c745d4f83ff621e4110907a8ac1f1d597
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11330
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: Ben Walker <benjamin.walker@intel.com>
2022-03-21 10:49:11 +00:00
Shuhei Matsumoto
3182be6d26 bdev/nvme: Fail fast I/O qpair if poll_group_process_completions() returns negated errno
If qpair is disconnected asynchronously, it takes time from detecting
transport error to actually disconnected. We should avoid using the
path as soon as possible after detecting any transport error.

Poll group clears I/O path cache if it finds transport error and avoid
using the path which had transport error.

These changes will reduce the failover time.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I00580159a84372a115ed5e62a6ce13eed4368999
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11329
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: Ben Walker <benjamin.walker@intel.com>
2022-03-21 10:49:11 +00:00
Shuhei Matsumoto
aca0d56e3d bdev/nvme: Reconnect ctrlr after it is disconnected at completion poller
spdk_nvme_ctrlr_disconnect() will be made asynchronous in the
following patches and so we will need to have some changes.

spdk_nvme_ctrlr_disconnect() disconnects adminq and ctrlr synchronously
now.

If spdk_nvme_ctrlr_disconnect() is made asynchronous,
spdk_nvme_ctrlr_process_admin_completions() will complete to disconnect
adminq and ctrlr, and will return -ENXIO only if adminq is disconnected.

However even now spdk_nvme_ctrlr_process_admin_completions() returns
-ENXIO if adminq is disconnected.

So as a preparation, set a callback before calling spdk_nvme_ctrlr_disconnect()
and call the callback if it is set and spdk_nvme_ctrlr_process_admin_completions()
returns -ENXIO.

Besides, fix the return value of bdev_nvme_poll_adminq() in this patch.

Change-Id: I2559f86bb8cf9a92b5b386ed816c00b08c9832df
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10950
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: Ben Walker <benjamin.walker@intel.com>
2022-03-21 10:49:11 +00:00
Shuhei Matsumoto
a76bbe3553 bdev/nvme: Disconnect and then free I/O qpair in a ctrlr reset sequence
As we do when deleting ctrlr_channel, disconnect and then free I/O
qpair in a ctrlr reset sequence.

Deleting ctrlr_channel and resetting ctrlr_channel may cause conflicts.
This patch processes such conflicts correctly.

If destroy_ctrlr_channel_cb() is executed between pending and executing
reset_destroy_qpair(), reset_destroy_qpair() is not executed because
ctrlr_channel is not found. In this case, destroy_qpair_channel()
starts disconnecting qpair and deletes ctrlr_channel. Then
disconnected_qpair_cb() releases a reference to poll group.

If destroy_ctrlr_channel_cb() is excuted between executing reset_destroy_qpair()
and disconnected_qpair_cb(), destroy_ctrlr_channel_cb() skips
ctrlr_channel for a reset sequence.

Change-Id: I1f49f74b94aefbea178680aa53ded3a12876c676
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10766
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: Ben Walker <benjamin.walker@intel.com>
2022-03-21 10:49:11 +00:00
Yuriy Umanets
8ec34933e9 bdev/crypto: Add qp_desc_nr to struct vbdev_crypto
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>
2022-03-16 08:20:03 +00:00
Yuriy Umanets
0d857f441c bdev/crypto: Zero out key and key2 before release.
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>
2022-03-16 08:20:03 +00:00
Yuriy Umanets
15a5bd8264 bdev/crypto: Rename AES_CBC_IV_LENGTH to IV_LENGTH
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>
2022-03-16 08:20:03 +00:00
Liu Xiaodong
884bcfcf15 bdev_nvme: update reset_start_tsc for failover
When connection is disconnected, bdev_nvme will call
bdev_nvme_failover, and then reset the controller.
nvme_ctrlr->reset_start_tsc should be updated in function
bdev_nvme_failover, then bdev_nvme_check_xxx_timeout can
work well.

Change-Id: I99b639545e9dd4082cdc14696bb7872cb4917b1d
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11957
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: Changpeng Liu <changpeng.liu@intel.com>
2022-03-16 08:19:58 +00:00
Krzysztof Karas
32da70152f scheduler: create and parse JSON values for dynamic scheduler params
Creates a JSON on scheduler side to return after .get_opts is called
and parses a JSON on .set_opts call.

The JSON passed to dynamic scheduler on .set_stats is a copy of a
pointer already available during RPC framework_set_scheduler call.

Getting and setting scheduler stats via RPC calls is going to be
implemented in the next patch in this series.

Change-Id: I62880a71066a140c74336a5725e7b10952008e5c
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11448
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-03-16 08:19:26 +00:00
Shuhei Matsumoto
068ca77ab2 bdev/nvme: Disconnect and then free I/O qpair when deleting ctrlr_channel
For RDMA transport, current synchronous qpair disconnect occupied CPU for
a second when qpair disconnect gets timeout.

To remove this limitation, we will do the following:
- make spdk_nvme_ctrlr_disconnect_io_qpair() asynchronous,
- spdk_nvme_qpair_process_completions() returns -ENXIO only if the
  qpair is actually disconnected.

Even at this patch, spdk_nvme_poll_group_process_completions() invokes
disconnected_qpair_cb only if a qpair is actually disconnected. This
behavior will be maintained.

To use the upcoming asynchronous qpair disconnect easily, when
deleting a ctrlr_channel, disconnect the qpair, and then free the qpair
and release a reference to the poll group when the qpair is actually
disconnected.

We need to delete a nvme_qpair asynchronously after the corresponding
nvme_ctrlr_channel is deleted and defer the deletion of the corresponding
nvme_ctrlr until the nvme_qpair is deleted. To satisfy this requirement,
utilize the reference count of the nvme_ctrlr.

disconnected_qpair_cb() may call spdk_nvme_ctrlr_free_io_qpair() and
spdk_io_device_unregister() successively. The spdk_io_device_unregister()
will execute spdk_nvme_detach_async() from its callback.
spdk_nvme_ctrlr_free_io_qpair() has to complete earlier than
spdk_nvme_detach_async() starts. spdk_nvme_ctrlr_free_io_qpair() is
executed after unwinding stack. spdk_nvme_detach_async() is executed
after sending a message. Sending message is later than unwinding stack.
Hence the requirement is satisfied naturally.

spdk_io_device_unregister() for the nvme_ctrlr is required to be called
on the nvme_ctrlr->thread. To satisfy this requirement, redirect
nvme_ctrlr_unregister() to the nvme_ctrlr->thread. This change is too
small to stand as an independent patch. So include the change in this
patch.

Change-Id: Id8c01966c40b1dae9c4ef17f1b0b3f60a0bd17d5
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10765
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>
2022-03-15 09:05:09 +00:00
Shuhei Matsumoto
c113e4cdca bdev/nvme: Alloc qpair context dynamically on nvme_ctrlr_channel
This is another preparation to disconnect qpair asynchronously.

Add nvme_qpair object and move the qpair and poll_group pointers and
the io_path_list list from nvme_ctrlr_channel to nvme_qpair. nvme_qpair
is allocated dynamically when creating nvme_ctrlr_channel, and
nvme_ctrlr_channel points to nvme_qpair.

We want to keep the times of references at I/O path. Change nvme_io_path
to point nvme_qpair instead of nvme_ctrlr_channel, and add
nvme_ctrlr_channel pointer to nvme_qpair.

nvme_ctrlr_channel may be freed earlier than nvme_qpair. nvme_poll_group
lists nvme_qpair instead of nvme_ctrlr_channel and nvme_qpair has a
pointer to nvme_ctrlr.

By using the nvme_ctrlr pointer of the nvme_qpair, a helper function
nvme_ctrlr_channel_get_ctrlr() is not necessary any more. Remove it.

Change-Id: Ib3f579d3441f31b9db7d3844ec56c49e2bb53a5d
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11832
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-03-15 09:05:09 +00:00
Shuhei Matsumoto
c1b0b339cf bdev/nvme: Refactor create/destroy_ctrlr_channel_cb()
The following patches will have the following changes.

Add nvme_qpair object and move qpair and poll_group pointers and
the io_path_list list from nvme_ctrlr_channel to nvme_qpair. nvme_qpair
is allocated dynamically when creating nvme_ctrlr_channel, and
nvme_ctrlr_channel points to nvme_qpair.

qpair is disconnected asynchronously and nvme_ctrlr_channel is
deleted asynchronously.

To make the following patches simpler, refactor two functions,
bdev_nvme_create_ctrlr_channel_cb() and
bdev_nvme_destroy_ctrlr_channel_cb(). The details are as follows.

Factor out nvme_qpair_create() from bdev_nvme_create_ctrlr_channel_cb()
and factor out nvme_qpair_delete() from
bdev_nvme_destroy_ctrlr_channel_cb(). Then reorder a few operation
in these.

Additionally, reorder a operation in _bdev_nvme_add_io_path().

Change-Id: Idf0328fa77a54f40fe52ca72c3842dde82d55972
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11831
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>
2022-03-15 09:05:09 +00:00
Shuhei Matsumoto
d7f0a1820e bdev/nvme: Inline bdev_nvme_destroy_qpair()
In the following patches, spdk_nvme_ctrlr_disconnect_io_qpair() will
be changed to be asynchronous, spdk_nvme_ctrlr_disconnect_io_qpair()
will be called first and then spdk_nvme_ctrlr_free_io_qpair() after
the qpair is actually disconnected.

We will not be able to keep the current bdev_nvme_destroy_qpair()
function.

As a preparation, inline bdev_nvme_destroy_qpair() and remove it.

Additionally, this patch has the following changes.

Previously I/O qpair was freed and then I/O path caches were cleared.
Both are SPDK thread local. So there is no dependency for the ordering
of these two operations. However, it will reduce the size of the
following patches if we clear I/O path caches before freeing I/O qpair
when the qpair is disconnected. Hence we clear I/O path caches and then
free I/O qpair.

Remove DTRACE for bdev_nvme_destroy_qpair() for now.
It will be restored in the following patches.

Furthermore, fix potential NULL pointer acces in
bdev_nvme_create_qpair().

Change-Id: I0ab78ccb0d240e56b95b53179341afcd909a31f6
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10746
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-03-15 09:05:09 +00:00
Shuhei Matsumoto
0fba8dc8cb bdev/nvme: I/O error resiliency can be configured by global options
Add three options for I/O error resiliency to spdk_nvme_bdev_opts.
Then the RPC bdev_nvme_set_options can configure these.
These can be overridden if these are given by the RPC bdev_nvme_attach_controller.

Change-Id: If3ee23aeef8b7585fe0fb5ec4695df5866fc1e74
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11830
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>
2022-03-15 09:05:09 +00:00
Jim Harris
002b25cc5a bdev_nvme: use INFOLOG for discovery messages
This is not in the fast path, so using INFOLOG
instead of DEBUGLOG allows these messages to be
enabled in release builds.

While here, set this flag in the discovery.sh
test script so that we get better information if
there are test failures.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1c0d087b5c0cb40118691f4a1bc16adc2fdaad9c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11932
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-14 08:44:21 +00:00
Richael Zhuang
3ee923eff1 uring: fix heap-use-after-free bug in sock_flush_client
If the req's cb_fn will close the socket, there is heap-use-after-free
error if continuing to access sock.

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Change-Id: I88c6adb9d25e52d94b08f53e8ccac611c4d29fff
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11855
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-11 08:04:59 +00:00
John Levon
c4f7ddd2c7 lib/nvme: report shadow doorbell update stats
Currently shadow doorbell updates are not counted; add statistics for
those, and rename the other statistic for clarity.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I211a77902e38265c99b15862034c6d022dc582a0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11844
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-10 09:49:25 +00:00
Krzysztof Karas
fcf5ae7e4e scheduler: prepare scheduler code for dynamic changes
Change dynamic scheduler parameters from #define to
global variables.

Change-Id: I5bbbf40ac66971bcc24fc8bf0ac5d13efdc7412f
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11447
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-03-09 13:33:21 +00:00
John Levon
ba4ffda671 lib/nvme: correct typo in transport stats
"doorbell" not "doobell"

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I9261559576e72a09b63fbc984ae0ec2a2572eb2c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11841
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-03-09 08:03:42 +00:00
Shuhei Matsumoto
00a7998254 bdev/nvme: Move per controller settings into a option structure
The following patches will enable us to specify I/O error resiliency
options per nvme_ctrlr as global options. To do it easier, move
per controller options about I/O error resiliency into struct nvme_ctrlr_opts.

prchk_flags is not exactly for resiliency but move it into struct
nvme_ctrlr_opts too.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I85fd1738bb6e293cd804b086ade82274485f213d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11829
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>
2022-03-09 08:00:45 +00:00
Shuhei Matsumoto
df32eb112b bdev/nvme: Add helper functions to decode T10 DIF parameters
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: If218cbc8ee0a5354e5c4e58eaae111660eb9c099
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11828
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>
2022-03-09 08:00:45 +00:00
Shuhei Matsumoto
d40292d05a bdev/nvme: Add prefix "drv_" to instance or pointer of spdk_nvme_ctrlr_opts
The following patches will add options per struct nvme_ctrlr in the
NVMe bdev module. bdev_opts will be used for it.

Additionally, fabrics_connect_timeout_us is set directly to
spdk_nvme_ctrlr_opts. So remove it from the RPC request structure.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I981cda5e69375edc43a8581cd3b43497c38a3d56
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11827
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>
2022-03-09 08:00:45 +00:00
Shuhei Matsumoto
1a00f5c094 bdev/nvme: Fix overflow of RB tree comparison when the NSID is very big
If 0 - UINT32_MAX or UINT32_MAX - 0 is substituted into a int variable,
we cannot get any expected result.

Fix the bug and add unit test case to verify the fix.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ib045273238753e16755328805b38569909c8b83a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11836
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: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2022-03-09 08:00:45 +00:00
Yuriy Umanets
c58d5161e9 bdev/crypto: Fixed g_session_mp init error handling
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>
2022-03-08 15:07:46 +00:00
Yuriy Umanets
bfb676e93d bdev/crypto: Fixed bdev_io double completion
_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>
2022-03-08 15:07:46 +00:00
Yuriy Umanets
3d0bae35c4 bdev/crypto: Error handling fixes in vbdev_crypto_claim()
- 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>
2022-03-08 15:07:46 +00:00
Jim Harris
43d17a844c bdev/nvme: handle detach first in discovery_poller
This will be helpful in later patches, when we handle
detach not just at discovery service stop, but also
when a discovery controller is disconnected.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie62d62f73b328c6e058f6480c61fbdf91e854e2a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11767
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-08 07:52:49 +00:00
Jim Harris
a96c1bfdbd bdev/nvme: change order of add/remove for discovery
If the path to a subsystem changes from one discovery
log to the next, we should add the new paths first,
and only then remove paths.  This ensures we don't
remove the last path to a subsystem, causing associated
bdevs to get unregisterd and reregistered.

This requires adding a new log_page member to
discovery_ctx, since we now need to walk the log
page to find removed paths after all the new paths
are attached.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I99fc2e40e6f7e2e26d558ebe7bc5208fe474c0ea
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11766
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-03-08 07:52:49 +00:00
paul luse
89ee5a13bf module/bdev/compress: print a reasonable message on create error
Specifically when a compress bdev already exists on the supplied
base.  Before this you'd get a bunch of nasty messages providing
really no clue as to what was wrong.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I8cce8902909659fba0e9613891c7ef8ebe4b06d0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11806
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>
2022-03-08 07:50:49 +00:00
paul luse
8951c15759 accel/idxd: add and respect flag to support writes to PMEM
Plumbing for flags was added in prior pathces.  This patch
introduces and respects the relevant flags for use with PMEM
aka durable memory through the accel_fw, IDXD, IOAT and SW
modules.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I792f31459e061d220965feced60e0c236d819a68
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9455
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-04 21:56:54 +00:00
paul luse
12c40f05e2 accel: plumb accel flags through operations that need them
This patch is just plumbing the flags param. Use of it for PMEM
will come in upcoming patches.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I620df072aaad3f8062a0312bbea3da1bc3f911b9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9281
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-04 21:56:54 +00:00
paul luse
7d63e716eb idxd: Add flags parameter to all low level API for prep/submission
Previously required flags were hardcoded in the low level library.
By having the user pass them in there is more flexbility and control.
This was driven by the need to add a new flag for pmem durability,
coming in a future patch in this series.

There is no change in functionality with this patch, just movement
of where flags are set and by whom and the plumbing of 'flags'..

Also note that some flags in scenarios that we know are required are
still set by the library.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I194278f9e3cec0886628585cf84bcc2eae635e0a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9449
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-04 21:56:54 +00:00
Yuriy Umanets
5990c4ecef bdev/crypto: Close device on errors during init
- Always stop/close crypto devices properly on error handling in
vbdev_crypto_init_crypto_drivers().
- Stop/close crypto devs during finalization in vbdev_crypto_finish().
- When finalizing device qp, check for dev id. Maintain g_qat_total_qp
  counter correctly.

Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: I285788c562007847d9fc5921eb59b59cc73920bf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11627
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2022-03-04 09:40:04 +00:00
Yuriy Umanets
9afa85b543 bdev/crypto: Fixed page boundary bug in _crypto_operation()
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
2022-03-04 09:40:04 +00:00
Yuriy Umanets
ddb443751b bdev/crypto: Cancel re-enqueue in crypto_dev_poller()
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>
2022-03-04 09:40:04 +00:00
Yuriy Umanets
8ecf8dfcd7 bdev/crypto: Continue init after AESNI_MB failure
- 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>
2022-03-04 09:40:04 +00:00
Yuriy Umanets
a837ea37da bdev/crypto: Switched to pkt_mbuf API
- 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>
2022-03-04 09:40:04 +00:00
Yuriy Umanets
03d9c67139 bdev/crypto: Error handling in create_vbdev_dev()
- 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>
2022-03-04 09:40:04 +00:00
Yuriy Umanets
706d2c1dc1 bdev/crypto: Fixes with json export
- 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>
2022-03-04 09:40:04 +00:00
Kefu Chai
a7d174e2ef bdev/null: call spdk_bdev_module_fini_done() even if not registered
in bdev subsystem, if any of the bdev module fails to initialize in
bdev_modules_init(), this function just stops immediately. in general,
the non-zero rc is returned to the callback func passed to spdk_subsystem_init().
if spdk app is used for building the spdk application, it's very
likely that app_start_rpc() is used as this very callback func.
in this case, app_start_rpc() would just pass the `rc` to spdk_app_stop()
which tears down all subsystems one after another.

bdev tears itself down by calling all its modules' module_fini(),
including those whose .module_init never gets called. the problem is,
if a bdev module marks its `.async_fini` true, and it calls
spdk_bdev_module_fini_done() only if spdk_io_device_unregister(),
then a bdev module which fails to initialize would leave us an spdk
application hanging in the air.

a typical logging message sequence looks like:

[2022-02-27 20:47:13.766578] bdev.c:1438:spdk_bdev_initialize: *ERROR*: bdev modules init failed
[2022-02-27 20:47:13.766622] subsystem.c: 169:spdk_subsystem_init_next: *ERROR*: Init subsystem bdev failed
[2022-02-27 20:47:13.766638] app.c: 691:spdk_app_stop: *WARNING*: spdk_app_stop'd on non-zero
[2022-02-27 20:47:13.766658] thread.c:2050:spdk_io_device_unregister: *ERROR*: io_device 0x10d3c30 not found

this is exactly the case we could run into if a bdev module fails to
initialize and bdev_null is unable to call spdk_bdev_module_fini_done()
when being teared down, because spdk_io_device_unregister() just refuses
to call the callback if the I/O device is never registered.

since `g_null_read_buf` is set in bdev_null_initialize(), in this change,
this pointer is checked for zero before calling spdk_io_device_unregister(),
if it is NULL, spdk_bdev_module_fini_done() is called directly instead
of calling spdk_io_device_unregister(). this helps to address the
hanging issue.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
Change-Id: I3a41fcd2f1c986e416dacecd5ca352dfd1e379b7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11750
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-03-02 08:39:40 +00:00
Rafal Stefanowski
c39647df83 bdev/ocf: Improve OCF mpools
- Reduce the size of initial memory needed by OCF.
  Number of allocator buffers equal to 16383 is tested to work
  on 24 caches running IO of io_size=512 and io_depth=512, which
  should be more than enough for any real life scenario.
  This reduces initial OCF memory usage from 726 MiB to 392 MiB.
- Fix string handling for the name of the mempool.

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Change-Id: I40063ab1897c479c25904ae4096c5dae3351f73b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10843
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-03-02 08:34:39 +00:00
Jim Harris
84bec316c2 bdev/nvme: add additional DEBUGLOGs for discovery
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iba16c5f3273fe2335b847b6bd396e45aa97da7c9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11734
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-02-28 11:06:16 +00:00
Jim Harris
bcb75753dc bdev/nvme: add DISCOVERY_DEBUGLOG/ERRLOG
These macros are used to prefix the following to
any discovery-related DEBUGLOG or ERRLOG:

Discovery[127.0.0.1:8009]

Inside the brackets are the traddr and trsvcid of
the discovery service associated with that message.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib1991a13f550bb8c9aaf1194a56b218cbd71c96c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11733
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-02-28 11:06:16 +00:00
Jim Harris
9614dca9f9 bdev/nvme: save the trid of the discovery service
This is useful for adding trid details to discovery
related log messages in a later patch.

Future patches will update this trid if the
current discovery ctrlr fails and we need to fail
over to a different path to the discovery subsystem.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I51712bab2d891ae9c683f8716b4228741f64e7db
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11732
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-02-28 11:06:16 +00:00
Jim Harris
a0690464dd bdev/nvme: allocate discovery_entry_ctx for discovery subsystems
For now, just allocate entries and put them on a new TAILQ on
the discovery_ctx.  Future patches will use these to try
to reattach to the discovery subsystem if the current discovery
ctrlr fails.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3cd841df2260bbe8a497bbbf36dea4a1081f25c0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11731
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-02-28 11:06:16 +00:00
Jim Harris
21aa2ba37e bdev/nvme: move discovery_attach_cb up in file
It will be referenced in a second location in
an upcoming patch, so move its definition now to
reduce the size of that patch and avoid a forward
declaration.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iae12cc613190c03f0d48d71475df98384f8e47c7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11730
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-02-28 11:06:16 +00:00
Jim Harris
9b04bd8d5c bdev_nvme: rename discovery_ctrlr_ctx to discovery_entry_ctx
This name better describes the purpose of this structure.
Currently it is used to represent discovery log page entries
for NVM subsystems found by the discovery service.  Upcoming
patches will also use this structure to represent discovery
log page entries for the discovery subsystem.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I84996c9968200c50c32427f0233cb707cdc2d54c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11547
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-02-28 11:06:16 +00:00
Jim Harris
09240a1c3c bdev/nvme: don't connect to discovered discovery subsystems
For now, if the discovery service finds a discovery subsystem,
don't connect to it.  Support for nested discovery controllers
will be coming soon, but for now we need to make sure we don't
try to connect to a discovery subsystem as if it was an NVM
subsystem.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I00234718b0e39eda6e1cb1b1150a4fadcf6d8b11
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11546
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-02-28 11:06:16 +00:00
Shuhei Matsumoto
ecdbaa2310 bdev/nvme: Call spdk_free() to the object allocated by spdk_malloc()
This is a bug fix. free() was called to the object allocated by
spdk_malloc().

Hence

  free(): invalid pointer: 0x00002000146ece00

was printed.

This was found during multipath testing.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Icf6aa6dcdda728fef91b3acad7a1f1ee219c27af
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11710
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-02-24 14:56:03 +00:00
John Levon
5f27092835 thread: add spdk_thread_exec_msg()
A common pattern is:

	if (foo->thread == spdk_get_thread())
		cb(arg);
	else
		spdk_thread_send_msg(foo->thread, cb, arg);

for cases where it's important the callback runs on a particular thread,
but it doesn't matter if it's synchronous or asynchronous.

Add a new API to support this pattern, and convert over the current
instances.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Idfbf77c02c9321c52e07181ffd8b0c437e1ab335
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11503
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-02-23 10:06:49 +00:00
Alexey Marchuk
b5b752792f bdev/aio: Correct error message when IO fails
structure io_event defined in aio_abi.h has
res member with type __s64 which is typically
mapped to long long int.
When we print error message, res member can be
treated as an error code.

In the following error message:
	failed to complete aio: requested len is 4096, but
	completed len is 18446744073709551611
the last digit in int representation is -5 which is -EIO

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reported-by: Anil <aniruddha080699@gmail.com>
Change-Id: I33b98d2118bbc9cace2d9da7cf9cd9bd06d784e6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11453
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-02-22 09:03:51 +00:00
zgu3
af2bd57875 bdev/nvme/bdev_nvme_rpc.c: apply_firmware_complete: free bdev_io after each command finish
apply_firmware_complete bug fix: after each
firmware image download command finished,
apply_firmware_complete is called and issue the next
firmware image download command, and get another bdev_io.
After last command, apply_firmware_complete_reset
only release the last bdev_io, and all the ios in previous
commands are not release.
So after rpc_bdev_nvme_apply_firmware cycling,
the io pool will be used up and cause assert.

Signed-off-by: Gu, Zhimin <kookoo.gu@intel.com>
Change-Id: Icb1c722d85b1985521e5f25031ae70557b7ba84a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11586
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-02-17 17:10:21 +00:00
Jim Harris
5d2d253125 nvmf: remove deprecated conn_sched parameter
This parameter was ignored, and was a parameter to the
nvmf_set_config RPC.

For reference, this was deprecated in June 2020, commit
c37cf9fb.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I013f4d7cf874e7e26a8a1d299fdf9d8fa05da580
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11544
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-02-15 14:38:37 +00:00
Shuhei Matsumoto
0ee07a484e bdev/nvme: Missing newline (\n) for SPDK_ERRLOG
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I77711a6d3fdbaf6698ebec5a233cf6cd795726ba
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11401
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
2022-02-09 18:06:15 +00:00