Commit Graph

9420 Commits

Author SHA1 Message Date
Changpeng Liu
2226750a7c nvme: add an option 'no_shn_notification' to driver
spdk_nvme_detach() will do the normal shutdown notification for
most cases, and it will take some time e.g. 2 seconds to finish
the process for PCIe based controllers.  If users' environment
has several drives, each drive will call spdk_nvme_detach() one
by one, and the shutdown process may take very long time.

Since users know exactly what they would like to do for the next
step, so here we provide an option to users, users can enable it
to skip the shutdown notification process so that they can have
very quick shutdown process, and when starting next time, the
controller can be enabled again.

Change-Id: Ie7f87115d57776729fab4cdac489cae6dc13511b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463949
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-08-13 22:50:03 +00:00
Changpeng Liu
5adac19ad0 blobfs: return error to caller when loading a bs which isn't blobfs
Also release the IO channels with filesystem data structure.

Change-Id: I75a5d427fe4837ad7d85444d09ded9ab41e0ca8e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464851
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>
2019-08-13 17:12:02 +00:00
Changpeng Liu
62202dda32 blobfs: use macro instead of hardcoded BLOBFS string
We used "BLOBFS" as the signature when loading from blobstore, so define
a macro here.

Change-Id: Iff504a36686c2bc08c90c49b8a505b5533b62508
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464850
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>
2019-08-13 17:12:02 +00:00
Seth Howell
765f4a7363 test/nvmf: add initiator timeout test.
This test is meant to simulate uncommon network situations where lots of
I/O are getting dropped before they get to the initiator. Essentially,
we are trying to trigger the initiator timeout in the kernel which
disconnects from the target and reconnects after 10 seconds.

This test is different from the other tests that we have currently
because it doesn't rely on killing either the target or initiator.
Instead it expects the target to stay up and properly respond to the
initiator error conditions. The hope is that the fio job running on the
initiator can still complete successfully and the target doesn't crash
due to improperly handling the disconnect and reconnect.

This test should be added to the nightly CI jobs because it is rather
time consuming.

Change-Id: Id457d9eb21a980140f065663547b89b2c69ace93
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464459
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: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-08-13 16:56:01 +00:00
Seth Howell
d2424824a1 bdev/delay: make latencies reconfigurable.
This will allow us to do interesting things in tests like configure a
bdev with a really long delay, and allow I/O to build up on a target to
see what happens, then decrease the latency to allow traffic to flow
through normally without ever having to delete and reconfigure the bdev.

Change-Id: Ibcb1101f8eed9fe3094ba239110cb4e49ace6554
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464454
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>
2019-08-13 16:56:01 +00:00
Shuhei Matsumoto
7877ddc86e iscsi: Use cached host and port name of connection widely
portal_host and portal_name were added to struct spdk_iscsi_conn long
ago but had not been used yet. Portal group and its portals can be
removed dynamically even if there is any binded connection. Using
cached pg_tag will avoid potential errors.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I56d02664a3e8b2398bbb9162b1c85856e991b5b4
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463879
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>
2019-08-13 15:46:17 +00:00
Shuhei Matsumoto
f338b43a86 iscsi: Use cached portal group tag of connection widely
pg_tag was added to struct spdk_iscsi_conn long ago but had not
been used yet. Portal group and its portals can be removed
dynamically even if there is any binded connection. Using cached
pg_tag will avoid potential errors.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic7a96ef97c3cab7e5a58aa7f439364b53694a1e4
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463874
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>
2019-08-13 15:46:17 +00:00
Shuhei Matsumoto
23eb38f1ac iscsi: Use fixed size string for host and port name of connection
This will reduce the potential malloc failure.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibcd631bf318ef6ece4ac337219652323ca5fd8f1
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464136
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>
2019-08-13 15:46:17 +00:00
Shuhei Matsumoto
20bbd038aa ut/bdev/raid: try to break lines after 100 characters
Some lines in this file are long and should be broken
as bdev/raid/raid_rpc.c was done recently.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I98a7f965b7230f32ab6a2d33a0f204591fa92ac1
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464484
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-13 00:27:17 +00:00
Shuhei Matsumoto
953975fe87 ut/bdev/raid: Reorder stub definitions by libraries or modules
Ordering stub definitions by libraries or modules will be a little
easier to read.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7568c94691229188c348a9c5e3fba8f2bc1ecf04
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464483
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-13 00:27:17 +00:00
Shuhei Matsumoto
47155be6f3 ut/bdev/raid: Use cached pointer to expected output in IO verification
Use cached pointer to g_io_output in IO verification to improve
readability.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I71ced5d1e438d5046b9a5913a1a2860f8435d79b
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464485
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-13 00:27:17 +00:00
Shuhei Matsumoto
2b015b7a26 ut/bdev/raid: Factor out operation to setup expected IO output
Create a helper function set_io_output() to setup expected IO output.
Besides change the name of cached pointer to expeced IO output
from p to output because p is ambiguous.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7574bf8362f7c5d7841e08b4fbd9a9b66836012a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464482
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-08-13 00:27:17 +00:00
Shuhei Matsumoto
c0329efef3 ut/bdev/raid: Move create_construct_req() to clarify it is for RPC
create_construct_req() had been located just above raid_bdev_init().
However this location was not intuitive. Hence move create_construct_req()
to just above spdk_rpc_construct_raid_bdev().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia5998146ce7b4b9a3c3bdeb38b6dbc8dd21fa276
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464481
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-13 00:27:17 +00:00
paul luse
2c35c8fbea bdev/compress: re-type and re-name misleading variable name
Becomes important in next patch

Change-Id: Ida19f0b59c4b841d6f5120f9130e24b57ae91560
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464717
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-12 21:37:21 +00:00
Mateusz Kozlowski
0cb8a3319c lib/ftl: Update initialization of io channel
Changed initialization of io channels to be made in the core/read
thread themselves. This fixes potential hangs when using the ftl lib
directly, without bdev and initializing an ftl device from a different
thread than will be used for IO.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: I7089cc46cc6de5e9008e7c22cc01d2b4103ebb14
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464891
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-12 21:37:13 +00:00
Liang Yan
35f840b324 iscsi: remove portal group cpumask usage example
Change-Id: I6e87c15ae0e9839d0d4b0922bbb9e397588b770d
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464624
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-08-12 21:32:47 +00:00
Shuhei Matsumoto
ff9d333171 iscsi: Move macros to define max port name from portal_grp.h to iscsi.h
This is a preparation to the next patch which will change portal_host
and portal_port from malloc to fixed size.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0f95d969edfd88efde41a43eaf0426fcd4b98987
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464135
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-08-12 21:31:44 +00:00
Shuhei Matsumoto
1738ec7a9e iscsi: Simplify duplicated target pointers in iscsi_op_login_phase_none
conn->target is initialized to NULL in iscsi_op_login_phase_none
and then configured in iscsi_op_login_session_normal. Hence
subsequent references to target node can be done by conn->target and
related local variables can be removed.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I68b94cb8e136522ef1e0ed74c0035ec2b666bb9e
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463700
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-08-12 21:31:44 +00:00
Seth Howell
8f71ab3a2b mk: use the env shared lib when linking apps
Previously, aplications were always being linked against the
spdk_env_dpdk.a file even during the shared object build. Change this to
be consistent with our linking.

Also, the old behavior causes issues with resolving symbols in FreeBSD.

Change-Id: I96e2e6044c16e7579cff35ad46e3688ce6fa2b5a
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464733
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>
2019-08-12 21:12:16 +00:00
Seth Howell
e29c6fe133 mk: force --no-as-needed for spdk libs.
When building shared libs, we specifically don't set the --as-needed
flag so that we still link against libraries that have constructor
functions. LD reports on its man page that the default behavior is
equivalent to --no-as-needed.

For RHEL based distros like fedora and centos this works fine. While
the LD man page shipped with ubuntu distributions also states that
--no-as-needed is the default, they don't respect that behavior and do
--as-needed linking unless you force them with --no-as-needed.

Change-Id: I914ab849323de198af5c5e53fffb1f57fcaff5fe
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464621
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>
2019-08-12 21:12:16 +00:00
Shuhei Matsumoto
b3cf508f56 iscsi: Make get_iscsi_connections RPC asynchronous
iSCSI poll groups are bind to SPDK thread through IO channel now.

This patch changes get_iscsi_connections RPC from synchronous to
asynchronous by using spdk_for_each_channel.

Core ID was removed from the output of the RPC but thread name
is added to the output of the RPC in this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I20fdb7f11434acf838a89435ba5052b19869181c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463569
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>
2019-08-12 20:49:36 +00:00
Shuhei Matsumoto
9a17b539f9 iscsi: Factor out JSON information of connection
Factor out writing connection information to JSON context into
a helper function spdk_iscsi_conn_info_json.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3e92bcb4f21cc7a36af182f850c944b8c5dd559f
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463568
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-08-12 20:49:36 +00:00
Ben Walker
fb641c4b54 iscsi: Assign connections to poll groups instead of lcores.
This patch binds poll groups to SPDK thread through IO channel and
assigns connections to poll groups instead of cores.

iSCSI subsystem registers iSCSI global object as an IO device, and create
poll groups as context of IO channels of the IO device.

Each portal get and hold portal group on which the corresponding acceptor is
running.

When a connection is constructed, iSCSI subsystem assigns a poll group
to the connection by getting it from the corresponding portal.

When a connection enters full-feature phase, iSCSI subsystem schedules
the connection to a poll group by round-robin.

Then, each connection can know its running SPDK thread directly and can
use SPDK message passing infrastructure instead of SPDK event framework.

By this change, iSCSI connections are binded to SPDK thread, and not
binded to processor core anymore.

Some other changes in this patch are
- core ID is removed from the output of get_iscsi_connections RPC. The
  upcoming patches will change the RPC to use spdk_for_each_channel and can
  access SPDK thread safely, and add SPDK thread ID instead.
- utilize UT multithread framework added by the last patch to test
  iSCSI poll groups by UT.

Change-Id: Iec73c778aa413bcabdb63141cc41d4160911ea0e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463359
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-12 20:49:36 +00:00
Shuhei Matsumoto
566aa11ebb ut/iscsi/portal_grp: Use UT multithread framework
This is a preparation to the next patch to test IO channel. Separate
this from the next patch to clarify the intention.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iaa456667b5509d5fd8470315e2716b0b9fe209a5
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464811
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>
2019-08-12 20:49:36 +00:00
Evgeniy Kochetov
42dec8ffa2 bdev/null: Pack constructor parameters into a structure
Null bdev constructor parameters are packed into a single structure to
simplify future extensions.

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I2c542c159d21703147c3a5b910fcc853bb5db890
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464776
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-12 20:41:31 +00:00
Evgeniy Kochetov
e06e34be1d bdev/null: Fix infinite loop in configuration parsing
Invalid configuration file parameter in Null bdev section results in
infinite loop.

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I79a1a53e0f4d76a8724e7a624cabda7250b511c5
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464775
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-12 20:41:31 +00:00
Shuhei Matsumoto
cdde42d52e ut/bdev/raid: Factor out operation to create request for get_raid_bdevs RPC
Create a helper function create_get_raids_req() and move duplication
of category name and initialization of related global variables into
the function. Some operations are re-ordered accordingly.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I03e12e8d77872634a65a94b4cd4092554e376b13
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464480
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-08-12 04:20:15 +00:00
Shuhei Matsumoto
898c67d722 ut/bdev/raid: Factor out operation to create request for destroy_raid_bdev RPC
Create a helper function create_destroy_req() and move duplication
of bdev name and initialization of related global variables into
the function. Some operations are re-ordered accordingly.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I60f01103faec3ec7ec6c317470b043f84187a4c1
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464479
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-08-12 04:20:15 +00:00
Shuhei Matsumoto
309be937f0 ut/bdev/raid: Factor out operation to create config for .INI config loading
Create a helper function create_construct_config() and move
create_test_req() and initialization of related global variables
into the function.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia675f67e8332247cce4585a2d287b8062d4e1359
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464478
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-08-12 04:20:15 +00:00
Shuhei Matsumoto
0f9704a685 ut/bdev/raid: Factor out operation to create request for construct_raid_bdev RPC
Create a helper function create_construct_req() and move create_test_req()
and initialization of related global variables into the function.

The next patch will create an another helper function
create_construct_config() and move create_test_req() and initialization
of related global variables into the function.

Hence move the common part of create_construct_req() and
create_construct_config() into create_test_req().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6852fdc7966359a1029c809565ceb7230b749dc6
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464477
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-08-12 04:20:15 +00:00
Shuhei Matsumoto
5135e6e76d ut/bdev/raid: Remove unnecessary NULL byte appends after snprintf()
snprintf() do not write more than specified bytes including the
terminating null byte. If the output was truncated due to this limit
then the return byte is the number of chars excluding the terminating
null byte.

So remove NULL byte appends after snprintf() in this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic5b7719791721c6ae7b1dd8367be454b34df0fe5
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464476
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-12 04:20:15 +00:00
Shuhei Matsumoto
6e90531549 ut/bdev/raid: Use string constants for verification
Some places had used dynamically allocated strings but they were
just duplicated from string constants. Hence we change them to
use string constants to make refactoring easier.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0a5c4c1a72ee4aede12703c2dd50057c47098e28
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464475
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-12 04:20:15 +00:00
Shuhei Matsumoto
cd6630d009 ut/bdev/raid: Add g_ prefix to pointer and size of RPC request
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id701260521f7d91a8c9c1eedd54941261e092f52
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464359
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>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-08-12 04:20:15 +00:00
Shuhei Matsumoto
d98458f6d2 ut/bdev/raid: Move free(bdev_io) into bdev_io_cleanup()
This simplifies the UT code a little bit.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8aae0a8f0b0aa7e931ed4303b9504feabf76e2b0
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464358
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>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-08-12 04:20:15 +00:00
Shuhei Matsumoto
e5f28d5d39 bdev/raid: Unify data type of number of base bdevs to uint8_t
Data type of number of base bdevs are corrupted. uint8_t is enough
and unify almost all related variables into uint8_t.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I323aaa229a76c3d5b5361d7643c3a9591ccad340
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464357
Reviewed-by: yidong0635 <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-12 04:20:15 +00:00
Shuhei Matsumoto
441ecc09ae bdev/raid: Check if required params are specified when parsing .INI config file
Checking if required parameters strip_size, num_base_bdevs, and
raid_level had been done in raid_bdev_config_add(). However, this
required us to use integer type.

If we do the check in raid_bdev_parse_raid(), we will be able to
use the same type between function parameters and variables of
struct, and hence do in this patch.

This will align with the next patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I10fd75f25ed9a5d40eb189b05c2a20c276fa3ad6
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464365
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: yidong0635 <dongx.yi@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-08-12 04:20:15 +00:00
Shuhei Matsumoto
284aca9e36 bdev/raid: Fix race issue among multiple threads to free RAID bdev
The following issue was observed.

The first thread returned the last IO channel and the second thread
then removed the first base device, but raid_bdev_cleanup() was
called before raid_bdev_destroy_cb() was called.

raid_bdev_destroy_cb() was accessed to the raid bdev already freed
by raid_bdev_cleanup() and caused segmentation fault.

The call sequence was as follows:

The first thread:
 spdk_put_io_channel() -> ch->destroy_cb -> raid_bdev_destroy_cb
-> access raid bdev

The second thread:
 raid_bdev_remove_base_devices() -> raid_bdev_deconfigure() ->
spdk_bdev_unregister() -> spdk_io_device_unregister() ->
spdk_bdev_destroy_cb() -> raid_bdev_destruct() -> raid_bdev_cleanup()
-> free raid bdev

The fix is to hold number of created channels in struct
raid_bdev_io_channel and use it in raid_bdev_destroy_cb().

Bdev layer, IO device/channel layer, and NVMe-oF layer  already
process this case correctly.

    Fixes #884.

Reported-by: yidong0635 <dongx.yi@intel.com>

Change-Id: Ie9d61bdddca479ce7f491ff9a08db45e71f16a8d
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463249
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-12 04:20:15 +00:00
Changpeng Liu
ea1132a926 blobfs: free sync request if got error with flush request allocation
Change-Id: I13bd02b1083816781980bcd7af7a6dd27235ed7d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464360
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>
2019-08-12 02:59:24 +00:00
Tomasz Zawadzki
baa49be957 test/bdev: fix fio test verification
When this test was ran, it reported for each job:
"fio: verification read phase will never start because write phase uses all of runtime"

There was only randwrite phase, without any read phase with verification.
Alternatievly we can verify a set number of blocks during write using
"verify_backlog" argument.

With this patch writes to all bdevs will be verfied in 1024 chunks.

Change-Id: Ie79d543badd10f3b3ca91b3b56d9d8cb0dd332b2
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464646
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-08-09 23:49:16 +00:00
Darek Stojaczyk
3d23defba4 Remove remaining spdk_jsonrpc_begin_result() NULL checks
After recent changes, that function can not return
NULL anymore, so remove all redundant checks from
various SPDK libraries.

Change-Id: If80344b6fa81ad5f87a7086804dba221522cd7e2
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464175
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-08-09 16:35:00 +00:00
Darek Stojaczyk
4a713238b7 nvme: fix json response on failed construct_nvme_bdev RPCs
spdk_jsonrpc_send_error_response() is documented as a
shorthand for spdk_jsonrpc_begin_result() + end result,
but we used to call it already after doing
spdk_jsonrpc_begin_result(), which makes the response
completely invalid.

Fix it by deferring the initial spdk_jsonrpc_begin_result()
until after we did our error checking. While here, remove
the NULL checks from that function. After recent jsonrpc
changes it can never return NULL.

Change-Id: Ibb69803d4e6ce6516817673eec6626dcfc4f1abf
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464174
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-08-09 16:35:00 +00:00
Ziye Yang
1917d3b413 nvmf: move the assigment of pdu outside the switch
Purpose: To reduce the duplicated code.

And one minor fix: add an empty line between two functions

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I12c9ddba6526c094cd2bd945e14f9d8bf5209adf
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464504
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>
2019-08-09 07:37:12 +00:00
Changpeng Liu
3d12e6d4e6 bdev/nvme: deprecate ResetControllerOnTimeout configuration option
'ResetControllerOnTimeout' was renamed to 'ActionOnTimeout' for a
long time, so we deprecate the support for this old configuration
option.

Change-Id: Ia44035a8749ca046c1df16f82601389b5bafeb76
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464491
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-08-09 00:44:50 +00:00
Changpeng Liu
7cbe1ccd56 nvme: move SPDK_NVME_DEFAULT_RETRY_COUNT out from nvme.h
SPDK_NVME_DEFAULT_RETRY_COUNT is the default value for each controller, so
we can move it out from public header file, and change the value if users
provide a new one.

"NvmeRetryCount" was deprecated for a long time, so we removed the support
for this configuration option as well.

Change-Id: I187251cc1e5342abb4fce96727d06631b7c16a01
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464489
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-08-09 00:44:50 +00:00
Changpeng Liu
62bb65289d nvme: change retry count can be configured via bdev nvme driver
Also eliminate 'spdk_nvme_retry_count' finally.

Change-Id: I2f3e390e4b8a49208a11b54bb82c4891cf3e1845
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464473
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-09 00:44:50 +00:00
Changpeng Liu
936d856219 nvme: eliminate global configuration 'spdk_nvme_retry_count' option with PCIe transport
We have defined NVMe controller initialization 'transport_retry_count' option, so
global 'spdk_nvme_retry_count' can be removed, we will remove the variable with
PCIe transport first, and make the retry count can be configured via RPC.

Change-Id: I4d54f78c8da2180d536635587e7291f44a57c4fb
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464472
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>
2019-08-09 00:44:50 +00:00
Pawel Kaminski
16ed234497 test/openstack: Fix. Assign nvmfpid var as it is used in nvmftestfini
Change-Id: Id56b5034d034190f518bfa6cf84ec52a27a3ff5a
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464187
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-08-08 22:58:35 +00:00
Seth Howell
2cbe2acaef delay_bdev: move delay_type enum to header file.
Change-Id: Iaab3104b87e87d2fef4f4858e6e05d0773c5e453
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464453
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-08-08 22:57:59 +00:00
Darek Stojaczyk
35a4f3a4bd mk: clean up BLOCKDEV_MODULES_LIST in spdk.modules.mk
Reorder BLOCKDEV_MODULES_LIST entries - put dependant
libraries first. Also break lines after 80 characters.

Change-Id: Ib09b28938253435f335c4e1ebe83928ab551194c
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459909
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>
2019-08-08 22:41:30 +00:00
Karol Latecki
0f0cd0a87b test: Use $((..)) instead of deprecated $[..]
Fix SC2007: Use $((..)) instead of deprecated $[..].
SC2007 removed from check_format.sh exclude list.

Change-Id: Ifd858857e461d785d6d6f101acca13c326ee637e
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464172
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-08-08 21:27:40 +00:00