Add initial support for negotiating iSER parameters to iscsid(8). Some
rework might be needed to support asymetrical limits, but this should be ok for now. Obtained from: Mellanox Technologies (earlier version) MFC after: 1 month Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
2685841b38
commit
5abae79af4
@ -422,8 +422,38 @@ login_negotiate_key(struct connection *conn, const char *name,
|
||||
/* Ignore */
|
||||
} else if (strcmp(name, "IFMarker") == 0) {
|
||||
/* Ignore */
|
||||
} else if (strcmp(name, "RDMAExtensions") == 0) {
|
||||
if (conn->conn_conf.isc_iser == 1 &&
|
||||
strcmp(value, "Yes") != 0) {
|
||||
log_errx(1, "received unsupported RDMAExtensions");
|
||||
}
|
||||
} else if (strcmp(name, "InitiatorRecvDataSegmentLength") == 0) {
|
||||
tmp = strtoul(value, NULL, 10);
|
||||
if (tmp <= 0)
|
||||
log_errx(1, "received invalid "
|
||||
"InitiatorRecvDataSegmentLength");
|
||||
if ((size_t)tmp > conn->conn_limits.isl_max_data_segment_length) {
|
||||
log_debugx("capping InitiatorRecvDataSegmentLength "
|
||||
"from %d to %zd", tmp,
|
||||
conn->conn_limits.isl_max_data_segment_length);
|
||||
tmp = conn->conn_limits.isl_max_data_segment_length;
|
||||
}
|
||||
conn->conn_max_data_segment_length = tmp;
|
||||
} else if (strcmp(name, "TargetPortalGroupTag") == 0) {
|
||||
/* Ignore */
|
||||
} else if (strcmp(name, "TargetRecvDataSegmentLength") == 0) {
|
||||
tmp = strtoul(value, NULL, 10);
|
||||
if (tmp <= 0) {
|
||||
log_errx(1,
|
||||
"received invalid TargetRecvDataSegmentLength");
|
||||
}
|
||||
if ((size_t)tmp > conn->conn_limits.isl_max_data_segment_length) {
|
||||
log_debugx("capping TargetRecvDataSegmentLength "
|
||||
"from %d to %zd", tmp,
|
||||
conn->conn_limits.isl_max_data_segment_length);
|
||||
tmp = conn->conn_limits.isl_max_data_segment_length;
|
||||
}
|
||||
conn->conn_max_data_segment_length = tmp;
|
||||
} else {
|
||||
log_debugx("unknown key \"%s\"; ignoring", name);
|
||||
}
|
||||
@ -465,13 +495,23 @@ login_negotiate(struct connection *conn)
|
||||
conn->conn_limits.isl_max_data_segment_length);
|
||||
keys_add(request_keys, "InitialR2T", "Yes");
|
||||
keys_add(request_keys, "MaxOutstandingR2T", "1");
|
||||
if (conn->conn_conf.isc_iser == 1) {
|
||||
keys_add_int(request_keys, "InitiatorRecvDataSegmentLength",
|
||||
conn->conn_limits.isl_max_data_segment_length);
|
||||
keys_add_int(request_keys, "TargetRecvDataSegmentLength",
|
||||
conn->conn_limits.isl_max_data_segment_length);
|
||||
keys_add(request_keys, "RDMAExtensions", "Yes");
|
||||
} else {
|
||||
keys_add_int(request_keys, "MaxRecvDataSegmentLength",
|
||||
conn->conn_limits.isl_max_data_segment_length);
|
||||
}
|
||||
} else {
|
||||
keys_add(request_keys, "HeaderDigest", "None");
|
||||
keys_add(request_keys, "DataDigest", "None");
|
||||
keys_add_int(request_keys, "MaxRecvDataSegmentLength",
|
||||
conn->conn_limits.isl_max_data_segment_length);
|
||||
}
|
||||
|
||||
keys_add_int(request_keys, "MaxRecvDataSegmentLength",
|
||||
conn->conn_limits.isl_max_data_segment_length);
|
||||
keys_add(request_keys, "DefaultTime2Wait", "0");
|
||||
keys_add(request_keys, "DefaultTime2Retain", "0");
|
||||
keys_add(request_keys, "ErrorRecoveryLevel", "0");
|
||||
|
Loading…
x
Reference in New Issue
Block a user