Commit 66723f7f authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Jim Harris
Browse files

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: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/423050


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 1b987076
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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.

### 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:

### bdev
+10 −10
Original line number Diff line number Diff line
@@ -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")
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)
no_discovery_auth           | boolean | CHAP for discovery session should be disabled (default: `false`)
req_discovery_auth          | 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`)
discovery_auth_group        | number  | CHAP group ID for discovery session (default: 0)
disable_chap                | boolean | CHAP for discovery session should be disabled (default: `false`)
require_chap                | boolean | CHAP for discovery session should be required (default: `false`)
mutual_chap                 | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`)
chap_group                  | number  | CHAP group ID for discovery session (default: 0)
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_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`)
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

@@ -1806,7 +1806,7 @@ Example request:
    "nop_timeout": 30,
    "nop_in_interval": 30,
    "auth_file": "/usr/local/etc/spdk/auth.conf",
    "no_discovery_auth": true,
    "disable_chap": true,
    "default_time2wait": 2
  },
  "jsonrpc": "2.0",
@@ -1857,9 +1857,9 @@ Example response:
    "default_time2retain": 60,
    "immediate_data": true,
    "node_base": "iqn.2016-06.io.spdk",
    "req_discovery_auth_mutual": false,
    "mutual_chap": false,
    "nop_in_interval": 30,
    "discovery_auth_group": 0,
    "chap_group": 0,
    "max_connections_per_session": 2,
    "max_queue_depth": 64,
    "nop_timeout": 30,
@@ -1867,9 +1867,9 @@ Example response:
    "error_recovery_level": 0,
    "auth_file": "/usr/local/etc/spdk/auth.conf",
    "min_connections_per_core": 4,
    "no_discovery_auth": true,
    "disable_chap": true,
    "default_time2wait": 2,
    "req_discovery_auth": false
    "require_chap": false
  }
}
~~~
+4 −0
Original line number Diff line number Diff line
@@ -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_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},
	{"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_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},
+4 −4
Original line number Diff line number Diff line
@@ -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_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, "req_discovery_auth", g_spdk_iscsi.require_chap);
	spdk_json_write_named_bool(w, "req_discovery_auth_mutual", g_spdk_iscsi.mutual_chap);
	spdk_json_write_named_int32(w, "discovery_auth_group", g_spdk_iscsi.chap_group);
	spdk_json_write_named_bool(w, "disable_chap", g_spdk_iscsi.disable_chap);
	spdk_json_write_named_bool(w, "require_chap", g_spdk_iscsi.require_chap);
	spdk_json_write_named_bool(w, "mutual_chap", g_spdk_iscsi.mutual_chap);
	spdk_json_write_named_int32(w, "chap_group", g_spdk_iscsi.chap_group);

	spdk_json_write_named_uint32(w, "min_connections_per_core",
				     spdk_iscsi_conn_get_min_per_core());
+10 −10
Original line number Diff line number Diff line
@@ -493,10 +493,10 @@ if __name__ == "__main__":
            node_base=args.node_base,
            nop_timeout=args.nop_timeout,
            nop_in_interval=args.nop_in_interval,
            no_discovery_auth=args.no_discovery_auth,
            req_discovery_auth=args.req_discovery_auth,
            req_discovery_auth_mutual=args.req_discovery_auth_mutual,
            discovery_auth_group=args.discovery_auth_group,
            disable_chap=args.disable_chap,
            require_chap=args.require_chap,
            mutual_chap=args.mutual_chap,
            chap_group=args.chap_group,
            max_sessions=args.max_sessions,
            max_queue_depth=args.max_queue_depth,
            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('-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('-d', '--no-discovery-auth', help="""CHAP for discovery session should be disabled.
    *** Mutually exclusive with --req-discovery-auth""", action='store_true')
    p.add_argument('-r', '--req-discovery-auth', help="""CHAP for discovery session should be required.
    *** Mutually exclusive with --no-discovery-auth""", 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('-g', '--discovery-auth-group', help="""Authentication group ID for discovery session.
    p.add_argument('-d', '--disable-chap', help="""CHAP for discovery session should be disabled.
    *** Mutually exclusive with --require-chap""", action='store_true')
    p.add_argument('-r', '--require-chap', help="""CHAP for discovery session should be required.
    *** Mutually exclusive with --disable-chap""", action='store_true')
    p.add_argument('-m', '--mutual-chap', help='CHAP for discovery session should be mutual', action='store_true')
    p.add_argument('-g', '--chap-group', help="""Authentication group ID for discovery session.
    *** 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('-q', '--max-queue-depth', help='Max number of outstanding I/Os per queue.', type=int)
Loading