Commit Graph

6967 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Konrad Sztyber
ed23b2078a test/unit: use valid v4 UUID in NQN tests
On FreeBSD spdk_uuid_parse() will fail if the UUID doesn't have the
variant/version fields filled in correctly.  So, use a proper UUID in
the test to make them pass on FreeBSD.

Fixes #2942.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I7c5384086c6828c7380f9d128878578301077b17
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17184
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-03-24 07:25:42 +00:00
Michal Berger
ede1caf025 lib/vhost: Rename rte_vhost_slave_config_change()
As per https://github.com/DPDK/dpdk/commit/71998eb61ff

Change-Id: Ie4e5a38976145e1037ef45593b4dc4265091482d
Signed-off-by: Michal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17322
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-24 07:23:19 +00:00
Michal Berger
8075955f60 test/common: Don't apply ipsec_mb patch on DPDK >= 23.03
The change in question is already available upstream.

Change-Id: I26a641f8314a3292d57124056ac197e1f861685d
Signed-off-by: Michal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17321
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-03-24 07:23:19 +00:00
Karol Latecki
690cf1c9b1 autotest_common: suppress libcrypto leaks in asan tests
Asan reports memory leaks from CRYPTO_zalloc which
seem to be caused by openssl library.

See https://github.com/spdk/spdk/issues/2947

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I964acc8ae8c3a6978ea01a0235a32661ffbc74c0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17217
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-23 08:28:08 +00:00
Michal Berger
85ce5767db test/nvmf: Increase size of the malloc bdev
xfsprogs refuse to create fs smaller than 300MB since:

https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?id=6e0ed3d19

To make sure mkfs does not fail, increase bdev size to 512MB.

Change-Id: Ic313db06cfab43f13f43a269c9cc058391bfb8ad
Signed-off-by: Michal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17214
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-23 08:27:37 +00:00
Mike Gerdts
c64ce716e4 blob: add spdk_blob_is_esnap_clone
Add an API to easily determine if a blob is an esnap clone, similar to
what already exists for snapshot, clone, and thin_provisioned.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Ie07cd09b30513893e82f1c85e94a24a93c79d71e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16862
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-22 09:39:29 +00:00
Mike Gerdts
4d5ee263b1 blob: pass blob context to esnap_bs_dev_create
When consumers open a blob with spdk_bs_open_blob_ext(), they can set
esnap_ctx in struct spdk_blob_open_opts to have that context passed
to bs->external_bs_dev_create().

Change-Id: I0c1a9cec0e5aed5ef2a7143103e822cbe400aabb
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14971
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-22 09:39:29 +00:00
Michal Berger
a75bdf361c test/nvme/cuse: Don't check OACS in the parent test
This job is already done by the target test. Also, this makes sure
that nvme_ns_manage_cuse is always executed (note that we don't
consider it as a test to be skipped).

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I6d964230e4d961152912b1f8a0636712039eeae6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17080
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-22 07:09:37 +00:00
Michal Berger
685dfa0ade test/nvme/cuse: Create common wrapper around OACS
Use it in the nvme_cli_cuse to make sure proper drive was selected
for the test (i.e. supporting ns management) - some of the nvmes
installed in the CI pool don't support ns management, hence all
related commands fail as part of these tests.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ib93933d7ee9b0d2eb283313d3f2bbb6f4af727a4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17079
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-22 07:09:37 +00:00
Michal Berger
a18050e8d6 test/scheduler: Merge cppc_cpufreq into acpi-cpufreq check
They have exactly the same conditions, no need to keep it separate
for now.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I6826ffe7b70e3d502f483cf1966930586a6f9f0b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16934
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Richael <richael.zhuang@arm.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-22 07:08:22 +00:00
Michal Berger
7832b34f94 test/scheduler: Trigger actual freq drop
In order to do so we need to make sure that freq is lowered for
all thread siblings of a given core. Since DPDK and/or dynamic
scheduler do not take that into the account we need to do this
on our own.

Find thread sibling of the main cpu and imitate the DPDK's governor
work by adjusting its freq settings.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I154a2a789903b66c2722160d7e252221083f5e3c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16930
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-22 07:08:22 +00:00
Jim Harris
7c3c0b6630 blob: track last md_page index correctly during resize
During resize, we correctly determine if we have enough
md_pages for new extent pages, before proceeding with
actually allocating clusters and associated extent
pages.

But during actual allocation, we were incrementing
the lfmd output parameter, which was incorrect.
Technically we should increment it any time
bs_allocate_cluster() allocated an md_page.  But
it's also fine to just not increment it at the
call site at all - worst case, we just check that
bit index again which isn't going to cause a
performance problem.

Also add a unit test that demonstrated the original
problem, and works fine with this patch.

Fixes issue #2932.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iba177a66e880fb99363944ee44d3d060a44a03a4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17150
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: 阿克曼 <lilei.777@bytedance.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
2023-03-15 09:27:17 +00:00
Jim Harris
037c8b01a1 blob: remove short-circuiting path for blob_freeze
If blob_freeze_io() is called twice in a row,
and the second time occurs before the for_each_channel
for the first completes, the second caller will
receive its callback too soon.

Instead just simplify the whole process, always do
the for_each_channel and don't try to optimize it
at all.  These are infrequent operations - correctness
and simplicity are in order.

A few additional changes:

1) Make same changes for unfreeze path.
2) Add blob_verify_md_op() calls, just to be sure
   these are only called from md_thread.  This was
   already checked in calling functions, but as these
   functions get called from new code paths (i.e.
   esnap clones) it can't hurt to add additional
   checks.
3) Add unit test that failed with original code, but
   passes with this patch.

Fixes issue #2935.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ibefba554547ddf3e26aaabfa4288c8073d3c04ff
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17148
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Mike Gerdts <mgerdts@nvidia.com>
Community-CI: Mellanox Build Bot
2023-03-15 09:27:17 +00:00
Michal Berger
76a2663e43 test/common: use vhost's at_app_exit() during cleanup
This function can be used to kill all lingering vhost and qemu
processes that might have been left behind by vfio-user|vhost
tests.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I17121f416e26732d53b5dfec0f010e5db8bd369f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15186
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.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>
2023-03-14 07:11:07 +00:00
Michal Berger
b76cb37ce4 test/nvmf: Fix trap
Also, add at_app_exit() to make sure that all vhost and qemu
instances are terminated as well.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I917f1cb1b02d18b78a482d754a19f509e580fc98
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15185
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2023-03-14 07:11:07 +00:00
Konrad Sztyber
43cf39be90 bdev/crypto: memory domain support
Now that all crypto operations are using interfaces that support memory
domains, bdev_crypto can report support for memory domains.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I13a128a599f6560197fed3405599c2a6bb609703
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17041
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-03-13 21:02:27 +00:00
Konrad Sztyber
382200062c test/blockdev: add extra crypto bdev for crypto_sw
This will stress the accel chaining code just a little bit more.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: If08625b8606a021a3494eb4aa8527d2b338bd255
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17040
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-13 21:02:27 +00:00
Konrad Sztyber
3fbe74fd82 accel: don't modify user iovs when allocating buffers
It is quite common for a user to use the exact same iovec (in memory) to
describe buffers for two different operations.  If that iovec was
describing accel buffer, accel would modify it replacing it with an
actual buffer.  This is broken if that iovec was used by some other task
in a sequence, as accel wouldn't be aware that it has been changed too.

To address this, accel will use a new iovec from the aux_iovs array.  It
means that accel buffers always *must* be passed using a single iovec.
Theoretically, users could chunk that buffer into several iovecs, but
spdk_accel_get_buf() always returns a single buffer, so, in practice,
this should never happen, and therefore is unsupported.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I25271bc032987dd6028fb7b3adde061657759b4b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17039
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-03-13 21:02:27 +00:00
Konrad Sztyber
454ee6be5e bdev/crypto: merge IO-type specific callbacks
All these callbacks look identical now, so there's little point in
having three different functions doing the same thing.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I60d1426b5d2b20d924776699885e6a9dd176504a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17024
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2023-03-13 21:02:27 +00:00
Konrad Sztyber
5b18e904d2 bdev/crypto: remove quiescing reset code
After changing to spdk_accel_append_*, this code is no longer necessary,
as accel operations are now executed by the base bdev/bdev layer.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2e31249dfdf7abeee420744a5cc75b8273ecbad9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17023
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-13 21:02:27 +00:00
Konrad Sztyber
85cf8d273f bdev/crypto: use accel appends for encryption
Similarly to reads, writes path is now also using the spdk_accel_append*
interface for performing encrypt operation.

Additionally, this patch also changes the way aux buffer is allocated -
spdk_bdev_io_get_aux_buf() was replaced with spdk_accel_get_buf().  This
ensures that the actual data buffer will be only allocated if it's
actually needed.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I3cd1d4f5753a95709d7b81de23d9227102a74261
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17022
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-13 21:02:27 +00:00
Konrad Sztyber
5d860c18d4 bdev/crypto: use accel appends for decrypting data
The new spdk_accel_apend_decrypt() interface is now used for all read
requests for decrypting data.  This makes it possible to chain decrypt
operations with other operations in a sequence.  Support for encryption
in the write path will be added in the following patches.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2f65044eeaf92232d839ddd166ae50889b3f386d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17021
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-13 21:02:27 +00:00
Konrad Sztyber
04c222f2db bdev: accel sequence support for read requests
This patch enables passing accel sequence for read requests.  The
handling is pretty similar to writes, but the sequence is executed after
a request is completed by a bdev module.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I79fd7d4873265c81a9f4a66362634a1c4901d0c9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16975
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-03-13 21:02:27 +00:00
Konrad Sztyber
22c0e97884 bdev: accel sequence support for write requests
It is now possible to submit a write request with a sequence of accel
operations that need to be executed before actually writing the data.

Such requests will be directly passed to a bdev module (so that it can
append subsequent operations to an accel sequence) if that bdev supports
accel sequences and the request doesn't need to be split.  If either of
these conditions are not met, bdev layer will execute all the
accumulated accel operations before passing the request to a bdev
module.

The reason for not submitting split IOs with an accel sequence is that
we would need to split that accel sequence too.  Currently, there's no
such functionality in accel, so we treat this case in the same way as if
the underlying bdev module didn't support accel sequences (it's executed
before bdev_io is split).

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I66c53b3a1a87a35ea2687292206c899f80aaed4a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16974
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-03-13 21:02:27 +00:00
Konrad Sztyber
80b22cf314 bdev: allocate accel_channel for each bdev_channel
This channel will be used to execute accel operation sequences.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ied4bb57d14a50a923908ffb13ef4ba34ca65175c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16972
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-03-13 21:02:27 +00:00
Konrad Sztyber
dc4cb8bf83 test/sma: limit number of vhost-blk devices to 2
We *really* don't need to fill the whole bus with virtio-blk
controllers, the intention is just to verify that they can be created on
two different buses.  So, instead of looping through 33 devices, specify
two addresses that will translate to bus 0 and bus 1.

This significantly reduces the amount of necessary resources needed for
this test.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I6d60bd0fa840596d2231f50fc10ccde6b47ac60e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17032
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-13 21:02:27 +00:00
Michal Berger
66a352354b test/common: Don't assume cntlid is 0 in nvme_namespace_revert
Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ib9e26b1c5112d7cfd59e6621bdfe1c9dc0fce008
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17047
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-13 09:39:21 +00:00