Commit Graph

18835 Commits

Author SHA1 Message Date
Sebastian Brzezinka
a2ca928aab autobuild: copy files to avoid mv: failed to preserve ownership
Some setup mount `$out` directory using sshfs therefor ownership can
not be preserve on host side.

Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Change-Id: Icf4c02dbb19fb6d521e2a19df6266bca7f5b3bb3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15558
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-11-24 10:09:29 +00:00
Sebastian Brzezinka
7c79992e9c SC2295: Expansions inside ${..} need to be quoted separately
Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Change-Id: Ieb89027d41567f000f0f1a8c7375fde5201b06db
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15561
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>
2022-11-24 10:09:29 +00:00
Sebastian Brzezinka
6e7b3e4cba SC2048: Use "${array[@]}" (with quotes) to prevent whitespace problems.
Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Change-Id: I64473e4904c82fa06d41e8a02d56070ebf966adc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15559
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>
2022-11-24 10:09:29 +00:00
Jun Wen
d7fc39cc93 test/fuzz: write nvme fuzz test log to a file instead of on Console
The long time fuzz output size is so big that
cause Jenkins job abort.

Signed-off-by: Jun Wen <junx.wen@intel.com>
Change-Id: I5deeb1ff7414e2bf01cd3b5200e8c51d40487ad8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15369
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <qun.wan@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2022-11-24 10:08:54 +00:00
Richael Zhuang
61b8122dc5 bdev_nvme: added io_outstanding in nvme_io_path
Added io_outstanding in struct nvme_io_path to record outstanding
I/O number in each path, which will be used by multipath to select
I/O path.

io_outstanding gets updated for I/O sent to a namespace and not get
updated if sent to a controller.
For FLUSH case, it calls bdev_nvme_io_complete() directly and
io_outstanding is not updated for this case.
spdk_bdev_io_get_buf() is executed in the generic bdev layer.
Hence, we do not update io_outstanding for spdk_bdev_io_get_buf().

Change-Id: I47b515e0f254e5daa7e1e88799a832032b23ff34
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15032
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-11-24 10:08:43 +00:00
Richael Zhuang
141fb10ea2 bdev/nvme: directly call bdev_nvme_io_complete for FLUSH IO
Directly call bdev_nvme_io_complete() for FLUSH case.

This is a preparation for io_outstanding update in nvme_io_path. For
IO sent to a namespace, io_outstanding gets increment/decrement. For
IO sent to a controller, io_outstanding is not updated. For FLUSH
case, it's not sent to a namespace nor a controller. Directly call
bdev_nvme_io_complete() here to make it easier to understand why
io_outstanding not gets updated for FLUSH.

Change-Id: Idcf4b37a0816a327256fe87004705fb65df1b06c
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15517
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-11-24 10:08:43 +00:00
Ben Walker
85478eccc9 thread: Fix error handling in spdk_interrupt_register
If the calloc failed, the fd was left in the fd_group.

Change-Id: Ie68426a13d342756c20315656f0309440fda6e02
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15475
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: John Levon <levon@movementarian.org>
2022-11-24 10:08:31 +00:00
Mike Gerdts
8dbaca1300 bdev: use spinlock instead of mutex
SPDK threads generally run on dedicated cores and locks should be rarely
contended. Thus, putting a thread to sleep while waiting on a mutex does
not free up CPU cycles for other pthreads or processes. Even when
running in interrupt mode, lock contention should be low enough that
spinlocks are a net win by avoiding context switches.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I6e2e78b2835bbadb56bbec34918d998d75280dfd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15438
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-11-24 10:08:17 +00:00
Jim Harris
2be196c609 nvme/pcie: validate that mptr is iova contiguous
Also add unit tests that explicitly test this
condition.  They fail without the nvme driver changes
in this patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iaa369be341eb4eba394f248990e56dce001d3940
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15579
Reviewed-by: Mariusz Barczak <mariusz.barczak@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@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>
2022-11-23 08:23:15 +00:00
GangCao
ef9168dcaa examples/bdevperf: fix potential memory leak of allocated config
Change-Id: Idd9d9bec5df0fbb74bb1f2a8af61c408a150d1aa
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15536
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-11-23 08:22:53 +00:00
Kamil Godzwon
9d95427594 test/check_so_deps: compare xml representations of the so files
Right now for ABI tests, the abidiff tool requires
a reference .so files matching the SPDK version that
is being compared to. For example patches on master
are compared to .so files build from last SPDK release.
This requires continuous maintenance and backports
to the prior release branches, to keep new VM images
buildable.
Since ABI tests should be done only against specific
release (git tags) rather than tip of the branches,
this would mean to address it properly the VM image
and point releases would need to be synchronized.
To avoid that, we can switch from using the .so files
to their text (XML) representation generated at the
time of the release.

The XML representation of the SO files will be kept in
the separate repository "spdk-abi" and cloning during
"confirm_abi_deps()" test.

Signed-off-by: Kamil Godzwon <kamilx.godzwon@intel.com>
Change-Id: I37b4c556e8f8ffb5ffd67e16df9f186ef9c52294
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14160
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-11-23 08:22:38 +00:00
Jim Harris
1d2700d4c1 event: check that all non-app threads have exited at shutdown
For now, just print a loud warning when this case is
violated.  We will add a hard assertion and cause the app
to exit with error status in a later release.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic9226f76a4729820f13a2728bea977b6a54f48ee
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15513
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-11-23 08:22:04 +00:00
Jim Harris
8203e68e24 thread: add spdk_thread_is_running()
This function can be useful to query if a thread
had spdk_thread_exit() called on it yet.  Internally
we have both EXITING and EXITED state - so
!spdk_thread_is_running() can be used to detect a
thread that is in either of those states.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2f6fb024a6b1bc895fdc5132c722abc10f5d30f9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15512
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-11-23 08:22:04 +00:00
Jim Harris
98ceddb47c rocksdb: remove spdk_thread
This was an accidental remnant from the original
check-in, when we did not have a clear differentiation
between the event and thread libraries.

The rocksdb plugin code will send events to an
lcore - not an SPDK thread.  But originally the two
were combined though an API called spdk_allocate_thread.
Once the differentiation was clearly made, we moved to
using spdk_event_allocate() to send events to a specific
lcore, but never removed the spdk_thread.

So now let's just remove the spdk_thread_create since
it is not needed.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5c6a3c304b7b4183eee90038367fdea7ebd7280f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15504
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-11-23 08:22:04 +00:00
Jim Harris
0d3b54825e subsystem: assert all subsystems initialized on app thread
This requires creating and setting SPDK threads in the
subsystem unit tests as well.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I31acfb1d7e418f011acc9b48933032d8bf8a1c53
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15511
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-11-23 08:22:04 +00:00
Jim Harris
327d1c988d vhost: defer vhost_dev_unregister until scsi tgts removed
Currently when a vhost-scsi controller is removed, it
calls spdk_vhost_scsi_dev_remove_tgt on all remaining
targets, and then immediately calls vhost_dev_unregister.
But this path goes into vhost_user_dev_unregister which
immediately returns with error if there are any pending
async operations - and there are since scsi_dev_remove_tgt
is asynchronous.

So instead add the vhost_dev_unregister call to
remove_scsi_tgt, so that the unregister only happens
after the last ref goes away.

This requires changing vhost_fini() to no longer
assume that spdk_vhost_dev_remove() will immediately
unregister the device, since it now happens
asynchronously.  Previously vhost_fini() was making
this assumption erroneously - it would call g_fini_cb
without actually checking that the devices had been
unregistered.  Because of that incorrect assumption,
we need to do both the vhost and vhost-scsi changes
in the same patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9577901266975447f9acfe53475221113f02fea3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15510
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2022-11-23 08:22:04 +00:00
Jim Harris
081b190b5f bdevperf: call spdk_thread_exit on job threads
Note: we can only exit a job thread after all
jobs are done executing.  This is because some bdevs
like Ceph send messages to a main thread, so we need
to make sure a main thread doesn't exit before another
thread that is sending messages to it.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iaa51f13f3bc659f6eda7fcefff82c127e095ce29
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15516
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: wanghailiang <hailiangx.e.wang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-11-23 08:22:04 +00:00
Jim Harris
85d70c03c5 thread: don't move to EXITED if there are pending messages
At end of spdk_thread_poll(), if thread is in EXITING state,
we call thread_exit() to see if the thread can move to
EXITED state.  If there are any pollers, io_channels
or pending device unregistrations in progress, thread_exit()
will keep the thread in EXITING mode for this iteration.

But a thread may post messages to itself during this cleanup
process, so thread_exit() should also check if there are
any messages on its queue.

Found during testing of spdk_thread lifetime patch set.
rbd bdev module will send messages to itself like this
during cleanup.  Without this change, rbd module testing
with bdevperf would cause an spdk_thread to move to
EXITED state prematurely.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie611026a67b7fa48640ae83be03e29a9c64883a2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15533
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-11-23 08:22:04 +00:00
Jim Harris
dcb296a32b bdevperf: add bdevperf_job_free() function
Introduce a helper function to properly free everything
associated with a job structure, and then use that
in all of the various error paths to reduce the
number of changes required if/when new strings are
added to the job structure.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I05280371326ce9582e8452a7753a7990072f25b7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15506
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-11-23 08:22:04 +00:00
Jim Harris
7aa2cc29c0 bdevperf: simplify freeing of 'outstanding' bit array
spdk_bit_array_free(NULL) is fine, so we can avoid the
check.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I989797d5dce0339efb18a7e47e8d974d4ac5abf7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15505
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-11-23 08:22:04 +00:00
Jim Harris
be19fe4bd7 bdevio: call spdk_thread_exit()
We need to make sure we call spdk_thread_exit()
to clean up the io and ut threads in the bdevio
app.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I29774b36c5f294072011fcf810e8b7346842c303
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15503
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2022-11-23 08:22:04 +00:00
Jim Harris
0e7821e99d accel_perf: call spdk_thread_exit()
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id93c64a5eda13b21d36bc2006f078a7df76d0e56
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15502
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-11-23 08:22:04 +00:00
Jim Harris
dedc926239 test/dma: call spdk_thread_exit()
We should always exit threads that we create.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ife982798bc23a5da5706b9baca80e102a4541bab
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15501
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-11-23 08:22:04 +00:00
Jim Harris
97011ecc92 test/unit: call spdk_thread_exit() in reactor_ut
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I50ca06619345f0596bfaf416e8ab3296a8990fca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15437
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-11-23 08:22:04 +00:00
Jim Harris
eb979f3ebc llvm_vfio_fuzz: call spdk_thread_exit()
Make sure we exit the thread that we created in
the llvm_vfio_fuzz app.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7fad1402a83206728f5a7ceac6c33a2b4c812719
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15500
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-11-23 08:22:04 +00:00
Jim Harris
b35aceb8cf iscsi: unregister login_timer when destroying connection
If a connection is established and we receive a bad
PDU before successful login, the login_timer would not
get unregistered.  So ensure the login_timer is always
unregistered in _iscsi_conn_destruct().

Found with Calsoft tests during new spdk_thread_exit()
assertion testing.  Lack of unregistration would result
in its associated spdk_thread being unable to exit
cleanly due to the unexpired timer.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I79d427512f7829ad76bf89155e0e14c7bce3a7d7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15499
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-11-23 08:22:04 +00:00
Jim Harris
090b8af12b thread: add spdk_thread_get_app_thread
The "app thread" will always be the first
thread created using spdk_thread_create().  There
are many operations throughout SPDK that implicitly
expect to happen in the context of this app thread,
so by formalizing it we can start to make assertions
on this to help clarify and simplify locking and
synchronization through the code base.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7133b58c311710f1d132ee5f09500ffeb4168b15
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15497
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-11-23 08:22:04 +00:00
Jim Harris
db18916f29 thread: move _free_thread() earlier in file
Next patch will add a new caller to this function.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I54374c0af3a4a0fdcc5ac9ca25e2c7ef03e99829
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15576
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-11-23 08:22:04 +00:00
wanghailiangx
13b7f1b200 doc/jsonrpc: fix a corresponding symbol for method accel_get_opc_assignments
Method "accel_get_opc_assignments"'s response,
start and end symbol do not correspond.

Change-Id: I040cf00778863b350f21126d460a74e3ee932385
Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15484
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-11-22 10:04:13 +00:00
Changpeng Liu
b45556e2b2 include/bdev_module.h: add SPDK_ prefix to macros
`BDEV_IO_NUM_CHILD_IOV` and `BDEV_RESET_IO_DRAIN_RECOMMENDED_VALUE`
are public macro definitions without `SPDK_` prefix, so we add the
`SPDK_` prefix to them.

Change-Id: I4be86459f0b6ba3a4636a2c8130b2f12757ea2da
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15425
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-11-22 10:03:57 +00:00
yupeng
c0c333e2ed bdev: provide all available bdevs when loop bdevs
The bdev hot remove might be an async process. The bdev_open will
return an error during the hot remove process. If someone invoke the
bdev_get_bdevs API when a bdev is in the middle of a hot remove
process, the spdk_for_each_bdev function will stop its loop when a
bdev_open return an error. Thus the bdev_get_bdevs will only return
partual bdevs or even return an empty list if the hot remove bdev is
the first bdev in the loop. When spdk_for_each_bdev and
spdk_for_each_bdev_leaf loop for each bdevs, if a bdev returns an
error, we skip that bdev instead of stop the whole loop.

Signed-off-by: Peng Yu <yupeng0921@gmail.com>
Change-Id: Ib35b817e23e47569fc5762a883b4ff8e322ae173
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15322
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-11-22 10:03:48 +00:00
Thanos Makatos
70f185ea51 json: add spdk_json_write_named_double
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Suggested-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2439cd739240fb2d95c5cdaccc557ba9a8f6501b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15490
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-11-22 10:01:43 +00:00
Thanos Makatos
4475295e15 nvmf/vfio-user: add some unlikely on the hot path
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Change-Id: Ib7977f34fc2fc312f0a502405dcd1b5266a22d3f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15430
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-11-22 10:01:43 +00:00
Thanos Makatos
6b71006dfe nvmf/vfio-user: refactor nvmf_vfio_user_prop_req_rsp
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Change-Id: Id6b0a4bc12aa8799fdb1ce1b286c308c9a79083b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15389
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
2022-11-22 10:01:43 +00:00
Thanos Makatos
82b2c1923f nvmf/vfio-user: refactor duplicate code
Change-Id: If501002e9ed110f77a4ece9f026ecfc4e53dee27
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15388
Reviewed-by: John Levon <levon@movementarian.org>
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>
2022-11-22 10:01:43 +00:00
Thanos Makatos
a7885283b3 nvmf/vfio-user: delete CQ on vfio-user client disconnect
If the guest performs a hard shutdown we're not deleting the CQs:
nvmf_vfio_user_close_qpair calls delete_sq_done, which won't delete
the CQ because vu_ctrlr->reset_shn is false.

Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Change-Id: I383fb985340a0d9d0eb7fea7403372cbdc55a089
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15387
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-11-22 10:01:43 +00:00
Thanos Makatos
e398dcdadb nvmf/vfio-user: don't use uninitialized refcount for admin CQ
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Change-Id: I16d511ac10b8ba4dfb2f7a7e5c144e2f2fe1bad5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15386
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
2022-11-22 10:01:43 +00:00
Thanos Makatos
25440c3bdb nvmf/vfio-user: don't blindly drain poll group eventfd
This eventfd may be passed by libvfio-user to the remote process which
might remove the EFD_NONBLOCK flag, in which case we would block
indefinitely.

Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Change-Id: If9826cd700b4a7b3458a0a8278a96322d99ac08e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15385
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2022-11-22 10:01:43 +00:00
Thanos Makatos
7f23638550 util: add function spdk_fd_group_get_epoll_event
This patch introduces function spdk_fd_group_get_epoll_event, which
returns the epoll(7) event that caused the file descriptor group
callback function to execute. Rather than changing the signature of
spdk_fd_fn in order to pass the struct epoll_event, which would result
in a gigantic patch where there vast majority of users would simply have
to ignore the new argument, we introduce this new API that allows to
return the epoll_event only when really needed.

Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Suggested-by: John Levon <john.levon@nutanix.com>
Change-Id: I3debe1382d1c2bfec6ae4fea274ee38ed0b135fe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14935
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
2022-11-22 10:01:43 +00:00
Kozlowski Mateusz
5f8c056649 module/ftl: Translate rc to spdk_bdev_io_status on submission error
Currently this translation was only done for IOs that were successfully
submitted. This needs to be done on submission too, in order to pass the
proper error code to the bdev layer.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Change-Id: I69bf7b33b4d3a89199e1105c7f49ceeb7ab07da4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15486
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-11-22 10:01:30 +00:00
Kozlowski Mateusz
304f0802d1 lib/ftl: Fix segfault in recovery path of unmap
The ftl_md_get_buffer_size returns the buffer size in bytes, so we
should divide by the block size, instead of this smaller value. Risks
touching bad memory during dirty shutdown recovery, especially in >16TiB
drives.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Mariusz Barczak <mariusz.barczak@intel.com>
Change-Id: I4095b00a79a1bdbce5046dc46349a9670e41b18e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15259
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-11-22 10:01:30 +00:00
Kozlowski Mateusz
6a26cb6053 lib/ftl: Fix findings of static code analysis
A metadata region without mirror should have the INVALID enum set,
otherwise it risks touching invalid parts of the array.

The sb_shm_md not being set to NULL could cause the code to touch this
freed pointer in the error path in ftl_md_create -> ftl_md_create_shm ->
ftl_md_invalidate_shm calls.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Mariusz Barczak <mariusz.barczak@intel.com>
Change-Id: I7fe9694dad535de5f6b2a4af27400fa125480605
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15258
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-11-22 10:01:30 +00:00
Kozlowski Mateusz
646b851e75 lib/ftl: Update FTL IO activity statistics
Bumping the IO activity statistics during relocation, compaction, L2P
cache processing and user IO handling. This makes sure poller busy
counter is more accurate.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Change-Id: Iabf8ec7ca41c01d7a00d3a70825b8d5283ab2bf1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15257
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
2022-11-22 10:01:30 +00:00
Kozlowski Mateusz
a7f4a2db7f lib/ftl: Validate l2p_dram_limit parameter
Disallow 0 value as parameter - avoids a segmentation fault.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Signed-off-by: Mateusz Brenk <mateusz.brenk@intel.com>
Change-Id: I492256ff621da3be11239d2fd705d8cc54bfe7b7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15256
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>
Community-CI: Mellanox Build Bot
2022-11-22 10:01:30 +00:00
Konrad Sztyber
72a6cd5381 nvme: execute hotplug monitor even if hotplug_fd < 0
NVMe controllers can be marked as removed even if we cannot receive
uevents (e.g. by the VMD driver), so we should process them regardless
of hotplug_fd.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Iaaf13a136929200e824f7a6dd3b5584998801630
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15547
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tom Nabarro <tom.nabarro@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-11-21 16:15:44 +00:00
Konrad Sztyber
0a672ea974 rpc: print device type in framework_get_pci_devices
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2d3825ffcce098909745ba949cdde3eb7f71c703
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15545
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tom Nabarro <tom.nabarro@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-11-21 16:15:44 +00:00
Konrad Sztyber
806c100595 rpc: extend bdf buffer in framework_get_pci_devices
The previous 14B buffer was too small for VMD devices.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ib3984f7104fadbb2fbf7ec56932675d73eda1456
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15532
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tom Nabarro <tom.nabarro@intel.com>
2022-11-21 16:15:44 +00:00
Michal Berger
485f9f974a pkgdep/freebsd: Update name of the ceph package
Under latest 13.1 builds ceph package is now available as "ceph14"
so try to install it when the first attempt fails.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I4301f357d2c04881a1e8839c644cb000ba74e4e6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15495
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2022-11-21 12:02:48 +00:00
Roger
e1b81c06bf doc: fix typo in vhost document
In "Example output"
'./scripts/rpc.py bdev_malloc_create 128 4096 Malloc0'
should be
'./scripts/rpc.py bdev_malloc_create 128 4096 -b Malloc0'
Add the missing '-b'.

Signed-off-by: Roger <lichangxinlivingshade@gmail.com>
Change-Id: I81b7eb122d8a4f115ec23c9e017b235d36b2d7d1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15531
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-11-21 12:01:05 +00:00
xiaoxiangxzhang
1a0ccf39ea UT/nvme_pcie_common:test for nvme_pcie_poll_group_get_stats
Signed-off-by: xiaoxiangxzhang <xiaoxiangx.zhang@intel.com>
Change-Id: I92d4e2a18a281f1e9abc89f0ccb76063a3709784
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15415
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-11-21 12:00:55 +00:00