Commit Graph

1127 Commits

Author SHA1 Message Date
Jim Harris
35a3cfd51e examples/nvme: fix reconnect memory leaks
1) In submit_single_io(), if an I/O fails to submit,
   we need to free the associated task structure,
   otherwise it gets leaked.
2) When draining I/O, just always check_io() instead
   of only doing it when current_queue_depth > 0.
   This is the simplest of ensuring that we cleanup
   the ns_ctx (including freeing the IO qpairs and
   the qpair pointer array) if the current_queue_depth
   is already 0 when starting to drain.

Fixes issue #2995.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I53f336c6a11ff63782dc81c087a58feca0e8a5d7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17873
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2023-05-09 17:58:11 +08:00
Jim Harris
5bf8031230 examples/nvme/perf: connect io qpairs asynchronously
This significantly speeds up testing with high connection
workloads (i.e. -P 64) with TCP especially.  We already
set async_mode=true all of the time for the bdev/nvme
module, so there's no reason we shouldn't do it in
perf too.

After allocating all of the IO qpairs, busy poll the
poll group, using the new spdk_nvme_poll_group_all_connected()
API to ensure the qpairs are all connected before proceeding
with I/O.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If0c3c944cd5f3d87170a5bbf7d766ac1a4dcef7c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17578
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-05-09 17:58:11 +08:00
Jim Harris
6335d88c8a fio: set FIO_DISKLESSIO flag for spdk engines
This tells fio to not try to use POSIX calls on
"files" specified for an SPDK engine.

Note that w/o DISKLESSIO option set, fio would
figure out that "*" wasn't a real file.  With this
option set, we now need to explicitly set its
real_file_size to 0 to tell fio to ignore it.

Found by Karol Latecki - he noticed that when
specifying lvols in the form "lvs/lvol" that
fio would create an empty "lvs" directory.  Adding
this flag prevents things like this from happening.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5d457631b122ba5eb480813ab9d8aa6578f38277
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17937
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-05-09 17:58:11 +08:00
Konrad Sztyber
483520322a accel_perf: add shutdown callback
Otherwise, it's impossible to stop the app before its run time expires,
because the accel library waits until its IO channels are released which
would only happen at the end.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I7438b474f4f6d6bcb4bf6aad02ccae9f511f1b51
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17768
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-05-09 17:58:11 +08:00
Ankit Kumar
c9fde53991 nvme/fio_plugin: add fdp support to fio plugin
This adds support for FDP device described by TP4146.

spdk_fio_fdp_fetch_ruhs() fetches the reclaim unit handle
descriptors, used by fio for placement identifiers. This function
also informs fio whether device has fdp capability or not.

spdk_fio_queue() has been modified to submit write with
extended IO arguments. This can only work if sgl is enabled.

Note, a guard FIO_HAS_FDP checks for the required io-engine ops
version.

Change-Id: I91d0d02d3147357a66a831ef9fb82e6b7250be3d
Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17605
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>
2023-05-09 17:58:11 +08:00
Konrad Sztyber
793be3a0f5 accel_perf: use accel stats when dumping results
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Iae1128ce01c16731bced8f97c08f44e1b0bc83f2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17626
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-05-09 17:58:11 +08:00
Ben Walker
7ba7715530 idxd: In perf tool, correctly pass fill pattern as a uint64_t
The pattern is 64 bits but we were only passing in 8.

Fixes #2821

Change-Id: I4a4c3f7c18bcb610df9c37edee549255f93f2632
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17686
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-05-09 17:58:11 +08:00
Jim Harris
f353506f1c examples/nvme/perf: increase opts.num_io_queues when needed
By default we specify 1024 max_io_queues per controller.
But it's possible we need more for high connection count
use cases (i.e. -c 0xFF -P 512 which is 8 * 512 = 4096).
So dynamically configure opts.num_io_queues based on
the corresponding values.

Note: we have to change a couple of globals from int to
uint32_t to avoid signed v. unsigned comparison warnings.
Let's just do that in this patch instead of a separate
one.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iba2d670c224a91e50377e622b154ce43eed94002
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17621
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2023-05-09 17:58:11 +08:00
Jim Harris
a8d86cb313 examples/nvme/perf: pick num_requests based on qpairs per ns
If we want to test something like 512 qpairs, with qd = 8 for
each, you need to specify -q 4096 -P 512.  Then those 4096
I/O are spread across the 512 qpairs, to get qd = 8
for each qpair..

But currently it ends up also allocating 4096 num_io_requests
for each qpair which is a huge waste.  We need to instead
base the num_io_requests on the effective queue depth for
each of the qpairs.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3ec0f4d9ab94388bf980c0b0439790847161ec12
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17620
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-05-09 17:58:11 +08:00
Krzysztof Karas
0c4c32a928 bdevperf: avoid writing outside "out" array boundary
Currently variables "i" and "k" in config_filename_next()
function may increase at the same speed. When repeating
"for" loop at line 1862 both "i" and "k" are being incremented:
 + i by the for loop,
 + k by the "out[k++]" instruction.
This means that there may be a case, where for loop ends with
"i < BDEVPERF_CONFIG_MAX_FILENAME" condition, as value of "i"
is equal to BDEVPERF_CONFIG_MAX_FILENAME, and at the same time
value of "k" is also equal to BDEVPERF_CONFIG_MAX_FILENAME,
because after writing to out[BDEVPERF_CONFIG_MAX_FILENAME - 1]
element, we increment it one last time.
This results in writing "0" value at line 1873 to memory outside
"out" array boundary.
To amend this problem, compare k against
BDEVPERF_CONFIG_MAX_FILENAME, insted of i.

Change-Id: Ia45778c1f267d2b9dcd676cd9b6c662d09f6f94e
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17176
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>
2023-05-09 17:58:11 +08:00
Krzysztof Karas
8e8c360b53 bdevperf: free job->zipf
Currently we do not free the memory allocated
during spdk_zipf_create() call, when we exit
the for loop on line 1769 with error. Remedy
this problem by adding spdk_zipf_free() calls.

Change-Id: I1d593ad2375204b158a2c97b23e492e69f836f43
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17405
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: Aleksey Marchuk <alexeymar@nvidia.com>
2023-04-06 14:24:16 +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
Shuhei Matsumoto
8e373044bf bdevperf: Create and use per lcore thread pool
If bdevperf runs with -C option and two or more NVMe bdevs,
two or more poll groups are created on each CPU core because bdevperf
creates one SPDK thread per job per CPU core in this case.

However, generally SPDK application creates one SPDK thread per CPU
core. We want bdevperf to immitate closely generic SPDK application
pattern.

For this requirement, create a thread poll made of per core threads.
Then, each job gets one of the threads whose lcore matches instead of
creating a new thread.

This feature is available only if bdevperf's config file is not used
because bdevperf's config file can specify cpumap per job.

Fixes issue #2933

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I0bd5a72f9ee8deade6c4e8ca0cdea3c89ff2541f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16994
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-03-08 08:46:29 +00:00
Shuhei Matsumoto
72da547aa2 bdevperf: Use job->name instead of spdk_thread_get_name(job->thread)
The next patch will support a feature to share per lcore thread among
multiple jobs. Hence, spdk_thread_get_name(job->thread) will not be
usable. Currently job->name is equal with
spdk_thread_get_name(job->thread). Hence, we can do this replacement
simply.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I9e086d18043cf6125e059c85044420138c0eeece
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16993
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-03-08 08:46:29 +00:00
Tomasz Zawadzki
71a0db0e66 example/perf: add --use-every-core
This option overrides the current worker and ns
association logic with using every ns from each
worker.

This mimics the bdevperf -C option, and allows
to test scenarios in similar fashion.

Change-Id: Ie3734f86cd8fd1025bca5bd69e27b7316c2f3fbd
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14415
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-03-03 11:18:59 +00:00
Slawomir Ptak
d254a3b924 bdevperf: Random map for picking I/O offsets
Added a random map feature (-D command line option),
which enables offset tracking of every I/O
for random read, random write and random rw mix,
to make sure every offset is accessed the same
number of times.

Change-Id: I5a0a23718b9f0a94ca094f86175c036b3230fb8b
Signed-off-by: Slawomir Ptak <slawomir.ptak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16865
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-02-24 12:51:45 +00:00
Slawomir Ptak
652db802f1 bdevperf: Outstanding requests array size check
Change-Id: I7bbdff40b23c3d28ae9483690d427f3c4639b651
Signed-off-by: Slawomir Ptak <slawomir.ptak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16877
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-02-23 13:36:01 +00:00
Artur Paszkiewicz
a5d5ab27d1 examples/accel/perf: add support for xor
Change-Id: I0a9216945f5877af80d911b46f988a440e855fd4
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16395
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-02-21 08:33:18 +00:00
Ankit Kumar
cc7736c968 include/nvme_spec.h: add changes for fdp log pages
TP4146 added support for 4 new log pages.
These are FDP configurations, reclaim unit handle usage,
FDP statistics and FDP events.

Updated the identify example file accordingly.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Change-Id: I5a20b728605257774d72bc184b50bc5008e142ea
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16518
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-02-15 10:37:56 +00:00
Ankit Kumar
1f600d381d include/nvme_spec.h: set and get features changes for fdp
TP4146 added support for 2 new set/get features.
Add changes for those (FDP and FDP events).

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Change-Id: I778da0a9aba9eca0c2d70b6b193494edf2e8bd43
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16519
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-02-15 10:37:56 +00:00
Ankit Kumar
4095963599 include/nvme_spec.h: update cdata and error status codes
1. Update cdata structure to indicate FDP support.
2. Add missing error status codes for base spec and
   the ones added by TP4146 (FDP).

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Change-Id: Id6f467d54a047e959ce3fc4d2197c23bf39ea059
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16517
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-02-15 10:37:56 +00:00
Ankit Kumar
7bbeb80a31 nvme: support 64 LBA formats for NVM and ZNS command set
Format LBA size (FLBAS) is updated to have:
Bit 3:0 as least significant 4 bits for format index
Bit 6:5 as most significant 2 bits for format index

NVMe format command fields are updated accordingly.

Add a new helper function to fetch the correct format index.
Update examples and unit test files accordingly.

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Change-Id: I2d6d9045b9d65ae91cb18843ca75b59cc27ed2f2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16515
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-02-15 10:37:56 +00:00
Jim Harris
0d11cf939b bdevperf: use rand_r() twice to get 64-bit values
rand_r() only returns up to RAND_MAX which is
INT32_MAX.  This means that on sufficiently large
bdevs, especially with smaller block sizes, bdevperf
may not be issuing I/O across the full range of the
bdev.

Found while investigating issue #2908.

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

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Change-Id: I63bd1aa94dbc2bec0a9ce837aa5efb48daa1fc1e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16514
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-02-13 18:40:20 +00:00
Konrad Sztyber
13d3123115 examples/abort: check process_completions()'s status
The abort app expects some requests to be failed (because they're
aborted), so a failed I/O doesn't cause the app to exit with a failed
status.  However, the qpairs should never be disconnected during the
test, so we should check their status to avoid hiding errors when that
happens.

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

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic1a40ef59cff058d7926b3df4a966e5e6de9b0f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16646
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-02-13 13:50:15 +00:00
Konrad Sztyber
9c04e6d832 examples/abort: check status of all workers
Previously, we only cared about the status of the main worker thread and
ignored errors from other threads.  This patch changes that and now
it'll return an error if any of the worker threads encountered an error.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Icc54b18a0bc4fae7a40e0a13846aa6ac01111c6f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16645
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-02-13 13:50:15 +00:00
Yifan Bian
f21a34ac26 perf: add io check for aio device
If no aio device exist, then we can use 'exit(1)' to exit. Also,
update the same error check with 'exit(1)' for io_uring path.

Fix issue with 2893

Signed-off-by: Yifan Bian <yifan.bian@intel.com>
Change-Id: Iade74fba4588b109ce77af76ac998bb05b842ef3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16652
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-02-09 11:31:58 +00:00
Shuhei Matsumoto
f5885db9ed bdev_fio_plugin: Replace spdk_bdev_first/next_leaf() by spdk_for_each_bdev_leaf()
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Icf7bd4348de200d33c242fa63f4facb9592abcaa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16538
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-01-31 10:30:52 +00:00
Shuhei Matsumoto
5647948681 bdevperf: Replace spdk_bdev_first/next_leaf() by spdk_for_each_bdev_leaf()
Replace all spdk_bdev_first/next_leaf() calls by spdk_for_each_bdev_leaf().

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I61e8302346a70b0dc219fff29b06158b542dd87f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16537
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-01-31 10:30:52 +00:00
Shuhei Matsumoto
9ef9d4bd23 bdevperf: Factor out creating multithread job config into helper function
The next patch will replace spdk_bdev_first/next_leaf() calls by
spdk_for_each_bdev(). As a preparation, factor out creating multithread
job config for a bdev into a helper function.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ib4df53af8b1bba5b012e93ff9d00c4089cca774e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16536
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-01-31 10:30:52 +00:00
Jim Harris
dba35d8e44 nvme/perf: include config.h to get SPDK_CONFIG_URING
perf has support for io_uring when SPDK_CONFIG_URING
is set, but we have to include config.h to get it.

Fixes problem with perf -R option not working, even
when user specified --with-uring.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I403ae755349e702c39dba332c5fb335d171f0d02
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16584
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-01-30 16:29:35 +00:00
Jim Harris
c62637c9e7 perf: zero the ns_entry buffer for aio/uring
Otherwise we get garbage in ns_entry->zipf.  If
this is not-NULL, we use it for zipf random
distribution and segfault since it's not-NULL but
also not valid.

So use calloc instead.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0d13e21989b6f43e9f6f16736479395d1d6f0e77
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16362
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2023-01-23 17:48:10 +00:00
paul luse
6afbf3db4d examples/accel_perf: Add buffer padding to compress buffer
Some data cannot be compresssed and if there is not room in
the output buffer for the uncompressed data and whatever
info the compress back end needs it will error out.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I4cb47e6cdb3facd3867d5dc4fb6f9352a307e33c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16098
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-01-19 11:16:01 +00:00
paul luse
91f3063b14 lib/accel: add output_size to decompress API
We had it for compress but simply didn't think of a use case for
decompress.  During the develpoment of the compressdev accel_fw
module it was discovered that compressdev does indeed provide the
uncompressed length on completion of decompress and the reducelib
uses it.  So, add it here.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I2f6a8bbbe3ef8ebe0b50d6434845f405afa7d37d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16035
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-01-19 11:16:01 +00:00
Shuhei Matsumoto
2085362d89 example/nvme_perf: Add an option for the RDMA SRQ size
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I227fb3ca61f1c8900aca1a5802bc1b7f32b96f3e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14913
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-01-17 23:53:01 +00:00
Hailiang Wang
cfd726a23f example/idxd_perf: Adjust the printing data spacing to make it beautiful
Like this:
IDXD_ChanID   Core      Transfers      Bandwidth     Failed     Miscompares
---------------------------------------------------------------------------
         0    0         7006937/s       13 MiB/s   35034688               0
===========================================================================
Total:                  7006937/s       13 MiB/s   35034688               0

Change-Id: I18b0538268ba56d79b77ca6659dc260ee115675c
Signed-off-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16100
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2023-01-16 15:19:54 +00:00
Mike Gerdts
9e96e331c3 fio_plugin: initalize when create_serialize=0
When the fio plugin is used with reate_serialize set to false, fio calls
the init callback (spdk_fio_init()) before calling the setup callback
(spdk_fio_setup()). When create_serialize is true, spdk_fio_setup() is
called earlier.  Both spdk_fio_setup() and spdk_fio_init() call
functions that require that the SPDK libraries have been initialized.

While it is arguably a bug in SPDK that per-thread initialization
happens before global initialization, it is not terribly difficult to
work around in fio_plugin. The workaround implemented in this patch
splits the start of the plugin's init thread into its own function and
calls it from both spdk_fio_setup() and spdk_fio_init(). The init thread
is started while holding a mutex, and as before there is a guard to be
sure that the init thread is created only once.

Fixes issue #2843

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I20d1863a88b75b416283f9466ee1186d8ef05063
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16053
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-01-11 09:17:16 +00:00
Mike Gerdts
9b754587c7 fio_plugin: bdev calls on spdk thread
This is a rework of commit 7722996dd2.

As the locks in bdev.c transition to spdk_spinlock, callers of
spdk_bdev_get_by_name() and any other function that uses an SPDK
spinlock needs to be executing from an spdk_thread.  This commit reverts
the earlier commit then fixes it with a different approach than was
previously used.

fio plugin functions that need to be on an SPDK thread into two parts:

1. fio API callback: transform args from fio into a spdk_fio_oat_ctx
   structure, then calls spdk_fio_sync_run_oat(). In the case of
   spdk_fio_setup(), the app thread is started in this part.
2. On App Thread (oat) callback: runs on the SPDK app thread via the
   poller spdk_init_thread_poll().

spdk_fio_sync_run_oat() sends a message to the app thread to have the
specified oat callback run. It wakees the poller loop via a condition
variable then waits for the oat callback to signal its completion via a
condition variable in the spdk_fio_oat_ctx.

Fixes issue #2818

Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I5c82542bb9e9e6b8823e9d1da293050bba336b65
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15866
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-01-11 09:17:16 +00:00
GangCao
60fd5c554d examples/bdevperf: check the successful status before dereferencing the pointer
Issue here is that the status could be negative due to NULL pointer and in the
callback, the status is not checked before dereferencing the pointer which is
NULL here.

Change-Id: I7240fa91d1a640556e1f27b8295921c7dd1fb57f
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16176
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
2023-01-10 13:11:18 +00:00
Krzysztof Karas
91b8f349fd hotplug: let device insertions/removals take priority
When running io_loop() let insertions and removals counters
take precedence before timeouts. This will let us determine
the cause of premature io_loop() exit in case of timeout.

Consider two scenarios:
First:
 1. Hotplug app records enough insertions/removals
 2. During "if (now > tsc_end)" check it also notices that
    it should terminate due to time constraint
 3. Hotplug exits using the timeout condition, because
    enough time has passed and no error is printed at
    this point.

Second:
 1. Hotplug app did not record enough insertions/removals
    during app runtime
 2. During "if (now > tsc_end)" check it also notices that
    it should terminate due to time constraint
 3. Hotplug exits using the timeout condition, because
    enough time has passed and no error is printed at
    this point.

After prioritizing the check on counters we avoid the first
scenario and timeout will be checked after the counters
were confirmed to be less than expected value, allowing us
to determine the cause of failure earlier.

Additionally added an errorlog to the body of the if checking
for timeout to signal this failure.

First part of the series fixing #2201.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I3f6f9c5c95e82e0a003419fcf181d858ffbd94dd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15964
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>
2023-01-09 11:16:50 +00:00
GangCao
0ab8393c60 examples/bdev/fio_plugin: add the RPC listen support
With this support, user could send the RPC commands to FIO
to query the IO statistics like output of below commands:

root@storage35:/spdk# ./scripts/iostat.py
cpu_stat:  user_stat  nice_stat  system_stat  iowait_stat  steal_stat  idle_stat
           3.18%      0.00%      0.35%        0.00%        0.00%       96.46%

Device   tps   KB_read/s  KB_wrtn/s  KB_dscd/s  KB_read  KB_wrtn      KB_dscd
TestPT   0.01  0.00       0.04       0.00       36.00    499608.00    0.00
Malloc1  0.61  0.00       2.42       0.00       36.00    31012820.00  0.00
Malloc3  0.01  0.00       0.04       0.00       36.00    499608.00    0.00

Change-Id: I694119313fb92cf9798c6897e61f788c2ac1f013
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15984
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2023-01-06 15:58:47 +00:00
GangCao
592fc6f410 examples/nvme_manage: check the valid address parse
Change-Id: I40daaae514902854c5d546388789e88248fe6869
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16078
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2023-01-05 23:26:02 +00:00
Michael Haeuptle
031ba90fe1 perf: Support setting IPv4 type of service (TOS)
New option --transport-tos to allow setting TOS value for RDMA transport.

Signed-off-by: Michael Haeuptle <michael.haeuptle@hpe.com>
Change-Id: I7747fac5c6641dfd18356314e8209bf5f3f35b7e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15909
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
2023-01-05 19:54:53 +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
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
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
Alexey Marchuk
e58885f949 bdevperf: Limit queue depth for verify job with big IO
By design verify payload, uses a bit array to find
an offset of IO request. The bit array's size is
calculated as bdev_num_blocks / (io_size/block_size),
if bdev is small, queue depth requested by the user
might be bigger than the bit array size and in that
case bdevperf won't find a free bit for IO request
offset.

To fix that issue, limit queue_depth of such bdevs
by "size_in_ios" value

Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: I3117f5af7ae3ea18219c25982f33db936dd24c0b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15777
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-14 08:02:55 +00:00
Alexey Marchuk
893aaacccb bdevperf: Check current_queue_depth when job starts draining
During debug of some issue, it was found that
current_queue_depth might be 0 when job timer expires,
in that case we won't trigger the job end flow and
bdevperf may hang.

Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: Ia49ce6905d329f3ef40216c277bf095782ac9b2d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15776
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>
2022-12-14 08:02:55 +00:00
Michal Berger
483d34ad03 bdev/bdevperf: Fix spdk_bdev_channel_get_histogram() arguments
Don't pass bdev argument as it was completely removed from the
function via:

https://review.spdk.io/gerrit/c/spdk/spdk/+/15837

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Icbc1265a516e9fd21820b2f433ced4d4522b46b9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15893
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-12-13 11:51:25 +00:00