Commit Graph

19402 Commits

Author SHA1 Message Date
John Levon
9fa252375a util: add spdk_iov_one()
It's common to set up an iovec around a single buffer; add a helper for
this.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Ic4183e29d78549ec102045c6af0b5ff448cb5c59
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16192
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>
2023-01-16 09:38:43 +00:00
John Levon
47568c65de util: add spdk_iov_memset()
And use it in a couple of places.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I4b86cef0e9489c1435c0206dd6c5cda4ffe4d33a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16191
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>
2023-01-16 09:38:43 +00:00
MengjinWu
eb7506a1b4 lib/thread: iobuf get/put functions will not add offset
When a buffer is get, it does not need to reserve the space
for tailq header.

Signed-off-by: MengjinWu <mengjin.wu@intel.com>
Change-Id: I0aa2d77739fbb86a6e2df1c00a772aff1cb7c6e4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16181
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>
2023-01-16 08:35:33 +00:00
Jim Harris
6b97cccf34 bdev, bdev_nvme: deprecate VTUNE support
This VTune integration was added many years ago, but
hasn't been tested and to my knowledge is not being
used by anyone.  The statistics it enables are very
limited, specific to the bdev nvme module with no
insight into the rest of an SPDK application.

So deprecate this support now, we will remove it
immediately after the v23.01 release.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5552d85084c350e9d0b2570946801acd65a89d64
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16294
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-01-16 08:30:47 +00:00
Dennis Maisenbacher
2aa7fa7002 nvmf: Set required ZNS opcodes for NVMe-oF ZNS support
In order to connect to a zoned SPDK NVMe-oF target the ZNS specific
identify functions must be implemented and the supported ZNS opcodes
must be set accordingly.

Enable the zone management send and receive opcodes within the
`g_cmds_and_effect_log_page`. If the backing zoned bdev supports the
zone append command the `nvmf_get_cmds_and_effects_log_page` function
will respect that in the returned data structure.

Signed-off-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com>
Change-Id: Id9dd22a8696aa28177cc52e1f3587e10194de910
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16045
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-16 08:30:34 +00:00
Dennis Maisenbacher
a36785df71 nvmf: Add ZNS specific identify functions for NVMe-oF ZNS support
In order to connect to a zoned SPDK NVMe-oF target the ZNS specific
identify functions must be implemented and the supported ZNS opcodes
must be set accordingly.

Implementing ZNS specific identify functions to return the 'I/O Command
Set specific Identify Namespace data structure (CNS 05h)'
(`spdk_nvmf_ns_identify_iocs_specific`) and 'I/O Command Set specific
Identify Controller data structure (CNS 06h)'
(`spdk_nvmf_ctrlr_identify_iocs_specific`).

Those functions return a null filled data structure for any I/O Command
Set other than ZNS.

Signed-off-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com>
Change-Id: I6b9529ce0a86400afb01d4e09cbdb3e5c3a68514
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16044
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-16 08:30:34 +00:00
Kozlowski Mateusz
102d266d1a lib/ftl: Update alignment layout's region
Layout's regions need to be aligned to write unit size.
Calculate the exact amount of bands needed for metadata, rather than
assuming 1 band is enough.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Mariusz Barczak <mariusz.barczak@intel.com>
Change-Id: Ib304ea65a35d8b34518efda02379072355c0cd10
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16218
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>
Community-CI: Mellanox Build Bot
2023-01-16 08:28:28 +00:00
Kozlowski Mateusz
dd94984927 lib/ftl: Update L2P management initialization flow
It fixes segmentation fault in cleanup path of L2P
after failure in L2P initialization.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Mariusz Barczak <mariusz.barczak@intel.com>
Change-Id: I1cffa2b39550421939731509c5a51c1565f0fa91
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16216
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>
2023-01-16 08:28:28 +00:00
Kozlowski Mateusz
9bd8b264ec lib/ftl: Update GC band selection mechanism
Don't let the invalidity value continuously drop in degenerate scenarios -
previously could have happened if band_cmp picked based on other value, when invalidity is similar.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Mariusz Barczak <mariusz.barczak@intel.com>
Change-Id: I33166501e832cd7f359b3acef1e614cf9b1288d5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16215
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>
2023-01-16 08:28:28 +00:00
Shuhei Matsumoto
723b1c5021 bdev/raid0: Factor out block count calculation of raid0 bdev
Factor out block count calculation of raid0 bdev into a helper
function raid0_calculate_blockcnt(). This helper function will be used
to support resize in the following patches.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ie99d8686897f1249f48ef8985cb1c8347028fccf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16283
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-01-16 08:24:16 +00:00
Shuhei Matsumoto
c9224e267d bdev/raid: Handle resize event from a base_bdev
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Id22973cf7ce49e8bbfec16c4518dfd3a7033c61a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16259
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-01-16 08:24:16 +00:00
Changpeng Liu
eb5789ceae test/vfio_user: use 2048MiB static memory size for bdevperf
Previously we use 1024MiB static memory for bdevperf, but it may invoke
DPDK dynamic memory allocation when calling `spdk_zmalloc`, and this
part of new memory region isn't registered to remote target process,
vfio-user like solution is designed for pre-allocated memory, so here
we can increase the static memory size as a workaround.

Also add debug log when testing.

Fix issue #2846.

Change-Id: I509093a12a63db2c9e9797da10eab9b5ee0b3aac
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16141
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>
2023-01-16 08:22:08 +00:00
Changpeng Liu
312a6511db module/vfu_virtio: add IO path debug flag
The new flag is used in the data processing path.

Change-Id: I93dfc00003d370f8505cc3d334aea161024e2435
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16265
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>
2023-01-16 08:22:08 +00:00
Karol Latecki
a6b62f3221 test/nvmf: reduce connect_disconnect iterations
Reduce connect-disconnect iterations to 5 to
save execution time. 5 should be enough for a
basic test which is significantly extended in
nightly version.

Change-Id: I44549ccb96f69e925471acc91a1704a0b9e61d2b
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16212
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-01-16 08:16:12 +00:00
Changpeng Liu
ac6ed1e540 test/vfio_user: update VFIO-USER QEMU version
Branch `vfio-user-patch1-noreq` is recommended to use for VFIO-USER
VM test cases now.

Change-Id: I8550d995795d923483877d9a81063f198a65d74a
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15914
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-01-16 08:13:32 +00:00
GangCao
bf94bb78c4 lib/blobfs: add the missing lock operation
Change-Id: I9d02357688a11d06c5afb3d8be90a1f3b1927333
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16266
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-13 08:55:34 +00:00
Karol Latecki
9c53c34656 test/nvmf: unmask nvme disconnect in tests
We're not doing any type of "negative" testing here
so we don't expect "nvme disconnect" to fail in
these tests so that would be neccesary to mask it.

Change-Id: Id8ae8706d33f1db74f5e5da811bb542859b55c44
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16211
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>
2023-01-13 08:55:21 +00:00
Karol Latecki
6c502fa7c0 test/nvmf: reduce workload runtime in host/timeout
Running 20sec workload multiple times in the test
takes some time. Reduce the run times to shorten
the execution.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I4ecfa9d48f7ccaabb2a3707093da7662b5e5e807
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16214
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>
2023-01-13 08:55:21 +00:00
Karol Latecki
4b3210bd7d test/nvmf: remove sleeps from nvmf_vfio_user test
This should save a few seconds of execution time.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I96ade7da77ee9031fc20e7d93d3ab130b9d9be1e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16213
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>
Reviewed-by: Michal Berger <michal.berger@intel.com>
2023-01-13 08:55:21 +00:00
Karol Latecki
83c8db4919 scripts/nvmf_perf: allow sharing initiator CPU cores
Each fio job section will get unique CPU cores
assigned based on the number of numjobs value.
In case of high number of fio jobs or high numjobs
parameter value we might eventually run out of
CPU cores to assign. Allow regenerating list
of available CPU cores. This allows to run the
test, but as a result CPU cores might be shared
between fio threads.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I69b1713e640d9343d68b26317f4caccdcec3cddd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16240
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>
2023-01-13 08:54:59 +00:00
Karol Latecki
cdab715b28 scripts/nvmf_perf: add irq_settings option
Allow user to specify the way IRQ alignment for
network interfaces used in test should be done.

Change-Id: Ib835d2ac2bc0c7b79474e617de32b96a483e436b
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15737
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-13 08:54:59 +00:00
Karol Latecki
7be3200f55 scripts/nvmf_perf: don't build unit tests on initiator side
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I44763a3fef9e05042623749b6fbc387a485becf1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15736
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2023-01-13 08:54:59 +00:00
Karol Latecki
70066e0c38 scripts/nvmf_perf: enable LTO on initiator side
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: Icc62a586f59448242087e3d78e73e5fb76022a7d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15735
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Jaroslaw Chachulski <jaroslawx.chachulski@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2023-01-13 08:54:59 +00:00
Karol Latecki
87b94e3b1d scripts/nvmf_perf: manually pick fio allowed cpus
Fio "numa_cpu_nodes" parameter (which tells fio
which NUMA node to use to pick cpus for the job)
seemed promising, but manually adjusting
"cpus_allowed" seems to have better results.

Change-Id: I113566ad0dd1d32fb5a1e989725b257e3ccff4c0
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14842
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>
2023-01-13 08:54:59 +00:00
Changpeng Liu
d6db5988c5 test/vhost: use light IO workloads for live migration tests
Use lightweight workload test cases in VM for the purpose
to keep number of dirty pages is in low rate of VM's total
memory.

Fix issue #2805.

Change-Id: I52efd0d0522ccef713ba2c3a451daac0683234dc
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15954
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>
2023-01-13 07:47:10 +00:00
Shuhei Matsumoto
4f33deb89c bdev/nvme: Cache non-optimized path for active/active policy
Non-optimized path was not cached for active/active policy unexpectedly.
Fix the bug in this patch.

This will simplify the code and will be helpful to add more algorithms a
little.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I233d9fa6eca73b1e0fb850c7ea4b3474aff6fc1d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16190
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: Richael <richael.zhuang@arm.com>
2023-01-13 00:47:04 +00:00
Shuhei Matsumoto
8346b57397 bdev/nvme: Unify _bdev_nvme_find_io_path() and bdev_nvme_find_next_io_path()
Unify _bdev_nvme_find_io_path() and bdev_nvme_find_next_io_path()
into _bdev_nvme_find_io_path() by modifying nvme_io_path_get_next().

For active/passive policy, _bdev_nvme_find_io_path() is called only if
nbdev_ch->current_io_path is NULL. Hence, the prev parameter is not
necessary anymore.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: If61b8a24b768a1d571c0033b91d9d9bd487b5cf7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16189
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: Richael <richael.zhuang@arm.com>
2023-01-13 00:47:04 +00:00
Shuhei Matsumoto
7baa78c86c bdev/nvme: Refactor _bdev_nvme_find_io_path() to cache non-optimized path for active/active
nbdev_ch->current_io_path is NULL at initialization.
bdev_nvme_find_io_path() calls _bdev_nvme_find_io_path() if
nbdev_ch->current_io_path is NULL. If there is no optimized path,
nbdev_ch->current_io_path is not filled. Hence, as long as there is no
optimized path, bdev_nvme_find_next_io_path() is never called.

However, bdev_nvme_find_next_io_path() fills nbdev_ch->current_io_path
even if the found path is non optimized.

This is a contradiction and a bug.

To fix this bug, as a preparation, refactor _bdev_nvme_find_io_path() to
cnosolidate bdev_nvme_find_next_io_path() and _bdev_nvme_find_io_path()
into a single function because  bdev_nvme_find_next_io_path() and
_bdev_nvme_find_io_path() were almost identical.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I7bc4107ce6ae6f116dee03c9bb67d9e4061ce775
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16188
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: Richael <richael.zhuang@arm.com>
2023-01-13 00:47:04 +00:00
Shuhei Matsumoto
ae620784bd bdev/nvme: Retry I/O to the same path if error is I/O error
When an I/O gets an I/O error, the I/O path to which the I/O was
submitted may be still available. In this case, the I/O should be
retried to the same I/O path. However, a new I/O path was always
selected for an I/O retry.

For the active/passive policy, the same I/O path was selected naturally.
However, for the active/active policy, it was very likely that a
different I/O path was selected.

To use the same I/O path for an I/O retry, add a helper function
bdev_nvme_retry_io() into bdev_nvme_retry_ios() and replace
bdev_nvme_submit_request() by bdev_nvme_retry_io(). bdev_nvme_retry_io()
checks if nbdev_io->io_path is not NULL and is available. Then, call
_bdev_nvme_submit_request() if true, or call bdev_nvme_submit_request()
otherwise. For I/O path error, clear nbdev_io->io_path for
clarification. Add unit test to verify this change.

Linux kernel native NVMe multipath already takes this approach. Hence,
this change will be reasonable.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I7022aafd8b1cdd5830c4f743d64b080aa970cf8d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16015
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Richael <richael.zhuang@arm.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-01-13 00:47:04 +00:00
Shuhei Matsumoto
6fa7cf97d0 bdev/nvme: io_complete_nvme_status() caches bio->io_path in local variable
The following patches will clear bio->io_path when the error is a
network path error. As a preparation, cache bio->io_path to a local
variable io_path.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I0a25f4a70dd1064702b2037283bddd6e789dfae1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16014
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>
2023-01-13 00:47:04 +00:00
Shuhei Matsumoto
02acec4e26 bdev/nvme: Factor out abort to-be-retried I/O into a helper function
This is in the same effort as gathering all retry functions into the
same place. This will make the following patches easier.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: If2a017ebda45eb1eaf0dc93b15d02b4122dc3be0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15958
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>
2023-01-13 00:47:04 +00:00
Shuhei Matsumoto
47e4c931e8 bdev/nvme: Relocate abort_retry_ios() to gather related functions
Relocate abort_retry_ios() in a file to gather all retry functions
in the same place.

I/O retry is very complex and an improvement will be added in the
following patches. This will make the following patches easier.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I84751bd078db4aef753dcc533320cee9aa09c9b2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15957
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>
2023-01-13 00:47:04 +00:00
Shuhei Matsumoto
21160add26 bdev/nvme: Factor out request submit functions into a helper function
The following patches will change I/O retry to use the same io_path if
it is still available. However, bdev_nvme_submit_request() always calls
bdev_nvme_find_io_path() first. For I/O retry, if possible, we want to
skip calling bdev_nvme_find_io_path() and use nbdev_io->io_path instead.
To reuse the code as much as possible and not to touch the fast code
path, factor out request submit functions from
bdev_nvme_submit_request() into _bdev_nvme_submit_request().

While developing this patch, a bug/mismatch was found such that
bdev_io->internal.ch was different from ch of
bdev_nvme_submit_request(). Fix it together in this patch.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Id003e033ecde218d1902bca5706c772edef5d5e5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16013
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>
2023-01-13 00:47:04 +00:00
Parameswaran Krishnamurthy
2796687d54 nvme: Added support for TP-8009, Auto-discovery of Discovery controllers for NVME initiator using mDNS using Avahi
Approach:
Avahi Daemon needs to be running to provide the mDNS server service. In the SPDK, Avahi-client library based client API is implemented.
The client API will connect to the Avahi-daemon and receive events for new discovery and removal of an existing discovery entry.

Following sets on new RPCs have been introduced.

scripts/rpc.py bdev_nvme_start_mdns_discovery -b cdc_auto -s _nvme-disc._tcp

User shall initiate an mDNS based discovery using this RPC. This will start a Avahi-client based poller
looking for new discovery events from the Avahi server. On a new discovery of the discovery controller,
the existing bdev_nvme_start_discovery API will be invoked with the trid of the discovery controller learnt.
This will enable automatic connection of the initiator to the subsystems discovered from the discovery controller.
Multiple mdns discovery instances can be run by specifying a unique bdev-prefix and a unique servicename to discover as parameters.

scripts/rpc.py bdev_nvme_stop_mdns_discovery -b cdc_auto

This will stop the Avahi poller that was started for the specified service.Internally bdev_nvme_stop_discovery
API will be invoked for each of the discovery controllers learnt automatically by this instance of mdns discovery service.
This will result in termination of connections to all the subsystems learnt by this mdns discovery instance.

scripts/rpc.py bdev_nvme_get_mdns_discovery_info

This RPC will display the list of mdns discovery instances running and the trid of the controllers discovered by these instances.

Test Result:

root@ubuntu-pm-18-226:~/param-spdk/spdk/build/bin# ./nvmf_tgt -i 1 -s 2048 -m 0xF
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_start_mdns_discovery -b cdc_auto -s _nvme-disc._tcp
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_mdns_discovery_info
[
  {
    "name": "cdc_auto",
    "svcname": "_nvme-disc._tcp",
    "referrals": [
      {
        "name": "cdc_auto0",
        "trid": {
          "trtype": "TCP",
          "adrfam": "IPv4",
          "traddr": "66.1.2.21",
          "trsvcid": "8009",
          "subnqn": "nqn.2014-08.org.nvmexpress.discovery"
        }
      },
      {
        "name": "cdc_auto1",
        "trid": {
          "trtype": "TCP",
          "adrfam": "IPv4",
          "traddr": "66.1.1.21",
          "trsvcid": "8009",
          "subnqn": "nqn.2014-08.org.nvmexpress.discovery"
        }
      }
    ]
  }
]
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_discovery_info
[
  {
    "name": "cdc_auto0",
    "trid": {
      "trtype": "TCP",
      "adrfam": "IPv4",
      "traddr": "66.1.2.21",
      "trsvcid": "8009",
      "subnqn": "nqn.2014-08.org.nvmexpress.discovery"
    },
    "referrals": []
  },
  {
    "name": "cdc_auto1",
    "trid": {
      "trtype": "TCP",
      "adrfam": "IPv4",
      "traddr": "66.1.1.21",
      "trsvcid": "8009",
      "subnqn": "nqn.2014-08.org.nvmexpress.discovery"
    },
    "referrals": []
  }
]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_get_bdevs
[
  {
    "name": "cdc_auto02n1",
    "aliases": [
      "600110d6-1681-1681-0403-000045805c45"
    ],
    "product_name": "NVMe disk",
    "block_size": 512,
    "num_blocks": 32768,
    "uuid": "600110d6-1681-1681-0403-000045805c45",
    "assigned_rate_limits": {
      "rw_ios_per_sec": 0,
      "rw_mbytes_per_sec": 0,
      "r_mbytes_per_sec": 0,
      "w_mbytes_per_sec": 0
    },
    "claimed": false,
    "zoned": false,
    "supported_io_types": {
      "read": true,
      "write": true,
      "unmap": true,
      "write_zeroes": true,
      "flush": true,
      "reset": true,
      "compare": true,
      "compare_and_write": true,
      "abort": true,
      "nvme_admin": true,
      "nvme_io": true
    },
    "driver_specific": {
      "nvme": [
        {
          "trid": {
            "trtype": "TCP",
            "adrfam": "IPv4",
            "traddr": "66.1.1.40",
            "trsvcid": "4420",
            "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.0"
          },
          "ctrlr_data": {
            "cntlid": 3,
            "vendor_id": "0x0000",
            "model_number": "SANBlaze VLUN P3T0",
            "serial_number": "00-681681dc681681dc",
            "firmware_revision": "V10.5",
            "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.0",
            "oacs": {
              "security": 0,
              "format": 1,
              "firmware": 0,
              "ns_manage": 1
            },
            "multi_ctrlr": true,
            "ana_reporting": true
          },
          "vs": {
            "nvme_version": "2.0"
          },
          "ns_data": {
            "id": 1,
            "ana_state": "optimized",
            "can_share": true
          }
        }
      ],
      "mp_policy": "active_passive"
    }
  },
  {
    "name": "cdc_auto00n1",
    "aliases": [
      "600110da-09a6-09a6-0302-00005eeb19b4"
    ],
    "product_name": "NVMe disk",
    "block_size": 512,
    "num_blocks": 2048,
    "uuid": "600110da-09a6-09a6-0302-00005eeb19b4",
    "assigned_rate_limits": {
      "rw_ios_per_sec": 0,
      "rw_mbytes_per_sec": 0,
      "r_mbytes_per_sec": 0,
      "w_mbytes_per_sec": 0
    },
    "claimed": false,
    "zoned": false,
    "supported_io_types": {
      "read": true,
      "write": true,
      "unmap": true,
      "write_zeroes": true,
      "flush": true,
      "reset": true,
      "compare": true,
      "compare_and_write": true,
      "abort": true,
      "nvme_admin": true,
      "nvme_io": true
    },
    "driver_specific": {
      "nvme": [
        {
          "trid": {
            "trtype": "TCP",
            "adrfam": "IPv4",
            "traddr": "66.1.2.40",
            "trsvcid": "4420",
            "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.2.0"
          },
          "ctrlr_data": {
            "cntlid": 1,
            "vendor_id": "0x0000",
            "model_number": "SANBlaze VLUN P2T0",
            "serial_number": "00-ab09a6f5ab09a6f5",
            "firmware_revision": "V10.5",
            "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.2.0",
            "oacs": {
              "security": 0,
              "format": 1,
              "firmware": 0,
              "ns_manage": 1
            },
            "multi_ctrlr": true,
            "ana_reporting": true
          },
          "vs": {
            "nvme_version": "2.0"
          },
          "ns_data": {
            "id": 1,
            "ana_state": "optimized",
            "can_share": true
          }
        }
      ],
      "mp_policy": "active_passive"
    }
  },
  {
    "name": "cdc_auto01n1",
    "aliases": [
      "600110d6-dce8-dce8-0403-00010b2d3d8c"
    ],
    "product_name": "NVMe disk",
    "block_size": 512,
    "num_blocks": 32768,
    "uuid": "600110d6-dce8-dce8-0403-00010b2d3d8c",
    "assigned_rate_limits": {
      "rw_ios_per_sec": 0,
      "rw_mbytes_per_sec": 0,
      "r_mbytes_per_sec": 0,
      "w_mbytes_per_sec": 0
    },
    "claimed": false,
    "zoned": false,
    "supported_io_types": {
      "read": true,
      "write": true,
      "unmap": true,
      "write_zeroes": true,
      "flush": true,
      "reset": true,
      "compare": true,
      "compare_and_write": true,
      "abort": true,
      "nvme_admin": true,
      "nvme_io": true
    },
    "driver_specific": {
      "nvme": [
        {
          "trid": {
            "trtype": "TCP",
            "adrfam": "IPv4",
            "traddr": "66.1.1.40",
            "trsvcid": "4420",
            "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1"
          },
          "ctrlr_data": {
            "cntlid": 3,
            "vendor_id": "0x0000",
            "model_number": "SANBlaze VLUN P3T1",
            "serial_number": "01-6ddce86d6ddce86d",
            "firmware_revision": "V10.5",
            "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1",
            "oacs": {
              "security": 0,
              "format": 1,
              "firmware": 0,
              "ns_manage": 1
            },
            "multi_ctrlr": true,
            "ana_reporting": true
          },
          "vs": {
            "nvme_version": "2.0"
          },
          "ns_data": {
            "id": 1,
            "ana_state": "optimized",
            "can_share": true
          }
        }
      ],
      "mp_policy": "active_passive"
    }
  },
  {
    "name": "cdc_auto01n2",
    "aliases": [
      "600110d6-dce8-dce8-0403-00010b2d3d8d"
    ],
    "product_name": "NVMe disk",
    "block_size": 512,
    "num_blocks": 32768,
    "uuid": "600110d6-dce8-dce8-0403-00010b2d3d8d",
    "assigned_rate_limits": {
      "rw_ios_per_sec": 0,
      "rw_mbytes_per_sec": 0,
      "r_mbytes_per_sec": 0,
      "w_mbytes_per_sec": 0
    },
    "claimed": false,
    "zoned": false,
    "supported_io_types": {
      "read": true,
      "write": true,
      "unmap": true,
      "write_zeroes": true,
      "flush": true,
      "reset": true,
      "compare": true,
      "compare_and_write": true,
      "abort": true,
      "nvme_admin": true,
      "nvme_io": true
    },
    "driver_specific": {
      "nvme": [
        {
          "trid": {
            "trtype": "TCP",
            "adrfam": "IPv4",
            "traddr": "66.1.1.40",
            "trsvcid": "4420",
            "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1"
          },
          "ctrlr_data": {
            "cntlid": 3,
            "vendor_id": "0x0000",
            "model_number": "SANBlaze VLUN P3T1",
            "serial_number": "01-6ddce86d6ddce86d",
            "firmware_revision": "V10.5",
            "subnqn": "nqn.2014-08.com.sanblaze:virtualun.virtualun.3.1",
            "oacs": {
              "security": 0,
              "format": 1,
              "firmware": 0,
              "ns_manage": 1
            },
            "multi_ctrlr": true,
            "ana_reporting": true
          },
          "vs": {
            "nvme_version": "2.0"
          },
          "ns_data": {
            "id": 2,
            "ana_state": "optimized",
            "can_share": true
          }
        }
      ],
      "mp_policy": "active_passive"
    }
  }
]
root@ubuntu-pm-18-226:~/param-spdk/spdk#

root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_stop_mdns_discovery -b cdc_auto
root@ubuntu-pm-18-226:~/param-spdk/spdk#
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_mdns_discovery_info
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_nvme_get_discovery_info
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk# scripts/rpc.py bdev_get_bdevs
[]
root@ubuntu-pm-18-226:~/param-spdk/spdk#

Signed-off-by: Parameswaran Krishnamurthy <parameswaran.krishna@dell.com>
Change-Id: Ic2c2e614e2549a655c7f81ae844b80d8505a4f02
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15703
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-by: <qun.wan@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-12 17:22:48 +00:00
GangCao
b3785e87c5 lib/event: free the resource in the error case
Change-Id: I99474b93aae545cc7a2524659e3216c98f619665
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16207
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>
2023-01-12 08:15:42 +00:00
MengjinWu
9e9da4675f nvmf/tcp: fix async bugs when ddgst enalbed
If host disconnect the connection when fabric commands are offload to
DSA, there will be use-after-free problems.

Now, disable the offload of fabrics command.

Fix issue 2828

Signed-off-by: MengjinWu <mengjin.wu@intel.com>
Change-Id: I669b01728e1ad275b7b121d47141bdf3fe5f7d9f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15992
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2023-01-12 08:15:27 +00:00
Jaroslaw Chachulski
941cf96d3c pkgdep/git: add slirp devel package to Qemu installation
From Qemu 7.2 slirp submodule has been removed from the Qemu source tree
which affects "-net user" in vhost-vs-qemu tests

Signed-off-by: Jaroslaw Chachulski <jaroslawx.chachulski@intel.com>
Change-Id: I2ab69dc8eccafe3649bf1c67f8dd310585c50eaa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15894
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Michal Berger <michal.berger@intel.com>
2023-01-12 08:14:18 +00:00
Jim Harris
34bc24f10f pkgdep: add avahi package dependencies
This will enable NVMe mDNS discovery implementation
and testing in future patches.

Signed-off-by: Parameswaran Krishnamurthy <parameswaran.krishna@dell.com>
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic8de8e463b07b5b9d260781175d117766acdab9e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16254
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Boris Glimcher <Boris.Glimcher@emc.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-12 07:20:42 +00:00
Hailiang Wang
cec20de824 scripts/rpc.py: fix missing argument for bdev_ftl_unload
There is an error:
./scripts/rpc.py bdev_ftl_unload -b ftl0
Traceback (most recent call last):
  File "./scripts/rpc.py", line 3290, in <module>
    call_rpc_func(args)
  File "./scripts/rpc.py", line 3191, in call_rpc_func
    args.func(args)
  File "./scripts/rpc.py", line 2124, in bdev_ftl_unload
    print_dict(rpc.bdev.bdev_ftl_unload(args.client, name=args.name))
TypeError: bdev_ftl_unload() missing 1 required positional argument: 'fast_shutdown'

Change-Id: I3adf213d5aa8b97dee9a1e1b2db74a162fc0b760
Signed-off-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16177
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: <qun.wan@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
2023-01-11 09:28:30 +00:00
Jim Harris
935721bb1e iscsi_top: remove application
This application has not been maintained for at least
two years, let's just remove it rather than updating
it.  Original intent was to monitor iSCSI I/O
processed on each core, if we decide it's important
to still provide this kind of analysis for iSCSI it
would be better to incorporate it into spdk_top
instead most likely.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I4093ab1357ccc06c8a6770f7f87238b510bb20d4

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16219
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-01-11 09:28:08 +00:00
GangCao
3ecf99d65a app/spdk_top: check the valid pointer earlier
Change-Id: I162d90257e7bf23cff9b9adc84b811f79c404da2
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16178
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>
2023-01-11 09:27:43 +00:00
Jim Harris
544a8fe597 build, config: add CONFIG_HAVE_LIBARCHIVE
Always add -larchive to DPDK static link args if
libarchive is available.  This is less fragile than
previous mechanism of trying to remove
RTE_HAS_LIBARCHIVE to keep DPDK from trying to use it.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib26fc204927d8967b98d416373fc91446169d5af
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15951
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-01-11 09:27:17 +00:00
Jim Harris
5e258e979a build: remove spdk.nvmecli.mk
This was a Makefile snippet used to build the now
unsupported SPDK nvme-cli fork.  That fork hasn't
been updated in 4 years, but this file was never
removed from the main SPDK repo.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I81a83f035d4f721d93b84c70c54a751d0579bcda
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16137
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-01-11 09:27:17 +00:00
Jim Harris
25ac67f18b build, config: set CONFIG_HAVE_LIBBSD when libbsd available
Previously we would only set this if we detected that
the DPDK specified using --with-dpdk required it.  When
using the DPDK submodule, we would always strip
RTE_USE_LIBBSD to keep DPDK from trying to use it.
This is fragile and unnecessarily complex though - if
libbsd exists, just always add -lbsd to the link line.

Next patch will do the same for libarchive.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I94dd792b392c23a705dead47947b33d899db8f4f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15950
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
2023-01-11 09:27:17 +00:00
Dennis Maisenbacher
28092d2fee nvmf: Find a NS for an identify cmd through a helper function
Refactoring to avoid code duplication in the following commits.

Signed-off-by: Dennis Maisenbacher <dennis.maisenbacher@wdc.com>
Change-Id: I5a597a02c810cfa1fad6dc397d012cf6a3f189ca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16043
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>
2023-01-11 09:27:00 +00:00
Michal Berger
b1b2ccbf44 dpdkbuild: Silence warning about deprecated use of meson
Warning in question:

WARNING: Running the setup command as `meson [options]` instead of
`meson setup [options]` is ambiguous and deprecated.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I14c70d3d69ec3390d450229195b4a79ea9569156
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16012
Reviewed-by: Pawel Piatek <pawelx.piatek@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>
Community-CI: Mellanox Build Bot
2023-01-11 09:17:45 +00:00
Karol Latecki
aa244ce482 test/nvmf: group target and host tests
- Move "run_test" entries around so that target
  and hosts tests are grouped
- Add missing timing start & exit directives for
  target tests
- Further move tests around to group them by
  matching SPDK_TEST_* flags

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: If1decd49ffbf2d1fffac60e55b506002a2107d7e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16210
Reviewed-by: Michal Berger <michal.berger@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>
2023-01-11 09:17:34 +00:00
Karol Latecki
5fb5e91e68 test/common: reduce waitforserial sleep
NVMe-oF initiator in recent kernel versions takes
considerably less time than when the "sleep 4" was
introduced, as described in:
https://github.com/spdk/spdk/issues/2467

This effectively reverts:
dacd8ec827

Change-Id: Ib678d99c330c739788a5d6aaeabd23cb2c9017ef
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15989
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michal Berger <michal.berger@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-01-11 09:17:34 +00:00
Mike Gerdts
9e96e331c3 fio_plugin: initalize when create_serialize=0
When the fio plugin is used with reate_serialize set to false, fio calls
the init callback (spdk_fio_init()) before calling the setup callback
(spdk_fio_setup()). When create_serialize is true, spdk_fio_setup() is
called earlier.  Both spdk_fio_setup() and spdk_fio_init() call
functions that require that the SPDK libraries have been initialized.

While it is arguably a bug in SPDK that per-thread initialization
happens before global initialization, it is not terribly difficult to
work around in fio_plugin. The workaround implemented in this patch
splits the start of the plugin's init thread into its own function and
calls it from both spdk_fio_setup() and spdk_fio_init(). The init thread
is started while holding a mutex, and as before there is a guard to be
sure that the init thread is created only once.

Fixes issue #2843

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I20d1863a88b75b416283f9466ee1186d8ef05063
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16053
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>
2023-01-11 09:17:16 +00:00
Mike Gerdts
9b754587c7 fio_plugin: bdev calls on spdk thread
This is a rework of commit 7722996dd2.

As the locks in bdev.c transition to spdk_spinlock, callers of
spdk_bdev_get_by_name() and any other function that uses an SPDK
spinlock needs to be executing from an spdk_thread.  This commit reverts
the earlier commit then fixes it with a different approach than was
previously used.

fio plugin functions that need to be on an SPDK thread into two parts:

1. fio API callback: transform args from fio into a spdk_fio_oat_ctx
   structure, then calls spdk_fio_sync_run_oat(). In the case of
   spdk_fio_setup(), the app thread is started in this part.
2. On App Thread (oat) callback: runs on the SPDK app thread via the
   poller spdk_init_thread_poll().

spdk_fio_sync_run_oat() sends a message to the app thread to have the
specified oat callback run. It wakees the poller loop via a condition
variable then waits for the oat callback to signal its completion via a
condition variable in the spdk_fio_oat_ctx.

Fixes issue #2818

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I5c82542bb9e9e6b8823e9d1da293050bba336b65
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15866
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>
2023-01-11 09:17:16 +00:00