rpc/iscsi: Use chap to parameter names for CHAP in discovery session

Current parameter names of `set_iscsi_options` and `get_iscsi_global_params`
RPC method for CHAP in discovery session may not be clear and long
compared with CHAP in login to target nodes.

This patch changes parameter names of `set_iscsi_options` and
`get_iscsi_global_params` RPC method for CHAP in discovery session
from no_discovery_auth, req_discovery_auth, req_discovery_auth_mutual,
and discovery_auth_group to disable_chap, require_chap, mutual_chap,
and chap_group, respectively.

Old parameters are still usable because decoder of them are not removed.

Change-Id: If3102f1233d57ee3cadfb733a6fc1fca14a0e972
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/423050
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 commit is contained in:
Shuhei Matsumoto 2018-08-22 11:30:57 +09:00 committed by Jim Harris
parent 1b987076e4
commit 66723f7f92
6 changed files with 51 additions and 40 deletions

View File

@ -22,6 +22,13 @@ does not at this time confer any SPDK ABI compatibility claims.
spdk_bdev_alias_del_all() was added to delete all alias from block device. spdk_bdev_alias_del_all() was added to delete all alias from block device.
### iscsi
Parameter names of `set_iscsi_options` and `get_iscsi_global_params` RPC
method for CHAP authentication in discovery sessions have been changed to
align with `construct_target_node` RPC method. Old names are still usable
but will be removed in future release.
## v18.07: ## v18.07:
### bdev ### bdev

View File

@ -1775,10 +1775,10 @@ auth_file | string | Path to CHAP shared secret file for disc
node_base | string | Prefix of the name of iSCSI target node (default: "iqn.2016-06.io.spdk") node_base | string | Prefix of the name of iSCSI target node (default: "iqn.2016-06.io.spdk")
nop_timeout | number | Timeout in seconds to nop-in request to the initiator (default: 60) nop_timeout | number | Timeout in seconds to nop-in request to the initiator (default: 60)
nop_in_interval | number | Time interval in secs between nop-in requests by the target (default: 30) nop_in_interval | number | Time interval in secs between nop-in requests by the target (default: 30)
no_discovery_auth | boolean | CHAP for discovery session should be disabled (default: `false`) disable_chap | boolean | CHAP for discovery session should be disabled (default: `false`)
req_discovery_auth | boolean | CHAP for discovery session should be required (default: `false`) require_chap | boolean | CHAP for discovery session should be required (default: `false`)
req_discovery_auth_mutual | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`) mutual_chap | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`)
discovery_auth_group | number | CHAP group ID for discovery session (default: 0) chap_group | number | CHAP group ID for discovery session (default: 0)
max_sessions | number | Maximum number of sessions in the host (default: 128) max_sessions | number | Maximum number of sessions in the host (default: 128)
max_queue_depth | number | Maximum number of outstanding I/Os per queue (default: 64) max_queue_depth | number | Maximum number of outstanding I/Os per queue (default: 64)
max_connections_per_session | number | Session specific parameter, MaxConnections (default: 2) max_connections_per_session | number | Session specific parameter, MaxConnections (default: 2)
@ -1789,7 +1789,7 @@ error_recovery_level | number | Session specific parameter, ErrorRecover
allow_duplicated_isid | boolean | Allow duplicated initiator session ID (default: `false`) allow_duplicated_isid | boolean | Allow duplicated initiator session ID (default: `false`)
min_connections_per_core | number | Allocation unit of connections per core (default: 4) min_connections_per_core | number | Allocation unit of connections per core (default: 4)
Parameters `no_discovery_auth` and `req_discovery_auth` are mutually exclusive. Parameters `disable_chap` and `require_chap` are mutually exclusive. Parameters `no_discovery_auth`, `req_discovery_auth`, `req_discovery_auth_mutual`, and `discovery_auth_group` are still available instead of `disable_chap`, `require_chap`, `mutual_chap`, and `chap_group`, respectivey but will be removed in future releases.
### Example ### Example
@ -1806,7 +1806,7 @@ Example request:
"nop_timeout": 30, "nop_timeout": 30,
"nop_in_interval": 30, "nop_in_interval": 30,
"auth_file": "/usr/local/etc/spdk/auth.conf", "auth_file": "/usr/local/etc/spdk/auth.conf",
"no_discovery_auth": true, "disable_chap": true,
"default_time2wait": 2 "default_time2wait": 2
}, },
"jsonrpc": "2.0", "jsonrpc": "2.0",
@ -1857,9 +1857,9 @@ Example response:
"default_time2retain": 60, "default_time2retain": 60,
"immediate_data": true, "immediate_data": true,
"node_base": "iqn.2016-06.io.spdk", "node_base": "iqn.2016-06.io.spdk",
"req_discovery_auth_mutual": false, "mutual_chap": false,
"nop_in_interval": 30, "nop_in_interval": 30,
"discovery_auth_group": 0, "chap_group": 0,
"max_connections_per_session": 2, "max_connections_per_session": 2,
"max_queue_depth": 64, "max_queue_depth": 64,
"nop_timeout": 30, "nop_timeout": 30,
@ -1867,9 +1867,9 @@ Example response:
"error_recovery_level": 0, "error_recovery_level": 0,
"auth_file": "/usr/local/etc/spdk/auth.conf", "auth_file": "/usr/local/etc/spdk/auth.conf",
"min_connections_per_core": 4, "min_connections_per_core": 4,
"no_discovery_auth": true, "disable_chap": true,
"default_time2wait": 2, "default_time2wait": 2,
"req_discovery_auth": false "require_chap": false
} }
} }
~~~ ~~~

View File

@ -49,6 +49,10 @@ static const struct spdk_json_object_decoder rpc_set_iscsi_opts_decoders[] = {
{"req_discovery_auth", offsetof(struct spdk_iscsi_opts, require_chap), spdk_json_decode_bool, true}, {"req_discovery_auth", offsetof(struct spdk_iscsi_opts, require_chap), spdk_json_decode_bool, true},
{"req_discovery_auth_mutual", offsetof(struct spdk_iscsi_opts, mutual_chap), spdk_json_decode_bool, true}, {"req_discovery_auth_mutual", offsetof(struct spdk_iscsi_opts, mutual_chap), spdk_json_decode_bool, true},
{"discovery_auth_group", offsetof(struct spdk_iscsi_opts, chap_group), spdk_json_decode_int32, true}, {"discovery_auth_group", offsetof(struct spdk_iscsi_opts, chap_group), spdk_json_decode_int32, true},
{"disable_chap", offsetof(struct spdk_iscsi_opts, disable_chap), spdk_json_decode_bool, true},
{"require_chap", offsetof(struct spdk_iscsi_opts, require_chap), spdk_json_decode_bool, true},
{"mutual_chap", offsetof(struct spdk_iscsi_opts, mutual_chap), spdk_json_decode_bool, true},
{"chap_group", offsetof(struct spdk_iscsi_opts, chap_group), spdk_json_decode_int32, true},
{"max_sessions", offsetof(struct spdk_iscsi_opts, MaxSessions), spdk_json_decode_uint32, true}, {"max_sessions", offsetof(struct spdk_iscsi_opts, MaxSessions), spdk_json_decode_uint32, true},
{"max_queue_depth", offsetof(struct spdk_iscsi_opts, MaxQueueDepth), spdk_json_decode_uint32, true}, {"max_queue_depth", offsetof(struct spdk_iscsi_opts, MaxQueueDepth), spdk_json_decode_uint32, true},
{"max_connections_per_session", offsetof(struct spdk_iscsi_opts, MaxConnectionsPerSession), spdk_json_decode_uint32, true}, {"max_connections_per_session", offsetof(struct spdk_iscsi_opts, MaxConnectionsPerSession), spdk_json_decode_uint32, true},

View File

@ -1038,10 +1038,10 @@ spdk_iscsi_opts_info_json(struct spdk_json_write_ctx *w)
spdk_json_write_named_int32(w, "nop_timeout", g_spdk_iscsi.timeout); spdk_json_write_named_int32(w, "nop_timeout", g_spdk_iscsi.timeout);
spdk_json_write_named_int32(w, "nop_in_interval", g_spdk_iscsi.nopininterval); spdk_json_write_named_int32(w, "nop_in_interval", g_spdk_iscsi.nopininterval);
spdk_json_write_named_bool(w, "no_discovery_auth", g_spdk_iscsi.disable_chap); spdk_json_write_named_bool(w, "disable_chap", g_spdk_iscsi.disable_chap);
spdk_json_write_named_bool(w, "req_discovery_auth", g_spdk_iscsi.require_chap); spdk_json_write_named_bool(w, "require_chap", g_spdk_iscsi.require_chap);
spdk_json_write_named_bool(w, "req_discovery_auth_mutual", g_spdk_iscsi.mutual_chap); spdk_json_write_named_bool(w, "mutual_chap", g_spdk_iscsi.mutual_chap);
spdk_json_write_named_int32(w, "discovery_auth_group", g_spdk_iscsi.chap_group); spdk_json_write_named_int32(w, "chap_group", g_spdk_iscsi.chap_group);
spdk_json_write_named_uint32(w, "min_connections_per_core", spdk_json_write_named_uint32(w, "min_connections_per_core",
spdk_iscsi_conn_get_min_per_core()); spdk_iscsi_conn_get_min_per_core());

View File

@ -493,10 +493,10 @@ if __name__ == "__main__":
node_base=args.node_base, node_base=args.node_base,
nop_timeout=args.nop_timeout, nop_timeout=args.nop_timeout,
nop_in_interval=args.nop_in_interval, nop_in_interval=args.nop_in_interval,
no_discovery_auth=args.no_discovery_auth, disable_chap=args.disable_chap,
req_discovery_auth=args.req_discovery_auth, require_chap=args.require_chap,
req_discovery_auth_mutual=args.req_discovery_auth_mutual, mutual_chap=args.mutual_chap,
discovery_auth_group=args.discovery_auth_group, chap_group=args.chap_group,
max_sessions=args.max_sessions, max_sessions=args.max_sessions,
max_queue_depth=args.max_queue_depth, max_queue_depth=args.max_queue_depth,
max_connections_per_session=args.max_connections_per_session, max_connections_per_session=args.max_connections_per_session,
@ -512,12 +512,12 @@ if __name__ == "__main__":
p.add_argument('-b', '--node-base', help='Prefix of the name of iSCSI target node') p.add_argument('-b', '--node-base', help='Prefix of the name of iSCSI target node')
p.add_argument('-o', '--nop-timeout', help='Timeout in seconds to nop-in request to the initiator', type=int) p.add_argument('-o', '--nop-timeout', help='Timeout in seconds to nop-in request to the initiator', type=int)
p.add_argument('-n', '--nop-in-interval', help='Time interval in secs between nop-in requests by the target', type=int) p.add_argument('-n', '--nop-in-interval', help='Time interval in secs between nop-in requests by the target', type=int)
p.add_argument('-d', '--no-discovery-auth', help="""CHAP for discovery session should be disabled. p.add_argument('-d', '--disable-chap', help="""CHAP for discovery session should be disabled.
*** Mutually exclusive with --req-discovery-auth""", action='store_true') *** Mutually exclusive with --require-chap""", action='store_true')
p.add_argument('-r', '--req-discovery-auth', help="""CHAP for discovery session should be required. p.add_argument('-r', '--require-chap', help="""CHAP for discovery session should be required.
*** Mutually exclusive with --no-discovery-auth""", action='store_true') *** Mutually exclusive with --disable-chap""", action='store_true')
p.add_argument('-m', '--req-discovery-auth-mutual', help='CHAP for discovery session should be mutual', action='store_true') p.add_argument('-m', '--mutual-chap', help='CHAP for discovery session should be mutual', action='store_true')
p.add_argument('-g', '--discovery-auth-group', help="""Authentication group ID for discovery session. p.add_argument('-g', '--chap-group', help="""Authentication group ID for discovery session.
*** Authentication group must be precreated ***""", type=int) *** Authentication group must be precreated ***""", type=int)
p.add_argument('-a', '--max-sessions', help='Maximum number of sessions in the host.', type=int) p.add_argument('-a', '--max-sessions', help='Maximum number of sessions in the host.', type=int)
p.add_argument('-q', '--max-queue-depth', help='Max number of outstanding I/Os per queue.', type=int) p.add_argument('-q', '--max-queue-depth', help='Max number of outstanding I/Os per queue.', type=int)

View File

@ -6,10 +6,10 @@ def set_iscsi_options(
node_base=None, node_base=None,
nop_timeout=None, nop_timeout=None,
nop_in_interval=None, nop_in_interval=None,
no_discovery_auth=None, disable_chap=None,
req_discovery_auth=None, require_chap=None,
req_discovery_auth_mutual=None, mutual_chap=None,
discovery_auth_group=None, chap_group=None,
max_sessions=None, max_sessions=None,
max_queue_depth=None, max_queue_depth=None,
max_connections_per_session=None, max_connections_per_session=None,
@ -26,10 +26,10 @@ def set_iscsi_options(
node_base: Prefix of the name of iSCSI target node (optional) node_base: Prefix of the name of iSCSI target node (optional)
nop_timeout: Timeout in seconds to nop-in request to the initiator (optional) nop_timeout: Timeout in seconds to nop-in request to the initiator (optional)
nop_in_interval: Time interval in secs between nop-in requests by the target (optional) nop_in_interval: Time interval in secs between nop-in requests by the target (optional)
no_discovery_auth: CHAP for discovery session should be disabled (optional) disable_chap: CHAP for discovery session should be disabled (optional)
req_discovery_auth: CHAP for discovery session should be required require_chap: CHAP for discovery session should be required
req_discovery_auth_mutual: CHAP for discovery session should be mutual mutual_chap: CHAP for discovery session should be mutual
discovery_auth_group: Authentication group ID for discovery session chap_group: Authentication group ID for discovery session
max_sessions: Maximum number of sessions in the host max_sessions: Maximum number of sessions in the host
max_queue_depth: Maximum number of outstanding I/Os per queue max_queue_depth: Maximum number of outstanding I/Os per queue
max_connections_per_session: Negotiated parameter, MaxConnections max_connections_per_session: Negotiated parameter, MaxConnections
@ -53,14 +53,14 @@ def set_iscsi_options(
params['nop_timeout'] = nop_timeout params['nop_timeout'] = nop_timeout
if nop_in_interval: if nop_in_interval:
params['nop_in_interval'] = nop_in_interval params['nop_in_interval'] = nop_in_interval
if no_discovery_auth: if disable_chap:
params['no_discovery_auth'] = no_discovery_auth params['disable_chap'] = disable_chap
if req_discovery_auth: if require_chap:
params['req_discovery_auth'] = req_discovery_auth params['require_chap'] = require_chap
if req_discovery_auth_mutual: if mutual_chap:
params['req_discovery_auth_mutual'] = req_discovery_auth_mutual params['mutual_chap'] = mutual_chap
if discovery_auth_group: if chap_group:
params['discovery_auth_group'] = discovery_auth_group params['chap_group'] = chap_group
if max_sessions: if max_sessions:
params['max_sessions'] = max_sessions params['max_sessions'] = max_sessions
if max_queue_depth: if max_queue_depth: