Commit Graph

11474 Commits

Author SHA1 Message Date
Konrad Sztyber
0674194ae8 lib/ftl: initialize per-ioch write buffers
This patch introduces the per-io_channel write buffer entry, the
structures necessary for its management, and performs their
initialization.  They will be utilized by the upcomming patches.

Change-Id: I772caa445d1887166b9bcd7679d32d2ed2461ef3
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/903
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-02 10:27:06 +00:00
Konrad Sztyber
bfafd4e472 lib/ftl: IO channel array
The IO channel pointers are now stored inside an array of the device
they belong to.  Once write buffer entries are tied to IO channels,
it'll provide a method for dereferencing an entry from its address.

Change-Id: Iaf401525eb0f5af8dc6047a1dc8bae11b56761d7
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/901
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-02 10:27:06 +00:00
Konrad Sztyber
085bfa0d13 lib/ftl: allocate separate memory for IO channels
This is the first patch of a series that replaces single global write
buffer with per-io_channel buffers.  This change is intended to improve
performance for multithreaded workloads.

This patch changes the way the ftl_io_channels are allocated by only
keeping an ftl_io_channel pointer inside spdk_io_channel's context.  It
allows for delaying IO channel destruction, which in turn allows the FTL
to iterate over all exisiting IO channels without locking.

Change-Id: I5e0cab8043a2b5f747e971dd3d65ed2546c8cf26
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/900
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-02 10:27:06 +00:00
Shuhei Matsumoto
595173aaba bdevperf: Make bdevperf_construct_targets() asynchronous by sentinel value
Follow the idea of bdev_get_iostat in module/bdev/rpc/bdev_rpc.c.

Add a global variable g_bdev_count and then set it to 1 as sentinel
value in bdev_construct_targets().

Subsequent patches will make _bdevperf_construct_targets() asynchronous.
Then bdevperf_construct_targets() will be truely asynchronous.

This patch is too small to be an independent patch but keep to
hold previous review result.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I49d0b6e6d61df65d4eb31c402f98cc4300482e20
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/639
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-02-28 14:38:15 +00:00
Shuhei Matsumoto
a4335feb6d lib/event: Support SPDK_THREAD_OP_RESCHED operation in reactor
Add a flag resched to check if reschedule operation is requested
to struct spdk_lw_thread. Add _reactor_resquest_thread_reschedule()
to set the resched flag, and add it to the case SPDK_THREAD_OP_RESCHED
in spdk_reactor_thread_op(), and return true in the case
SPDK_THREAD_OP_RESCHED in spdk_reactor_thread_op_supported().

Then _spdk_reactor_run() checks if the resched flag is true for each
thread. If true, set the resched flag to false, and remove the
thread and call _reactor_schedule_thread(). Add continue to avoid
use-after-free issue for both reschedule and terminate cases.

This idea follows voluntary thread termination and will remove our
worries for all complicated rare cases.

Add unit test case to verify this update.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I656872d32dbb469ae70f771cd0419a77236bfe18
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/500
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-02-28 14:37:53 +00:00
Seth Howell
bad25cad1b test/nvmf: don't return before calling nvmftestfini
This is necessary to avoid leaving the machine in a bad state between
test runs.

Change-Id: I2c68d2dc88f0f9f4cab099564d25a3e21eb5671c
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1027
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-02-28 08:55:07 +00:00
Wojciech Malikowski
62610945c0 lib/ftl: Band relocation should be performed only on closed bands
Remove checks for open bands inside because
we should only support closed bands relocation.

Change-Id: Ice5f13d579a046a9cb46684488801a2fa0c15a9d
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/876
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-02-28 08:54:07 +00:00
Wojciech Malikowski
f93ac08d26 lib/ftl: Merge ftl_thread structure with ftl_dev
Since ftl supports only one core thread ftl_thread
structure is not needed anymore.

Change-Id: I66eda9249d74b3eff0c4473dcd0aba4a6135e296
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/548
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Maciej Szczepaniak <maciej.szczepaniak@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2020-02-28 08:54:07 +00:00
Wojciech Malikowski
c6bca349da lib/ftl: Replace reloc spdk_ring with STAILQ
Since relocation can be done only on core thread there is
no need for spdk_ring. Move queue size is limited by
reloc->max_qdepth so we are trying to iterate over all
move elements in move queue when processing band relocation.

Change-Id: Ic4cfaeeab4b5f3dd3e1dbd967908a3e6c9b3ed46
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/547
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-02-28 08:54:07 +00:00
Tomasz Zawadzki
49de02ec4d Revert "test/hotremove: Select test cases to be run for scci and blk hotremove."
This reverts commit 29e9fdc857.

Nightly tests after merging the reverted patch show that it does not
pass in current state. It affected the per-patch, since the new
tests weren't added to skipped_tests list.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If8a58cbe9ecd0e58f20c0a9ee844bc9a8ee046a3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1045
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-02-27 18:11:36 +00:00
Maciej Wawryk
dad9d17406 test/common: Add smartmontools dependencies for FUSE and NVMe-CUSE in vm_setup.sh
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ia8f12aca0a70e93bddd0ad7aeb658f85044ffdfa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/956
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-02-27 10:16:19 +00:00
Pawel Kaminski
29e9fdc857 test/hotremove: Select test cases to be run for scci and blk hotremove.
With this change user can defined test cases that he wants to run.
It could enable to run hotremove test cases per-patch and nightly.

Change-Id: I6876f39886a347ada4dd548a2f45b99a37207c3e
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/768
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-02-27 10:16:10 +00:00
Alexey Marchuk
32c6f860d5 reconnect: Add transport ack_timeout and retry_count parameters
These parameters can be enabled using -A (ack_timeout) and
-R (retry_count) cli options

Change-Id: I0c262f93c664a69aa952d6926fd7b0d02acf9e30
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/503
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-02-27 10:16:00 +00:00
Alexey Marchuk
94966468ae nvme/rdma: Introduce transport_ack_timeout
Add transport_ack_timeout parameter to nvme controller opts.
This parameter allows to configure RDMA ACK timeout according
to the formula 4.096 * 2^(transport_ack_timeout) usec.
The parameter should be in range 0..31 where 0 means use
driver-specific default value.

Change-Id: I0c8a5a636aa9d816bda5c1ba58f56a00a585b060
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/502
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-02-27 10:16:00 +00:00
Darek Stojaczyk
ebe4bfc2bb test/common: add one more fio leak to ASAN suppresions list
It comes up on failed fio runs and bloats the log.

Change-Id: I8dd0196bfc98b3ee888aca0def83f0961fbc1197
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1010
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>
2020-02-27 10:15:52 +00:00
Michal Berger
2695854b90 test/nvmf: Add skel for nvmf error testing
The goal of this test is to make sure that proper parts of the lib
fail as they should. These particular tests focus on:

  - spdk_rpc_nvmf_create_subsystem(): model and serial number checks

Change-Id: I504279d08b192d6dfe37a8a601eda44084b596d4
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/693
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>
2020-02-27 10:15:40 +00:00
Michal Berger
c0fb1b93d0 test/unit: [nvmf/ctrlr.c] Increase feature get|set coverage
Add tests for the following features:

  - SPDK_NVME_FEAT_TEMPERATURE_THRESHOLD (4),
  - SPDK_NVME_FEAT_ERROR_RECOVERY (5),

For Temperature Threshold feature the validity of the THSEL and TMPSEL
is covered as described in the NVMe spec (1.4):
	"Figure 279: Temperature Threshold – Command Dword 11"

For the Error Recovery feature the validity of the DULBE is covered
as decribed in the NVME spec (1.4):
	"Figure 280: Error Recovery – Command Dword 11"

Random value is selected for the lsb in the cdw11 (0x42).

Change-Id: Ia57ab4d79439ec315ddc9bbfdad8400aa926062a
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/692
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-02-27 10:15:40 +00:00
Michal Berger
c843612041 test/common: Introduce new test flag for enabling debug app runs
SPDK_AUTOTEST_DEBUG_APPS - if set to 1, all applications will be
			   executed with --log-flags=all

This should increase, to some extent, coverage of each application.

Change-Id: I1fc82a837abb7e94bda55f47056a120bd9be40d7
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/691
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-02-27 10:15:40 +00:00
Michal Berger
ee7cdc2c76 test/fuzz: Rename FUZZ_APP to VHOST_FUZZ_UP
Since there's more than one fuzz app covering different areas, rename
FUZZ_UP to VHOST_FUZZ_UP to make the type of the app clear right off
the bat.

Change-Id: I7730f1e14895d9221ec76dea0f53b5054a97be1c
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/978
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-02-27 10:15:40 +00:00
Michal Berger
b4c5509c6e test/common: Source *_APP from a common place
Instead of declaring each app in the actual test, source their default
declarations from a single location. Additionally, use them as arrays
now instead for easier cmdline management.

Change-Id: I0ea39403f070dc57987065ebb800e91c35de643a
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/690
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-02-27 10:15:40 +00:00
Pawel Kaminski
6f7cb2ad58 test/vhost: Move negative tests from nightly to per-patch.
Change-Id: Ia679f176f84b1d461f6bcc69b3fd509b6f7a66d1
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/556
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-02-27 10:15:28 +00:00
Pawel Kaminski
50e44f841a test/vhost: Add negative test for vhost_scsi_controller_add_target
Change-Id: Ie8305b8128ca2a6b16020f72ac5bfa9dec2bb7c0
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/536
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-02-27 10:15:28 +00:00
Pawel Kaminski
6668f0d9f2 test/vhost: Add negative test for vhost_controller_set_coalescing rpc
Change-Id: I883d20d9ff2d1da1de89543cf81c9f3d3712e44f
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/535
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-02-27 10:15:28 +00:00
Pawel Kaminski
765ae06958 test/vhost: Negative test - get controller that does not exist
Change-Id: I9f241c2dea10891bed62e7dcd26cb6d7ffc061d5
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/831
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-02-27 10:15:28 +00:00
Michal Berger
e338a8dd37 test/common: Don't attempt to install tsocks package on fedora 31
Currently, this particular package is not available in fedora 31's
repos, thus don't exit the setup if its installation fails.

Change-Id: I56852ed172c95b23c92e25b1cec391b4e909f2bd
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/936
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-02-27 10:15:11 +00:00
Tomasz Kulasek
873c8748eb config: fix fail if explicit dependency not met
This patch modifies default configuration disabling features
with known issues or incompatibilities.

If user tries to explicitly turn on feature which dependences are
not met it exits with error immediately.

	Fixes issue #1193

Change-Id: If7363506ee812c5135f5a3a023ab9e8d26268528
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/971
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>
2020-02-27 10:15:02 +00:00
Michal Berger
e4c26938a4 test/common: Drop single quotes in --extra-cflags arg
Since '' are placed within "" they are treated as literal part of the
argument passed to configure. Due to that, configure fails to run cc
since all -W flags are treated as one.

Change-Id: I69e182f308628cc5b63bd363d3a47cf87336a59a
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1024
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-02-27 10:14:51 +00:00
Tomasz Zawadzki
2ce1406a59 shared_lib: bump version of all .SO to 1.1
The original SOVERSION was not updated since its introduction,
two years ago.

This will serve as a cut-off point for any changes done before.
Going forward each SO will be versioned separately whenever
ABI breaking change occurs.

Version 1.1 will point to changes done up to
release of SPDK 20.01.
By SPDK 20.04 some of the libraries might update to 1.2.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I9ef6c1d345a66b7683efa61e28edb5c2ba9b7c5a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1009
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-02-27 10:14:32 +00:00
Shuhei Matsumoto
713aafbc10 lib/thread: Add spdk_thread_set_cpumask() and enum SPDK_THREAD_OP_RESCHED
Add an new API spdk_thread_set_cpumask() and enum SPDK_THREAD_OP_RESCHED.

spdk_thread_set_cpumask() can be called only from the current thread
and requires SPDK thread operation supports reschedule operation.

spdk_thread_set_cpumask() updates the cpumask of the current thread to
the specified value, and then invokes framework's reschedule operation
to the thread.

If spdk_thread_set_cpumask() calls multiple times in a single
spdk_thread_poll() context, the last value will be used in the
reschedule operation.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7808626b10269543c1e2cd86793a504daa4b6389
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/499
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>
2020-02-27 10:14:23 +00:00
Shuhei Matsumoto
1368aec870 lib/event: Use spdk_thread_lib_init_ext() to initialize thread library
Remove the prefix "spdk" from spdk_reactor_schedule_thread(), add
spdk_reactor_thread_op() and spdk_reactor_thread_op_supported().

For SPDK_THREAD_OP_NEW, spdk_reactor_thread_op() calls
_reactor_schedule_thread() and spdk_reactor_thread_op_supported()
returns true.

Then replace spdk_thread_lib_init() by spdk_thread_lib_init_ext()
with spdk_reactor_thread_op() and spdk_reactor_thread_op_supported().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I232a3b2c6bcaf4d86b0dd3cefacd3e47eadda6d8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/968
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>
2020-02-27 10:14:23 +00:00
Shuhei Matsumoto
d82d69017f lib/thread: Add spdk_thread_lib_init_ext() and generic thread operation function
Add enum spdk_thread_op and two function typedefs spdk_thread_op_fn
and spdk_thread_op_supported_fn.

The first operation type of enum spdk_thread_op is SPDK_THREAD_OP_NEW,
and it is used as an alternative to spdk_new_thread_fn.

Add global variables, g_thread_op_fn and g_thread_op_supported_fn, and
then add spdk_thread_lib_init_ext() to initialize these.
spdk_thread_lib_init() requires both of thread_op_fn and
thread_op_supported_fn are specified or not specified.

spdk_thread_create() calls g_thread_op_fn() with SPDK_THREAD_OP_NEW
if g_new_thread_fn is NULL, g_thread_op_supported_fn is not NULL,
and g_thread_op_supported_fn(SPDK_THREAD_OP_NEW) returns true.

Update unit test to test these addition.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I56db903f62437f6ff3198248ffc5dede396c22bc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/967
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>
2020-02-27 10:14:23 +00:00
Shuhei Matsumoto
ee8134099a lib/thread: Add spdk_thread_get_by_id() API to get thread whose ID matches
Add an new API spdk_thread_get_by_id(). This will be used in the
subsequent patches to set the cpumask of the running thread to the
specified value.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib5d02b9d7b499477c43e6527cf8f603d8323e063
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/966
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-02-27 10:14:23 +00:00
Shuhei Matsumoto
515733ca4a lib/thread: Add unique ID for each created SPDK thread
Add an unique ID for each created SPDK thread. Use a single 64 bits
variable, g_thread_id, and guard its update by the global mutex
g_devlist_mutex. For our safety, further thread creation is not
allowed if g_thread_id rolls over, and request user to restart SPDK
application.

Besides, as a minor update, move the debug log down and add ID to it
in spdk_thread_create(), and ID is added to thread_get_stats RPC and
framework_get_reactors RPC.

The thread ID will be used to set the cpumask of the running thread
to the specified value in the subsequent patches.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic09f11d4c7175c3b89acba6a42e76063acd0d1a0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/498
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-02-27 10:14:23 +00:00
Shuhei Matsumoto
04f6e24ae3 lib/thread: Update the comment for spdk_thread_exit() in the header file
By these patch series, spdk_thread_poll() runs normally even after
the thread is marked at exited. However, spdk_thread_send_msg(),
spdk_get_io_channel(), and spdk_get_io_channel() will fail after
the thread is marked at exited.

Update the comment for spdk_thread_exit() in the header file
accordingly. To avoid rebasing the patch series, append this to
the end of the patch series.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic03d3c5461feb3ad878749a4c71a582c8ef3f26c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/847
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-02-27 10:14:23 +00:00
Jacek Kalwas
fb7129881a nvmf: add const to nqn getters
There is a warning triggered when holding ref to const obj and passing
to these getters.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I2c7b4ea0d325d84d66923fc524273ea44a3a311b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/997
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-02-26 09:27:11 +00:00
GangCao
c65d64a6b8 vbdev/raid: close the base bdev on its opened thread
With the JSON configure, the base device will be opened on the
same thread (RPC thread) to handle the JSON operation. Later the
virtual device upon the base device can be opened on another
thread. At the time of virtual device destruction, the base
device is also closed at the thread where opening the virtual
device, it is actually different than the original thread where
this base device is opened through the JSON configure.

Add a thread here to record the exact thread where the base
device is opened and then later route it back to handle the base
device close operation.

Change-Id: Ib95e8d190bd87158ae1ecc6698da95ccc4ba9579
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/992
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-02-26 09:26:49 +00:00
Changpeng Liu
8d6f48fbf8 nvme: set transport string before the probe based on transport type
Users may only set the transport type, but for the actual probe
process, the trstring field is mandatory, so set the trstring
based on transport type at first.  Also remove unnecessary
spdk_nvme_trid_populate_transport() call from each transport
module.

Fix #1228.

Change-Id: I2378065945cf725df4b1997293a737c101969e69
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1001
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-02-26 09:26:09 +00:00
Changpeng Liu
bad2c8e86c nvme: detach the controller in STUB and flush the admin active requests at last
In the autotest, when calling kill_stub() function, there is error log
like this: "Device 0000:83:00.0 is still attached at shutdown!", so it's
better to detach the controller when exit the stub process.

But after call spdk_nvme_detach() in the stub process, there is another issue:
1. NVMe stub running as the primary process, and it will send 4 AERs.
2. Using NVMe reset tool as the secondary process.

When doing NVMe reset from the secondary process, it will abort all the
outstanding requests, so for the 4 AERs from the primary process, the 4
requests will be added to the active_proc->active_reqs list.

When calling spdk_nvme_detach() to detach a controller, there is a
assertion in the nvme_ctrlr_free_processes() at last to check the
active requests list of this active process data structure.

We can add a check before destructing the controller to poll the
completion queue, so that the active requests list can be flushed.

Change-Id: I0c473e935333a28d16f4c9fb443341fc47c5c24f
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/977
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-02-26 09:26:09 +00:00
suhua
9c6d4649eb vhost: Fix the issue of virtual machine device parameter max_segments always equal to 1
Solve the problem that the /sys/block/vd../max_segments is always 1 in the virtual
machine,and avoid the problem of low sequential read and write performance caused
by this limitation in the general block device layer of some lower kernels.

Signed-off-by: suhua <suhua1@kingsoft.com>
Change-Id: I3289b4c6c74d9225f34e117f444f310bf8bc8ea2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/975
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-02-26 09:25:32 +00:00
Changpeng Liu
4f7fa18d69 nvme: export internal security send/receive APIs as public APIs
There are synchronous security send/receive APIs defined in nvme.h,
however, we still need the asynchronous APIs so that we can make the
OPAL library can be used in asynchronous way. As the asynchronous APIs
are already defined in nvme_ctrlr_cmd.c, so just export them to public
APIs.

Change-Id: I5646f342a4bf70faad37daa956476f05a1327bcc
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/675
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-02-26 09:22:15 +00:00
Jim Harris
39dce00bb5 test: add FreeBSD-specific ps options to get process name
Fixes issue #1145.

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

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/970
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-02-26 09:16:45 +00:00
Seth Howell
2b43f6353f test/nvmf: add verify_backlog to fio SGL tests.
On newer versions of FIO, there is an issue with heavy verify workloads
where one of the headers (rand_seed) gets incorrectly generated by fio
during verify. This can be circumvented by using the verify_backlog
flag.

This is needed because it will enable testing this workload on the tcp
transport using fio in the SPDK test pool.

Change-Id: I028be3fdb72a76733b4226a37b6332cd45d0f774
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/988
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-02-25 15:59:21 +00:00
Maciej Szczepaniak
35ce722145 make: Compile with libpmem if --with-pmdk is set.
Signed-off-by: Maciej Szczepaniak <maciej.szczepaniak@intel.com>
Change-Id: I120c4a1e04df5cf79900b6b84d7392f57ca25238
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/648
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
2020-02-25 10:47:15 +00:00
GangCao
b3be320de4 vbdev: close the base bdev on its opened thread
With the JSON configure, the base device will be opened on the
same thread (RPC thread) to handle the JSON operation. Later the
virtual device upon the base device can be opened on another
thread. At the time of virtual device destruction, the base
device is also closed at the thread where opening the virtual
device, it is actually different than the original thread where
this base device is opened through the JSON configure.

Add a thread here to record the exact thread where the base
device is opened and then later route it back to handle the base
device close operation.

Change-Id: Id1299bb0d86db57bce48b9787d7f248d29a6f345
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/974
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.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>
2020-02-25 10:46:40 +00:00
Seth Howell
ae86baeba2 nvmf: implement controller reset for fabrics.
According to the spec, if the CC.EN bit is transitioned from 1 to 0,
then all of the I/O qpairs shall be disconnected and the csts.rdy bit
shall be set to zero.

Change-Id: I871170e79e08a9fab8286f9c135c7b3316f58ace
Signed-off-by: Seth Howell <seth.howell@intel.com>
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/423
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-02-25 10:32:30 +00:00
Ben Walker
68c2244cdc nvmf: Add spdk_nvmf_ctrlr_get_regs to nvmf_transport.h
Add a way for the transport to query the value of the controller
registers.

Change-Id: Id365ff088989f6f8e74e26ff6f3d435f35bee2f4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/422
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-02-25 10:32:30 +00:00
Ben Walker
e8c195b3eb nvmf: Allow 4 byte property operations on 8 byte properties
The first 4 or last 4 bytes of an 8 byte property can now
be written independently.

Change-Id: I894f8349be836511c18c380262eae46951060766
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/421
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>
2020-02-25 10:32:30 +00:00
Wojciech Malikowski
8175aa1fea lib/ftl: Use fio_plugin for ftl tests
Use fio with fio_plugin instead nbd.

Change-Id: Ibd94f9de65296814c4bbe45c67f9b47a717c79ac
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/958
Reviewed-by: Maciej Szczepaniak <maciej.szczepaniak@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-02-25 10:32:17 +00:00
zhuxiaohui.400
32f59976df lib/iscsi:break the loop in iscsi_parse_portal_grp() when the portal
section reaches the end

Change-Id: Ia7a23833927e24b1f90a443b582b2f43ea00f450
Signed-off-by: zhuxiaohui.400 <zhuxiaohui.400@bytedance.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/979
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-02-25 10:32:08 +00:00
dongx.yi
044704995d nvme/cmb_copy: Carriage return between return type and function name.
Meanwhile,  checking new gerrit for committing a new patch.

Signed-off-by: dongx.yi <dongx.yi@intel.com>
Change-Id: I33c0f5bf5b13a147777a9831c9c6e6079b90590f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/999
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-02-25 10:32:01 +00:00