There is no guarantee that the first io_channel created for
a LUN will be the last one destroyed. So we need to attach
the poller to the LUN, not the io_channel.
While here, and related to this patch, remove the assert()
that the last channel destroyed must be on the LUN's
master thread. This assertion simply isn't true.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3e0dfddde2de70caec479bf1b6703f01c9d7b3a2
Reviewed-on: https://review.gerrithub.io/431375
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: Liang Yan <liang.z.yan@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Most to-do items in lib/bdev/iscsi/README have been
done a long time ago, leaving this file greatly outdated.
It is removed now and the iSCSI bdev description is
added to doc/bdev.md.
Since most of the to-do items have been done, this
patch also adds a CHANGELOG entry announcing that
iSCSI bdev is no longer in experimental state.
Change-Id: I186c9e1489547152655e1e036b27ab6bc17fcf11
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/429896
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Added reminder to build with the iscsi configuration option.
Change-Id: I1e4e325394368f2bc3462761a3793f4b0edb065c
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/428397
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This prevents us from using the bdev embedded in the lun after it has
been freed.
Change-Id: I780cf3eccca05a58d3461366fec024be42b8ff74
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/425174
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
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>
This is a string name used for debugging only.
Change-Id: I9827f0e6c83be7bc13951c7b5f0951ce6c2a1ece
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/424127
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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Fixes a memory leak and a possible data race.
Change-Id: Ib094ca62e66d8d3a88b0acccc92e69214d413e72
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420573
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Besides the obvious memory leaks, we also need
to call the async completion callback, which may
also free some resources.
Change-Id: Ia80799be4b220053b82dfb4ee2453181c90136a1
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420571
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
It was never destroyed.
Change-Id: If10b23b0a6784994a5aac85968f7efb99fa6ba70
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420570
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
create_iscsi_lun freed the provided parameters under
one condition, and did not under some other. The
behavior is now clarified.
When create_iscsi_lun succeeded, the parameters are
passed to an iscsi bdev and will be freed together
with its removal, but if the bdev could not be created,
the params need to be freed manually.
Change-Id: I010421d48461b365a324488029e11c90a4e20a37
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420569
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
It is not required anymore.
Change-Id: Ic16003311a451a223a626eca63cd9308a196bbdc
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420568
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Bdev module fini is triggered after all bdevs get
unregistered - this includes all iscsi bdevs. There's
no need to unregister/free them manually.
A few words for the iscsi_logout_async call, which was
never possibly called, but is now completely removed:
Destroying the iscsi context, which is done at bdev
destruction, will "tear down any existing connection"
as the libiscsi docs say, so there's apparently no
need to perform a manual logout.
Change-Id: Id163668a19a1d4b9bcd7538ecd1c0febae0fe47a
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420567
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
When testing iscsi reset with bdevperf, all tasks
before will be canceled. And the return status will
be set to CANCELED. We need to trace this status.
For submit_td, sometimes, segfault is thrown because
in bdev_iscsi_io_complete the iscsi_io->submit_td points
to a invalid address. And assigning the submit_td in
bdev_iscsi_submit_request prevent this from happening.
Already tested with bdevperf and bdevio for all io types.
Change-Id: Ib2bf8e2a111c4b3edb5ed88dfd2c91ed6acc5c48
Signed-off-by: Chunyang Hui <Chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/419932
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
In our current code, when we call the following statement:
spdk_bdev_destruct_done(&lun->bdev, 0);
Actually lun is already freed in bdev_iscsi_lun_cleanup function
(called by iscsi_free_lun). So this patch can be used to
prevent this issue by changing the order.
Change-Id: I5ec02319b8205fafc4d8074511f5a334b9bbb3ad
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/417630
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Construct calls that create single new bdev,
now return a string instead of array with single element.
Change-Id: Iad841b8e5eab0265693efb6be472354ea616c562
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/416081
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.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>
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for iSCSI bdev.
No changes in spdkcli, since it is not implemented yet.
Tests unchanged, because test is only done by running
bdevperf and exiting. Without time to delete_iscsi_bdev.
Change-Id: I8341bfb65932a1deb1fb6463e11ef932d6f6d597
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/415678
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>
bdev_iscsi_lun_cleanup() was not accounting for LUNs
getting cleaned up before the module_finish function
was called. This resulted in the bdev/iscsi module
calling spdk_bdev_module_finish_done twice which
resulted in io_device_unregister not found errors and
possible seg faults.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I42c3e0af250e0abcea1cd88ffd3c041ebdaeea49
Reviewed-on: https://review.gerrithub.io/415372
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
I do not think that this variable is needed.
The rpc system will be always executed in the first
call, so there is no sync issue, add a deleted variable
and put the free in the loop sounds not very clear.
For the ASAN issue (use req after free), I think
that the correct solution is that: we should store
the context first instead of defer the free of req.
Change-Id: I49ca2708ddc2c5533bb3a0aee4622ae23bfe47c6
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/414726
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This corrects return code value of the bdev iscsi pollers. It was
needed to ensure all the pollers output consistent return code
values. This will further help in measuring consistent poller busy,
idle or unknown tsc stats.
Change-Id: I19c678bee9079f6aa453a4b925819a5ea1086534
Signed-off-by: Vishal Verma <vishal4.verma@intel.com>
Reviewed-on: https://review.gerrithub.io/414722
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>
Target might want to send Asynchronous Message that we need to handle.
Of course this need further work but at least we can respond to NOP
This patch also open a way to remove bdev_iscsi_conn_req structure as it
make more troubles than need when managing connections request.
Change-Id: Ib5bc8ae3bc5f90219bb4e13aee1b2e637b458236
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/410891
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>
Change-Id: I6babd4cf990bf19b510db88bdfb0ca81e29d9252
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/414700
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Madhu Pai <mpai@netapp.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Suggested-by: Ziye Yang
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6ca7f08aed2e12c59518269c7b277895b4817bd8
Reviewed-on: https://review.gerrithub.io/413844
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Also, as we are here, switch to new spdk_json_write_named_* API in
bdev_iscsi_dump_info_json()
Change-Id: Ib29466eb5c6d6496dd1d8efc1f2064577bf56272
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/406635
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>
Also convert bdev_iscsi_set_module_init() into new callback.
Change-Id: I439369180e1e10eab5dee6aba27ffb0489ea2550
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/410095
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>
This will become the public interface for implementing
bdev modules. Right now the file exposes too much of
the guts of the bdev layer to modules, so it needs
to be stripped down.
Change-Id: Ie8b8c3271d51fdb8d0c24a80244b3f3e510c8790
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/412297
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This was omitted in one of previous commits.
Change-Id: I93ed4bae671bb36bf2b714ff6649b1f33a692647
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/410094
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>
iscsi_url is not need after bdev creation. Also implementing get_config
RPC call in next patches is quite problematic as information how bdev is
created using iSCSI URL is lost (eg username).
Change-Id: I8b097617c09bd4636c28531ca20a59919b2b4f84
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/407769
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>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
This assignment is converting from the libiscsi sense key enumerated
type to the SPDK one, and clang issues a warning for this case. We know
that these enums are equivalent, so just add a cast to avoid the
warning.
Change-Id: Ie2619b3ddeda46419df1a37755125bfeb6ddf636
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/409963
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I06335ea1c552afba4025eb0c52abdd3488b02262
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/407236
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>
Change-Id: I9d3b56ed908273c6853014241a28237f8d077cfa
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/405537
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>
This uses libiscsi to implement an iSCSI initiator bdev
module for SPDK. Still a lots of work to do on this - posting
it in case anyone is interested in working on this further.
A number of todo items are listed in a README in the lib/bdev/iscsi
directory.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Change-Id: I060e33de0cd6796246789bf0e1bb4f2df59d8f71
Reviewed-on: https://review.gerrithub.io/390313
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>