diff -r bd55759b10d9 sys/dev/cxgbe/cxgbei/cxgbei.c --- a/sys/dev/cxgbe/cxgbei/cxgbei.c Tue Sep 29 17:27:43 2015 -0700 +++ b/sys/dev/cxgbe/cxgbei/cxgbei.c Tue Sep 29 23:58:22 2015 -0700 @@ -651,8 +651,11 @@ iscsi_conn_receive_pdu(struct iscsi_sock mbufq_dequeue(&isock->iscsi_rcvq); data_len = cb->pdulen; +#if 0 CTR5(KTR_CXGBE, "%s: response:%p m:%p m_len:%d data_len:%d", __func__, response, m, m->m_len, data_len); +#endif + response->ip_bhs_mbuf = m; response->ip_bhs = mtod(response->ip_bhs_mbuf, struct iscsi_bhs *); diff -r bd55759b10d9 sys/dev/iscsi/iscsi.c --- a/sys/dev/iscsi/iscsi.c Tue Sep 29 17:27:43 2015 -0700 +++ b/sys/dev/iscsi/iscsi.c Tue Sep 29 23:58:22 2015 -0700 @@ -1329,6 +1329,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ 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_ 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,19 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ 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; + 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 +1402,7 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ /* * 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);