isert: Handle TargetRecvDataSegmentLength in RFC compliant way

iSER RFC defines TargetRecvDataSegmentLength to be mandatory.
Also, according to the RFC, the target must be prepared to receive at least 512 bytes,
so fix that.

Signed-off-by: Yan Burman <yanb@mellanox.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5486 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Yan Burman
2014-04-28 12:22:13 +00:00
parent de6aa12e9c
commit 23250756c2
4 changed files with 11 additions and 4 deletions

View File

@@ -1,5 +1,3 @@
* In login, handle declarative statements correctly:
use text_key_add() to add target declarative keys.
* Add suppport for immediate data in iSER
* Add suppport for data-out in iSER
* Look into allocating wr and sg entries dynamically from kmem_cache instead of embedding them into iser_cmnd

View File

@@ -371,7 +371,7 @@ static inline void isert_link_recv_pdu_wrs(struct isert_cmnd *from_pdu,
int isert_alloc_conn_resources(struct isert_connection *isert_conn)
{
struct isert_cmnd *pdu, *prev_pdu = NULL, *first_pdu = NULL;
int t_datasz = ISER_HDRS_SZ;
int t_datasz = 512; /* RFC states that minimum receive data size is 512 */
int i_datasz = ISER_HDRS_SZ + SCST_SENSE_BUFFERSIZE;
int i, err = 0;
int to_alloc;

View File

@@ -642,6 +642,15 @@ static int login_finish(struct connection *conn)
{
int res = 0;
if (conn->is_iser &&
conn->session_params[key_target_recv_data_length].key_state == KEY_STATE_START) {
char buf[32] = "\0";
params_val_to_str(session_keys, key_target_recv_data_length,
session_keys[key_target_recv_data_length].local_def,
buf, sizeof(buf));
text_key_add(conn, "TargetRecvDataSegmentLength", buf);
}
switch (conn->session_type) {
case SESSION_NORMAL:
if (!conn->sess)

View File

@@ -383,7 +383,7 @@ struct iscsi_key session_keys[] = {
{"OFMarkInt", 2048, 2048, 1, 65535, 0, &marker_ops},
{"IFMarkInt", 2048, 2048, 1, 65535, 0, &marker_ops},
{"RDMAExtensions", 0, 0, 0, 0, 1, &and_ops},
{"TargetRecvDataSegmentLength", 8192, -1, 512, -1, 0, &minimum_ops},
{"TargetRecvDataSegmentLength", 8192, 512, 512, -1, 0, &minimum_ops},
{"InitiatorRecvDataSegmentLength", 8192, -1, 512, -1, 0, &minimum_ops},
{"MaxAHSLength", 256, 0, 0, -1, 0, &minimum_ops},
{"TaggedBufferForSolicitedDataOnly", 0, 0, 0, 0, 0, &and_ops},