|
@@ -433,6 +433,28 @@ int iscsi_create_default_params(struct iscsi_param_list **param_list_ptr)
|
|
|
TYPERANGE_MARKINT, USE_INITIAL_ONLY);
|
|
|
if (!param)
|
|
|
goto out;
|
|
|
+ /*
|
|
|
+ * Extra parameters for ISER from RFC-5046
|
|
|
+ */
|
|
|
+ param = iscsi_set_default_param(pl, RDMAEXTENTIONS, INITIAL_RDMAEXTENTIONS,
|
|
|
+ PHASE_OPERATIONAL, SCOPE_SESSION_WIDE, SENDER_BOTH,
|
|
|
+ TYPERANGE_BOOL_AND, USE_LEADING_ONLY);
|
|
|
+ if (!param)
|
|
|
+ goto out;
|
|
|
+
|
|
|
+ param = iscsi_set_default_param(pl, INITIATORRECVDATASEGMENTLENGTH,
|
|
|
+ INITIAL_INITIATORRECVDATASEGMENTLENGTH,
|
|
|
+ PHASE_OPERATIONAL, SCOPE_CONNECTION_ONLY, SENDER_BOTH,
|
|
|
+ TYPERANGE_512_TO_16777215, USE_ALL);
|
|
|
+ if (!param)
|
|
|
+ goto out;
|
|
|
+
|
|
|
+ param = iscsi_set_default_param(pl, TARGETRECVDATASEGMENTLENGTH,
|
|
|
+ INITIAL_TARGETRECVDATASEGMENTLENGTH,
|
|
|
+ PHASE_OPERATIONAL, SCOPE_CONNECTION_ONLY, SENDER_BOTH,
|
|
|
+ TYPERANGE_512_TO_16777215, USE_ALL);
|
|
|
+ if (!param)
|
|
|
+ goto out;
|
|
|
|
|
|
*param_list_ptr = pl;
|
|
|
return 0;
|
|
@@ -442,19 +464,23 @@ out:
|
|
|
}
|
|
|
|
|
|
int iscsi_set_keys_to_negotiate(
|
|
|
- int sessiontype,
|
|
|
- struct iscsi_param_list *param_list)
|
|
|
+ struct iscsi_param_list *param_list,
|
|
|
+ bool iser)
|
|
|
{
|
|
|
struct iscsi_param *param;
|
|
|
|
|
|
+ param_list->iser = iser;
|
|
|
+
|
|
|
list_for_each_entry(param, ¶m_list->param_list, p_list) {
|
|
|
param->state = 0;
|
|
|
if (!strcmp(param->name, AUTHMETHOD)) {
|
|
|
SET_PSTATE_NEGOTIATE(param);
|
|
|
} else if (!strcmp(param->name, HEADERDIGEST)) {
|
|
|
- SET_PSTATE_NEGOTIATE(param);
|
|
|
+ if (iser == false)
|
|
|
+ SET_PSTATE_NEGOTIATE(param);
|
|
|
} else if (!strcmp(param->name, DATADIGEST)) {
|
|
|
- SET_PSTATE_NEGOTIATE(param);
|
|
|
+ if (iser == false)
|
|
|
+ SET_PSTATE_NEGOTIATE(param);
|
|
|
} else if (!strcmp(param->name, MAXCONNECTIONS)) {
|
|
|
SET_PSTATE_NEGOTIATE(param);
|
|
|
} else if (!strcmp(param->name, TARGETNAME)) {
|
|
@@ -473,7 +499,8 @@ int iscsi_set_keys_to_negotiate(
|
|
|
} else if (!strcmp(param->name, IMMEDIATEDATA)) {
|
|
|
SET_PSTATE_NEGOTIATE(param);
|
|
|
} else if (!strcmp(param->name, MAXRECVDATASEGMENTLENGTH)) {
|
|
|
- SET_PSTATE_NEGOTIATE(param);
|
|
|
+ if (iser == false)
|
|
|
+ SET_PSTATE_NEGOTIATE(param);
|
|
|
} else if (!strcmp(param->name, MAXXMITDATASEGMENTLENGTH)) {
|
|
|
continue;
|
|
|
} else if (!strcmp(param->name, MAXBURSTLENGTH)) {
|
|
@@ -502,6 +529,15 @@ int iscsi_set_keys_to_negotiate(
|
|
|
SET_PSTATE_NEGOTIATE(param);
|
|
|
} else if (!strcmp(param->name, OFMARKINT)) {
|
|
|
SET_PSTATE_NEGOTIATE(param);
|
|
|
+ } else if (!strcmp(param->name, RDMAEXTENTIONS)) {
|
|
|
+ if (iser == true)
|
|
|
+ SET_PSTATE_NEGOTIATE(param);
|
|
|
+ } else if (!strcmp(param->name, INITIATORRECVDATASEGMENTLENGTH)) {
|
|
|
+ if (iser == true)
|
|
|
+ SET_PSTATE_NEGOTIATE(param);
|
|
|
+ } else if (!strcmp(param->name, TARGETRECVDATASEGMENTLENGTH)) {
|
|
|
+ if (iser == true)
|
|
|
+ SET_PSTATE_NEGOTIATE(param);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -544,6 +580,12 @@ int iscsi_set_keys_irrelevant_for_discovery(
|
|
|
param->state &= ~PSTATE_NEGOTIATE;
|
|
|
else if (!strcmp(param->name, OFMARKINT))
|
|
|
param->state &= ~PSTATE_NEGOTIATE;
|
|
|
+ else if (!strcmp(param->name, RDMAEXTENTIONS))
|
|
|
+ param->state &= ~PSTATE_NEGOTIATE;
|
|
|
+ else if (!strcmp(param->name, INITIATORRECVDATASEGMENTLENGTH))
|
|
|
+ param->state &= ~PSTATE_NEGOTIATE;
|
|
|
+ else if (!strcmp(param->name, TARGETRECVDATASEGMENTLENGTH))
|
|
|
+ param->state &= ~PSTATE_NEGOTIATE;
|
|
|
}
|
|
|
|
|
|
return 0;
|
|
@@ -1759,6 +1801,9 @@ void iscsi_set_connection_parameters(
|
|
|
* this key is not sent over the wire.
|
|
|
*/
|
|
|
if (!strcmp(param->name, MAXXMITDATASEGMENTLENGTH)) {
|
|
|
+ if (param_list->iser == true)
|
|
|
+ continue;
|
|
|
+
|
|
|
ops->MaxXmitDataSegmentLength =
|
|
|
simple_strtoul(param->value, &tmpptr, 0);
|
|
|
pr_debug("MaxXmitDataSegmentLength: %s\n",
|
|
@@ -1804,6 +1849,22 @@ void iscsi_set_connection_parameters(
|
|
|
simple_strtoul(param->value, &tmpptr, 0);
|
|
|
pr_debug("IFMarkInt: %s\n",
|
|
|
param->value);
|
|
|
+ } else if (!strcmp(param->name, INITIATORRECVDATASEGMENTLENGTH)) {
|
|
|
+ ops->InitiatorRecvDataSegmentLength =
|
|
|
+ simple_strtoul(param->value, &tmpptr, 0);
|
|
|
+ pr_debug("InitiatorRecvDataSegmentLength: %s\n",
|
|
|
+ param->value);
|
|
|
+ ops->MaxRecvDataSegmentLength =
|
|
|
+ ops->InitiatorRecvDataSegmentLength;
|
|
|
+ pr_debug("Set MRDSL from InitiatorRecvDataSegmentLength\n");
|
|
|
+ } else if (!strcmp(param->name, TARGETRECVDATASEGMENTLENGTH)) {
|
|
|
+ ops->TargetRecvDataSegmentLength =
|
|
|
+ simple_strtoul(param->value, &tmpptr, 0);
|
|
|
+ pr_debug("TargetRecvDataSegmentLength: %s\n",
|
|
|
+ param->value);
|
|
|
+ ops->MaxXmitDataSegmentLength =
|
|
|
+ ops->TargetRecvDataSegmentLength;
|
|
|
+ pr_debug("Set MXDSL from TargetRecvDataSegmentLength\n");
|
|
|
}
|
|
|
}
|
|
|
pr_debug("----------------------------------------------------"
|
|
@@ -1916,6 +1977,10 @@ void iscsi_set_session_parameters(
|
|
|
ops->SessionType = !strcmp(param->value, DISCOVERY);
|
|
|
pr_debug("SessionType: %s\n",
|
|
|
param->value);
|
|
|
+ } else if (!strcmp(param->name, RDMAEXTENTIONS)) {
|
|
|
+ ops->RDMAExtensions = !strcmp(param->value, YES);
|
|
|
+ pr_debug("RDMAExtensions: %s\n",
|
|
|
+ param->value);
|
|
|
}
|
|
|
}
|
|
|
pr_debug("----------------------------------------------------"
|