Add an new RPC iscsi_portal_group_set_auth. This RPC overwrites
the setting of CHAP authentication for discovery sessions by the
global parameters specific for the portal group.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I01578b2d01e3dbed599db10340d5053fb0a3738d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469369
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>
Parameter 'MinConnectionsPerCore' was removed in last release and marked
as deprecated, now we will deprecate 'MinConnectionsPerCore' finally.
Change-Id: I613a371e8b5352dfb84f8e4293805b792020c643
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468789
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: Paul Luse <paul.e.luse@intel.com>
Part of a larger series simplifying the library directory.
Change-Id: Ib9c9dc9a0c92ac35a9f0260451f97fc126d10031
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465212
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
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>
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>
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>
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>
Connections will soon be assigned to poll groups, which will be
dynamically moved between CPU cores based on load. It no longer makes
sense to restrict certain portal groups to specific cpu cores in this
model.
Change-Id: Iee983d75febc9797aa60021c5bc0680335e895cd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463358
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
As spdk_jsonrpc_begin_result() is not allowed to return NULL we can
remove these checks. We didn't have any tests cases that goes this path
anyway.
Change-Id: I0894e76c0162591e550e70b172566b9060a6dd5f
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459199
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This patch changes spdk_rpc_delete_target_node() to pass
rpc_delete_target_node_done() and its context to
spdk_iscsi_shutdown_tgt_node_by_name().
iscsi_tgt_node_destruct() is not asynchronized yet and so
spdk_iscsi_shutdown_tgt_node_by_name() calls the callback
passed from the caller directly for now.
The next patch will replace the call.
Change-Id: Ide2d9fcc6738e02de19f91249c21ac2d0d37138a
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450605
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
delete_target_node RPC had not waited for completion of
spdk_iscsi_shutdown_tgt_node_by_name. This implementation
is not the direct cause of the deadlock issue in
spdk_iscsi_conn_stop() but changing delete_target_node RPC
to wait for completion of spdk_iscsi_shutdown_tgt_node_by_name
will prevent future errors.
spdk_iscsi_shutdown_tgt_node_by_name() is not asynchronized yet
and so rpc_delete_target_node calls rpc_delete_target_node_done
directly in this patch.
The next patch will replace the call.
Change-Id: I6a042028b93c36ca9f68e3b212141e101b33d394
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450604
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>
Partially decoded request need to be free even if
spdk_json_decode_object() fails.
Change-Id: I72127c484636547fcf1389af232dab855622c69a
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/439372
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Add an new RPC to get current authentication group configuration.
This patch is utilized in the next patch to support JSON config dump
for authentication group configuration.
Change-Id: I34be9e196f8e7a484bcd316da54f05d0f6ee0300
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/421468
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Add RPCs to add/delete a secret to/from an existing authentication group
dynamically.
Use mutex to ensure exclusive access to CHAP secrets.
Tries to use descriptive message in RPCs when error occurs.
Change-Id: I59650ae11a2fe675d03b90bbd4d2dc5b9c0160ed
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/421465
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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>
This patch adds new RPCs add/delete_iscsi_auth_group to add and
delete authentication group dynamically.
Mutex is added to ensure exclusive access to CHAP secrets.
Additionally provide descriptive message in RPC when error occurs.
Change-Id: Iaddfbdd5688ca7907d2c7d859835faa056deecd1
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/421464
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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>
An new RPC set_iscsi_target_node_auth enables users to configure CHAP
authentication for the target node dynamically.
New setting is used for new iSCSI sessions. For existing iSCSI sessions,
new setting is not used until user logout and login again.
Try to use descriptive message in the RPC when error occurs.
Change-Id: I0bd40d92262d708c1f7de0effb208078bdf8cc41
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/420974
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>
An new RPC set_iscsi_discovery_auth enables users to configure
CHAP authentication for discovery sessions dynamically.
Try to use descriptive message in the RPC when error occurs.
Change-Id: I8883d5e054539cf6db091a5b79d0479e62119811
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/420976
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 patch is a pair to the following
- subsystem/iscsi: Add set_iscsi_options RPC to set global params
Now options can be loaded from JSON config file.
Change-Id: Ifb68cddbb045d51fbaf8161ad59ede9d399e70cb
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/410874
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Support JSON config/info dump for portal group. These are added to
portal_grp.c. Text config dump is moved to portal_grp.c.
Add accesses to g_spdk_iscsi.pg_head are consolidated into
portal_grp.c to extract pg_head from g_spdk_iscsi.
Change-Id: I8c551b067c68a785eb0c7d83d695bde5f7219c2b
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407850
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Support JSON config/info dump for initiator group. These are added
to init_grp.c. Text config dump is moved to init_grp.c too.
Add accesses to g_spdk_iscsi.ig_head are consolidated into
init_grp.c to extract ig_head from g_spdk_iscsi.
Change-Id: I88131d248ed13e42e4da56aed8ae0edc01a65715
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407849
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
Add state_mask to each RPC method and state to RPC server, respectively.
State mask of RPC method is set at registration. State of RPC server
is changed according to the state of the SPDK.
When any RPC method is recieved, if the bit of the RPC server is on in
the state mask of the RPC method, it is allowed. Otherwise, it is
rejected.
When any RPC is rejected by state_mask control, the new error code
is returned to describe the error clearly.
Change-Id: I84e52b8725a286e9329d61c56f498aa2c8664ec1
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407397
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
For the CHAP setting of iSCSI targets, JSON-RPC handles the
value of parameters directly and dump of iSCSI targets can be
used to construct directly.
For the CHAP setting of iSCSI discovery session, the same manner
will be applied.
Change-Id: I8731af4273cc89ee5c4ea2f97955e56e3bff202d
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/401076
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>
Currently CHAP parameters for discovery are handled as bool but
they are defined as int. Hence change their type from int to bool
as done for target node previously.
Change-Id: I1e815946d4bdececcdd7cc873a725afbbcb98e50
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403234
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>
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>