Commit Graph

19402 Commits

Author SHA1 Message Date
Michal Berger
1efd574527 test/vhost: Don't remove QEMU's pidfile when terminating the process
QEMU is fully capable of unlinking its own pidfile so it may happen
that after sending a signal to terminate it, the file is already gone
when we attempt to rm it - in such a case, rm fails leading to overall
test failure. Avoid that by allowing QEMU to do its job.

For cases where QEMU might have potentially failed (e.g. due to a crash)
we leave the rm in with an extra -f on its cmdline.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ia8d5c73dd76225583a63c1f622835e22ce32e66c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16040
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-12-22 08:53:50 +00:00
Changpeng Liu
5871a46e99 vfu/virtio-blk: add missed \n in error log
Change-Id: Ia70aed9d5345a399988cf2e60cf7e4368480c675
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15583
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-12-21 12:25:48 +00:00
Changpeng Liu
4a78a37fd7 test/vfu_virtio: add SPDK virtio initiator bdevperf tests
Change-Id: Ifc86834c1fae7087b4e25e00d9576decffa7248a
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15075
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-12-21 12:25:48 +00:00
Mike Gerdts
b09ae853f9 doc: mention SPDK spinlocks in concurrency.md
Encourage the use of spdk_spinlock over pthread_mutex_t and
pthread_spinlock_t to improve safety and debugability.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I22e2d3cc917687c9878d7558fe8c640051b51a45
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16021
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>
2022-12-21 09:34:34 +00:00
GangCao
ed4b89aaab examples/bdevperf: reset the performance period for next run
In the case of running by below commands:

./examples/bdev/bdevperf/bdevperf.py perform_tests

This value needs to be reset in each run, otherwise, it shows
wrong IOPS in the periodical way with -S parameter.

Change-Id: Ib8de7611aa06675d4a16fc3aa130d99b508b7605
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15960
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: Changpeng Liu <changpeng.liu@intel.com>
2022-12-21 09:34:12 +00:00
Simon A. F. Lund
b99b00e595 bdev_xnvme: add option to conserve cpu and set default to false
To achieve the highest possible IO-rates and lowest latency, then CPU
cycles must be spent processing IO. This commit introduces three
different techniques dependendent on the 'io_mechanism' used.

For 'libaio', xNVMe is instructued via 'opts.poll_io' to not wait for
completions, thus xnvme_queue_poke() returns immmediatly, the user can
then call xnvme_queue_poke() as frequently as desired. This requires
xNVMe v0.5.0. Earlier versions will ignore 'opts.poll_io' for 'libaio'.

For 'io_uring', xNVMe is instructed via 'opts.poll_io' to enable
IORING_SETUP_IOPOLL.

For 'io_uring_cmd', xNVMe is instructued via 'opts.poll_sq' to enable
IORING_SETUP_SQPOLL, this sets up a kernel-side thread reaping
completions from user-space on the ring. Note that 'io_uring_cmd'
requires liburing >= 2.2.

This commit enables the above by default. The above can be disabled by
setting 'conserve_cpu' to true on the bdev-setup.

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: Id54f1e59733ce9ae3b174ad4562904d868d4ef4f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14678
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-12-21 09:33:27 +00:00
Simon A. F. Lund
877573897a xnvme: update submodule to v0.5.0
This updates the xNVMe submodule to v0.5.0 and adjusts the Makefile,
disabling a backend (libvfn) introduced in v0.5.0 which is not of
interest.

With xNVMe v0.5.0 two things important for the bdev_xnvme has changed:

* The 'libaio' backend implementation responds to 'opts.poll_io'. It
  does so by 'xnvme_queue_poke()' returning immediatly instead of
  waiting for at least one outstanding IO to complete or for a timeout
  to occur. This dramatically improves the IO-rate and reduces latency.

* Prior to xNVMe v0.5.0, the liburing library was vendored and "bundled"
  into the xNVMe library. This library-bundling can cause linker issue
  and is thus replaced by linking "properly" with liburing on the system
  via pkg-config discovery.

  To make sure linker can properly link libxnvme.a's content we need to
  make sure we point at system's -luring during the build. Effectively,
  this can now work together with --with-uring[=/uring].

This change is made in preparation to adding the 'conserve_cpu' option
which makes use of 'opts.poll_io' for 'io_mechanism=libaio'.

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ibd6e620679a3991a4a8642bb39390a61284aac74
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14677
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>
Community-CI: Mellanox Build Bot
2022-12-21 09:33:27 +00:00
Michal Berger
fecffda6ec scripts/pkgdep: Install liburing's .pc to known directory
Under fedora, install_liburing() would put .pc under
/usr/lib/pkgconfig, whereas the pkg-config, by default, looks under
/usr/lib64/pkgconfig.

For the tests, make sure both paths are included in the environment
in case any entity (like xnvme) attempts to use pkg-config during
build.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Iab3a4d1f69afc12c56c9fa6b7dd99daaca670e45
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15853
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: Konrad Sztyber <konrad.sztyber@intel.com>
2022-12-21 09:33:27 +00:00
Jim Harris
3327bb4391 histogram_data: check bucket_shift when merging
When merging data from one spdk_histogram_data to
another, the merging is only valid if the bucket_shift
for each structure is the same.  Otherwise we are
combining data points that cover different ranges
of values.

So check that the bucket_shifts are the same before
merging. Change the return type to int to
return -EINVAL if structures with different
bucket_shifts are attempted to be merged.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If98e2d03384d85f478965956da2a42cfcff4713d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15813
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-12-21 09:32:40 +00:00
Mike Gerdts
69bec87a91 scripts: gdb macros should allow missing symbols
When gdb_macros.py is used with unit tests some of the globals it
expects are not present. This commit handles the relevant exceptions so
a missing symbol does not prevent the use of macros that are initialized
later.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Ic81f0dfa705839c9a03fb76e934684716b710390
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15999
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-12-21 09:32:24 +00:00
Mike Gerdts
555ca7adc0 rpc: fix python style
A bunch of python files in rpc and scripts directories were missing two
blank lines after the opening comments. python3-pycodestyle-2.5.0-2.el8
was unhappy with this

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Iee7f2bd4f0ddd96b2be89949a3aa324b2f9ea43a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16003
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-12-21 09:32:24 +00:00
Michal Berger
5dcb6e2426 scripts/rpc: Don't load same plugin module more than once
This is only relevant when rpc.py is running in server mode. Recent
changes in argparse under python3.11 force it to raise the
ArgumentError exception whenever subparser of the same name is being
added.

With that in mind, avoid extra call to spdk_rpc_plugin_initialize()
by keeping track of all plugins that were already successfully
initialized.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I89124738b995ba774b6619f97726a5bd69fe1fd9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15807
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Kamil Godzwon <kamilx.godzwon@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
2022-12-20 09:20:56 +00:00
GangCao
56f5f7e9d4 lib/iscsi: missing a comma for the string
Change-Id: I67f2b73923c2ea0fe985c4a92f6f72cd2fb4a438
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16008
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: wanghailiang <hailiangx.e.wang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Mellanox Build Bot
2022-12-20 09:20:31 +00:00
GangCao
de02db6366 lib/nvmf: check the return value of the resume operation
Change-Id: I87975e8cfc450463f46f00e90b4c6ff1744014ee
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16007
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
2022-12-20 09:19:57 +00:00
GangCao
f042d6bac4 examples/accel_perf: correct the unlock operation
Change-Id: I43e54ceae1184483747dff70d224a7aa2b24a6fd
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16006
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
2022-12-20 09:19:28 +00:00
Mike Gerdts
cc27c1ab11 blobstore: missing lock leads to md page race
Many parts of the blobstore.c seem to have gone with the assumption that
blob creation, deletion, etc. all happen on the md thread. This
assumption would allow modification of the bs->used_md_pages and
bs->used_clusters bit arrays without holding a lock. Placing
"assert(spdk_get_thread() == bs->md_thread)" in bs_claim_md_page() and
bs_claim_cluster() show that each of these functions are called on other
threads due writes to thin provisioned volumes.

This problem was first seen in the wild with this failed assertion:

  bs_claim_md_page: Assertion
     `spdk_bit_array_get(bs->used_md_pages, page) == false' failed.

This commit adds "assert(spdk_spin_held(&bs->used_lock))" in those
places where bs->used_md_pages and bs->used_lock are modified, then
holds bs->used_lock in the places needed to satisfy these assertions.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I0523dd343ec490d994352932b2a73379a80e36f4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15953
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
2022-12-20 09:19:09 +00:00
Mike Gerdts
67c7e85809 blobstore: use common return path in bs_create_blob()
A future commit will add to the complexity when returning with a
non-zero value. Rather than further complicating the several error
return locations, all affected error returns are handled after the error
label.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I56e8e338b0560f849399c085d0bb07efb7df26fb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15983
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
2022-12-20 09:19:09 +00:00
Mike Gerdts
c1544908e0 blobstore: use common return path in blob_resize()
A future commit may need to release a lock before returning. This
refactors blob_resize() to always return at end of the function using an
out label and goto.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I671fbdbe0e3b766c264c45589dad3a864ba1f192
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15982
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
2022-12-20 09:19:09 +00:00
Mike Gerdts
316cf9ef99 blobstore: convert used_lock to spinlock
Convert bs->used_lock to a spinlock.  This is being done to help with
the debugging and fixing of a race that has led to a failed assertion in
bs_claim_md_page.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I11b80096de022f79a217c65d787ee57ca54240f9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15952
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
2022-12-20 09:19:09 +00:00
Mike Gerdts
2a608d0241 blobstore: rename used_clusters_mutex to used_lock
The bs->used_clusters_mutex protects used_md_pages, used_clusters, and
num_free_clusters. A more generic name is appropraite. The next patch in
this series will convert it from a mutex to a spinlock and having
"mutex" or "spin" in the name is of little help to maintainers, so a
more generic name is used.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I5ce7b85b84fdec2a0c5d2ac959e0109e1d80c7f5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15981
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
2022-12-20 09:19:09 +00:00
GangCao
58549382d0 lib/jsonrpc: check the return value from setsockopt
Change-Id: I47c0635dcc53e28a8c7cfa85416b42c6475a3b65
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15915
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
2022-12-20 09:17:59 +00:00
Kamil Godzwon
a043e45cd1 doc/Doxyfile: remove obsolete options with the default values
Options:
FORMULA_TRANSPARENT
LATEX_SOURCE_CODE
RTF_SOURCE_CODE
DOCBOOK_PROGRAMLISTING
CLASS_DIAGRAMS
DOT_FONTNAME
DOT_FONTSIZE
DOT_TRANSPARENT

are obsolete in the Doxygen version 1.9.5
Doxyfile has been updated with 'doxygen -u'

Signed-off-by: Kamil Godzwon <kamilx.godzwon@intel.com>
Change-Id: Ic2c598f2e463d94b963a32a20f28a16b21389bfe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15822
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michal.berger@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-12-20 09:17:18 +00:00
Kamil Godzwon
4e8a0de05b autobuild: skip doxygen 1.9.5 false positives
Doxygen 1.9.5 contains false positives that will be fixed
in later version. Right now if that version of doxygen is used
in tests (e.g. Fedora 37), any error (from issues below) is ignored.

False possitive is related to:
https://github.com/doxygen/doxygen/issues/9552
https://github.com/doxygen/doxygen/issues/9678

This patch ignores only warnings related to "\ifile" and
"@param" processing in doxygen, reporting any other warnings.

Signed-off-by: Kamil Godzwon <kamilx.godzwon@intel.com>
Change-Id: I1ff5005351b82e81c323ad0fae47ba53a765b8a0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15847
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michal Berger <michal.berger@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-12-20 09:17:18 +00:00
Karol Latecki
da846dd402 spdkcli: add uring bdev support
Change-Id: I0cd99636c69dcd4fe07c7329be8d67367ea7782c
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15907
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-12-20 09:17:07 +00:00
Sebastian Brzezinka
48f3f38384 mk/spdk.common.mk: check availability of avx512f with clang llc
`--target-help` option is not available with CC set to clang
causing `clang: error: no input files`.

redirect `--target-help` stderr to `/dev/null`

This patch fix issue: #2820

Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Change-Id: I2c90e0122e162dc08537d94bbf0adad58f2eee2c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15967
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Michal Berger <michal.berger@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
2022-12-20 09:16:38 +00:00
Tomasz Zawadzki
110d8411ec bdev/crypto: do not create mempool for session private data
In DPDK 22.11 rte_cryptodev_sym_session_create() now takes
a single mempool with element size big enough to hold session
data and session private data.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6c9db063825843a903d1ff84dd8d77f198a841a1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15435
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>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
2022-12-19 08:35:14 +00:00
Tomasz Zawadzki
495055b054 bdev/crypto: update rte_cryptodev usage for DPDK 22.11
Adjusts use of rte_crypto API after DPDK patch below:
(bdce2564dbf78e1fecc0db438b562ae19f0c057c)

For DPDK 22.11 and later, rte_cryptodev_sym_session_init()
is no longer used and only calling
rte_cryptodev_sym_session_create/free().

Change-Id: I89d8fa737fd6c199a4a5a810b85d6d5b79d5d27b
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15391
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>
Community-CI: Mellanox Build Bot
2022-12-19 08:35:14 +00:00
GangCao
4f4bf8c482 lib/env_dpdk: add a valid check before fclose
Change-Id: I43fc46500aa95a1f34365d0ac269dc1aa4b4bfa6
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15955
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-12-16 09:43:47 +00:00
GangCao
1450c5470b lib/bdev: send back the eligible QoS IO to the original thread
Fix issue: #2815

Change-Id: Ic1533b9ed055734a721be0fd7159754e5db1791b
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15917
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>
2022-12-16 09:43:28 +00:00
GangCao
9e9ac9903a module/bdev: set the proper copy size
Change-Id: Ia379bd2ba1ca6f3ee1825987a41510f97ccb6237
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15883
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-12-16 09:40:33 +00:00
Jim Harris
e39512ec18 nvmf: add completed_nvme_io to nvmf_poll_group_stat
Basic IO completion counting can be done at the common
layer, to enable some level of stat tracking even for
transports that don't have transport-specific tracking
yet.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If04f854b97440089b8ad149b64cb59173c73975c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15912
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
2022-12-16 09:27:50 +00:00
Tomasz Zawadzki
fe24da164a autobuild.sh: add test for DPDK PCI API with any DPDK version
There is set of "*_vs_DPDK" jobs running on nightly basis,
their purpose is to verify version compatibility between
SPDK and DPDK. That includes latest DPDK too.

This patch modifies the path passed to check_dpdk_pci_api.sh,
to be any DPDK under test.

Change-Id: Id059e60a0260e7dc11e61445389f2afed0f78f1f
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15865
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>
2022-12-16 09:27:11 +00:00
Tomasz Zawadzki
32e6ffb55c env_dpdk: add support for DPDK main branch for 23.03
For validation of upcoming DPDK releases, pci_dpdk needs
to initialize and work.
This patch adds support for testing DPDK main branch,
with appropriate notice given when that DPDK version is used.

Change-Id: I5257beac3a3926bd432d9c00e50858facd21e6f5
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15891
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>
2022-12-16 09:27:11 +00:00
Tomasz Zawadzki
44290e13b4 env_dpdk: add script for comparing DPDK PCI API
Starting with DPDK 22.11, PCI API are no longer public.
In order to implement out-of-tree driver like
SPDK NVMe driver that is compatible with DPDK,
a copy of PCI API headers are required in SPDK.

check_dpdk_pci_api.sh script is intended simplify
the maintanance of the compatibility between
SPDK copies of the headers and multiple DPDK versions.

Please see the included README

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ief028c13564441560425761e7802c6cf07460876
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15857
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>
2022-12-16 09:27:11 +00:00
Tomasz Zawadzki
fcbbd17a3a env_dpdk: DPDK 22.07 PCI now includes in-tree headers
Since SPDK holds copies of local DPDK headers for DPDK PCI API,
the same headers will now be used as includes.
It was already the case for DPDK 22.11, but not for DPDK 22.07.

Change-Id: I5859a630d1fb20b4ebf8628adb962f5e46c23788
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15969
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>
2022-12-16 09:27:11 +00:00
Tomasz Zawadzki
8f45e159a3 env_dpdk: add support for DPDK 22.11.1 LTS
Shortly after DPDK 22.11 release it was amended with single
patch, which bumped the minor version.

No changes have occurred to the DPDK PCI API.

Change-Id: I94dadb23b3ad79cfbb21e848d718d909493137d1
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15890
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Michal Berger <michal.berger@intel.com>
2022-12-16 09:27:11 +00:00
Mike Gerdts
6e770cf8d6 lib/lvol: bad cluster size error message
As spdk_lvs_init() validates arguments, it uses o->cluster_sz in a
comparison but misleadingly prints opts.cluster_sz in the error message.
This changes the error message to print cluster_sz from the proper
structure.

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I810bf9ad4a24ed7cc844c2835e0edda988cb2cbe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15970
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>
2022-12-16 09:26:35 +00:00
GangCao
857e8cae85 examples/sock: close the right sock object
Change-Id: If26e4ace04e2ab6a950ebd270a46805ed8ca973d
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15956
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-12-16 09:26:11 +00:00
sijie.sun
a5283034de nvmf/rdma: Factor out creating/destroying rdma resources into helper functions
The following patches will support dynamically create/destory resources for
IB devices. Make these resource management functions reusable.

Signed-off-by: sijie.sun <sijie.sun@smartx.com>
Change-Id: I471f7c9e1afd01d13936836b87d0ae72da5d98bc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15614
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-12-16 09:25:36 +00:00
Michal Rozegnal
51124e5c35 sma test: disable line wrapping for base64
Cipher keys in sma are encoded by base64 that by default wrap line
after 76chars. It causes issues for 256bit keys in sma flow.
Adding "-w 0" disables line wrapping

Signed-off-by: Michal Rozegnal <michal.rozegnal@intel.com>
Change-Id: Ic6a8136672b1cdbd8d71d3cc1caa82a5bc898636
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15888
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: <sebastian.brzezinka@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>
2022-12-16 09:22:52 +00:00
Kamil Godzwon
aa11a97dda doc/ftl.md: fix ftl_l2p reference
Fixed ftl_l2p reference by adding anchor to the
"Logical to physical address map" subsection

Signed-off-by: Kamil Godzwon <kamilx.godzwon@intel.com>
Change-Id: I7d6ef590a76d55bea4d1392847241f439fc7aebf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15821
Tested-by: SPDK CI Jenkins <sys_sgci@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>
2022-12-16 09:21:04 +00:00
Konrad Sztyber
b7964a3c5a sma: forbid deleting devices with attached volumes
It makes it possible for stateless clients to send CreateDevice /
DeleteDevice each time a volume is attached / detached.  Deleting a
device with attached volumes results in FAILED_PRECONDITION error, which
a client can simply ignore.  The device will be deleted during the final
DeleteDevice call, once all volumes are detached.

We limit this behavior to device types that support AttachVolume /
DetachVolume methods, otherwise it would be impossible to delete such
devices.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I244b2b09455ec1430970c70f3fbb739cc9069754
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15670
Reviewed-by: Jing Yan <jing1.yan@intel.com>
Reviewed-by: Filip Szufnarowski <filip.szufnarowski@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>
2022-12-16 09:20:52 +00:00
Konrad Sztyber
5a3e64efe4 bdev: replace internal buffer pools with iobuf
The internal mempools were replaced with the newly added iobuf
interface.

To make sure we respect spdk_bdev_opts's (small|large)_buf_pool_size, we
call spdk_iobuf_set_opts() from spdk_bdev_set_opts().  These two options
are now deprecated and users should switch to spdk_iobuf_set_opts().

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ib1424dc5446796230d103104e272100fac649b42
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15328
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-12-16 09:06:07 +00:00
Konrad Sztyber
f2409773de bdev: move max buf length calculation to a function
This is done in a couple of places, so it makes sense to extract it to a
separate function.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Id34b2545d9912c2b7b65b1277711e9683db92658
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15327
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-12-16 09:06:07 +00:00
Konrad Sztyber
107741fc79 test/unit: add bdev init/fini functions
It will allow us to add extra (de)initialization steps to be executed
before / after each unit test.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic3c644e893e4fdb368723c120b23f18cd752db70
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15780
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-12-16 09:06:07 +00:00
Konrad Sztyber
8b0bb7f08e test/sma: limit the number of created devices in vhost_blk
We don't need to create as many devices to fully populate two buses, we
can create 32 devices on the first bus and 1 device on the second one
and basically test the same thing, while allocating less resources at the
same time.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ibaca094f71f3702f8d58f5feb54b676df749ff49
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15645
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-12-16 09:06:07 +00:00
Konrad Sztyber
55b047a776 module/iobuf: introduce iobuf module
This gives us a place to initialize iobuf pools, specify subsystem
dependencies, and execute RPCs to configure the sizes of the pools.

We allow users to configure the size of the pools either through the
options in spdk_bdev_opts or through the new RPC, iobuf_set_options.
The second option has higher priority, so it will override the options
set by the bdev layer.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I7c45ace04bc71c8343658f98248fc7babcf24e5d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15765
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: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-12-16 09:06:07 +00:00
Konrad Sztyber
36df38c059 thread: cache a number of iobuf buffers on each channel
Users can now specify a number of small/large buffers to be cached on
each iobuf channel.  Previously, we relied on the cache of the
underlying spdk_mempool, which has per-core caches. However, since iobuf
channels are tied to a module and an SPDK thread, each module and each
thread is now guaranteed to have a number of buffers available, so it
won't be starved by other modules/threads.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I1e29fe29f78a13de371ab21d3e40bf55fbc9c639
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15634
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2022-12-16 09:06:07 +00:00
Konrad Sztyber
3aceb2da6c thread: introduce iobuf buffer pools
The idea behind "iobuf" is to have a single place for allocating data
buffers across different libraries.  That way, each library won't need
to allocate its own mempools, therefore decreasing the memory footprint
of the whole application.

There are two reasons for putting these kind of functions in the thread
library.  Firstly, the code is pretty small, so it doesn't make sense to
create a new library. Secondly, it relies on the IO channel abstraction,
so users will need to pull in the thread library anyway.

It's very much inspired by the way bdev layer handles data buffers (much
of the code was directly copied over).  There are two global mempools,
one for small and one for large buffers, and per-thread queues that hold
requests waiting for a buffer.  The main difference is that we also need
to track which module requested a buffer in order to allow users to
iterate over its pending requests.

The usage is fairly simple:

```
/* Embed spdk_iobuf_channel into an existing IO channel */
struct foo_channel {
	...
	struct spdk_iobuf_channel iobuf;
};

/* Embed spdk_iobuf_entry into objects that will request buffers */
struct foo_object {
	...
	struct spdk_iobuf_entry entry;
};

/* Register the module as iobuf user */
spdk_iobuf_register_module("foo");

/* Initialize iobuf channel in foo_channel's create cb */
spdk_iobuf_channel_init(&foo_channel->iobuf, "foo", 0, 0);

/* Finally, request a buffer... */
buf = spdk_iobuf_get(&foo_channel->iobuf, length,
		     &foo_objet.entry, buf_get_cb);

...

/* ...and release it */
spdk_iobuf_put(&foo_channel->iobuf, buf, length);

```

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ifaa6934c03ed6587ddba972198e606921bd85008
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15326
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-12-16 09:06:07 +00:00
Tomasz Zawadzki
7019dbbdba env_dpdk: align copyright notice with DPDK
Recently while updating the copyright notices
throughout SPDK the headers, env_dpdk copies of
DPDK headers were modified too.

This patch brings them to the exact version as
in DPDK upstream.

Change-Id: If30b8556386a539d81d2fc1a5e42293522ed91f5
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15856
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Michal Berger <michal.berger@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-12-15 08:41:05 +00:00