Commit Graph

19402 Commits

Author SHA1 Message Date
Jim Harris
0d11cf939b bdevperf: use rand_r() twice to get 64-bit values
rand_r() only returns up to RAND_MAX which is
INT32_MAX.  This means that on sufficiently large
bdevs, especially with smaller block sizes, bdevperf
may not be issuing I/O across the full range of the
bdev.

Found while investigating issue #2908.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I16db684a57a96f138e709008bded4471428944b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16768
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-02-14 09:04:20 +00:00
Ankit Kumar
df45f11427 include/nvme_spec.h:update nsdata fields for NVM and ZNS command set
Updated the examples file as per the code changes.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Change-Id: I63bd1aa94dbc2bec0a9ce837aa5efb48daa1fc1e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16514
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-02-13 18:40:20 +00:00
Ankit Kumar
af9411b0af include/nvme_spec.h: add missing log page and features
Added missing identifiers for set / get features.
Added missing log page identifers for get log page.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Change-Id: I12390d0b7aa2060b6abbc019027452f36ff31bb1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16513
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.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-02-13 18:40:20 +00:00
Michal Berger
66ed26e06d perf/pm: Discard < 0 readings coming from RAPL
Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I5a4071441b6eed53553624c5ee587b7c91360eb5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16633
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-02-13 13:52:22 +00:00
Michal Berger
7ee11c56ce perf/pm: Use bc while dumping all the readings
This is done to calculate readings with better precision and fix
the case where calculation of total reading from given entity would
fail if it was < 1 (as bc drops the leading 0, leaving e.g. .42).

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I68f2df89c340dba28d15c4aaac3e106c9f8057d4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16586
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-02-13 13:52:22 +00:00
Konrad Sztyber
ece50640a2 ut/accel: always clear whole g_seq_operations array
That way, we are sure that each test case starts with the same, clean
state of the g_seq_operations array and we don't need to manually zero
out each individual value.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I6a45499a87480b0803f3af52c9e22b3bb68e9996
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16547
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-02-13 13:52:06 +00:00
Konrad Sztyber
225202447b ut/accel: always increment ops->count in mocked submit_tasks
It makes it possible to check the number of times a task was submitted
to be executed by a module, even if we defined a submit() function for
that opcode.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Id6b592b0461c722bf22ab04d5bad1a7542bb17e7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16546
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-02-13 13:52:06 +00:00
Konrad Sztyber
45b7fb23b1 accel: assert that we never modify seq's ERROR state
This should help catching bugs when a failed sequence gets cleared its
failed state.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I9389a2610e94e766aaf4185445c36442c4d4a1f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16545
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-02-13 13:52:06 +00:00
Konrad Sztyber
914007c1c6 accel: functions to iterate over tasks in a sequence
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I97f011b7eaa7db7e9a9df583aff23321d60bb72f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16378
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-02-13 13:52:06 +00:00
Konrad Sztyber
02e8b81bb6 accel: expose method for allocating accel buffers
This will allow a platform driver to allocate a buffer in case it cannot
execute the whole sequence and the destination buffer of the last
operation is a "virtual" accel buffer.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ia947cf553619828a170c5d0563b4c355d7b5ead5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16377
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-02-13 13:52:06 +00:00
Konrad Sztyber
efcae1bdee accel: method for getting accel memory domain
This will allow drivers to check if a task is using buffers from accel
domain.  This is just a helper, since the same can be achieved by
calling `spdk_memory_domain_get_first("SPDK_ACCEL_DMA_DEVICE")`, but
there's only a single accel domain and it is a bit special, so it makes
sense to have a dedicated helper function for getting it.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I07db7445ed9b109e66ecdbc0483a6a158a551070
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16376
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-02-13 13:52:06 +00:00
Konrad Sztyber
b2454dfbcc accel: introduce platform drivers
The goal of a platform driver is to execute chained accel operations in
the most efficient way possible.  A driver is aware of the hardware
available on a platform and can execute several operations as a single
one.  For instance, if we want to do DMA and then encrypt the data, the
driver can do both at the same time, if the hardware is capable of doing
that.

Platform drivers aren't required to support all operations.  If a given
operation cannot be executed, the driver should notify accel to continue
processing a sequence, via spdk_accel_sequence_continue(), and that
operation will processed by a module assigned to its opcode.

It is required however, that all platform drivers support memory
domains, including the "virtual" accel domain.  A method for allocating
those buffers will be added in the following patches.

This patch only adds methods to register and select platorm drivers, but
doesn't change the way a sequnce is executed (i.e. it doesn't use the
driver to execute it).

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I97a0b07e264601ab3cf980735319fe8cea54d38e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16375
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-02-13 13:52:06 +00:00
John Levon
11e67d93ff lib/nvmf: sanity check req->iovcnt
If req->data is set, with all the previous changes, then req->iovcnt
should also be more than zero.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I29b5f45541c9dba2dd896109dd43d2b5321ec467
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16274
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-02-13 13:50:51 +00:00
John Levon
70a82d9a95 nvmf: add spdk_nvmf_request_copy_*_buf()
Also deprecate the existing spdk_nvmf_request_data() API, which is
incompatible with iovecs.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I44df8ff30a431873a0c2f34b0cdb58df858fd7e3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16200
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-02-13 13:50:51 +00:00
John Levon
cc3184b8b4 nvmf: handle iovecs in reservation handling
Use req->iov instead of req->data in reservation handling code.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I6d79711d03f45bd5e118c6324d22decad887a788
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16199
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.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>
2023-02-13 13:50:51 +00:00
Konrad Sztyber
7db282dc26 tcp: add note about default case in qpair_abort_request()
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2f3741596be2f06b36894306203214a4ef096d1a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16694
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>
2023-02-13 13:50:15 +00:00
Konrad Sztyber
43121e8693 test/zcopy: disable traces in subsystem_add_ns loop
This loop produces a LOT of logs, which aren't very useful, so silence
them to reduce the clutter in the logs.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I5032c2c5bc309f8b29455349adf7063c7e9d50cc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16648
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michal.berger@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-02-13 13:50:15 +00:00
Konrad Sztyber
13d3123115 examples/abort: check process_completions()'s status
The abort app expects some requests to be failed (because they're
aborted), so a failed I/O doesn't cause the app to exit with a failed
status.  However, the qpairs should never be disconnected during the
test, so we should check their status to avoid hiding errors when that
happens.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I100cda8656ad748983695a434721424db84ea260
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16647
Reviewed-by: Michal Berger <michal.berger@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-02-13 13:50:15 +00:00
Konrad Sztyber
924a61bfa6 examples/abort: free qpairs at the end
It'll make it easier to handle errors in the following patch.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic1a40ef59cff058d7926b3df4a966e5e6de9b0f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16646
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-02-13 13:50:15 +00:00
Konrad Sztyber
9c04e6d832 examples/abort: check status of all workers
Previously, we only cared about the status of the main worker thread and
ignored errors from other threads.  This patch changes that and now
it'll return an error if any of the worker threads encountered an error.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Icc54b18a0bc4fae7a40e0a13846aa6ac01111c6f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16645
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-02-13 13:50:15 +00:00
Konrad Sztyber
ac94b60b54 nvme/tcp: fail qpair when spdk_sock_flush() fails
If spdk_sock_flush() returns an error, there's no reason not to
disconnect the qpair, as it usually means that that socket's connection
has been terminated.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I54e9bebc38e2a24a3baf69eb18ec3c654b210318
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16644
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-02-13 13:50:15 +00:00
Konrad Sztyber
739c6d7c5a nvme/tcp: check for EAGAIN when flushing socket
The bahavior of spdk_sock_flush() was changed in 5433004ec to return the
number of flushed bytes and -1 with errno set to EAGAIN in case nothing
has been flushed (instead of returning 0).  Therefore, we shouldn't
treat EAGAIN as an error in nvme_tcp_qpair_process_completions().

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I5473488b5b408cdc739921046f1a0cc2c98f98de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16643
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-02-13 13:50:15 +00:00
Konrad Sztyber
25b0c20c0a tcp: remove abort handling for reqs in ZCOPY_START_COMPLETED
This never happens, as requests in this state are always immediately
transitioned to other states.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I0408ed9d8003d364bc38c86a9a50312721ab1284
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16642
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-02-13 13:50:15 +00:00
Konrad Sztyber
b12419a231 tcp: don't abort requests waiting for R2T ACK
It is possible for requests waiting for R2T ACK to receive H2C PDU
before receiving the ACK.  Therefore, the following sequence:

1. Host sends a write request to the target.
2. Target sends R2T PDU to the host and sets request's state to
   AWAITING_R2T_ACK.
3. Host sends H2C PDU to the target, but it doesn't reach the target
   yet.
3. Host sends an abort command to abort that request.  Request's state
   is changed to READY_TO_COMPLETE.
4. Target receives the H2C PDU, sees that request's state is
   READY_TO_COMPLETE, which is unexpected, and terminates the
   connection.

will cause the target to terminate the connection, which is obviously
incorrect.

So, to avoid that, we can treat AWAITING_R2T_ACK state in the same way
as TRANSFERRING_HOST_TO_CONTROLLER and register a poller waiting for the
state to be changed.

Fixes #2789.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Idddc627050000b74663dba397dc14d10aa0e284f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16641
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-02-13 13:50:15 +00:00
Krzysztof Karas
c824f88347 autobuild: patch DPDK with "ipsec_mb: expect EENOTSUP in ipsec_mb_create()"
Apply this patch, when building SPDK with external DPDK (versions 22.11.0+).

Change-Id: I0a09dbe6b4ee9519d51a0b4cb881844b96d94779
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16702
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
2023-02-10 13:27:51 +00:00
Richael Zhuang
d8c8e3f4ee bdev_nvme: update outdated log for reset_io
It has been implemented in commit 56e2d632ce to reset all nvme_ctrlrs
of a bdev controller sequentially. Update the log.

Change-Id: Id87bf99d7e269c8ad0d6b2576e2329455601ec55
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16653
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-02-09 11:32:12 +00:00
Yifan Bian
f21a34ac26 perf: add io check for aio device
If no aio device exist, then we can use 'exit(1)' to exit. Also,
update the same error check with 'exit(1)' for io_uring path.

Fix issue with 2893

Signed-off-by: Yifan Bian <yifan.bian@intel.com>
Change-Id: Iade74fba4588b109ce77af76ac998bb05b842ef3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16652
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-02-09 11:31:58 +00:00
Changpeng Liu
56f238488e lib/virtio_vfio_user: use VIRTIO_PCI_VRING_ALIGN aligned vring address
We don't need to allocate 2MiB aligned memory address for
vrings, this will waste memory and may invoke dynamic
memory allocation in DPDK sometimes.

Fix issue #2846.

Change-Id: I6410d417f92623b44c375359d5e2b5ec8ed815c0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16651
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-02-09 11:31:39 +00:00
Michal Berger
9694127db6 pkgdep/git: Remove igb_uio patch from dpdk-kmods
This change is already present in the upstream, no need to patch it
ourselves anymore.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I12c9eb59ee202a7e240542876a51977ef2f2d4ec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16716
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-02-09 11:21:11 +00:00
Mike Gerdts
3e7394af6a bdev: remove bdev_register_examine_thread deprecation
Starting in SPDK 23.01, calling spdk_bdev_register() and
spdk_bdev_examine() from a thread other than the app thread was
deprecated. This commit removes the deprecation and as such calling
these functions from a thread other than the app thread is an error.

As a side effect of this commit, all bdev module examine_config() and
examine_disk() callbacks will be called on the app thread.

Change-Id: Idaae06608101e2a513d9312ac5544ffe94effe4a
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15826
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
f246b2d5c8 blob_bdev: use bdev module claims v2
With the introduction bdev module claims v2, existing consumers should
transition off of v1 claims. This transitions blob bdevs from v1
exclusive writer claims to v2 read write once claims.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I1884585a540fa17ee341430e03de3c4f5d35322b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16168
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
e52b6c0d40 test/blob: add unit test for bs_dev claims
Add a unit test to ensure spdk_bs_bdev_claim() takes an exclusive write
claim and it is released when the destroy callback is called.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Ia5185545b148a8a83315c688a9c99a16b199063a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16230
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
c74b8b609b test/blob: create unit test for blob_bdev
This creates a minimal test for module/blob/bdev/blob_bdev.c.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I04698863f3228a27f73a90d50f0d5fbde30c0870
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16229
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
486651f790 test/vhost: close bdev before claim for lvs
The original implementation of bdev claims allows a module to establish
an exclusive writer claim on a bdev that has other descriptors open for
writing. This is arguably a bug. With claims v2, this bug does not
exist. The conversion of spdk_bs_bdev_claim() to claims v2 exposes this
bug in the vhost_negative test.

This patch removes an extraneous vhost_scsi_controller_add_target RPC
call that left Malloc0 open read-write while bdev_lvol_create_lvstore
tries to create an lvstore on Malloc0.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I963e210e1bc033d8720e240760004ed8aef7fda3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16169
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
86bbcdb8f6 bdev: call examine_disk() for all claim holders
If multiple claims exist on a bdev, examine_disk() is called for each of
them.

Change-Id: I0a6dc3e4bd1da20bbcbddf97a16e04c62c82354c
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15290
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
47bb651cd5 bdev: refactor bdev_examine before claims v2
This commit has no functional change. It refactors an if statement into
a case statement in preparation for supporting claims v2.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I1862428c91a7066ad9079878d4c1b690a5ef631c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15289
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@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-02-09 11:20:34 +00:00
Mike Gerdts
a7eb6187e5 bdev: implement claims v2
This implements the v2 claims API. Compared to the original v1 claims,
v2 claims:

- Support read-write-once, read-write-many, and read-only-many claims.
- Are claimed with spdk_bdev_module_claim_desc().
- Are associated with a bdev descriptor that is passed to
  spdk_bdev_module_claim_bdev_desc().
- Are released upon close of the bdev descriptor used to obain the
  claim.
- Cannot be taken when a descriptor other than the one passed to
  spdk_bdev_module_claim_bdev_desc() has write access.

Later commits in this series are needed to fully integrate them with the
bdev subsystem.

Change-Id: I39a356f5893aa45ac346623ec9ce0ec659b38975
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15288
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-02-09 11:20:34 +00:00
Mike Gerdts
0d8235f388 bdev: generic already claimed error message
As new claim types are introduced, printing error messages about who
holds a claim will get more complicated. This refactors the error
message code into a function to prevent code duplication.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Icdc5332214f3974e75baf11ba5ea02172c4275e1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15287
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-02-09 11:20:34 +00:00
Liu Xiaodong
120eb84454 ublk: update func ublk_try_close_dev
Merge function _ublk_try_close_dev() directly into
function ublk_try_close_dev.

Change-Id: Ib4df28f1d69f56d72e3eeaeb2220eb15f5c37440
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16417
Reviewed-by: <yifan.bian@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-02-08 15:26:00 +00:00
Liu Xiaodong
0f2f145963 ublk: rename g_ublk_bdevs to g_ublk_devs
bdev is not proper to describe ublk devices

Change-Id: Ic6784b3062b770dce1c77dc409ba1ee3704bdef2
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16418
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2023-02-08 15:26:00 +00:00
Jim Harris
3052809a3d ublk: add comment clarifying use of SQPOLL for ctrl ring
We need to use SQPOLL on the ctrl ring for now, due to
a bug in kernels <= 6.1.  This ring is used very
infrequently, so the workaround has no real effect
on performance.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia5e65a6edb7b1b6c4c945ebda8941f98c2bcdb07
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16620
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2023-02-07 08:18:54 +00:00
Jim Harris
addc545773 util: get SPDK_HAVE_* values for crc32.c
crc32.c uses SPDK_HAVE_ARM_CRC to use __crc32
intrinsics when available, but it isn't including
anything that would actually define SPDK_HAVE_ARM_CRC.

Only crc32c.c tried to define this previously, that
all got moved to crc_internal.h now, so we can just
include that here.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic5c2e6908508e32d2f3784304c5b58d3acd4c965
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16688
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>
2023-02-06 08:34:08 +00:00
Jim Harris
500ce16976 util add crc_internal.h
The preprocessor code will be needed in another
crc-related .c file in an upcoming patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Icc5e6f0d81f76093dfc973a9c1fe56271baf1ed8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16687
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>
2023-02-06 08:34:08 +00:00
Alexey Marchuk
677907db73 test/blockdev: Increase qdepth of bdev_verify_big_io test
Due to a problem described in github #2886, we
were not able to run verify payload with big IO
and big queue depth. This problem was fixed with
iobuf utilities, so now we can increase queue
depth in this test.

Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: I7b8935d17411c260ba416608444106684c17a0cb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16602
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-02-03 08:54:34 +00:00
Alexey Marchuk
cc8347dc2d bdev/crypto: Use iobuf large_bufsize to set opt IO boundary
We used hardcoded value set by bdev module, however
this value might be changed, so get a real value
from iobug config

Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: Id15b602f699f3dd63aeff11fb063bb62c384663d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16601
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-02-03 08:54:34 +00:00
Alexey Marchuk
a54fc9f4a2 bdev/crypto: Free aux buf when crypto op fails
Fixes issue #2886

Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: I19e2ba3763822bc9092fba584d35a6802c520ab7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16600
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-02-03 08:54:34 +00:00
Michal Berger
0fa77938a7 autobuild: Refactor doxygen version check
Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I053dedc537d4f58db42cbad9480c38ef520d1d9b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16028
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
2023-02-02 09:05:56 +00:00
Michal Berger
5aaa207a05 tests: Run make clean only when SPDK was configured
Otherwise the cmd fails due to the lack of config.mk. This forces
autopackage.sh, test_make.sh, etc. to be executed in the environment
where SPDK was already built which shouldn't be really a hard
requirement as they always re-build the SPDK for their own purposes.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ie3971acbf354734ed9c5c72d49bb93fc2ccc45f8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15743
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
2023-02-02 09:05:56 +00:00
Michal Berger
302f315939 autotest: Run env.sh as part of the functional tests
These mainly depend on DPDK, hence they don't really fit together
with the standard unittests as such.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ibe55f8c5c5988c61ea94a1db688270662d3b81e7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15727
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
2023-02-02 09:05:56 +00:00
Michal Berger
58ac71a4df autobuild: Create wrappers around top test suites
Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ia2791e357a7156adfa323c00f54b5ff356f0edf5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15726
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
2023-02-02 09:05:56 +00:00