Commit Graph

554 Commits

Author SHA1 Message Date
Yifan Bian
ed2b53f389 ublk: add configure and event/subsystem
ublk backend could support ublk driver with kernel. Specify
configuration parameter to start it up.

Signed-off-by: Yifan Bian <yifan.bian@intel.com>
Co-authored-by: Xiaodong Liu <xiaodong.liu@intel.com>
Change-Id: I55e7d757e04315b25e9bfab5fdcbb6621be3e29e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15680
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2023-01-20 07:48:25 +00:00
Jim Harris
935721bb1e iscsi_top: remove application
This application has not been maintained for at least
two years, let's just remove it rather than updating
it.  Original intent was to monitor iSCSI I/O
processed on each core, if we decide it's important
to still provide this kind of analysis for iSCSI it
would be better to incorporate it into spdk_top
instead most likely.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I4093ab1357ccc06c8a6770f7f87238b510bb20d4

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16219
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-11 09:28:08 +00:00
GangCao
3ecf99d65a app/spdk_top: check the valid pointer earlier
Change-Id: I162d90257e7bf23cff9b9adc84b811f79c404da2
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16178
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-11 09:27:43 +00:00
YafeiWangAlice
dbe0a6eed7 spdk_top: In THREAD tab and CORES tab, the status of the CPU does not match the utilization.
eg. when CPU utilization is more than 95%, the status of CPU is Idle which should be Busy.

Signed-off-by: YafeiWangAlice <yafei.wang@samsung.com>
Change-Id: I20ecacf1ed53c188cb12ca4d14cf22986a4740cc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15783
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-12-29 09:27:50 +00:00
Krzysztof Karas
20a3f67524 spdk_top: add scheduler pop-up details window
Adds global scheduler pop-up details window displaying current
scheduler name, scheduler period and governor name.

Modify help window to include newly added scheduler pop-up.

Mofdify parameter "string" of print_left() function to take
const char* instead of char* - the string is not modified
in that function.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: Icc0bdf55f716e5eed71a472f2c77c47ee2fc1b3d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6459
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-12-13 09:26:29 +00:00
Jim Harris
06bcface42 spdk_dd: use SPDK_POLLER_REGISTER
This was missed when we created the SPDK_POLLER_REGISTER
macro to use the poller function name as the name of the
poller.  All other uses of spdk_poller_register were
switched to SPDK_POLLER_REGISTER except for these.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Idcb77f14c710dea08e36b1ed01a0eb8f6ab17045
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15755
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
2022-12-05 09:33:17 +00:00
Krzysztof Karas
1091ed8269 spdk_top: add support for scrolling pages with arrow keys
Currently user can only use PgDn and PgUp to scroll pages,
which may be confusing.

Change-Id: I61632a9eba35bcc2c817d202935ef5999ba00bbb
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15656
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-11-29 08:28:22 +00:00
Krzysztof Karas
4b0b72c1a6 spdk_top: fix display issues
Current issues:
-tab buttons do not show on app startup,
-interface not refreshing properly after closing help
 window

Fix for the first bullet point is to change color pair ID
from 2 to 10 (the colors WHITE and BLACK were swapped).

The new helper function has been added to remedy the problems
with refreshing interface after the pop-ups close. It is being
called after details windows and help window are closed.

Fixes: #2793

Change-Id: Ic91fc1ea8f858869c658b7803f6116fc4738aa63
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15655
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-11-29 08:28:22 +00:00
paul luse
a6dbe3721e update Intel copyright notices
per Intel policy to include file commit date using git cmd
below.  The policy does not apply to non-Intel (C) notices.

git log --follow -C90% --format=%ad --date default <file> | tail -1

and then pull just the 4 digit year from the result.

Intel copyrights were not added to files where Intel either had
no contribution ot the contribution lacked substance (ie license
header updates, formatting changes, etc).  Contribution date used
"--follow -C95%" to get the most accurate date.

Note that several files in this patch didn't end the license/(c)
block with a blank comment line so these were added as the vast
majority of files do have this last blank line.  Simply there for
consistency.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Id5b7ce4f658fe87132f14139ead58d6e285c04d4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15192
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
2022-11-10 08:28:53 +00:00
Changpeng Liu
da231290b2 lib/vfu_tgt: add library for PCI device emulation
Previously SPDK use libvfio-user library to provide emulated NVMe
devices to VM, but it's limited to NVMe device type only.  Here we
add SPDK vfu_target library abstraction based on libvfio-user which
supports more PCI device types.

We will add virtio-blk and virtio-scsi devices emulation based on
vfu_tgt library in following patches, actually this library can
support NVMe emulation too, due to the fact that the NVMe emulation
is already exist, so we will keep the NVMe emulation which based on
libvfio-user directly as it is.

Change-Id: Ib0ead6c6118fa62308355fe432003dd928a2fae9
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12597
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 19:42:56 +00:00
Damiano Cipriani
3e917320b9 spdk_dd: Add data and hole management
A logic has been introduced to skip hole in files and
bdevs and so to copy only data. For files lseek is used, for
bdevs new bdev API spdk_bdev_seek_[data,hole].
Show progress function will display only affected size_unit

Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
Change-Id: Ide2b0d825267603d45e00872ea719c8f0e82a60c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14363
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-09-21 19:54:37 +00:00
Damiano Cipriani
552a26d9d9 spdk_dd: Add check on block size
If passed as a parameter, block size must be a multiple of input
native block size, so a check to control this requirement has been added

Signed-off-by: Damiano Cipriani <damiano.cipriani@suse.com>
Change-Id: I38c41afd421083ba0864d5066d9978cb29bdaed6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14554
Community-CI: Mellanox Build Bot
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>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
2022-09-21 19:54:37 +00:00
Ben Walker
75aded8439 spdk_dd: Use FIXED_BUFFERS
This improves performance for io_uring

Change-Id: Ifff7f87e76f7ce3074c25d409dfd2b171c800e19
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12514
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-20 16:57:47 +00:00
Ben Walker
c284fa9ec4 spdk_dd: Use FIXED_FILES
This reduces overhead from fget/fput on each operation.

Change-Id: I43ddfd6e4ec9ed210206a5378eff9e7ab2f64f82
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12513
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-20 16:57:47 +00:00
Ben Walker
84cec154e8 spdk_dd: Allow io_uring to use O_NONBLOCK
This works fine on recent Linux kernels.

Change-Id: If3bf7feb88666d5c3e4b2f3e5071d6be6937fdf8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12515
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-20 16:57:47 +00:00
Ben Walker
cec27746ae spdk_dd: Report speed correctly
There were several places where the integers were likely to overflow,
plus we can avoid checking the timestamp every time because the poller
already fires on a fixed interval.

Change-Id: I7ec8f40f13b6c7a9c0f3f2de6d0aa23e9479c100
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12574
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-20 16:57:47 +00:00
Ben Walker
128083ec42 spdk_dd: If both input and output are block devices, use
IORING_SETUP_IOPOLL

Change-Id: Ie1ab8ab896ce0d2e41290645bf3ee275e1a5c578
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12022
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-09-20 16:57:47 +00:00
Jim Harris
18c8b52afa trace: allocate shm filesize based on number of cores used
Previously we would always allocate the shm file based on
max (128) cores which is unnecessary.  So use
spdk_env APIs to only allocate shm file size based
on the cores we might possible use.

With default settings, an shm file was 135MB before this
change, now an app using cores 0-7 will just use
about 9MB.

A lot of the trace-related code depended on there
*always* being a history for every core, even unused
ones, so a few additional changes were needed,
mainly the trace_parser library.

Tested by starting an app using a 0x4 core mask and
enabling a trace mask, generating some events, then
checking both the size of the shm file and that
spdk_trace works properly with the resulting file.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie868b3e3658d6f82b2fea37cb87453e8a9e0abc4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14044
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-09-20 10:17:45 +00:00
Krzysztof Karas
b4e9ce466c spdk_top: Add status columns to THREADS and CORES tabs
We now have a Status column in POLLERS tab only. This patch aims
to add those status indicators to other columns to free user of
determining whether thread or core was busy themselves.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: Ib1fb58c50f41591107ed0ea9c8fe2abcd5e54b5f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8414
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: Dong Yi <dongx.yi@intel.com>
2022-09-12 07:25:57 +00:00
yidong0635
a929fa0417 spdk_dd: Fix SEGV on the error path.
We can see this app using dd_exit to cleanup.
Some error cases:
spdk_bdev_get_io_channel failed for -ENOMEM,
or it results in dd_open_bdev failed and then
dd_exit.

For a bdev, dd_exit does cleanup using spdk_put_io_channel.
And spdk_put_io_channel allows `ch == NULL`.
This causes SEGV.

So here add a separate function to check ch, and put
cleanup together.

This is found by xnvme pre-test.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I9dd860da250a86f52139e69c690dd257a7ff7717
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14195
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
2022-08-29 11:40:08 +00:00
Krzysztof Karas
9494e8f54c spdk_top: allocate a copy of strings during thread display routine
The display_thread() function is the only one that needs to use a copy
of thread data, as threads might be moved between the cores during
SPDK application lifetime.
To avoid problems with using freed memory in the copied thread
structures, make sure the data is always present, by allocating a copy
of necessary strings. This will ensure that even after we have already
freed the globals holding data from RPC, the pointers used to display
the names and cpumasks will still have something to point to.

Fixes #2635

Change-Id: If9228ee199a774d208ddd6ff846532be3ef2012d
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14141
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
2022-08-25 07:31:06 +00:00
YafeiWangAlice
d89e62e7ef spdk_top: In CORES tab, spdk_top can't collect the right poller count under certain conditions.
spdk_top can't collect the right poller count when thread count is more than core count. Max index of g_threads_info[] should be thread count NOT cores count.

Signed-off-by: YafeiWangAlice <yafei.wang@samsung.com>
Change-Id: Iff95fb1aa7f84626a559741ad135a2cbeed04f90
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13574
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-08-09 08:26:05 +00:00
Ben Walker
8dd1cd2104 check_format: For C files only, fix return type breaks
In SPDK, declarations have the return type on the same line. Definitions
have the return type on a separate line. Astyle has an option for
enforcing this. Unfortunately, it seems to have two bugs:

1) It doesn't work correctly at all on C++ files.
2) It often fails on functions that return enums, or long type names

Deal with 1) by adjusting the check_format.sh script to only tell astyle
to fix return type line breaks for C files and not C++. Deal with 2) by
adding a few typedefs to work around the problem.

Change-Id: Idf28281466cab8411ce252d5f02ab384166790c6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13437
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2022-06-27 09:33:48 +00:00
Heinrich Schuchardt
40319c0e77 app: every app should have an (un)install target
make install should install all apps.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Change-Id: I66c2f4536cb9f4c5bae1895066be2836038c0672
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12901
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2022-06-21 07:54:12 +00:00
Jim Harris
488570ebd4 Replace most BSD 3-clause license text with SPDX identifier.
Many open source projects have moved to using SPDX identifiers
to specify license information, reducing the amount of
boilerplate code in every source file.  This patch replaces
the bulk of SPDK .c, .cpp and Makefiles with the BSD-3-Clause
identifier.

Almost all of these files share the exact same license text,
and this patch only modifies the files that contain the
most common license text.  There can be slight variations
because the third clause contains company names - most say
"Intel Corporation", but there are instances for Nvidia,
Samsung, Eideticom and even "the copyright holder".

Used a bash script to automate replacement of the license text
with SPDX identifier which is checked into scripts/spdx.sh.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iaa88ab5e92ea471691dc298cfe41ebfb5d169780
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12904
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: <qun.wan@intel.com>
2022-06-09 07:35:12 +00:00
Tomasz Zawadzki
e0516095fc event/vhost: separate vhost subsystem to scsi and blk
Separate out SCSI and BLK vhost subsystems to later add
virtio_blk transport abstraction.

This allows for further changes to the vhost_blk, not
affecting vhost_scsi.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Id1ecfeafeb936809a479a43c321e13f75cb3d5ad
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9539
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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: Konrad Sztyber <konrad.sztyber@intel.com>
2022-05-20 09:20:07 +00:00
Krzysztof Karas
887556e521 spdk_top: fix CPU usage in threads and cores tabs
spdk_top does not display these values correctly,
because it is compared with the busy/idle data gathered
from the start of SPDK instead of the last cycle.
The patch fixes that by adding a subtraction
of second to last cycle metrics from the very last one.

Fixes #2461

Change-Id: I6976a005bc848076e0d7fc94c0f91f97180b932d
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12319
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-04-21 12:20:31 +00:00
Ben Walker
aef71e29a0 spdk_dd: Use IORING_SETUP_SQPOLL mode
This has better performance than interrupt mode, so it is a better
default.

Change-Id: Ia2e13058b9b36874cd402f97ef57db77192f596a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12021
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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-04-19 08:17:05 +00:00
Ben Walker
958ca17750 spdk_dd: Correctly allocate enough queue depth for both input and output
When using io_uring, both input and output operations can be outstanding
at the same time. Ensure there is enough queue depth.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ibd8a652c1be32e020a281529b50576c62ff12a98
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12201
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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-04-19 08:17:05 +00:00
Ben Walker
d5f7c9d3f7 spdk_dd: If the file size can't be detected, just use the input size
This lets us do testing on things like /dev/zero or /dev/null

Change-Id: Iec3a73c30ad58d13f6af3bf18c0932dcd177f8f2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12020
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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-04-19 08:17:05 +00:00
Krzysztof Karas
f9e4e1fd62 spdk_top: add pop-up windows' response to interface resize
Make pop-up details windows handle interface resize and
redraw themselves in the center of spdk_top window.

Change type of check_resize_interface() from void to int.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: Ib7d8e17c794eb4aab593a6057a1809ea678d633c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7398
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.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>
2022-04-13 12:47:16 +00:00
Krzysztof Karas
59f2f01f22 spdk_top: make checking interface resize into a function
Creates new function to check interface resize.
This will be used in the next patch.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I147145be2db4fdab6f97b67baf3c2936abf7f6a3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7499
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.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>
2022-04-13 12:47:16 +00:00
Krzysztof Karas
0ce6762b57 spdk_top: redraw tabs after exiting popups
Adds the following after exiting popups:
-redrawing tab menu
-tab and core window refresh after closing thread pop-up
-update_panels() to refresh column names and lines
-redrawing tab contents

The goal of this patch is purely to improve visual
aspects of spdk_top.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I16952b75dd8e79521a41a8c2bda6fa62d43ccec8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7397
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-04-13 12:47:16 +00:00
Krzysztof Karas
fb558e0dff spdk_top: set minimal time on refresh rate
Set minimal required time for data gathering thread
to give display thread time to redraw all windows.
This is useful when user-defined refresh rate is set
to 0. With minimal required time hardcoded here, we
avoid multiple data refresh calls during one
display refresh (because drawing on screen takes
more time).

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I44ae808bc25eed36de60eccce30c8ecdeca5088d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7396
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2022-04-13 12:47:16 +00:00
Krzysztof Karas
65da9a26d3 spdk_top: add dynamic refreshing when core popup is active
Changes refreshing of cores tab to work from within cores pop-up
refresh function. This works the same way as refreshing of
THREADS and POLLERS pop-ups and tabs.

Added a handle for core window and core info to display_thread().
The purpose is to allow threads popup to refresh already active
cores popup. Otherwise, there are artifacts left where core popup
was displayed.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I6471d5001989870a0c073f771cb8ed5acc05445e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7394
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2022-04-13 12:47:16 +00:00
Krzysztof Karas
05c45b39e0 spdk_top: move draw_core_win_content()
Move draw_core_win_content() before display_thread(), because
it is going to be used there in the next patch.

Change-Id: I2dee246f14bc95f7dcdd1641830114919b300630
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11237
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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-04-13 12:47:16 +00:00
Krzysztof Karas
6a0c7766bb spdk_top: separate core popup content drawing
Separate drawing of core popup content from the rest
of the popup's functionality.

Change-Id: I60641d347528b08e2809d9678ca306d9db5bb823
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11236
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2022-04-13 12:47:16 +00:00
Krzysztof Karas
d18ec6e392 spdk_top: make pollers tab refresh with pollers pop-up active
Changes refreshing of pollers tab to be done from within poller
pop-up display function. As mentioned before, NCURSES does not
behave predictably, when different parts of screen are refreshed
from within multiple functions at a time, so the "control" of
refreshing has to be passed to one function.

Adds refreshing of pollers pop-up.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I37dcedc495c314462b252774d97410158e1b895d

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7393
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2022-04-13 12:47:16 +00:00
Krzysztof Karas
c82148a5f3 spdk_top: separate drawing poller popup content
Separate drawing of popup content from the rest of
window functionality.

Change-Id: I00f4de51beb9e3bb61e4003dae8a341408466ff6
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11235
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2022-04-13 12:47:16 +00:00
Krzysztof Karas
409cc5bdd4 spdk_top: modify refreshing of display
Changes calling refresh on different parts of spdk_top window.
refresh() function copies the virtual screen contents to the terminal.
With constant refreshes the terminal would blink. To fix this refresh()
is replaced with wnoutrefresh() calls, which only refreshes
the virtual screen. After all changes to the terminal are ready, one
refresh() is enough to draw everything on screen.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I16b526a1cac8f68dee833ae775cfddee131851d0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7286
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2022-04-13 12:47:16 +00:00
Krzysztof Karas
53add5e240 spdk_top: make threads pop-up window refresh itself and active tab
Adds refreshing of threads and cores tab when thread pop-up is active.

Adds refreshing of threads pop-up and moved thread_win allocation and
poller number checking inside while loop.

Dynamic refresing of core pop-up with thread pop-up active
will be added in future patches.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I916f2b64a81db22e5caa32948094b4fce0b6577c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7391
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2022-04-13 12:47:16 +00:00
Krzysztof Karas
216a7c3d0b spdk_top: add a helper function to check if thread exists
This check is going to be called in two places in the next patch.
The purpose is to eliminate duplicating code.

Change-Id: I1d739395453c083479c104e2774b1e0c01962bd1
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11234
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2022-04-13 12:47:16 +00:00
Krzysztof Karas
27d157c187 spdk_top: fix broken column names after resizing
Redraw only current tab's column descriptions upon
resizing terminal to avoid writing text from other
columns.

Change-Id: I50f2be79615b08f42b2f8600cdb95048eda8ab56
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11684
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-04-07 07:24:13 +00:00
Ben Walker
fc61e8b7e1 spdk_dd: Create only a single io_uring/aio context
Instead of creating a ring/context per target, create just one for the
job. This is more efficient.

Change-Id: I1b20dff02421a47630b63a35ca09ee784fd03be5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12019
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-03-29 07:32:34 +00:00
Krzysztof Karas
0c97e22ccc spdk_top: fix scheduler data error display
spdk_top constantly shows scheduler data error
due to missing "_relaxed" suffix in
spdk_json_decode_object() function. This happens
when SPDK scheduler is switched to "dynamic", because
it provides more data than defined in spdk_top's
scheduler_decoders structure.

Additionally delete leftover governor code.

Fixes #2433

Change-Id: I1f849f0cb48fce5312cdc3c25d7b4529b407283c
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12010
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-03-23 09:01:46 +00:00
John Levon
70f3606bfc add USDT tracepoints for interrupt wakeups
With these we can write a simple bpftrace script to identify work being done,
and in particular what woke us up from sleeping.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I8997d847625ee4558092dbd753e6fc1b17beca92
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9424
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-03-21 11:07:05 +00:00
Krzysztof Karas
1de1797b11 spdk_top: change scheduler name to be optional in decoders
Make scheduler name optional in decoders. Some of our applications
do not use scheduler, so they do not provide its data via RPC requests.
This will spare users from seeing an error encountered while getting
scheduler data.

Change-Id: I5213b85cd9217b8573e980918bbfa2bb0c9d2cfd
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11781
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-03-04 08:18:38 +00:00
Jim Harris
e0ca35c4f6 spdk_top: allow connecting with TCP port
JSON-RPC server (spdk_rpc_listen) only listens on
a UNIX domain socket.  If users wish to issue
JSON-RPC calls over a TCP socket for debugging
purposes, they can forward calls using socat, i.e.

socat TCP4-LISTEN:8989,reuseaddr,fork,bind=127.0.0.1 \
      UNIX-CLIENT:/var/tmp/spdk.sock

This could allow running spdk_top to debug or
monitor an SPDK application remotely.  But currently
spdk_top -r option assumes AF_UNIX.  Look at the
first character in the -r option (if provided) - if
it's '/' use AF_UNIX, otherwise AF_INET.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie9c33bb0fb66dff895359f6f6608862df42b542c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11567
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2022-02-15 16:46:17 +00:00
Krzysztof Karas
07e3c34f79 spdk_top: add data structures and functions for scheduler and governor
Added data structure to hold scheduler name,
scheduler period and governor name.
Implemented functions to get data from rpc and free memory after use.

Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I83108e29b9b80415c276d3592cb78ec3eaf9aeb9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5944
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2022-02-15 00:25:54 +00:00
Krzysztof Karas
8f4c7cc33a spdk_top: fix warning on build
During make operation warning -Walloc-size-larger-than
is seen. The cause is the type of threads_count variable,
which can store value up to MAX_SIZE threshold. The value
of the variable is then divided by 8 and multiplied by 32,
what exceeds the MAX_SIZE limit.

To fix the problem I changed value of threads_count to uint16_t.
Its maximum value is closer to that of hard coded limit of threads
RPC_MAX_THREADS than size_t.

Change-Id: I7c76db21c328166c074d564d9c1d6d29ae8a07da
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11177
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-01-21 07:49:23 +00:00