Commit Graph

1153 Commits

Author SHA1 Message Date
Denis Barakhtanov
3d7851e011 bdev/daos: Add object class parameter
A new `oclass` parameter allow to specify DAOS DFS object class that is
responsible for data redundancy and protection.

Examples of the object classes could be found here: https://github.com/daos-stack/daos/blob/master/src/include/daos_obj_class.h

The default value is OC_SX for the max IOPS.

Signed-off-by: Denis Barakhtanov <denis.barahtanov@croit.io>
Change-Id: Ia48681832458c2266eb7c3bcae0df2055e59e309
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15006
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-10-25 07:12:06 +00:00
Denis Barakhtanov
bdc683aaa9 bdev/daos: add resize rpc call
Signed-off-by: Denis Barakhtanov <denis.barahtanov@croit.io>
Change-Id: I71d643733e31eb2229649cff3db610d5bee07796
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14921
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
2022-10-21 07:19:17 +00:00
Yuhua
4c6a2e3daa bdev/aio: implement read-only
Support Aio bdev 'readonly' option in RPC call. The read-only flag
can be dumped from the bdev info. Any writes on a read-only aio bdev
will be fail.

Signed-off-by: Yuhua <yuhua@smartx.com>
Change-Id: I939f72479f8953a3678a8df3083ecce0f96844fb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14955
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2022-10-21 07:18:15 +00:00
gongwei
6f445382a8 bdev_iscsi: add bdev iscsi config json
save bdev iscsi opts config

Signed-off-by: gongwei <gongwei833x@gmail.com>
Change-Id: I9601098b426b8c080ae374f2fa1c23eec14f140b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14898
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-10-17 12:37:36 +00:00
Artur Paszkiewicz
9cf1ab5b1c module/raid: fix async module stopping
If the module stop handler is asynchronous we must wait until it
finishes before unregistering the io_device.

Change-Id: I149b716d9f4b0c1680b3e43b395fc9ec5b90d70c
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14717
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
c2eea87ac4 raid5f: calculate and write parity
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Ia1b82d555c966b9b291eeb2426c42846b93e7fec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7703
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
7131bec415 raid5f: full stripe writes
Implement support for full stripe writes without parity calculation.

The size and alignment of write IOs must be a multiple of full stripe
size. To reflect this, the raid bdev's write_unit_size is set
accordingly. We rely on the bdev layer to split larger IOs based on
that.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I6940280ad870f3bd678fd19346b06ba4bdadd52e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7702
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
c89e20084b module/raid: support for raid module private io channel
Let the raid modules create their own IO channels by implementing the
get_io_channel callback.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Id4f6c90721474edd70a6e987c67f8f774737da27
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7700
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
95a0494902 module/raid: fix device destruction
Move device cleanup to spdk_io_device_unregister() callback. This fixes
a case when the device would be freed before its last io channel was
closed, leading to use after free condition.

Repurpose raid_bdev_free() to actually free the bdev.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Ib667b4d5ac1b34a0f2dda69f6b0775d9363dbfee
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11398
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
77bddc0f96 raid5f: read support
Depend on bdev layer to send down chunk sized IOs, based on
optimal_io_boundary.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Iec45f4917117d35c3a9e807940e49091dfcba870
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7699
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 22:52:45 +00:00
Changpeng Liu
8b260d5c92 virtio/vfio_user: add virtio_scsi device support
Example usage using `bdevperf` as the client:

Start `spdk_tgt` with created virtio_scsi device:
1. scripts/rpc.py bdev_malloc_create -b malloc0 $((512)) 512
2. scripts/rpc.py vfu_virtio_create_scsi_endpoint vfu.0 --cpumask 0x1 --num-io-queues=4 \
                                                  --qsize=128 --packed-ring
3. scripts/rpc.py vfu_virtio_scsi_add_target vfu.0 --scsi-target-num=0 --bdev-name malloc0

Start `bdevperf`:
1. test/bdev/bdevperf/bdevperf -r /var/tmp/spdk.sock.1 -g -s 2048 -q 128 -o 4096 \
                               -w randread -t 30 -m 0x2
2. scripts/rpc.py -s /var/tmp/spdk.sock.1 bdev_virtio_attach_controller --dev-type scsi \
                  --trtype vfio-user --traddr vfu.0 VirtioScsi0
3. test/bdev/bdevperf/bdevperf.py -s /var/tmp/spdk.sock.1 perform_tests

Change-Id: Id95908a5243e9a224a9bd709a22b87740c50b835
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13897
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-09-29 19:42:56 +00:00
Changpeng Liu
295e54d144 virtio/vfio_user: add virtio_blk device support
Add vfio-user transport support based on existing virtio client
library.

Test steps using bdevperf:

Start `spdk_tgt` with created virtio_blk device:
1. build/bin/spdk_tgt
2. scripts/rpc.py bdev_malloc_create -b malloc0 $((512)) 512
3. scripts/rpc.py vfu_virtio_create_blk_endpoint vfu.0 --bdev-name malloc0 \
                                                 --cpumask=0x1 --num-queues=2 \
                                                 --qsize=256 --packed-ring

Start `bdevperf`:
1. test/bdev/bdevperf/bdevperf -r /var/tmp/spdk.sock.1 -g -s 2048 -q 128 -o 4096 \
                               -w randread -t 30 -m 0x2
2. scripts/rpc.py -s /var/tmp/spdk.sock.1 bdev_virtio_attach_controller --dev-type blk \
                  --trtype vfio-user --traddr vfu.0 VirtioBlk0
3. test/bdev/bdevperf/bdevperf.py -s /var/tmp/spdk.sock.1 perform_tests

Change-Id: I368c4becebbca57328a25fc750e41c353420e481
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13896
Community-CI: Mellanox Build Bot
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>
2022-09-29 19:42:56 +00:00
Krishna Kanth Reddy
78ff96bb73 bdev_xnvme: free bdev_xnvme structure after device is fully unregistered
Fix for the issue 2702.
spdk_bdev plugin crashes while handling xnvme devices.

xnvme_queue_term gets invoked after the bdev_xnvme_free executes and
frees the xnvme structures. xnvme_queue_term references the xnvme->dev
structure, after it is freed, resulting in a segmentation fault.

Implemented a bdev_xnvme_destruct_cb, that frees the xnvme structures
after the xnvme_queue_term invokes and the device is fully unregistered.

Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I9338c84baf4b61ec2e0d324e67bfefcb96485156
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14680
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: Konrad Sztyber <konrad.sztyber@intel.com>
2022-09-28 06:47:35 +00:00
Indraneel M
5eafc3a279 bdev/uring: Proper handling for conventional zones
Identify and properly handle conventional zones (in smr drives) by using
zone type and WP state. Bdevs supporting zoned devices(like uring, nvme and
vbdev_zone_block) now update the zone type information. As a result, the
fio plugin now uses this info instead of hard coding the zone type.
Also adds new WP state(ZONE_STATE_NOT_WP) for handling zones w/o WP.

Signed-off-by: Indraneel M <Indraneel.Mukherjee@wdc.com>
Change-Id: If031e0742d68c55c35e95ddc33d478939bbd52fe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14572
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
2022-09-27 19:40:44 +00:00
Simon A. F. Lund
cfe5d18823 bdev/xnvme: enable polling on io_uring_cmd
Fixes #2708 for io_uring_cmd.

This is a minimal approach to enabling polling for bdev_xnvme. Ideally,
more would be done, however, there are several blockers to remove when
doing so. Thus, this commit only enables polling on
io_mechanism=io_uring_cmd.

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: Ifa604b52bb2b924fab4b559fae06f26a3574db42
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14679
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-09-27 15:36:32 +00:00
Krzysztof Karas
dfc9894396 bdev: send bdev reset based on outstanding IO and a new timeout parameter
A new parameter io_drain_timeout has been added to spdk_bdev
structure. If this value is unset, the bdev reset behavior
does not change.
The io_drain_timeout controls how long a bdev reset must wait for IO
to complete prior to issuing a reset to the underlying device.
If there is no outstanding IO at the end of that period, the reset
is skipped.

Change-Id: I585af427064ce234a4f60afc3d69bc9fc3252432
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14501
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
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-22 19:18:30 +00:00
Shuhei Matsumoto
2826ef13ce bdev/nvme: Fail reset sequence immediately if ctrlr is already removed.
After a controller was hot-removed, if a reset sequence started to
the controller, spdk_nvme_ctrlr_disconnect() failed and caused core
dump in debug mode.

When implemented, how to cause the failure and how to process the
failure were not clear. Hence assert was added to detect the
failure.

We know how we cause the failure now. Let's handle the failure
appropriately.

If spdk_nvme_ctrlr_disconnect() fails, we are on the nvme_ctrlr->thread.
Hence call bdev_nvme_reset_complete() with failure immediately.

Even if spdk_nvme_ctrlr_disconnect() completes synchronously, the
completion callback is executed asynchronously when polling an adminq.

Hence set the completion callback only if spdk_nvme_ctrlr_disconnect()
succeeds.

Fixes issue #2632

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I11f61853aba9eca2515592f964a291e59def7247
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13892
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-21 07:52:44 +00:00
Shuhei Matsumoto
6439abc0d8 bdev/nvme: Ignore failure of I/O qpair creation if reconnect and retry are enabled
By a recent improvement, failure of I/O qpair creation is ignored
if the nvme_ctrlr is being reset or scheduled to reconnect.

However, failure of I/O qpair creation is not ignored if a new I/O
channel is allocated. It is normal to allocate a new I/O channel
when a nvme_ctrlr is being reset or scheduled to reconnect.

Fix this bug by relaxing the condition to ignore the result of
bdev_nvme_create_qpair() to if reconnect_delay_sec is non-zero and
bdev_retry_count is non-zero.

If reconnect_delay_sec is non-zero, reconnect will be tried sooner
or later, and if bdev_retry_count is non-zero, submitted IOs will be
queued until it succeeds.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Icf26e1ea65d292f9b8d24966abe25907d2cc33ec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14446
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-09-21 07:52:44 +00:00
Artur Paszkiewicz
d1dd6ca814 ftl: check structure sizes for future ABI compatibility
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Ic32f6fe085d94b00d025b6cab7e5073341169a73
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13677
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-09-20 19:24:26 +00:00
Artur Paszkiewicz
1790ee8a8d ftl: I/O statistics
Add gathering of some performance counters and RPC for printing them.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Change-Id: I2e77d37fb66459240ff2e241f2b1f77c60f4eef4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13390
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-20 19:24:26 +00:00
Tomasz Zawadzki
69bcb185f3 bdev/xnvme: save xnvme bdevs from runtime
config_json callback is used to preserve all
bdevs that were created during application runtime.

xnvme bdev module was missing this callback.

While here, io_mechanism is now saved in the bdev_xnvme
structure for reference in the config_json.
Haven't seen an option to pull this from xnvme itself.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1a88ad2bb761f589d214fec8f0690c38572824d6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14116
Reviewed-by: Michal Berger <michal.berger@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-19 13:12:07 +00:00
jun.ran
488d6e84c4 bdev_aio: handle unexpected res=0 correctly
If res = 0, do not pass this value directly to bdev io completion function,
otherwise it will be treated as a successful completion.
Fix issue: 2679

Signed-off-by: jun.ran <ranjunsh@163.com>
Change-Id: Ice525de1bb5b0ada9ac30d3b59e5c731419efe2f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14364
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-16 13:32:40 +00:00
Damiano Cipriani
67bb33160a vbdev_lvol: Implement SEEK_[DATA,HOLE] io type
Two functions have been added to implement bdev io type
SEEK_DATA and SEEK_HOLE. Blob functions to find next
[un]allocated io_unit are used

Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
Change-Id: Ic3be3c0c86bd3010a23ba2681f0f00c62abcaaba
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14362
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-15 08:23:56 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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