Commit Graph

2839 Commits

Author SHA1 Message Date
Daniel Verkamp
7f2ff992ee event: update nvmf subsystem for new registration method
Change-Id: I94bbf1f035aca463530450811200f1f1800d6485
Fixes: 4294719ed7 ("subsystem: make subsystem declaration ...")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403355
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-09 12:57:57 -05:00
Changpeng Liu
7448f89536 io_channel: protect critial variables under mutex
Change-Id: If5e16c2ac148fd4818c942e8f57b02671e76ed62
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/403153
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-09 12:17:46 -05:00
Pawel Wodkowski
4d36735401 bdev: rework bdev module registration
Currently SPDK_BDEV_MODULE_REGISTER() take many parameters. Extending it
(eg for incoming JSON configuration dump/load) is quite challenging and
error prone. As we are already here in next patches, rework this macro
to take one parameter - the pointer to struct spdk_bdev_module_if.

This patch also remove following macros:
SPDK_GET_BDEV_MODULE - this is not really needed, to find module outside
module translation unit use spdk_bdev_module_list_find()

SPDK_BDEV_MODULE_ASYNC_INIT and SPDK_BDEV_MODULE_ASYNC_FINI - replaced
by bool fields in spdk_bdev_module_if struct.

Change-Id: Ief88e023fbbaee7d5402c838dbecbdffd4dfb259
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/402883
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-09 12:07:35 -05:00
Pawel Wodkowski
4294719ed7 subsystem: make subsystem declaration macro just register subsystem
Don't do anything under the scene as adding/removing fields in struct
spdk_subsystem will require both macro change and C file changes.

Change-Id: I11bc0d5758edd7e0e0bd3f93e251d868cd9b1d2b
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/401850
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-09 12:07:35 -05:00
Daniel Verkamp
a0484cad21 vhost: merge spdk_vhost_startup() into spdk_vhost_init()
This allows vhost initialization to be fully handled in the event
framework subsystem.

Change-Id: Ic0ff11f3765cc553b7ca183027209fb6dd131364
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403226
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-09 09:56:44 -05:00
Daniel Verkamp
fc0a23627e vhost: add API to set socket path
This lets us drop the basename parameter from spdk_vhost_startup(),
which is a step toward making vhost initialization happen as part of the
event subsystem instead of in the spdk_app_start() callback.

Change-Id: I4fe18c4c3f12b706e73ae74500be58f1582110fd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403225
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-09 09:56:44 -05:00
Daniel Verkamp
2491021f64 nvmf: convert nvmf_tgt into an event subsystem
This is required as part of our effort to build a single target app that
can run e.g. NVMe-oF and iSCSI targets in the same process.

Change-Id: Ic8426df08899070d709e3675a57f47f64c23c5eb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403218
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-09 09:56:44 -05:00
Daniel Verkamp
84918cd9fa bdev/null: allow user to override UUID
Change-Id: I2fe5eb46d5e5b67451b472b82cde69e3606c6235
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403222
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-09 09:55:34 -05:00
Daniel Verkamp
eca9ac03e4 bdev/malloc: allow user to override UUID
This can be used to force specific UUIDs for testing.

Change-Id: I40c403fd00c142552d632dd5f0fbe1ea9a6c9962
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403221
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-09 09:55:34 -05:00
Ziye Yang
f09b9c2ed1 lib/iscsi: Set last_nopin when the connection transfers in ffp
Change-Id: Ib2d38a8c744d2d4951f3503cb029ea6b26bb9eaa
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/403119
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-08 19:09:40 -05:00
Shuhei Matsumoto
1dd0a513a8 iscsi: Extract iSCSI subsystem initialization into a function
This patch extracts iSCSI subsystem initialization by .INI config file
into a function spdk_iscsi_parse_iscsi_globals().

Naming rule was adopted from NVMf-tgt.

By these two patches,
iSCSI subsystem init is done in spdk_iscsi_parse_iscsi_globals().
iscsi subsystem config is done in spdk_iscsi_parse_iscsi_configuration().

The purpose of the patch series is
- to separate iSCSI subsystem initialization and iSCSI subsystem
  configuration, and
- to develop a new JSON-RPC by reusing the separated iSCSI subsystem
  initialization.

Change-Id: Ibafb0b62cbb0aa23dd6dd6007dad0345293e65b8
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403146
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-08 12:37:29 -05:00
Shuhei Matsumoto
a11b2f3058 iscsi: Move poll_group init to the end of iSCSI subsystem init
iSCSI poll_group initialization must be completed before starting JSON-RPC.
This doesn't have any dependency to the other iSCSI subsystem
initialization and completes asynchronously. Hence thisis good to be placed
at the end of iSCSI subsystem initialization.

Besides, object creation of iSCSI configurable components started after
poll_group initialization by .INI config file is aggregated into a function
spdk_iscsi_parse_iscsi_configuration().

Naming rule was adopted from NVMf-tgt.

The purpose of the patch series is
- to separate iSCSI subsystem initialization and iSCSI subsystem
  configuration, and
- to develop a new JSON-RPC by reusing the separated iSCSI subsystem
  initialization.

Change-Id: I44421803268361f53840a7e47f07ce95c13d1139
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403145
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-08 12:37:29 -05:00
Shuhei Matsumoto
43062f2245 iscsi: Pass the callback to poll group initialization as an argument
The next patch will move the location and change the callback of poll
group initialization. Besides it is probable for JSON config file to
change the callback of poll group initialization.

Passing callback as argument increases visibility and flexibility of
code.

Change-Id: Ie4bfd2c60a112bb7c697110ef0efc30a2c098dc8
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403144
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-08 12:37:29 -05:00
Shuhei Matsumoto
d999e6af7d iscsi: Move connection init right after iSCSI global params init
Pool of iSCSI connections and related variables are initialized in
initialize_iscsi_conns().

Currently initialize_iscsi_conns() is located after configuration of
target nodes by .INI config file.

Configuration of target nodes can be done by JSON-RPC but connection
initialization must be completed before starting JSON-RPC.

iSCSI connections don't belong to iSCSI global params directly and
hence move connection initialization right after initialization of
iSCSI global params.

The purpose of the patch series is
- to separate iSCSI subsystem initialization and iSCSI subsystem
  configuration, and
- to develop a new JSON-RPC by reusing the separated iSCSI subsystem
  initialization.

Change-Id: I183365b84aa205790b27adf7cc1f632b932195aa
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403143
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-08 12:37:29 -05:00
Shuhei Matsumoto
180af18cc7 iscsi: Move PDU, session, and task pool init into iSCSI global params init
iSCSI subsystem have a pool for PDU, session, and task, respectively.

They belong to the struct spdk_iscsi_globals and are initialized by
using the parameters of the struct spdk_iscsi_globals.

Hence their initialization should be located just behind the setup of
parameters of the struct spdk_iscsi_globals.

The purpose of the patch series is
- to separate iSCSI subsystem initialization and iSCSI subsystem
  configuration, and
- to develop a new JSON-RPC by reusing the separated iSCSI subsystem
  initialization.

Change-Id: Ie39f63ee24c547dcd31a1a06d72d915e8c272864
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403142
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-08 12:37:29 -05:00
Shuhei Matsumoto
ef02d13d3e iscsi: Move PG and IG configuration right before target nodes configuration
Object creation of portal, portal group, and initiator group can be
done by JSON-RPC.

This patch moves object creation of portal, portal group, and initiator
group right before object creation of target node.

The purpose of the patch series is
- to separate iSCSI subsystem initialization and iSCSI subsystem
  configuration, and
- to develop a new JSON-RPC by reusing the separated iSCSI subsystem
  initialization.

Change-Id: If78beabb478923e7c920c09b16e42d6f8aa55775
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403141
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-08 12:37:29 -05:00
Shuhei Matsumoto
6ef949f276 iscsi: Extract TAILQ_INIT from IG, PG, and target nodes configuration
There are four configurable components, portal, portal group, target node,
and initiator group in iSCSI.

They have a TAILQ to manage their objects, respectively.
Currently each TAILQ initialization is done together with its object
creation by .INI config file.

This patch separates TAILQ initialization from object creation for four
configurable components in iSCSI.

The purpose of the patch series is
- to separate iSCSI subsystem initialization and iSCSI subsystem
  configuration, and
- to develop a new JSON-RPC by reusing the separated iSCSI subsystem
  initialization.

Change-Id: Ia4ac3f06f15acef671e785904f4c687e5d189fbe
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403140
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-08 12:37:29 -05:00
Ziye Yang
0c1003e983 lib/iscsi: change type of spdk_iscsi_send_nopin to void
Change-Id: Ie7a940efde885dbf0bb7c085fd17c3991dfa3341
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/403165
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-08 12:11:24 -05:00
Lance Hartmann
b9be940ae9 lib: Return instead of exit in event
Modifies behavior of spdk_app_start() and spdk_app_parse_args()
such that they return on failure instead of terminating with
exit().

Change-Id: I82566417f04e1ae2e3ca60a00c72e664db26c9e4
Signed-off-by: Lance Hartmann <lance.hartmann@oracle.com>
Reviewed-on: https://review.gerrithub.io/401243
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-08 11:47:01 -05:00
Daniel Verkamp
53d5499e32 env: print SPDK version during init
Change-Id: I738b4e28065797c9df7b0bc27ec0aee8c9f4f257
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402381
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-08 11:38:19 -05:00
Piotr Pelplinski
7029a8868a blobstore: add internal xattrs for creating blob
This patch adds possibility to set internal xattrs on blob

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I2d0f14558e4a1af7071ee1a4f59aaf9f14bea2d9
Reviewed-on: https://review.gerrithub.io/396418
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-08 11:34:15 -05:00
Piotr Pelplinski
c26c4e9fb4 blobstore: Add a blob_bs_dev that provides back_bs_dev for clones
Unit tests implemented in following patches.

This is rebased patch from https://review.gerrithub.io/#/c/396648
merged as commit c1174e6895
and reverted in 0847f27b54.

Change-Id: I3d152bf7847c83bf75149edd61564c1f393927d8
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Reviewed-on: https://review.gerrithub.io/402529
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-08 11:34:15 -05:00
Tomasz Kulasek
ca571b1563 blobstore: allow internaly get xattr value even in loading state
For some xattrs we need to know its value even if blob is in loading
state, e.g. BLOB_SNAPSHOT xattr value when blob is loading.

Change-Id: I1cd7805cf33be64cf59792f85a270e9b536e23bd
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/403062
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-08 11:34:15 -05:00
Sebastian Basierski
f5e590c8f2 bdev: Added functions allowing logical volume store rename.
Change-Id: Ief1f809308fbde2e696c60d3ce79c0720cb3e2ff
Signed-off-by: Sebastian Basierski <sebastianx.basierski@intel.com>
Reviewed-on: https://review.gerrithub.io/398934
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2018-03-08 11:26:16 -05:00
Changpeng Liu
5d841040ab nvmf: remove the duplicated line for aerl setting
Change-Id: I22c11cdd5ab0ffdf72b27223c0c9cd7282537613
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/402667
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-08 11:21:42 -05:00
Daniel Verkamp
8887697f8c bdev/lvol: add UUID to lvols
In addition to the lvolstore uuid, add a per-lvol uuid for bdev
identification.

The lvol uuid is stored as an xattr for each lvol blob; if an lvol blob
without a uuid xattr is encountered, the lvol bdev will not report a
uuid for now (it will be set to all zeroes, which will be treated as
no uuid available by the generic bdev layer).

Change-Id: If00221383a12d62234fc085d56e257dd48053103
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402973
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-08 10:49:51 -05:00
Daniel Verkamp
364d4fdfe0 bdev: add spdk_bdev_get_uuid() function
Add a generic way to get a UUID from a bdev.

For now, malloc and null bdevs generate random UUIDs, and no other bdev
types report a UUID.

Change-Id: Id9608c8c1b3ce3f1783e7f74bef96d44cd5d98a7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402177
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 Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2018-03-08 10:49:51 -05:00
Daniel Verkamp
4c06ce9b9d util: add uuid.h to wrap libuuid
This lets us have a common place to put definitions like the length of
the UUID string, as well as abstract away some of the API warts in
libuuid (non-const values, no size checking for uuid_unparse, etc.).

Change-Id: I80607fcd21ce57fdbb8729442fbb721bc71ccb98
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402176
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-08 10:49:51 -05:00
Daniel Verkamp
2532fd8f68 lvol: switch to uuid_generate()
Rather than explicitly asking for time-based UUIDs, let libuuid choose
the best available UUID source (high-quality random number based if
available, or time-based if not).

Change-Id: Ic2f538890f86d3158b64f5884708439b72c373f6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402963
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-08 10:49:51 -05:00
Ziye Yang
76c501834e lib/nvmf: set sgroup->channels[nsid] = NULL
We should add this state after free the io channel.
To make sure that we will not touch the wild pointer.

Change-Id: I570f649fe3ddffaea430125b40c6b6b020a05222
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/402999
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-08 10:49:15 -05:00
Tomasz Zawadzki
b86c4b6541 blob: persist super_blob id on blobstore immediately
Before this patch super_blob id for blobstore was persisted
only during spdk_bs_unload. If power fail occurred after creating and
syncing blob, super_blob id was lost within blobstore.

Lvol store metadata would be lost, if proper shutdown
didn't occur in first SPDK instance run since creation of lvs.

This fix changes setting super blob to be instantly persisted
on disk in super block. Without affecting clean bit in super block.

Change-Id: I578f1fc8717e2d7968ad506fa4dead7507a5e0b4
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/398804
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-08 00:14:36 -05:00
Shuhei Matsumoto
230833d8ce iscsi: Remove the variable ntargets from iscsi global params
The variable ntargets in the struct spdk_iscsi_globals was needed
previously because iSCSI target node was managed by a fixed size
array.

Now iSCSI target node is managed by a linked list and ntargets
doesn't take any meaningful role now.

Change-Id: I1805d7a6a6ce40efa4d18f198fbb9104bee43b26
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/402976
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-07 19:07:09 -05:00
Shuhei Matsumoto
d4d33783ee iscsi: Any value specified by user is not set to DefaultTime2Retain
Even if the value specified by user through the config file is correct,
the default value is always set to DefaultTime2Retain.

Change-Id: Ifdf44e743419813b728a1423c441df59cc90c0a1
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/402635
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-07 19:07:09 -05:00
Changpeng Liu
0bce761614 nvmf: fix potential leak when processing multi-range deallocate command
Change-Id: Ic3a612ceed65799d16dae111db355333a1915187
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/403002
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-07 11:14:41 -05:00
Tomasz Kulasek
3e717065d4 blobstore: fix missing debug logs
Change-Id: I5e636c4c9d930de0d9e6eadd453f0d17eadaf45e
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/402530
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-07 11:12:56 -05:00
Daniel Verkamp
85cc748fd0 bdev: use claim_module to determine leaf status
A bdev that is claimed is not a leaf, even if it has no vbdevs exposed
currently.

Change-Id: I3b790068128890a569f83b15071ea916c54bff9b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402935
Tested-by: SPDK Automated Test System <sys_sgsw@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>
2018-03-07 11:00:32 -05:00
Daniel Verkamp
0a37a369f3 bdev: assert that vbdev base bdevs are claimed
Change-Id: I7208fd5000cf1e2db9094311d875a568121e1ec5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402934
Tested-by: SPDK Automated Test System <sys_sgsw@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>
2018-03-07 11:00:32 -05:00
Changpeng Liu
14a18cca32 nvmf: don't submit FLUSH command to backend which can't support it
As for NVMeoF controller, SPDK always set volatile write cache to
present, so OS may submit FLUSH command to backend block device,
while here, return success for those block devices which can't
support FLUSH command.

Change-Id: Ib764503f1986e7e0a38a1751a91d6c11e1b78865
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/402653
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-07 10:18:19 -05:00
Ziye Yang
86922ce0cd lib/iscsi: Remove spdk_iscsi_conn_fn in conn
Also remove the related login and full feature
function

Change-Id: Ia2d0a6617910134c889d1322b53830fe26b9e956
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/402486
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-07 10:14:17 -05:00
Ziye Yang
da9f21680b lib/iscsi: Remove spdk_iscsi_conn_check_state
This patch will also re-export spdk_iscsi_conn_destruct

Change-Id: I7d6cbba33294c84398a919d888c8b375e901e09e
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/402485
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-07 10:14:17 -05:00
Shuhei Matsumoto
76d023fd56 iscsi: pthread_mutex_lock is called before pthread_mutex_init
iSCSI's global mutex is used in spdk_iscsi_portal_grp_create()
before it is initialized by pthread_mutex_init().

A mutex filled with zero bytes has been accepted by now but
this should be fixed.

Change-Id: I2e197bec8da2f781c8c4f6e2a2caf9924b0a4369
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/402497
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-06 16:20:39 -05:00
Ziye Yang
b86af2c8d2 lib/iscsi: Extract spdk_iscsi_conn_migration
Put it in the iscsi.c

Change-Id: Ifb2843fb7c78f9ca948eac60704547b8b0635bf0
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/402484
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-06 15:50:54 -05:00
Ziye Yang
d4d03a5ecf lib/iscsi: Make spdk_iscsi_conn_destruct a static function
Change-Id: I044a9980454cf9a0719477e606df104f377b3b43
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/402642
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-06 14:44:53 -05:00
Yanbo Zhou
d79ae3e253 event: remove two deprecated functions
Change-Id: I68820dc3b12934bc6bbc88872bf4bef44a05c396
Signed-off-by: Yanbo Zhou <yanbo.zhou@intel.com>
Reviewed-on: https://review.gerrithub.io/402489
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-05 20:34:49 -05:00
Daniel Verkamp
8a6ba58cb4 scripts/check_format: check for spaces before tabs
Automatically detect more whitespace errors.

All existing cases are fixed; only whitespace change (verify with
diff -w) except for one comment style fixup in include/spdk/nvme.h.

Change-Id: If750e54b9c8e3421ea6feda5f20184a31431631e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402360
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-05 11:09:13 -05:00
GangCao
dbeed703c2 rpc: remove the existing socket file when application starts
Currently if the application exits with some error (i.e., core
dump), the socket file is not removed. So that at next time the
RPC method can not enabled unless user manually removes the
socket file. The error of failing to start RPC is not that
obvious.

This patch introduces a lock for the reuse socket to properly
detect the only usage and handles the above error case particularly.

Refer to https://gavv.github.io/blog/unix-socket-reuse/ for the
details.

For the concern of the sockect file can be shared from different
applications, in the spdk_app_opts struct, it offers a parameter
to assign a specific socket file per application.

Change-Id: Ie2ef6af9207c468279cba5efd173fd06579ccdc7
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/396089
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-02 16:48:53 -05:00
Jim Harris
981607175b blobfs: cleanup and add comments in deleted file cleanup path
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I30675083dcb7dda47ac62eaf124614033ff9c587

Reviewed-on: https://review.gerrithub.io/401702
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-02 15:30:32 -05:00
Daniel Verkamp
0847f27b54 Revert "blobstore: Add a blob_bs_dev that provides back_bs_dev for clones"
This change wasn't correctly rebased and needs to be updated to compile
against the current blobstore.

This reverts commit c1174e6895.

Change-Id: I529608bee7323cb626d8c36dff15adc9ba24ad26
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402352
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-02 15:05:45 -05:00
Piotr Pelplinski
c1174e6895 blobstore: Add a blob_bs_dev that provides back_bs_dev for clones
Unit tests implemented in following patches.

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: Ib18c9060f527bd22bfdbed74e96871a6e0551ead
Reviewed-on: https://review.gerrithub.io/396648
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-02 14:09:09 -05:00
Piotr Pelplinski
4dc04dc679 blobstore: bugfix, pass proper spdk_io_channel to bs_dev
Currently only thin_provisioned zeroes back_bs_dev is supported.
There was no unit tests for channel in this bs_dev, because it's never used.
However, unit tests in patch https://review.gerrithub.io/c/393935/ show that channel is wrong.
This patch passed proper spdk_io_channel to callback function.

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: Ia288ef6c35343ce533ea3f74603e73f823a18181

Reviewed-on: https://review.gerrithub.io/400955
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-02 14:09:09 -05:00