Commit Graph

19537 Commits

Author SHA1 Message Date
Ben Walker
fe2d64cecf event: Nest the thread's spdk_fd_groups in interrupt mode
Instead of adding the spdk_fd_group's fd to the reactor fd group, use
the new nesting functionality.

Change-Id: I00727e836da6ba191d5bf778613f31956c9baacf
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15477
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
2023-04-04 17:38:22 +00:00
Ben Walker
d83e476240 util: Add spdk_fd_group_nest() and spdk_fd_group_unnest
These provide a way to nest one fd_group into another in a more
efficient manner than just adding the fd_group's fd to the parent. It
also keeps track of which events belong to which group, so the unnest
operation can be implemented.

Change-Id: I63d63365f1160cce8b4b6388a0ea2003ef424b9e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15473
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>
Community-CI: Mellanox Build Bot
2023-04-04 17:38:22 +00:00
Szulik, Maciej
acad335521 sock: change min recv/send buf sizes to 4 KiB
The 2 MiB minimum may be not reasonable for some users, so it is changed
to 4 KiB to allow wider range of possible values.

The new default is introduced to keep backward compatibility (2 MiB).

Signed-off-by: Szulik, Maciej <maciej.szulik@intel.com>
Change-Id: I450ff555f73ddd9be727ecc49209eb5af90fa88e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17406
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
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>
Community-CI: Mellanox Build Bot
2023-04-04 07:36:23 +00:00
Michal Berger
06084c8b7e autotest: Make sure cleanup timings have unique names
Otherwise it messes up with the time accounting of the last test block
marked with the same name.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I6baabc4166b78c27b3b504a6674005f0dd4a3da3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17146
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-04-03 09:17:13 +00:00
Pawel Piatek
624133b5c0 perf/nvmf: improve skip spdk install
Signed-off-by: Pawel Piatek <pawelx.piatek@intel.com>
Change-Id: I68495a4df74cfb3ee7f8278567c7f76f0d568b26
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16984
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
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-04-03 09:16:50 +00:00
Michal Berger
240177af76 pkgdep/git: Update ICE driver to latest version
Needed for the recent changes in the 6.2 kernel.

Also, add an extra patch to address changes in the net/core not
available in the out-of-tree driver.

Change-Id: I2e279a7728bbb462da99b79fad6a91ebd97ecae7
Signed-off-by: Michal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17337
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
2023-04-03 06:52:17 +00:00
Michal Berger
f060614249 pkgdep/git: Update QAT driver to the latest release
Needed for the recent changes in the 6.2 kernel.

Change-Id: I1788b11712dc581520ddcc5382894652be3a5576
Signed-off-by: Michal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17336
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-04-03 06:52:17 +00:00
Szulik, Maciej
fb058fe576 test/nvme: add doorbell_aers test app
This application can be used to test AER flows related to doorbell
errors.

Signed-off-by: Szulik, Maciej <maciej.szulik@intel.com>
Change-Id: Idc04d326f08f8e04455c77ab8265cc601485afbe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17401
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-03-31 17:41:35 +00:00
Jim Harris
7d44b36e0d nvme: only prefetch req's stailq when req != NULL
It is fine to prefetch an invalid address, but ASAN
doesn't like it.  So move the prefetch slightly to
make ASAN happy.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib51ab8890e5fe91d30057f65e1399cfc9dd1dd49
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17432
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-31 17:41:35 +00:00
Szulik, Maciej
7858e18b05 lib/nvme: restore spdk_nvme_ctrlr_get_registers
This function was intended to be deleted as unused, however it can be
useful for debug and test capabilities.

Its declaration was left in header file, so just adding implementation
for PCIE and VFIO USER transports.

Signed-off-by: Szulik, Maciej <maciej.szulik@intel.com>
Change-Id: I670acb53c2f88a844525a0ecea27143b055f117b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17400
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-03-31 17:41:35 +00:00
Szulik, Maciej
414ff9bc23 nvmf: make async event and error related functions public
This patch makes functions related to Asynchronous Event and error
handling public, so that they can be used in custom nvmf transport
compiled out of SPDK tree.

Signed-off-by: Szulik, Maciej <maciej.szulik@intel.com>
Change-Id: I253bb7cfc98ea3012c179a709a3337c36b36cb0e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17237
Community-CI: Mellanox Build Bot
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-03-31 17:41:35 +00:00
Karol Latecki
a7d3e1068e autotest: set FreeBSD kern.ipc.maxsockbuf to 4k
unittest_sock unit tests fail on FreeBSD due to
ENOBUFS. Increase to buffer size to 4k for tests
to pass.

Fixes #2943

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I55d1164d49edb2d90ebfe5f720a615f052ee52d9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17370
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-03-30 08:47:36 +00:00
Michal Berger
45dc5f12ff test/setup: Lower per_node_2G_alloc to per_node_1G_alloc
For some systems, depending on the mem distribution, 2GB per node may be too much. Just lower it to 1GB as the only thing we are verifying here
is HUGENODE usage in this test.

Also, make sure we always log output from setup.sh.

Change-Id: If7c382b442e9523fe5ad5df03110a8cc5467f1d9
Signed-off-by: Michal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17367
Reviewed-by: Jaroslaw Chachulski <jaroslawx.chachulski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2023-03-30 07:01:43 +00:00
Marcin Spiewak
c6591af05b lib/thread: fixed potential dereferencing of NULL pointer
Fixed issue indicated by Klocwork scan. 'name', which potentially
might be NULL, is passed as function parameter. Now the function
name will not point to NULL, and will be the same in interrupt
structure and in event handler.

Change-Id: I5588821139d11288a96f5041703d5b7b71890ad6
Signed-off-by: Marcin Spiewak <marcin.spiewak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17356
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-03-30 07:01:26 +00:00
Artur Paszkiewicz
d69516f5e7 thread: remove spdk_{start|stop}_poller typedefs
These are not used anywhere.

Change-Id: I04dba71d35b6684af13a8ff00f104665f2905cff
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17286
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
2023-03-29 06:10:03 +00:00
Jim Harris
2e1c5a722d dpdk_mem_info.py: handle spaces in mempool names
DPDK is OK with spaces in mempool names.  SPDK has
never done it, but latest OCF code uses a name with
a space that gets used as a mempool name. The
dpdk_mem_info.py script was parsing mempool
information assuming there were no spaces in the
name.  So this patch fixes it.

Note: I created a dummy memzone with a space in
its name, and confirmed that works correctly.  So
only mempool names needed to be fixed.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I76d4e6e94852dd697b4be187e6ee625db867867a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17316
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Amir Haroush <amir.haroush@huawei.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-28 21:02:13 +00:00
Yuri Kirichok
daaa699efa test/nvme: added test for bdev controller reset
This test scenario does the following:
- Attaches the controller to NVMe device.
- Injects an error timeout for admin command SPDK_NVME_OPC_GET_FEATURES
- Runs controller reset.

In this scenario the call for 'controller reset' should abort any outstanding requests that are waiting for completion defined in 'error injection' RPC call. Test fails if request(s) are not aborted (manually completed).

Signed-off-by: Yuri Kirichok <yuriy.kirichok@hpe.com>
Change-Id: I512de92e948d04cad538db378b44fd4d58d85bb3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17113
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
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-03-28 20:18:33 +00:00
Jim Harris
3b138377e2 nvmf/tcp, nvmf/rdma: default to dynamic buf_cache_size
The nvmf generic transport code creates a mempool of
I/O buffers, as well as its own per-thread cache
of those buffers.  The mempool was being created
with a non-zero mempool cache, effectively duplicating
work - we had a cache in the mempool and then another
in the transport layer.

So patch 019cbb9 removed the mempool cache, but the
tcp transport was significantly affected by it.  It
uses a default 32 buffers per thread cache which is
very small, it was actually mostly relying on the
mempool cache (which was 512).  Performance regression
tests caught this problem, and Karol verified that
specifying a higher buf_cache_size fixed the problem.

So change both the tcp and rdma transports to specify
UINT32_MAX as the default buf_cache_size.  If the
user does not override this when creating the transport,
it will be dynamically sized based on the size of
the buffer pool and the number of poll groups.

Fixes: 019cbb9 ("nvmf: disable data buf mempool cache")

Fixes issue #2934.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Idd43e99312d59940ca68402299e264cc187bfccd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17203
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
2023-03-28 20:17:21 +00:00
Jim Harris
3092c61d26 nvmf: enable dynamic buf_cache_size calculation
Allow transports to specify a default UINT32_MAX
as the buf_cache_size. If user does not override this
when creating the transport, calculate the buf_cache_size
dynamically using the number of poll groups and the
size of the buffer pool (num_shared_buffers).  We will
allocate 75% of the buffers for the caches, meaning
the buf_cache_size will be calculated as:

(num_shared_buffers * 3 / 4) / num_poll_groups

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I97768aea701060bbe0ff1925e5322229fa8d051c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17334
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-03-28 20:17:21 +00:00
Jim Harris
280a3abc9c nvmf: return early in nvmf_transport_poll_group_create
When buf_cache_size is 0, just return early.  This
allows us to un-indent a large section of code.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I167da677fdcd0504c6f2bfdb8b1a818155642f66
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17333
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-03-28 20:17:21 +00:00
Jim Harris
2597ebbede nvmf: point poll_groups back to their spdk_nvmf_tgt
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie7eaeb3aa65f0a8f8f9e811d025045fff7f77724
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17332
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-03-28 20:17:21 +00:00
Jim Harris
f9424ae73d nvmf: track num_poll_groups in spdk_nvmf_tgt
This will be useful in upcoming patch, where we
use the number of poll groups to dynamically pick
the buf_cache_size for each transport poll group.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id166098244287c56f12cdd88ba27a17fa34a4348
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17331
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-28 20:17:21 +00:00
Pawel Piatek
680ed635b3 scripts/vagrant: revert to use sshfs by default
This partially revert commit edc93a246.
Vagrant nfs support is broken in a way it changes /etc/exports
file, but leaves there broken entries. Most probably there
is some kind of race condition.
Keep support for NFSv4 to use it by default if vagrant sshfs
plugin is not installed or if user force to use it.

Signed-off-by: Pawel Piatek <pawelx.piatek@intel.com>
Change-Id: I871fbfa0f33c35d7a2ed3c91d56b39112a5d21ca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17352
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-28 13:19:18 +00:00
Changpeng Liu
e641e8f3f6 lib/ublk: use page aligned data buffer
Kernel `ublk_drv` driver will do memcpy to this data buffer in
unit of page size, for a simple 4KiB I/O, it may call memcpy
twice if the data buffer isn't page aligned.  Moreover, SPDK
may also has double buffers with this case, so here, we use
page aligned data buffer at initialization.

Change-Id: Ica86a9702283327a2bb491e38990b8c00bc77f57
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17283
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-03-28 10:20:50 +00:00
Mike Gerdts
26037aa3b0 accel: allow libisal and libisal_crypto
If CONFIG_ISAL and CONFIG_ISAL_CRYPTO are both defined, the build was
only including the LOCAL_SYS_LIBS for libisal_crypto. This fixes that
bug using the same technique used in other Makeifles.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I4c0869d60742cd6bdb0812d67db3abbfa7e69122
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17345
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-03-28 07:07:06 +00:00
Marcin Spiewak
a7cd3a2d57 lib/bdev: fixed potential dereferencing of NULL pointer
Fixed issue indicated by Klocwork scan. 'desc->bdev'
is assigned to 'bdev' ptr, before verification that
'desc' is not NULL

Change-Id: I36e63c27b4d3220e85524133a0ec0e3521770875
Signed-off-by: Marcin Spiewak <marcin.spiewak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17350
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-28 07:03:56 +00:00
Jaroslaw Chachulski
20c6796eaf scripts/nvmf_perf: fix for check_rdma_protocol function
Roce_ena object is already a string so you cant use decode() on it.
Added more log information

Signed-off-by: Jaroslaw Chachulski <jaroslawx.chachulski@intel.com>
Change-Id: I93f56ba0c7a562afd86a2bbb961f961ef30a2ae0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17293
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Michal Berger <michal.berger@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2023-03-28 07:03:22 +00:00
Jaylyn Ren
2b24637557 spdk_top: fix the core usage display issue
Fix the incorrect cpu usage display in core page.

Signed-off-by: Jaylyn Ren <jaylyn.ren@arm.com>
Change-Id: I073f4b16ed4c829f7713b2cb67bde54be5def783
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17288
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>
2023-03-28 07:02:49 +00:00
Konrad Sztyber
2a463e3e26 test/json_config: detach virtio controllers before shutdown
If the controllers are left attached when the application is terminated,
the virtio library might receive notifications about memory being
unregistered from the mem_map.  The apps in json_config test are
preallocating 1GB of memory, which should stop DPDK from releasing the
hugepages back to the system, but if they allocate more, that extra
pages can be released, which would generate the mem_map notifications .

This actually happened in #2951 - spdk_tgt was built with ocf support,
which preallocates an extra ~300MB mempools, exceeding 1GB, which caused
mem_map notifications to be sent when iscsi mempools were destroyed
triggering an assertion in virtio.

Another option to fix this would be to increase the size of the
preallocated memory, but detaching the controllers achieves the same
thing without requiring more resources.

Fixes #2951.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I743af39acfee68caba55ec4fccd593a696ab688b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17265
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-03-28 06:58:38 +00:00
Konrad Sztyber
e6f5dbb02b test/unit: add missing jsonrpc stubs
It fixes the following error under clang:

/usr/bin/ld.bfd: bdev_nvme_ut.o: in function `bdev_nvme_get_mdns_discovery_info':
/home/ksztyber/src/spdk/module/bdev/nvme/bdev_mdns_client.c:578: undefined reference to `spdk_jsonrpc_begin_result'
/usr/bin/ld.bfd: /home/ksztyber/src/spdk/module/bdev/nvme/bdev_mdns_client.c:599: undefined reference to `spdk_jsonrpc_end_result'

It probably works on gcc, because the bdev_nvme_get_mdns_discovery_info
isn't called anywhere in the unit test and gets optimized away.

Fixes #2950

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2bb856afbc1a1a7e882dec72e4182ad9d3b9b24a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17260
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2023-03-28 06:57:59 +00:00
Konrad Sztyber
1ac56070bc test/unit: add missing spdk_mempool_lookup stub
It fixes the following error under clang:

/usr/bin/ld.bfd: vfio_user_ut.o: in function `nvmf_transport_create_async_done':
/home/ksztyber/src/spdk/lib/nvmf/transport.c:203: undefined reference to `spdk_mempool_lookup'

It probably works on gcc, because the nvmf_transport_create_async_done
isn't called anywhere in the unit test and gets optimized away.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I497aae4d211d556a531455481ee9a69067988cce
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17259
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2023-03-28 06:57:59 +00:00
Konrad Sztyber
1b49dcefcb build: rely on configure to select which unit tests to build
There's no reason to check the OS to decide whether to build some unit
tests if we can rely on the configure parameters.  For instance, on
FreeBSD, RDMA unit tests can be built and run successfully, while vhost
is always disabled in configure.

Fixes #2941.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I0073783dcafa932f3a7f48fa553e04be7ae44f84
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17182
Reviewed-by: Ben Walker <benjamin.walker@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>
Community-CI: Mellanox Build Bot
2023-03-28 06:57:40 +00:00
Mike Gerdts
8e612918c2 lvol: allocate lvs before loading it
This refactors the code paths that call lvs_load() to allocate the
spdk_lvol_store structure before calling lvs_load(). Previously this
allocation was done in lvs_load_cb(). This is being done because a later
patch requires a pointer to the structure to be passed to lvs_load via
the spdk_bs_opts structure.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I2e942d1f7525fa5a16cd34b1b4b3a0a821e13006
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17220
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-03-28 03:57:35 +00:00
Mike Gerdts
9ea88fcb72 blob: refactor parent_id and allocate_all checks
The blob's parent_id and allocate_all examined and/or modified in a
two places bs_inflate_blob_open_cpl(). This transforms the two if
statements scattered around the function into a switch statement to make
it easier to understand how these two values are related.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I2cff2d07a0089b52678035b2ece60db6a5f67a8e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17178
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-28 03:57:35 +00:00
Mike Gerdts
ecee22738b lvol: introduce lvs_alloc()
There are multiple locations where a struct lvol_store is allocated.
This invites inconsistency in initialization, which will become more of
a problem as esnap clones have additional initialization.

Now all struct lvol_store allocations should be done with lvs_alloc().

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I07a2f274475375072f80c25ed67cb1fb802cc4e1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16231
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-03-28 03:57:35 +00:00
Mike Gerdts
a30ec964f9 lvol: introduce lvol_alloc()
There are several places where new lvols are created and each reproduces
much of the same code. Esnap clones will add yet another in lvol.c and
more in unit tests. This introduces lvol_alloc() to minimize the chance
of unintended skew over time.

A side effect of this is that snapshots and clones now inherit clear
method from their parent. Previously they would fall back to the
default. The old behavior seems to be accidental, hence the change.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Ibf6f79c567e92354ea73e6589c736b1b946731a0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14976
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
2023-03-28 03:57:35 +00:00
Mike Gerdts
0e41ee0b83 lvol: remove unused lvol->thin_provision
The thin_provision member of struct spdk_lvol is set but never used.
When needed, an lvol's thin provision state is obtained by looking at
the lvol's blob. This removes the unused thin_provision member.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I5a2048b5334a26772a25a0bd238e42d3aeb63b49
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17173
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
2023-03-28 03:57:35 +00:00
Mike Gerdts
aaebaece6d blob: hotplug new back_bs_dev
When an esnap clone blob's external snapshot arrives after the blob is
opened, it can now be hot-added to the blob. Presumably the new device
replaces a place-holder device that did not really atteempt IO.

Change-Id: I622feb84efa66628debf44f7e7cb88b6a012db6d
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16232
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-03-28 03:57:35 +00:00
Mike Gerdts
55199ed166 blob: abort IO when replacing esnap channel
This adds the ability to abort IOs as esnap bs_dev channels are being
destroyed.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Ia63d4cbef5cd4c84dc8d5e2e9e407bacd961385f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16423
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
2023-03-28 03:57:35 +00:00
Mike Gerdts
421fb11094 blob_bdev: defer free until all channels destroyed
To avoid races that lead to use-after-free errors during esnap device
hot add/remove, we need a way to ensure that the destroy callback does
not free a bs_dev until all consumers are done.

This adds reference counting to the create_channel() and
destroy_channel() callbacks. The reference couunt is initialized to 1
and is decremented by destroy(). The destroy() and destroy_channel()
callbacks are updated to free the bs_dev only when the reference count
drops to 0.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Ie0b873717e431b33ce6548f878643dbc66d4f956
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16422
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-28 03:57:35 +00:00
Mike Gerdts
ba91ffbae1 blob: defer unload until channel destroy done
As the blobstore is being unlaoded, async esnap channel destructions may
be in flight. In such a case, spdk_bs_unload() needs to defer the unload
of the blobstore until channel destructions are complete.

The following commands lead to the illustrated states.

  bdev_malloc_create -b malloc0
  bdev_lvol_clone_bdev lvs1 malloc0 eclone

     .---------.   .--------.
     | malloc0 |<--| eclone |
     `---------'   `--------'

  bdev_lvol_snapshot lvs1/eclone snap

     .---------.   .------.   .--------.
     | malloc0 |<--| snap |<--| eclone |
     `---------'   `------'   `--------'

  bdev_lvol_clone lvs1/snap eclone

                                .--------.
                              ,-| eclone |
     .---------.   .------.<-'  `--------'
     | malloc0 |<--| snap |
     `---------'   `------'<-.  .-------.
                              `-| clone |
                                `-------'

As the blobstore is preparing to be unloaded spdk_blob_unload(snap) is
called once for eclone, once for clone, and once for snap. The last of
these calls happens just before spdk_bs_unload() is called.
spdk_blob_unload() needs to destroy channels on each thread. During this
thread iteration, spdk_bs_unload() starts. The work performed in the
iteration maintains a reference to the blob, and as such it
spdk_bs_unload() cannot do its work until the iteration is complete.

Change-Id: Id9b92ad73341fb3437441146110055c84ee6dc52
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14975
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-03-28 03:57:35 +00:00
Mike Gerdts
652232ae16 blob: esnap clone inflate and decouple
This adds support for inflate and decouple for esnap clones. Since there
are no immediate consumers that will provide back_bs_dev->is_zeroes()
that can return true, a shortcut is taken in that inflate and decouple
of esnap clones are the same.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I4d2e6565126991acd650f073ce876466334e986d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11574
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-28 03:57:35 +00:00
Mike Gerdts
94c43313ab blob: snapshots of esnap clones
An esnap clone needs special handling as snapshots are created and
removed. In particular: the following must exist on the blob that
directly references the external snapshot and must be removed from
others:

- Ensure SPDK_BLOB_EXTERNAL_SNAPSHOT invalid flag exists only on the
  esnap clone.
- Ensure BLOB_EXTERNAL_SNAPSHOT_ID internal xattr exists only on the
  esnap clone.
- Clean up any esnap IO channels on a blob that is no longer an esnap
  clone due to snapshot creation or removal.

See the diagrams and description in blob_esnap_clone_snapshot() in
blob_ut.c for details.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Ie4125d64d5bac9cfa7d6c7cc9a543d72a169f6ee
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11573
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
2023-03-28 03:57:35 +00:00
Mike Gerdts
b47cee6c96 blob: add IO channels for esnap clones
The channel passed to blob IO operations is useful for tracking
operations within the blobstore and the bs_dev that the blobstore
resides on. Esnap clone blobs perform reads from other bs_devs and
require per-thread, per-bs_dev channels.

This commit augments struct spdk_bs_channel with a tree containing
channels for the external snapshot bs_devs. The tree is indexed by blob
ID. These "esnap channels" are lazily created on the first read from an
external snapshot via each bs_channel. They are removed as bs_channels
are destroyed and blobs are closed.

Change-Id: I97aebe5a2f3584bfbf3a10ede8f3128448d30d6e
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14974
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-03-28 03:57:35 +00:00
Rui Chang
d0516312ff nvmf: add copy command support in get log page
add copy command support in get log page and idenfity tool

Change-Id: I8771ffb193fc80ffc12f068993005e5702f41a0d
Signed-off-by: Rui Chang <rui.chang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17162
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-03-27 11:25:35 +00:00
Artur Paszkiewicz
3189582989 pkgdep: replace python-base with python3-base on sles
Python 2 has been removed from SLE so python-base installation will
fail and we only need python 3 anyway.

Change-Id: I0ac17b87313858f733f9dbbdf034cc5b118ef469
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17224
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2023-03-27 10:51:45 +00:00
Richael Zhuang
657cddc209 test/bdev_nvme: remove duplicated asserts
Two asserts are duplicated.

Change-Id: I9f2eff18e2f844708a8ea65d3f367709e8be512c
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17294
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2023-03-27 10:51:20 +00:00
Tomasz Zawadzki
fa6039abd2 ut/vfio_user: add UT execution for vfio_user
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I8f52b941e869ba59e6031f69b8d7ffd120080155
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16893
Community-CI: Mellanox Build Bot
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>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-03-27 10:50:42 +00:00
Michal Berger
eda86acfe0 test/vhost: Use --force for all mkfs and wipefs calls
Also, drop some code that's essentially not needed to improve
readability.

Change-Id: I5fda1c179983ce905661918e6f821eca486bb58d
Signed-off-by: Michal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17218
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-03-27 10:48:46 +00:00
Karol Latecki
0c653409dc test/vhost: add virtio blk transport negative test
Try to create virtio blk transport. Transport is
created at application start, so EEXIST error is
expected.

This is aimed purely at using
rpc_virtio_blk_create_transport() from vhost_rpc.c
to increase code coverage.

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: Iba87ef73f8d5a962bf5eac28c7e6c93bdb65b67f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16436
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-24 14:32:05 +00:00