Support JSON config/info dump for target node. These are added
to tgt_node.c Text config dump is moved to tgt_node.c too.
All accesses to g_spdk_iscsi.target_head are consolidated into
tgt_node.c to extract target_head from g_spdk_iscsi.
Change-Id: Ibdf57c6ec9457d762c5640483b5810c9a74604ef
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407848
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>
In the upcoming JSON config file, CHAP parameters for discovery will
be specified simply by the value of them.
This is as same as JSON-RPC for target node but different from .INI
config file.
If CHAP parameters are specified by the value of them, the combination
of them must be checked before applied to iSCSI globals.
Change-Id: Idf663796f97581366da945abb8dc351f3975ceae
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403235
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>
Portal, portal group, initiator group, and target node don't use fixed size
array anymore. To use the same naming rule in iSCSI subsystem and in SPDK
is helpful to understand and maintain. Current naming rule is not bad but
to use unified and compact name is prioritized at this time.
This patch changes function names as follows:
- spdk_iscsi_init_tgt_nodes() -> spdk_iscsi_parse_tgt_nodes()
- spdk_cf_add_iscsi_tgt_node() -> spdk_iscsi_parse_tgt_node()
- spdk_iscsi_portal_grp_array_create() -> spdk_iscsi_parse_portal_grps()
- spdk_iscsi_portal_grp_create_from_configfile() -> spdk_iscsi_parse_portal_grp()
- spdk_iscsi_portal_create_from_configline() -> spdk_iscsi_parse_portal()
- spdk_iscsi_portal_grp_array_destroy() -> spdk_iscsi_portal_grps_destroy()
- spdk_iscsi_init_grp_array_create() -> spdk_iscsi_parse_init_grps()
- spdk_iscsi_init_grp_create_from_configfile() -> spdk_iscsi_parse_init_grp()
- spdk_iscsi_init_grp_array_destroy() -> spdk_iscsi_init_grps_destroy()
For example "parse" is already used to explain the operation in portal_grp.c.
Hence using "parse" is familiar and not strange in iSCSI.
Change-Id: Ieff952069d39bd96b7afa1586bfff927968accc2
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403149
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>
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>
During converting type of CHAP params of target from int to bool
for JSON, changed names of them to be consistent with others.
In this patch, adjust variable name of struct to of JSON.
Change-Id: I1ccbfa11d57479dc55680835eb80e111bd24d9a3
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/400928
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 is a TODO from long ago. Complete this while adjusting dump()
and construct() format of target.
Besides names of variables and parameters about CHAP are not unified
between JSON-RPC and SPDK internal. JSON-RPC's wording looks better
and adjust SPDK internal to JSON-RPC.
Change-Id: I89bcd1ce13a11f7d63a62d51ef094dd302186d37
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/400201
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 is a TODO from long ago. Complete this while adjusting dump()
and construct() format of target.
Change-Id: I44348ec404cae8882086a1a71a65914c9bafccc3
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/400202
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>
Removing an LUN from an existing iSCSI target is possible by
removing the corresponding BDEV. However adding an LUN to an
existing iSCSI target is not possible yet.
Add a new function spdk_iscsi_tgt_node_add_lun() and related
functions first toward supporting this function.
JSON-RPC for this operation will be submitted an another patch.
Informing the newly added LUN to the initiator is not included
in this patch. Hence this operation is possible only for any
inactive target.
Change-Id: I3a28f4d75a17126e49c9d12ce64c3ad68f231840
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/385180
Tested-by: 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>
There is no need to keep a lun name anymore - we always
use the bdev name as the lun name so it is not providing any
additional value. This also keeps us from associating
the same bdev with different LUNs on different iSCSI target
nodes or vhost-scsi controllers.
Side effect of this change is:
1) Use "bdev_name" across the APIs to make it more clear
what these names refer to.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3d42fde22087352ce1d5dc80178bd8c5cac8cb7c
Reviewed-on: https://review.gerrithub.io/390843
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This patch add the internal mechanism to add/remove PG-IG maps
to/from an existing iSCSI target.
Next patch will add new JSON-RPC commands and python scripts.
Change-Id: Ib75d180197c5cb679ebfd21324dc36790b50a7aa
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/389667
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>
MaxQueueDepth is configurable for NVMf target by configuration
file. This patch makes this flexibility possible for iSCSI target
too. Increasing macro-defined constant for MaxQueueDepth consume
extra memory regardless of the necessity and hence it may be
better to avoid that.
Change-Id: I7fa9cf86b02c5a8b16411d4b4d356c6e6c0dc3eb
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/388552
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>
This patch is a preparation for dynamic reconfiguration of PG-IG maps.
Current PG-IG map is implemented by a fixed-size array. Linked list
will make much easier to support dynamic reconfiguration of PG-IG maps.
Current:
target - (1..n) ---> PG_map (1..1) -> PG
|
--> IG_map (1..1) -> IG
This proposal:
target - (1..n) -> PG_map --- (1..1) -> PG
|
-- (1..m) -> IG_map - (1..1) -> IG
Change-Id: I92f668b81cdd8003aff222926f8f1ed96b61e56d
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/385532
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>
Current fixed sized array for iSCSI target is not thread safe.
When newly created targets are inserted into the array, multiple
targets may be inserted into the same position. Linked list is
better than fixed size array to support dynamic reconfiguration.
Change-Id: I4db5a3ec16844db06e0cfcd2aef1f97952f15afa
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/385371
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
The following functions returns 1 and 0 for succcess and error,
respectively:
- spdk_iscsi_tgt_node_allow_ipv6()
- spdk_iscsi_tgt_node_allow_ipv4()
- spdk_iscsi_tgt_node_allow_netmask()
- spdk_iscsi_tgt_node_access()
Using bool for this purpose will avoid our misunderstanding.
Change-Id: I927876e0503c0eee5364e829a4713f9a345996f6
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/383664
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
the function of spdk_iscsi_find_init_grp() is duplicated with
of spdk_iscsi_init_grp_find_by_tag(). The later one should be kept.
Hence delete former one.
Change-Id: I8d397648bd400550445de49c8a7731f0932f5324
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/381244
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Fix up the existing comment blocks misaligned in the first column.
Also add line numbers to the comment checks.
Change-Id: I9d28c365271df36e7013d74cbb02d0023ab4f581
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This ensures against races, when an existing session to a target node
stalls, causing the initiator to create a new session. These new
session's connection may get migrated to a different core than the
core of the stalled session.
In practice, this does not happen, but is a common occurrence when
debugging the iSCSI target using gdb.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1864c2ca0c330dc4faeeb1312adac7a02c8281dc