diff options
author | Navdeep Parhar <np@FreeBSD.org> | 2015-12-24 02:35:59 +0000 |
---|---|---|
committer | Navdeep Parhar <np@FreeBSD.org> | 2015-12-24 02:35:59 +0000 |
commit | 1e86840331cef30597d470492f697068dada3871 (patch) | |
tree | ef5727d750bd42d142efd26389f9f30c273fa371 /sys/dev/iscsi | |
parent | 3526f66fc2b4192773eb0227ba3d1558ff3deef0 (diff) | |
parent | c8b73c2cc7dbfbda71794c04fc2a9ca898c2c060 (diff) | |
download | src-1e86840331cef30597d470492f697068dada3871.tar.gz src-1e86840331cef30597d470492f697068dada3871.zip |
MFP r291227, r291228, and r292618.
r291227:
s/is->is_conn/ic to shorten things a bit.
r291228:
Do not generate PDUs with payload greater than max_data_segment_length.
It is perhaps preferable to have a separate limit for send instead of
reusing the receive limit. I'll discuss with trasz@ and mav@ before
pulling this into head.
r292618:
Add comment to go with r291228.
Notes
Notes:
svn path=/head/; revision=292679
Diffstat (limited to 'sys/dev/iscsi')
-rw-r--r-- | sys/dev/iscsi/iscsi.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c index 826afd2f09dd..d792746091da 100644 --- a/sys/dev/iscsi/iscsi.c +++ b/sys/dev/iscsi/iscsi.c @@ -1329,6 +1329,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_softc *sc, struct iscsi_daemon_handoff *handoff) { struct iscsi_session *is; + struct icl_conn *ic; int error; sx_slock(&sc->sc_lock); @@ -1345,6 +1346,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_softc *sc, return (ESRCH); } ISCSI_SESSION_LOCK(is); + ic = is->is_conn; if (is->is_conf.isc_discovery || is->is_terminating) { ISCSI_SESSION_UNLOCK(is); sx_sunlock(&sc->sc_lock); @@ -1369,18 +1371,24 @@ iscsi_ioctl_daemon_handoff(struct iscsi_softc *sc, is->is_statsn = handoff->idh_statsn; is->is_initial_r2t = handoff->idh_initial_r2t; is->is_immediate_data = handoff->idh_immediate_data; - is->is_max_data_segment_length = handoff->idh_max_data_segment_length; + + /* + * Cap MaxRecvDataSegmentLength obtained from the target to the maximum + * size supported by our ICL module. + */ + is->is_max_data_segment_length = min(ic->ic_max_data_segment_length, + handoff->idh_max_data_segment_length); is->is_max_burst_length = handoff->idh_max_burst_length; is->is_first_burst_length = handoff->idh_first_burst_length; if (handoff->idh_header_digest == ISCSI_DIGEST_CRC32C) - is->is_conn->ic_header_crc32c = true; + ic->ic_header_crc32c = true; else - is->is_conn->ic_header_crc32c = false; + ic->ic_header_crc32c = false; if (handoff->idh_data_digest == ISCSI_DIGEST_CRC32C) - is->is_conn->ic_data_crc32c = true; + ic->ic_data_crc32c = true; else - is->is_conn->ic_data_crc32c = false; + ic->ic_data_crc32c = false; is->is_cmdsn = 0; is->is_expcmdsn = 0; @@ -1399,7 +1407,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_softc *sc, /* * Handoff without using ICL proxy. */ - error = icl_conn_handoff(is->is_conn, handoff->idh_socket); + error = icl_conn_handoff(ic, handoff->idh_socket); if (error != 0) { sx_sunlock(&sc->sc_lock); iscsi_session_terminate(is); |