svn commit: r268141 - stable/10/sys/cam/ctl
Alexander Motin
mav at FreeBSD.org
Wed Jul 2 10:20:08 UTC 2014
Author: mav
Date: Wed Jul 2 10:20:08 2014
New Revision: 268141
URL: http://svnweb.freebsd.org/changeset/base/268141
Log:
MFC r267872:
Allow to use iSCSI immediate data by several ctl_datamove() calls.
While for FreeBSD client that is only a minor optimization, VMWare client
doesn't support additional data requests after all data being sent once as
immediate.
Modified:
stable/10/sys/cam/ctl/ctl_frontend_iscsi.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Jul 2 10:18:42 2014 (r268140)
+++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Jul 2 10:20:08 2014 (r268141)
@@ -737,12 +737,15 @@ cfiscsi_handle_data_segment(struct icl_p
buffer_offset = ntohl(bhsdo->bhsdo_buffer_offset);
else
buffer_offset = 0;
+ len = icl_pdu_data_segment_length(request);
/*
* Make sure the offset, as sent by the initiator, matches the offset
* we're supposed to be at in the scatter-gather list.
*/
- if (buffer_offset !=
+ if (buffer_offset >
+ io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled ||
+ buffer_offset + len <=
io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled) {
CFISCSI_SESSION_WARN(cs, "received bad buffer offset %zd, "
"expected %zd; dropping connection", buffer_offset,
@@ -758,8 +761,8 @@ cfiscsi_handle_data_segment(struct icl_p
* to buffer_offset, which is the offset within the task (SCSI
* command).
*/
- off = 0;
- len = icl_pdu_data_segment_length(request);
+ off = io->scsiio.kern_rel_offset + io->scsiio.ext_data_filled -
+ buffer_offset;
/*
* Iterate over the scatter/gather segments, filling them with data
@@ -816,12 +819,8 @@ cfiscsi_handle_data_segment(struct icl_p
* This obviously can only happen with SCSI Command PDU.
*/
if ((request->ip_bhs->bhs_opcode & ~ISCSI_BHS_OPCODE_IMMEDIATE) ==
- ISCSI_BHS_OPCODE_SCSI_COMMAND) {
- CFISCSI_SESSION_DEBUG(cs, "received too much immediate "
- "data: got %zd bytes, expected %zd",
- icl_pdu_data_segment_length(request), off);
+ ISCSI_BHS_OPCODE_SCSI_COMMAND)
return (true);
- }
CFISCSI_SESSION_WARN(cs, "received too much data: got %zd bytes, "
"expected %zd; dropping connection",
@@ -2623,8 +2622,8 @@ cfiscsi_datamove_out(union ctl_io *io)
cdw->cdw_target_transfer_tag = target_transfer_tag;
cdw->cdw_initiator_task_tag = bhssc->bhssc_initiator_task_tag;
- if (cs->cs_immediate_data && io->scsiio.kern_rel_offset == 0 &&
- icl_pdu_data_segment_length(request) > 0) {
+ if (cs->cs_immediate_data && io->scsiio.kern_rel_offset <
+ icl_pdu_data_segment_length(request)) {
done = cfiscsi_handle_data_segment(request, cdw);
if (done) {
uma_zfree(cfiscsi_data_wait_zone, cdw);
More information about the svn-src-all
mailing list