Date: Fri, 26 Dec 2014 09:12:19 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276234 - in stable/10: sys/dev/iscsi usr.sbin/ctld usr.sbin/iscsid Message-ID: <201412260912.sBQ9CJpu087795@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Fri Dec 26 09:12:19 2014 New Revision: 276234 URL: https://svnweb.freebsd.org/changeset/base/276234 Log: MFC r275925: Slightly polish iSCSI parameters negotiation. Modified: stable/10/sys/dev/iscsi/iscsi.c stable/10/usr.sbin/ctld/login.c stable/10/usr.sbin/iscsid/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Fri Dec 26 09:11:26 2014 (r276233) +++ stable/10/sys/dev/iscsi/iscsi.c Fri Dec 26 09:12:19 2014 (r276234) @@ -2189,6 +2189,10 @@ iscsi_action_scsiio(struct iscsi_session ISCSI_SESSION_DEBUG(is, "len %zd -> %zd", len, is->is_first_burst_length); len = is->is_first_burst_length; } + if (len > is->is_max_data_segment_length) { + ISCSI_SESSION_DEBUG(is, "len %zd -> %zd", len, is->is_max_data_segment_length); + len = is->is_max_data_segment_length; + } error = icl_pdu_append_data(request, csio->data_ptr, len, M_NOWAIT); if (error != 0) { Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Fri Dec 26 09:11:26 2014 (r276233) +++ stable/10/usr.sbin/ctld/login.c Fri Dec 26 09:12:19 2014 (r276234) @@ -558,7 +558,7 @@ login_negotiate_key(struct pdu *request, tmp = MAX_DATA_SEGMENT_LENGTH; } conn->conn_max_data_segment_length = tmp; - keys_add_int(response_keys, name, tmp); + keys_add_int(response_keys, name, MAX_DATA_SEGMENT_LENGTH); } else if (strcmp(name, "MaxBurstLength") == 0) { tmp = strtoul(value, NULL, 10); if (tmp <= 0) { Modified: stable/10/usr.sbin/iscsid/login.c ============================================================================== --- stable/10/usr.sbin/iscsid/login.c Fri Dec 26 09:11:26 2014 (r276233) +++ stable/10/usr.sbin/iscsid/login.c Fri Dec 26 09:12:19 2014 (r276234) @@ -388,6 +388,11 @@ login_negotiate_key(struct connection *c if (tmp <= 0) log_errx(1, "received invalid " "MaxRecvDataSegmentLength"); + if (tmp > ISCSI_MAX_DATA_SEGMENT_LENGTH) { + log_debugx("capping MaxRecvDataSegmentLength " + "from %d to %d", tmp, ISCSI_MAX_DATA_SEGMENT_LENGTH); + tmp = ISCSI_MAX_DATA_SEGMENT_LENGTH; + } conn->conn_max_data_segment_length = tmp; } else if (strcmp(name, "MaxBurstLength") == 0) { if (conn->conn_immediate_data) { @@ -451,10 +456,11 @@ login_negotiate(struct connection *conn) keys_add(request_keys, "ImmediateData", "Yes"); keys_add_int(request_keys, "MaxBurstLength", - ISCSI_MAX_DATA_SEGMENT_LENGTH); + 2 * ISCSI_MAX_DATA_SEGMENT_LENGTH); keys_add_int(request_keys, "FirstBurstLength", ISCSI_MAX_DATA_SEGMENT_LENGTH); keys_add(request_keys, "InitialR2T", "Yes"); + keys_add(request_keys, "MaxOutstandingR2T", "1"); } else { keys_add(request_keys, "HeaderDigest", "None"); keys_add(request_keys, "DataDigest", "None"); @@ -465,7 +471,6 @@ login_negotiate(struct connection *conn) keys_add(request_keys, "DefaultTime2Wait", "0"); keys_add(request_keys, "DefaultTime2Retain", "0"); keys_add(request_keys, "ErrorRecoveryLevel", "0"); - keys_add(request_keys, "MaxOutstandingR2T", "1"); keys_save(request_keys, request); keys_delete(request_keys); request_keys = NULL;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412260912.sBQ9CJpu087795>