lib/iscsi: Add MaxLargeDataInPerConnection to iSCSI options
Add MaxLargeDataInPerConnection to iSCSI global options and make it configurable by JSON RPC. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: Ibcd16da2eac64241217bedeb89a7929bbdc67871 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3756 Community-CI: Broadcom CI 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>
This commit is contained in:
parent
bc814aad67
commit
5aaf754f81
@ -2977,6 +2977,7 @@ first_burst_length | Optional | number | Session specific paramete
|
|||||||
immediate_data | Optional | boolean | Session specific parameter, ImmediateData (default: `true`)
|
immediate_data | Optional | boolean | Session specific parameter, ImmediateData (default: `true`)
|
||||||
error_recovery_level | Optional | number | Session specific parameter, ErrorRecoveryLevel (default: 0)
|
error_recovery_level | Optional | number | Session specific parameter, ErrorRecoveryLevel (default: 0)
|
||||||
allow_duplicated_isid | Optional | boolean | Allow duplicated initiator session ID (default: `false`)
|
allow_duplicated_isid | Optional | boolean | Allow duplicated initiator session ID (default: `false`)
|
||||||
|
max_large_datain_per_connection | Optional | number | Max number of outstanding split read I/Os per connection (default: 64)
|
||||||
|
|
||||||
To load CHAP shared secret file, its path is required to specify explicitly in the parameter `auth_file`.
|
To load CHAP shared secret file, its path is required to specify explicitly in the parameter `auth_file`.
|
||||||
|
|
||||||
@ -3061,7 +3062,8 @@ Example response:
|
|||||||
"auth_file": "/usr/local/etc/spdk/auth.conf",
|
"auth_file": "/usr/local/etc/spdk/auth.conf",
|
||||||
"disable_chap": true,
|
"disable_chap": true,
|
||||||
"default_time2wait": 2,
|
"default_time2wait": 2,
|
||||||
"require_chap": false
|
"require_chap": false,
|
||||||
|
"max_large_datain_per_connection": 64
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
~~~
|
~~~
|
||||||
|
@ -320,6 +320,7 @@ struct spdk_iscsi_opts {
|
|||||||
bool ImmediateData;
|
bool ImmediateData;
|
||||||
uint32_t ErrorRecoveryLevel;
|
uint32_t ErrorRecoveryLevel;
|
||||||
bool AllowDuplicateIsid;
|
bool AllowDuplicateIsid;
|
||||||
|
uint32_t MaxLargeDataInPerConnection;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct spdk_iscsi_globals {
|
struct spdk_iscsi_globals {
|
||||||
|
@ -1716,6 +1716,7 @@ static const struct spdk_json_object_decoder rpc_set_iscsi_opts_decoders[] = {
|
|||||||
{"immediate_data", offsetof(struct spdk_iscsi_opts, ImmediateData), spdk_json_decode_bool, true},
|
{"immediate_data", offsetof(struct spdk_iscsi_opts, ImmediateData), spdk_json_decode_bool, true},
|
||||||
{"error_recovery_level", offsetof(struct spdk_iscsi_opts, ErrorRecoveryLevel), spdk_json_decode_uint32, true},
|
{"error_recovery_level", offsetof(struct spdk_iscsi_opts, ErrorRecoveryLevel), spdk_json_decode_uint32, true},
|
||||||
{"allow_duplicated_isid", offsetof(struct spdk_iscsi_opts, AllowDuplicateIsid), spdk_json_decode_bool, true},
|
{"allow_duplicated_isid", offsetof(struct spdk_iscsi_opts, AllowDuplicateIsid), spdk_json_decode_bool, true},
|
||||||
|
{"max_large_datain_per_connection", offsetof(struct spdk_iscsi_opts, MaxLargeDataInPerConnection), spdk_json_decode_uint32, true},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -401,6 +401,7 @@ iscsi_opts_init(struct spdk_iscsi_opts *opts)
|
|||||||
opts->chap_group = 0;
|
opts->chap_group = 0;
|
||||||
opts->authfile = NULL;
|
opts->authfile = NULL;
|
||||||
opts->nodebase = NULL;
|
opts->nodebase = NULL;
|
||||||
|
opts->MaxLargeDataInPerConnection = DEFAULT_MAX_LARGE_DATAIN_PER_CONNECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct spdk_iscsi_opts *
|
struct spdk_iscsi_opts *
|
||||||
@ -473,6 +474,7 @@ iscsi_opts_copy(struct spdk_iscsi_opts *src)
|
|||||||
dst->require_chap = src->require_chap;
|
dst->require_chap = src->require_chap;
|
||||||
dst->mutual_chap = src->mutual_chap;
|
dst->mutual_chap = src->mutual_chap;
|
||||||
dst->chap_group = src->chap_group;
|
dst->chap_group = src->chap_group;
|
||||||
|
dst->MaxLargeDataInPerConnection = src->MaxLargeDataInPerConnection;
|
||||||
|
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
@ -697,6 +699,11 @@ iscsi_opts_verify(struct spdk_iscsi_opts *opts)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (opts->MaxLargeDataInPerConnection == 0) {
|
||||||
|
SPDK_ERRLOG("0 is invalid. MaxLargeDataInPerConnection must be more than 0\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -770,7 +777,7 @@ iscsi_set_global_params(struct spdk_iscsi_opts *opts)
|
|||||||
g_iscsi.require_chap = opts->require_chap;
|
g_iscsi.require_chap = opts->require_chap;
|
||||||
g_iscsi.mutual_chap = opts->mutual_chap;
|
g_iscsi.mutual_chap = opts->mutual_chap;
|
||||||
g_iscsi.chap_group = opts->chap_group;
|
g_iscsi.chap_group = opts->chap_group;
|
||||||
g_iscsi.MaxLargeDataInPerConnection = DEFAULT_MAX_LARGE_DATAIN_PER_CONNECTION;
|
g_iscsi.MaxLargeDataInPerConnection = opts->MaxLargeDataInPerConnection;
|
||||||
|
|
||||||
iscsi_log_globals();
|
iscsi_log_globals();
|
||||||
|
|
||||||
@ -1487,6 +1494,9 @@ iscsi_opts_info_json(struct spdk_json_write_ctx *w)
|
|||||||
spdk_json_write_named_bool(w, "mutual_chap", g_iscsi.mutual_chap);
|
spdk_json_write_named_bool(w, "mutual_chap", g_iscsi.mutual_chap);
|
||||||
spdk_json_write_named_int32(w, "chap_group", g_iscsi.chap_group);
|
spdk_json_write_named_int32(w, "chap_group", g_iscsi.chap_group);
|
||||||
|
|
||||||
|
spdk_json_write_named_uint32(w, "max_large_datain_per_connection",
|
||||||
|
g_iscsi.MaxLargeDataInPerConnection);
|
||||||
|
|
||||||
spdk_json_write_object_end(w);
|
spdk_json_write_object_end(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -852,7 +852,8 @@ if __name__ == "__main__":
|
|||||||
first_burst_length=args.first_burst_length,
|
first_burst_length=args.first_burst_length,
|
||||||
immediate_data=args.immediate_data,
|
immediate_data=args.immediate_data,
|
||||||
error_recovery_level=args.error_recovery_level,
|
error_recovery_level=args.error_recovery_level,
|
||||||
allow_duplicated_isid=args.allow_duplicated_isid)
|
allow_duplicated_isid=args.allow_duplicated_isid,
|
||||||
|
max_large_datain_per_connection=args.max_large_datain_per_connection)
|
||||||
|
|
||||||
p = subparsers.add_parser('iscsi_set_options', aliases=['set_iscsi_options'],
|
p = subparsers.add_parser('iscsi_set_options', aliases=['set_iscsi_options'],
|
||||||
help="""Set options of iSCSI subsystem""")
|
help="""Set options of iSCSI subsystem""")
|
||||||
@ -876,6 +877,7 @@ if __name__ == "__main__":
|
|||||||
p.add_argument('-i', '--immediate-data', help='Negotiated parameter, ImmediateData.', action='store_true')
|
p.add_argument('-i', '--immediate-data', help='Negotiated parameter, ImmediateData.', action='store_true')
|
||||||
p.add_argument('-l', '--error-recovery-level', help='Negotiated parameter, ErrorRecoveryLevel', type=int)
|
p.add_argument('-l', '--error-recovery-level', help='Negotiated parameter, ErrorRecoveryLevel', type=int)
|
||||||
p.add_argument('-p', '--allow-duplicated-isid', help='Allow duplicated initiator session ID.', action='store_true')
|
p.add_argument('-p', '--allow-duplicated-isid', help='Allow duplicated initiator session ID.', action='store_true')
|
||||||
|
p.add_argument('-x', '--max-large-datain-per-connection', help='Max number of outstanding split read I/Os per connection', type=int)
|
||||||
p.set_defaults(func=iscsi_set_options)
|
p.set_defaults(func=iscsi_set_options)
|
||||||
|
|
||||||
def iscsi_set_discovery_auth(args):
|
def iscsi_set_discovery_auth(args):
|
||||||
|
@ -20,7 +20,8 @@ def iscsi_set_options(
|
|||||||
first_burst_length=None,
|
first_burst_length=None,
|
||||||
immediate_data=None,
|
immediate_data=None,
|
||||||
error_recovery_level=None,
|
error_recovery_level=None,
|
||||||
allow_duplicated_isid=None):
|
allow_duplicated_isid=None,
|
||||||
|
max_large_datain_per_connection=None):
|
||||||
"""Set iSCSI target options.
|
"""Set iSCSI target options.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -41,6 +42,7 @@ def iscsi_set_options(
|
|||||||
immediate_data: Negotiated parameter, ImmediateData
|
immediate_data: Negotiated parameter, ImmediateData
|
||||||
error_recovery_level: Negotiated parameter, ErrorRecoveryLevel
|
error_recovery_level: Negotiated parameter, ErrorRecoveryLevel
|
||||||
allow_duplicated_isid: Allow duplicated initiator session ID
|
allow_duplicated_isid: Allow duplicated initiator session ID
|
||||||
|
max_large_datain_per_connection: Max number of outstanding split read I/Os per connection (optional)
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
True or False
|
True or False
|
||||||
@ -81,6 +83,8 @@ def iscsi_set_options(
|
|||||||
params['error_recovery_level'] = error_recovery_level
|
params['error_recovery_level'] = error_recovery_level
|
||||||
if allow_duplicated_isid:
|
if allow_duplicated_isid:
|
||||||
params['allow_duplicated_isid'] = allow_duplicated_isid
|
params['allow_duplicated_isid'] = allow_duplicated_isid
|
||||||
|
if max_large_datain_per_connection:
|
||||||
|
params['max_large_datain_per_connection'] = max_large_datain_per_connection
|
||||||
|
|
||||||
return client.call('iscsi_set_options', params)
|
return client.call('iscsi_set_options', params)
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ o- iscsi .......................................................................
|
|||||||
| o- first_burst_length: 8192 .............................................................................................. [...]
|
| o- first_burst_length: 8192 .............................................................................................. [...]
|
||||||
| o- immediate_data: True .................................................................................................. [...]
|
| o- immediate_data: True .................................................................................................. [...]
|
||||||
| o- max_connections_per_session: 2 ........................................................................................ [...]
|
| o- max_connections_per_session: 2 ........................................................................................ [...]
|
||||||
|
| o- max_large_datain_per_connection: 64 ................................................................................... [...]
|
||||||
| o- max_queue_depth: 64 ................................................................................................... [...]
|
| o- max_queue_depth: 64 ................................................................................................... [...]
|
||||||
| o- max_sessions: 128 ..................................................................................................... [...]
|
| o- max_sessions: 128 ..................................................................................................... [...]
|
||||||
| o- mutual_chap: False .................................................................................................... [...]
|
| o- mutual_chap: False .................................................................................................... [...]
|
||||||
|
Loading…
Reference in New Issue
Block a user